aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2013-11-03 15:47:18 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-04-23 04:32:51 -0400
commit53bf2a2bca9b56e23fa8862159c75868672d7f1e (patch)
tree0c414e1e70ac8f768ddd2b3d3fa201948bdf6f9a
parentb2a21aa25a39837d06eb24a7f0fef1733f9843eb (diff)
drm: inline drm_pci_set_unique
This is only used for drm versions 1.0, and kms drivers have never been there. So we can appropriately restrict this to legacy and hence pci devices and inline everything. v2: Make the dummy function actually return something, caught by Wu Fengguang's 0-day tester. v3: Fix spelling in comment (Thierry) Reviewed-by: Thierry Reding <treding@nvidia.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--drivers/gpu/drm/drm_ioctl.c10
-rw-r--r--drivers/gpu/drm/drm_pci.c14
-rw-r--r--include/drm/drmP.h5
3 files changed, 20 insertions, 9 deletions
diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c
index 93a42040bedb..53560ef53f99 100644
--- a/drivers/gpu/drm/drm_ioctl.c
+++ b/drivers/gpu/drm/drm_ioctl.c
@@ -93,7 +93,8 @@ drm_unset_busid(struct drm_device *dev,
93 * Copies the bus id from userspace into drm_device::unique, and verifies that 93 * Copies the bus id from userspace into drm_device::unique, and verifies that
94 * it matches the device this DRM is attached to (EINVAL otherwise). Deprecated 94 * it matches the device this DRM is attached to (EINVAL otherwise). Deprecated
95 * in interface version 1.1 and will return EBUSY when setversion has requested 95 * in interface version 1.1 and will return EBUSY when setversion has requested
96 * version 1.1 or greater. 96 * version 1.1 or greater. Also note that KMS is all version 1.1 and later and
97 * UMS was only ever supported on pci devices.
97 */ 98 */
98int drm_setunique(struct drm_device *dev, void *data, 99int drm_setunique(struct drm_device *dev, void *data,
99 struct drm_file *file_priv) 100 struct drm_file *file_priv)
@@ -108,10 +109,13 @@ int drm_setunique(struct drm_device *dev, void *data,
108 if (!u->unique_len || u->unique_len > 1024) 109 if (!u->unique_len || u->unique_len > 1024)
109 return -EINVAL; 110 return -EINVAL;
110 111
111 if (!dev->driver->bus->set_unique) 112 if (drm_core_check_feature(dev, DRIVER_MODESET))
113 return 0;
114
115 if (WARN_ON(!dev->pdev))
112 return -EINVAL; 116 return -EINVAL;
113 117
114 ret = dev->driver->bus->set_unique(dev, master, u); 118 ret = drm_pci_set_unique(dev, master, u);
115 if (ret) 119 if (ret)
116 goto err; 120 goto err;
117 121
diff --git a/drivers/gpu/drm/drm_pci.c b/drivers/gpu/drm/drm_pci.c
index eff29e311f70..c550b349f202 100644
--- a/drivers/gpu/drm/drm_pci.c
+++ b/drivers/gpu/drm/drm_pci.c
@@ -185,9 +185,9 @@ err:
185 return ret; 185 return ret;
186} 186}
187 187
188static int drm_pci_set_unique(struct drm_device *dev, 188int drm_pci_set_unique(struct drm_device *dev,
189 struct drm_master *master, 189 struct drm_master *master,
190 struct drm_unique *u) 190 struct drm_unique *u)
191{ 191{
192 int domain, bus, slot, func, ret; 192 int domain, bus, slot, func, ret;
193 const char *bus_name; 193 const char *bus_name;
@@ -314,7 +314,6 @@ void drm_pci_agp_destroy(struct drm_device *dev)
314static struct drm_bus drm_pci_bus = { 314static struct drm_bus drm_pci_bus = {
315 .get_name = drm_pci_get_name, 315 .get_name = drm_pci_get_name,
316 .set_busid = drm_pci_set_busid, 316 .set_busid = drm_pci_set_busid,
317 .set_unique = drm_pci_set_unique,
318}; 317};
319 318
320/** 319/**
@@ -481,6 +480,13 @@ int drm_irq_by_busid(struct drm_device *dev, void *data,
481{ 480{
482 return -EINVAL; 481 return -EINVAL;
483} 482}
483
484int drm_pci_set_unique(struct drm_device *dev,
485 struct drm_master *master,
486 struct drm_unique *u)
487{
488 return -EINVAL;
489}
484#endif 490#endif
485 491
486EXPORT_SYMBOL(drm_pci_init); 492EXPORT_SYMBOL(drm_pci_init);
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index f4d0eaa3da46..1a9d509bef66 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -728,8 +728,6 @@ struct drm_master {
728struct drm_bus { 728struct drm_bus {
729 const char *(*get_name)(struct drm_device *dev); 729 const char *(*get_name)(struct drm_device *dev);
730 int (*set_busid)(struct drm_device *dev, struct drm_master *master); 730 int (*set_busid)(struct drm_device *dev, struct drm_master *master);
731 int (*set_unique)(struct drm_device *dev, struct drm_master *master,
732 struct drm_unique *unique);
733}; 731};
734 732
735/** 733/**
@@ -1511,6 +1509,9 @@ extern drm_dma_handle_t *drm_pci_alloc(struct drm_device *dev, size_t size,
1511 size_t align); 1509 size_t align);
1512extern void __drm_pci_free(struct drm_device *dev, drm_dma_handle_t * dmah); 1510extern void __drm_pci_free(struct drm_device *dev, drm_dma_handle_t * dmah);
1513extern void drm_pci_free(struct drm_device *dev, drm_dma_handle_t * dmah); 1511extern void drm_pci_free(struct drm_device *dev, drm_dma_handle_t * dmah);
1512extern int drm_pci_set_unique(struct drm_device *dev,
1513 struct drm_master *master,
1514 struct drm_unique *u);
1514 1515
1515 /* sysfs support (drm_sysfs.c) */ 1516 /* sysfs support (drm_sysfs.c) */
1516struct drm_sysfs_class; 1517struct drm_sysfs_class;