Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 915b4d11 authored by David Herrmann's avatar David Herrmann Committed by Dave Airlie
Browse files

drm: add driver->set_busid() callback



One step closer to dropping all the drm_bus_* code:
Add a driver->set_busid() callback and make all drivers use the generic
helpers. Nouveau is the only driver that uses two different bus-types with
the same drm_driver. This is totally broken if both buses are available on
the same machine (unlikely, but lets be safe). Therefore, we create two
different drivers for each platform during module_init() and set the
set_busid() callback respectively.

Signed-off-by: default avatarDavid Herrmann <dh.herrmann@gmail.com>
Reviewed-by: default avatarThierry Reding <treding@nvidia.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 1e444be0
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -308,6 +308,7 @@ static struct drm_driver armada_drm_driver = {
	.postclose		= NULL,
	.lastclose		= armada_drm_lastclose,
	.unload			= armada_drm_unload,
	.set_busid		= drm_platform_set_busid,
	.get_vblank_counter	= drm_vblank_count,
	.enable_vblank		= armada_drm_enable_vblank,
	.disable_vblank		= armada_drm_disable_vblank,
+1 −0
Original line number Diff line number Diff line
@@ -199,6 +199,7 @@ static struct drm_driver driver = {

	.load = ast_driver_load,
	.unload = ast_driver_unload,
	.set_busid = drm_pci_set_busid,

	.fops = &ast_fops,
	.name = DRIVER_NAME,
+1 −0
Original line number Diff line number Diff line
@@ -82,6 +82,7 @@ static struct drm_driver bochs_driver = {
	.driver_features	= DRIVER_GEM | DRIVER_MODESET,
	.load			= bochs_load,
	.unload			= bochs_unload,
	.set_busid		= drm_pci_set_busid,
	.fops			= &bochs_fops,
	.name			= "bochs-drm",
	.desc			= "bochs dispi vga interface (qemu stdvga)",
+1 −0
Original line number Diff line number Diff line
@@ -128,6 +128,7 @@ static struct drm_driver driver = {
	.driver_features = DRIVER_MODESET | DRIVER_GEM,
	.load = cirrus_driver_load,
	.unload = cirrus_driver_unload,
	.set_busid = drm_pci_set_busid,
	.fops = &cirrus_driver_fops,
	.name = DRIVER_NAME,
	.desc = DRIVER_DESC,
+7 −1
Original line number Diff line number Diff line
@@ -244,7 +244,13 @@ static int drm_set_busid(struct drm_device *dev, struct drm_file *file_priv)
	if (master->unique != NULL)
		drm_unset_busid(dev, master);

	if (dev->driver->bus && dev->driver->bus->set_busid) {
	if (dev->driver->set_busid) {
		ret = dev->driver->set_busid(dev, master);
		if (ret) {
			drm_unset_busid(dev, master);
			return ret;
		}
	} else if (dev->driver->bus && dev->driver->bus->set_busid) {
		ret = dev->driver->bus->set_busid(dev, master);
		if (ret) {
			drm_unset_busid(dev, master);
Loading