aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_pci.c
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2013-08-28 09:19:23 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-04-22 05:41:10 -0400
commiteaaf8f0fc32468d4dedbb5b5f9c5bfb27744be4c (patch)
tree1f33c7040b03c0e67cb1cfdf8a139b304fb1230d /drivers/gpu/drm/drm_pci.c
parent4984979b9b9025a1cb9a9bea089d31a3e01ccff1 (diff)
drm/pci: fold in irq_by_busid support
This is a ums-only ioctl, and we've only ever supported ums (at least in upstream) on pci devices. So no point in keeping that piece of legacy logic abstracted within the drm bus driver. To keep things work without CONFIG_PCI also add a dummy ioctl. v2: Block the irq_by_busid ioctl for modeset drivers. v3: Spelling/whitespace polish (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>
Diffstat (limited to 'drivers/gpu/drm/drm_pci.c')
-rw-r--r--drivers/gpu/drm/drm_pci.c39
1 files changed, 37 insertions, 2 deletions
diff --git a/drivers/gpu/drm/drm_pci.c b/drivers/gpu/drm/drm_pci.c
index 9c696a5ad74d..8d4221683af4 100644
--- a/drivers/gpu/drm/drm_pci.c
+++ b/drivers/gpu/drm/drm_pci.c
@@ -247,7 +247,6 @@ err:
247 return ret; 247 return ret;
248} 248}
249 249
250
251static int drm_pci_irq_by_busid(struct drm_device *dev, struct drm_irq_busid *p) 250static int drm_pci_irq_by_busid(struct drm_device *dev, struct drm_irq_busid *p)
252{ 251{
253 if ((p->busnum >> 8) != drm_get_pci_domain(dev) || 252 if ((p->busnum >> 8) != drm_get_pci_domain(dev) ||
@@ -262,6 +261,37 @@ static int drm_pci_irq_by_busid(struct drm_device *dev, struct drm_irq_busid *p)
262 return 0; 261 return 0;
263} 262}
264 263
264/**
265 * Get interrupt from bus id.
266 *
267 * \param inode device inode.
268 * \param file_priv DRM file private.
269 * \param cmd command.
270 * \param arg user argument, pointing to a drm_irq_busid structure.
271 * \return zero on success or a negative number on failure.
272 *
273 * Finds the PCI device with the specified bus id and gets its IRQ number.
274 * This IOCTL is deprecated, and will now return EINVAL for any busid not equal
275 * to that of the device that this DRM instance attached to.
276 */
277int drm_irq_by_busid(struct drm_device *dev, void *data,
278 struct drm_file *file_priv)
279{
280 struct drm_irq_busid *p = data;
281
282 if (drm_core_check_feature(dev, DRIVER_MODESET))
283 return -EINVAL;
284
285 /* UMS was only ever support on PCI devices. */
286 if (WARN_ON(!dev->pdev))
287 return -EINVAL;
288
289 if (!drm_core_check_feature(dev, DRIVER_HAVE_IRQ))
290 return -EINVAL;
291
292 return drm_pci_irq_by_busid(dev, p);
293}
294
265static void drm_pci_agp_init(struct drm_device *dev) 295static void drm_pci_agp_init(struct drm_device *dev)
266{ 296{
267 if (drm_core_check_feature(dev, DRIVER_USE_AGP)) { 297 if (drm_core_check_feature(dev, DRIVER_USE_AGP)) {
@@ -292,7 +322,6 @@ static struct drm_bus drm_pci_bus = {
292 .get_name = drm_pci_get_name, 322 .get_name = drm_pci_get_name,
293 .set_busid = drm_pci_set_busid, 323 .set_busid = drm_pci_set_busid,
294 .set_unique = drm_pci_set_unique, 324 .set_unique = drm_pci_set_unique,
295 .irq_by_busid = drm_pci_irq_by_busid,
296}; 325};
297 326
298/** 327/**
@@ -453,6 +482,12 @@ int drm_pci_init(struct drm_driver *driver, struct pci_driver *pdriver)
453} 482}
454 483
455void drm_pci_agp_destroy(struct drm_device *dev) {} 484void drm_pci_agp_destroy(struct drm_device *dev) {}
485
486int drm_irq_by_busid(struct drm_device *dev, void *data,
487 struct drm_file *file_priv)
488{
489 return -EINVAL;
490}
456#endif 491#endif
457 492
458EXPORT_SYMBOL(drm_pci_init); 493EXPORT_SYMBOL(drm_pci_init);