drm: Mark IRQ_BUSID ioctl as legacy
Subsystems (2)
Thomas Zimmermann
maintainerPATCH 1/1 drm: Mark IRQ_BUSID ioctl as legacy
The functionality is only implemented for legacy drivers. Mark the ioctl as legacy and move the code behind CONFIG_DRM_LEGACY. If legacy drivers are disabled, the ioctl call now returns -EINVAL instead of -EOPNOTSUPP.
Signed-off-by Thomas Zimmermann <[email protected]>
--- drivers/gpu/drm/drm_internal.h | 8 -------- drivers/gpu/drm/drm_ioctl.c | 3 ++- drivers/gpu/drm/drm_legacy.h | 8 ++++++++ drivers/gpu/drm/drm_pci.c | 8 ++++---- 4 files changed, 14 insertions(+), 13 deletions(-)
drivers/gpu/drm/drm_internal.h +0 -8
@@ -54,18 +54,10 @@ void drm_lastclose(struct drm_device *dev);#ifdef CONFIG_PCI /* drm_pci.c */ -int drm_legacy_irq_by_busid (struct drm_device *dev,void *data, -struct drm_file *file_priv);int drm_pci_set_busid (struct drm_device *dev,struct drm_master *master);#else -static inline int drm_legacy_irq_by_busid (struct drm_device *dev,void *data, -struct drm_file *file_priv) -{ -return -EINVAL ; -} -static inline int drm_pci_set_busid (struct drm_device *dev,struct drm_master *master) {
drivers/gpu/drm/drm_ioctl.c +2 -1
@@ -577,7 +577,8 @@ static const struct drm_ioctl_desc drm_ioctls[] = {DRM_IOCTL_DEF (DRM_IOCTL_VERSION , drm_version,DRM_RENDER_ALLOW ),DRM_IOCTL_DEF (DRM_IOCTL_GET_UNIQUE , drm_getunique,0 ),DRM_IOCTL_DEF (DRM_IOCTL_GET_MAGIC , drm_getmagic,0 ), -DRM_IOCTL_DEF (DRM_IOCTL_IRQ_BUSID , drm_legacy_irq_by_busid,DRM_MASTER |DRM_ROOT_ONLY ), +DRM_LEGACY_IOCTL_DEF (DRM_IOCTL_IRQ_BUSID , drm_legacy_irq_by_busid, +DRM_MASTER |DRM_ROOT_ONLY ), DRM_LEGACY_IOCTL_DEF(DRM_IOCTL_GET_MAP, drm_legacy_getmap_ioctl, 0),
drivers/gpu/drm/drm_legacy.h +8 -0
@@ -235,9 +235,17 @@ void drm_master_legacy_init(struct drm_master *master);static inline void drm_master_legacy_init (struct drm_master *master) {}#endif +/* drm_pci.c */ #if IS_ENABLED (CONFIG_DRM_LEGACY ) &&IS_ENABLED (CONFIG_PCI ) +int drm_legacy_irq_by_busid (struct drm_device *dev,void *data,struct drm_file *file_priv);void drm_legacy_pci_agp_destroy (struct drm_device *dev);#else +static inline int drm_legacy_irq_by_busid (struct drm_device *dev,void *data, +struct drm_file *file_priv) +{ +return -EINVAL ; +} +static inline void drm_legacy_pci_agp_destroy (struct drm_device *dev) {}#endif
drivers/gpu/drm/drm_pci.c +4 -4
@@ -72,7 +72,9 @@ int drm_pci_set_busid(struct drm_device *dev, struct drm_master *master)return 0 ; } -static int drm_pci_irq_by_busid (struct drm_device *dev,struct drm_irq_busid *p) +#ifdef CONFIG_DRM_LEGACY + +static int drm_legacy_pci_irq_by_busid (struct drm_device *dev,struct drm_irq_busid *p) {struct pci_dev *pdev =to_pci_dev (dev->dev);
@@ -115,11 +117,9 @@ int drm_legacy_irq_by_busid(struct drm_device *dev, void *data,if (!drm_core_check_feature (dev,DRIVER_HAVE_IRQ ))return -EOPNOTSUPP ; -return drm_pci_irq_by_busid (dev, p); +return drm_legacy_pci_irq_by_busid (dev, p); } -#ifdef CONFIG_DRM_LEGACY -void drm_legacy_pci_agp_destroy (struct drm_device *dev) {if (dev->agp) {
Signature · 1 line
2.31.1
Quoted 3 lines · Thomas Zimmermann
The functionality is only implemented for legacy drivers. Mark the ioctl as legacy and move the code behind
CONFIG_DRM_LEGACY. If legacy drivers are disabled, the ioctl call now returns-EINVALinstead of-EOPNOTSUPP.
I think that's fine.
Reviewed-by Daniel Vetter <[email protected]>
Quoted 99 lines
Signed-off-by Thomas Zimmermann <[email protected]>--- drivers/gpu/drm/drm_internal.h | 8 -------- drivers/gpu/drm/drm_ioctl.c | 3 ++- drivers/gpu/drm/drm_legacy.h | 8 ++++++++ drivers/gpu/drm/drm_pci.c | 8 ++++---- 4 files changed, 14 insertions(+), 13 deletions(-)drivers/gpu/drm/drm_internal.h +0
-8@@ -54,18 +54,10 @@ void drm_lastclose(struct drm_device *dev);#ifdef CONFIG_PCI /* drm_pci.c */ -int drm_legacy_irq_by_busid (struct drm_device *dev,void *data, -struct drm_file *file_priv);int drm_pci_set_busid (struct drm_device *dev,struct drm_master *master);#else -static inline int drm_legacy_irq_by_busid (struct drm_device *dev,void *data, -struct drm_file *file_priv) -{ -return -EINVAL ; -} -static inline int drm_pci_set_busid (struct drm_device *dev,struct drm_master *master) {drivers/gpu/drm/drm_ioctl.c +2
-1@@ -577,7 +577,8 @@ static const struct drm_ioctl_desc drm_ioctls[] = {DRM_IOCTL_DEF (DRM_IOCTL_VERSION , drm_version,DRM_RENDER_ALLOW ),DRM_IOCTL_DEF (DRM_IOCTL_GET_UNIQUE , drm_getunique,0 ),DRM_IOCTL_DEF (DRM_IOCTL_GET_MAGIC , drm_getmagic,0 ), -DRM_IOCTL_DEF (DRM_IOCTL_IRQ_BUSID , drm_legacy_irq_by_busid,DRM_MASTER |DRM_ROOT_ONLY ), +DRM_LEGACY_IOCTL_DEF (DRM_IOCTL_IRQ_BUSID , drm_legacy_irq_by_busid, +DRM_MASTER |DRM_ROOT_ONLY ), DRM_LEGACY_IOCTL_DEF(DRM_IOCTL_GET_MAP, drm_legacy_getmap_ioctl, 0),drivers/gpu/drm/drm_legacy.h +8
-0@@ -235,9 +235,17 @@ void drm_master_legacy_init(struct drm_master *master);static inline void drm_master_legacy_init (struct drm_master *master) {}#endif +/* drm_pci.c */ #if IS_ENABLED (CONFIG_DRM_LEGACY ) &&IS_ENABLED (CONFIG_PCI ) +int drm_legacy_irq_by_busid (struct drm_device *dev,void *data,struct drm_file *file_priv);void drm_legacy_pci_agp_destroy (struct drm_device *dev);#else +static inline int drm_legacy_irq_by_busid (struct drm_device *dev,void *data, +struct drm_file *file_priv) +{ +return -EINVAL ; +} +static inline void drm_legacy_pci_agp_destroy (struct drm_device *dev) {}#endif drivers/gpu/drm/drm_pci.c +4
-4@@ -72,7 +72,9 @@ int drm_pci_set_busid(struct drm_device *dev, struct drm_master *master)return 0 ; } -static int drm_pci_irq_by_busid (struct drm_device *dev,struct drm_irq_busid *p) +#ifdef CONFIG_DRM_LEGACY + +static int drm_legacy_pci_irq_by_busid (struct drm_device *dev,struct drm_irq_busid *p) {struct pci_dev *pdev =to_pci_dev (dev->dev);@@ -115,11 +117,9 @@ int drm_legacy_irq_by_busid(struct drm_device *dev, void *data,if (!drm_core_check_feature (dev,DRIVER_HAVE_IRQ ))return -EOPNOTSUPP ; -return drm_pci_irq_by_busid (dev, p); +return drm_legacy_pci_irq_by_busid (dev, p); } -#ifdef CONFIG_DRM_LEGACY -void drm_legacy_pci_agp_destroy (struct drm_device *dev) {if (dev->agp) {Signature · 1 line
2.31.1
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch