mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-27 12:45:16 +07:00
5829d1834e
This was only ever used to pretty-print the irq driver name. And on kms systems due to set_version bonghits we never set up the prettier name, ever. Which make this a bit pointless. Also, we can always dig out the driver-instance/irq relationship through other means, so this isn't that useful. So just rip it out to simplify the set_version/set_busid insanity a bit. Also delete the temporary busname from drm_pci_set_busid, it's now unused. v2: Rebase on top of the new host1x drm_bus for tegra. Reviewed-by: Thierry Reding <treding@nvidia.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
65 lines
1.4 KiB
C
65 lines
1.4 KiB
C
/*
|
|
* Copyright (C) 2013 NVIDIA Corporation
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
* published by the Free Software Foundation.
|
|
*/
|
|
|
|
#include "drm.h"
|
|
|
|
static int drm_host1x_set_busid(struct drm_device *dev,
|
|
struct drm_master *master)
|
|
{
|
|
const char *device = dev_name(dev->dev);
|
|
const char *bus = dev->dev->bus->name;
|
|
|
|
master->unique_len = strlen(bus) + 1 + strlen(device);
|
|
master->unique_size = master->unique_len;
|
|
|
|
master->unique = kmalloc(master->unique_len + 1, GFP_KERNEL);
|
|
if (!master->unique)
|
|
return -ENOMEM;
|
|
|
|
snprintf(master->unique, master->unique_len + 1, "%s:%s", bus, device);
|
|
|
|
return 0;
|
|
}
|
|
|
|
static struct drm_bus drm_host1x_bus = {
|
|
.set_busid = drm_host1x_set_busid,
|
|
};
|
|
|
|
int drm_host1x_init(struct drm_driver *driver, struct host1x_device *device)
|
|
{
|
|
struct drm_device *drm;
|
|
int ret;
|
|
|
|
driver->bus = &drm_host1x_bus;
|
|
|
|
drm = drm_dev_alloc(driver, &device->dev);
|
|
if (!drm)
|
|
return -ENOMEM;
|
|
|
|
ret = drm_dev_register(drm, 0);
|
|
if (ret)
|
|
goto err_free;
|
|
|
|
DRM_INFO("Initialized %s %d.%d.%d %s on minor %d\n", driver->name,
|
|
driver->major, driver->minor, driver->patchlevel,
|
|
driver->date, drm->primary->index);
|
|
|
|
return 0;
|
|
|
|
err_free:
|
|
drm_dev_unref(drm);
|
|
return ret;
|
|
}
|
|
|
|
void drm_host1x_exit(struct drm_driver *driver, struct host1x_device *device)
|
|
{
|
|
struct tegra_drm *tegra = dev_get_drvdata(&device->dev);
|
|
|
|
drm_put_dev(tegra->drm);
|
|
}
|