This patchset cleans up drm_pci.{c,h}. Patch 1 removes drm_pci.c from non-PCI builds. Declarations of legacy functions are hidden in drm_legacy.h and their implementation is protected by CONFIG_PCI in patch 2. The rest of the patches replace unnecessary include statements for drm_pci.h. Most of the source files only require <linux/pci.h>.
The pathset was built on x86-64 and aarch64 with PCI support and arm without PCI support.
Thomas Zimmermann (12): drm/pci: Only build drm_pci.c if CONFIG_PCI is set drm/pci: Hide legacy PCI functions from non-legacy code drm/ast: Don't include <drm/drm_pci.h> drm/i810: Don't include <drm/drm_pci.h> drm/mga: Don't include <drm/drm_pci.h> drm/mgag200: Don't include <drm/drm_pci.h> drm/r128: Don't include <drm/drm_pci.h> drm/radeon: Don't include <drm/drm_pci.h> drm/savage: Don't include <drm/drm_pci.h> drm/sis: Don't include <drm/drm_pci.h> drm/tdfx: Don't include <drm/drm_pci.h> drm/via: Don't include <drm/drm_pci.h>
drivers/gpu/drm/Makefile | 3 +- drivers/gpu/drm/ast/ast_drv.c | 1 - drivers/gpu/drm/drm_internal.h | 22 ++++++++++++++ drivers/gpu/drm/drm_pci.c | 17 +++-------- drivers/gpu/drm/i810/i810_dma.c | 2 +- drivers/gpu/drm/i810/i810_drv.c | 3 +- drivers/gpu/drm/mga/mga_drv.h | 2 +- drivers/gpu/drm/mgag200/mgag200_cursor.c | 2 +- drivers/gpu/drm/mgag200/mgag200_i2c.c | 3 +- drivers/gpu/drm/mgag200/mgag200_main.c | 3 +- drivers/gpu/drm/mgag200/mgag200_mode.c | 2 +- drivers/gpu/drm/mgag200/mgag200_ttm.c | 2 +- drivers/gpu/drm/r128/r128_drv.c | 2 +- drivers/gpu/drm/radeon/atom.h | 1 + drivers/gpu/drm/radeon/atombios_encoders.c | 2 +- drivers/gpu/drm/radeon/btc_dpm.c | 3 +- drivers/gpu/drm/radeon/ci_dpm.c | 3 +- drivers/gpu/drm/radeon/cik.c | 4 +-- drivers/gpu/drm/radeon/cypress_dpm.c | 2 +- drivers/gpu/drm/radeon/evergreen.c | 2 +- drivers/gpu/drm/radeon/kv_dpm.c | 3 +- drivers/gpu/drm/radeon/ni.c | 4 +-- drivers/gpu/drm/radeon/ni_dpm.c | 3 +- drivers/gpu/drm/radeon/r100.c | 6 ++-- drivers/gpu/drm/radeon/r300.c | 2 +- drivers/gpu/drm/radeon/r420.c | 2 +- drivers/gpu/drm/radeon/r600.c | 6 ++-- drivers/gpu/drm/radeon/radeon_agp.c | 3 +- drivers/gpu/drm/radeon/radeon_asic.c | 2 +- drivers/gpu/drm/radeon/radeon_atombios.c | 3 +- drivers/gpu/drm/radeon/radeon_bios.c | 4 +-- drivers/gpu/drm/radeon/radeon_clocks.c | 3 +- drivers/gpu/drm/radeon/radeon_combios.c | 3 +- drivers/gpu/drm/radeon/radeon_cs.c | 2 +- drivers/gpu/drm/radeon/radeon_device.c | 2 +- drivers/gpu/drm/radeon/radeon_display.c | 2 +- drivers/gpu/drm/radeon/radeon_encoders.c | 3 +- drivers/gpu/drm/radeon/radeon_fb.c | 2 +- drivers/gpu/drm/radeon/radeon_gart.c | 2 +- drivers/gpu/drm/radeon/radeon_gem.c | 3 +- drivers/gpu/drm/radeon/radeon_i2c.c | 2 +- drivers/gpu/drm/radeon/radeon_irq_kms.c | 2 +- drivers/gpu/drm/radeon/radeon_kms.c | 2 +- .../gpu/drm/radeon/radeon_legacy_encoders.c | 2 +- drivers/gpu/drm/radeon/radeon_pm.c | 2 +- drivers/gpu/drm/radeon/radeon_ttm.c | 2 +- drivers/gpu/drm/radeon/rs600.c | 2 +- drivers/gpu/drm/radeon/rs690.c | 2 +- drivers/gpu/drm/radeon/rs780_dpm.c | 3 +- drivers/gpu/drm/radeon/rv770.c | 2 +- drivers/gpu/drm/radeon/si.c | 4 +-- drivers/gpu/drm/radeon/si_dpm.c | 3 +- drivers/gpu/drm/radeon/trinity_dpm.c | 3 +- drivers/gpu/drm/savage/savage_drv.c | 2 +- drivers/gpu/drm/sis/sis_drv.c | 2 +- drivers/gpu/drm/tdfx/tdfx_drv.c | 2 +- drivers/gpu/drm/via/via_dmablit.c | 2 +- drivers/gpu/drm/via/via_drv.c | 2 +- drivers/gpu/drm/via/via_map.c | 3 +- include/drm/drm_legacy.h | 29 ++++++++++++++++++- include/drm/drm_pci.h | 19 ++++++++++-- 61 files changed, 144 insertions(+), 89 deletions(-)
-- 2.23.0
Non-PCI systems should not build PCI helpers. Set up source code, header file and Makefile accordingly.
Signed-off-by: Thomas Zimmermann tzimmermann@suse.de --- drivers/gpu/drm/Makefile | 3 ++- drivers/gpu/drm/drm_internal.h | 22 ++++++++++++++++++++++ drivers/gpu/drm/drm_pci.c | 13 ------------- include/drm/drm_pci.h | 34 +++++++++++++++++++++++++++++++--- 4 files changed, 55 insertions(+), 17 deletions(-)
diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile index d9bcc9f2a0a4..6493088a0fdd 100644 --- a/drivers/gpu/drm/Makefile +++ b/drivers/gpu/drm/Makefile @@ -5,7 +5,7 @@
drm-y := drm_auth.o drm_cache.o \ drm_file.o drm_gem.o drm_ioctl.o drm_irq.o \ - drm_memory.o drm_drv.o drm_pci.o \ + drm_memory.o drm_drv.o \ drm_sysfs.o drm_hashtab.o drm_mm.o \ drm_crtc.o drm_fourcc.o drm_modes.o drm_edid.o \ drm_encoder_slave.o \ @@ -28,6 +28,7 @@ drm-$(CONFIG_DRM_GEM_SHMEM_HELPER) += drm_gem_shmem_helper.o drm-$(CONFIG_DRM_PANEL) += drm_panel.o drm-$(CONFIG_OF) += drm_of.o drm-$(CONFIG_AGP) += drm_agpsupport.o +drm-$(CONFIG_PCI) += drm_pci.o drm-$(CONFIG_DEBUG_FS) += drm_debugfs.o drm_debugfs_crc.o drm-$(CONFIG_DRM_LOAD_EDID_FIRMWARE) += drm_edid_load.o
diff --git a/drivers/gpu/drm/drm_internal.h b/drivers/gpu/drm/drm_internal.h index 51a2055c8f18..6937bf923f05 100644 --- a/drivers/gpu/drm/drm_internal.h +++ b/drivers/gpu/drm/drm_internal.h @@ -45,12 +45,34 @@ struct drm_file *drm_file_alloc(struct drm_minor *minor); void drm_file_free(struct drm_file *file); void drm_lastclose(struct drm_device *dev);
+#ifdef CONFIG_PCI + /* drm_pci.c */ int drm_irq_by_busid(struct drm_device *dev, void *data, struct drm_file *file_priv); void drm_pci_agp_destroy(struct drm_device *dev); int drm_pci_set_busid(struct drm_device *dev, struct drm_master *master);
+#else + +static inline int drm_irq_by_busid(struct drm_device *dev, void *data, + struct drm_file *file_priv) +{ + return -EINVAL; +} + +static inline void drm_pci_agp_destroy(struct drm_device *dev) +{ +} + +static inline int drm_pci_set_busid(struct drm_device *dev, + struct drm_master *master) +{ + return -EINVAL; +} + +#endif + /* drm_prime.c */ int drm_prime_handle_to_fd_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv); diff --git a/drivers/gpu/drm/drm_pci.c b/drivers/gpu/drm/drm_pci.c index a86a3ab2771c..40a2015abc77 100644 --- a/drivers/gpu/drm/drm_pci.c +++ b/drivers/gpu/drm/drm_pci.c @@ -125,8 +125,6 @@ void drm_pci_free(struct drm_device * dev, drm_dma_handle_t * dmah)
EXPORT_SYMBOL(drm_pci_free);
-#ifdef CONFIG_PCI - static int drm_get_pci_domain(struct drm_device *dev) { #ifndef __alpha__ @@ -331,17 +329,6 @@ int drm_legacy_pci_init(struct drm_driver *driver, struct pci_driver *pdriver) } EXPORT_SYMBOL(drm_legacy_pci_init);
-#else - -void drm_pci_agp_destroy(struct drm_device *dev) {} - -int drm_irq_by_busid(struct drm_device *dev, void *data, - struct drm_file *file_priv) -{ - return -EINVAL; -} -#endif - /** * drm_legacy_pci_exit - unregister shadow-attach legacy DRM driver * @driver: DRM device driver diff --git a/include/drm/drm_pci.h b/include/drm/drm_pci.h index 8181e9e7cf1d..029352f8c583 100644 --- a/include/drm/drm_pci.h +++ b/include/drm/drm_pci.h @@ -38,24 +38,52 @@ struct drm_dma_handle; struct drm_device; struct drm_driver; struct drm_master; +struct pci_device; + +#ifdef CONFIG_PCI
struct drm_dma_handle *drm_pci_alloc(struct drm_device *dev, size_t size, size_t align); void drm_pci_free(struct drm_device *dev, struct drm_dma_handle * dmah);
-int drm_legacy_pci_init(struct drm_driver *driver, struct pci_driver *pdriver); -void drm_legacy_pci_exit(struct drm_driver *driver, struct pci_driver *pdriver); -#ifdef CONFIG_PCI int drm_get_pci_dev(struct pci_dev *pdev, const struct pci_device_id *ent, struct drm_driver *driver); + +int drm_legacy_pci_init(struct drm_driver *driver, struct pci_driver *pdriver); +void drm_legacy_pci_exit(struct drm_driver *driver, struct pci_driver *pdriver); + #else + +static inline struct drm_dma_handle *drm_pci_alloc(struct drm_device *dev, + size_t size, size_t align) +{ + return NULL; +} + +static inline void drm_pci_free(struct drm_device *dev, + struct drm_dma_handle *dmah) +{ +} + static inline int drm_get_pci_dev(struct pci_dev *pdev, const struct pci_device_id *ent, struct drm_driver *driver) { return -ENOSYS; } + +static inline int drm_legacy_pci_init(struct drm_driver *driver, + struct pci_driver *pdriver) +{ + return -EINVAL; +} + +static inline void drm_legacy_pci_exit(struct drm_driver *driver, + struct pci_driver *pdriver) +{ +} + #endif
#endif /* _DRM_PCI_H_ */
Declarations of drm_legacy_pci_{init,exit}() are being moved to drm_legacy.h. CONFIG_DRM_LEGACY protects the implementation.
Signed-off-by: Thomas Zimmermann tzimmermann@suse.de --- drivers/gpu/drm/drm_pci.c | 4 ++++ include/drm/drm_legacy.h | 29 ++++++++++++++++++++++++++++- include/drm/drm_pci.h | 15 --------------- 3 files changed, 32 insertions(+), 16 deletions(-)
diff --git a/drivers/gpu/drm/drm_pci.c b/drivers/gpu/drm/drm_pci.c index 40a2015abc77..f2e43d341980 100644 --- a/drivers/gpu/drm/drm_pci.c +++ b/drivers/gpu/drm/drm_pci.c @@ -282,6 +282,8 @@ int drm_get_pci_dev(struct pci_dev *pdev, const struct pci_device_id *ent, } EXPORT_SYMBOL(drm_get_pci_dev);
+#ifdef CONFIG_DRM_LEGACY + /** * drm_legacy_pci_init - shadow-attach a legacy DRM PCI driver * @driver: DRM device driver @@ -354,3 +356,5 @@ void drm_legacy_pci_exit(struct drm_driver *driver, struct pci_driver *pdriver) DRM_INFO("Module unloaded\n"); } EXPORT_SYMBOL(drm_legacy_pci_exit); + +#endif diff --git a/include/drm/drm_legacy.h b/include/drm/drm_legacy.h index 58dc0c04bf99..5745710453c8 100644 --- a/include/drm/drm_legacy.h +++ b/include/drm/drm_legacy.h @@ -38,7 +38,9 @@ #include <drm/drm_hashtab.h>
struct drm_device; +struct drm_driver; struct file; +struct pci_driver;
/* * Legacy Support for palateontologic DRM drivers @@ -188,8 +190,33 @@ do { \ void drm_legacy_idlelock_take(struct drm_lock_data *lock); void drm_legacy_idlelock_release(struct drm_lock_data *lock);
-/* drm_pci.c dma alloc wrappers */ +/* drm_pci.c */ + +#ifdef CONFIG_PCI + void __drm_legacy_pci_free(struct drm_device *dev, drm_dma_handle_t * dmah); +int drm_legacy_pci_init(struct drm_driver *driver, struct pci_driver *pdriver); +void drm_legacy_pci_exit(struct drm_driver *driver, struct pci_driver *pdriver); + +#else + +static inline void __drm_legacy_pci_free(struct drm_device *dev, + drm_dma_handle_t *dmah) +{ +} + +static inline int drm_legacy_pci_init(struct drm_driver *driver, + struct pci_driver *pdriver) +{ + return -EINVAL; +} + +static inline void drm_legacy_pci_exit(struct drm_driver *driver, + struct pci_driver *pdriver) +{ +} + +#endif
/* drm_memory.c */ void drm_legacy_ioremap(struct drm_local_map *map, struct drm_device *dev); diff --git a/include/drm/drm_pci.h b/include/drm/drm_pci.h index 029352f8c583..9031e217b506 100644 --- a/include/drm/drm_pci.h +++ b/include/drm/drm_pci.h @@ -38,7 +38,6 @@ struct drm_dma_handle; struct drm_device; struct drm_driver; struct drm_master; -struct pci_device;
#ifdef CONFIG_PCI
@@ -50,9 +49,6 @@ int drm_get_pci_dev(struct pci_dev *pdev, const struct pci_device_id *ent, struct drm_driver *driver);
-int drm_legacy_pci_init(struct drm_driver *driver, struct pci_driver *pdriver); -void drm_legacy_pci_exit(struct drm_driver *driver, struct pci_driver *pdriver); - #else
static inline struct drm_dma_handle *drm_pci_alloc(struct drm_device *dev, @@ -73,17 +69,6 @@ static inline int drm_get_pci_dev(struct pci_dev *pdev, return -ENOSYS; }
-static inline int drm_legacy_pci_init(struct drm_driver *driver, - struct pci_driver *pdriver) -{ - return -EINVAL; -} - -static inline void drm_legacy_pci_exit(struct drm_driver *driver, - struct pci_driver *pdriver) -{ -} - #endif
#endif /* _DRM_PCI_H_ */
Hi Thomas,
On Tue, 3 Dec 2019 at 10:04, Thomas Zimmermann tzimmermann@suse.de wrote:
Declarations of drm_legacy_pci_{init,exit}() are being moved to drm_legacy.h. CONFIG_DRM_LEGACY protects the implementation.
Signed-off-by: Thomas Zimmermann tzimmermann@suse.de
drivers/gpu/drm/drm_pci.c | 4 ++++ include/drm/drm_legacy.h | 29 ++++++++++++++++++++++++++++- include/drm/drm_pci.h | 15 --------------- 3 files changed, 32 insertions(+), 16 deletions(-)
How about we make this patch 01/12, this way we can avoid the current case of - add code only to be moved in next patch.
As always - couple of ideas for follow-up cleanups. - drm_irq_by_busid() is legacy codebase (see the DRIVER_LEGACY check at the top). How about we give it a _legacy_ name? - WE HAVE A FEW driver_features
On Tue, 3 Dec 2019 at 11:06, Emil Velikov emil.l.velikov@gmail.com wrote:
Hi Thomas,
On Tue, 3 Dec 2019 at 10:04, Thomas Zimmermann tzimmermann@suse.de wrote:
Declarations of drm_legacy_pci_{init,exit}() are being moved to drm_legacy.h. CONFIG_DRM_LEGACY protects the implementation.
Signed-off-by: Thomas Zimmermann tzimmermann@suse.de
drivers/gpu/drm/drm_pci.c | 4 ++++ include/drm/drm_legacy.h | 29 ++++++++++++++++++++++++++++- include/drm/drm_pci.h | 15 --------------- 3 files changed, 32 insertions(+), 16 deletions(-)
How about we make this patch 01/12, this way we can avoid the current case of - add code only to be moved in next patch.
As always - couple of ideas for follow-up cleanups.
- drm_irq_by_busid() is legacy codebase (see the DRIVER_LEGACY check
at the top). How about we give it a _legacy_ name?
- WE HAVE A FEW driver_features
Pardon there, the last one should read: - We have a few instances that read driver_features directly, instead of using the drm_core_check_feature() helper. Might be a good idea to address those.
Just some nitpicks noticed while skimming through. It's not a requirement by any means.
HTH Emil
Hi Emil
Am 03.12.19 um 12:09 schrieb Emil Velikov:
On Tue, 3 Dec 2019 at 11:06, Emil Velikov emil.l.velikov@gmail.com wrote:
Hi Thomas,
On Tue, 3 Dec 2019 at 10:04, Thomas Zimmermann tzimmermann@suse.de wrote:
Declarations of drm_legacy_pci_{init,exit}() are being moved to drm_legacy.h. CONFIG_DRM_LEGACY protects the implementation.
Signed-off-by: Thomas Zimmermann tzimmermann@suse.de
drivers/gpu/drm/drm_pci.c | 4 ++++ include/drm/drm_legacy.h | 29 ++++++++++++++++++++++++++++- include/drm/drm_pci.h | 15 --------------- 3 files changed, 32 insertions(+), 16 deletions(-)
How about we make this patch 01/12, this way we can avoid the current case of - add code only to be moved in next patch.
I tried. But before patch [01/12] drm_legacy_pci_init() in drm_pci.c is protected by CONFIG_PCI, while drm_legacy_pci_exit() isn't. So moving patch [02/12] first, makes things even more ugly.
As always - couple of ideas for follow-up cleanups.
- drm_irq_by_busid() is legacy codebase (see the DRIVER_LEGACY check
at the top). How about we give it a _legacy_ name?
- WE HAVE A FEW driver_features
Pardon there, the last one should read:
- We have a few instances that read driver_features directly, instead
of using the drm_core_check_feature() helper. Might be a good idea to address those.
This specific patchset isn't about legacy, but PCI functions. But, yeah, these things are good follow-up changes. If I need something quick and simple to do before Christmas holidays... :)
Best regards Thomas
Just some nitpicks noticed while skimming through. It's not a requirement by any means.
HTH Emil
Including <drm/drm_pci.h> is unnecessary in most cases. Replace these instances.
Signed-off-by: Thomas Zimmermann tzimmermann@suse.de --- drivers/gpu/drm/ast/ast_drv.c | 1 - 1 file changed, 1 deletion(-)
diff --git a/drivers/gpu/drm/ast/ast_drv.c b/drivers/gpu/drm/ast/ast_drv.c index 9da26750a22d..30aa73a5d9b7 100644 --- a/drivers/gpu/drm/ast/ast_drv.c +++ b/drivers/gpu/drm/ast/ast_drv.c @@ -33,7 +33,6 @@ #include <drm/drm_crtc_helper.h> #include <drm/drm_drv.h> #include <drm/drm_gem_vram_helper.h> -#include <drm/drm_pci.h> #include <drm/drm_probe_helper.h>
#include "ast_drv.h"
Hi Thomas,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on linus/master] [also build test ERROR on v5.4 v5.4-rc8 v5.4-rc7 next-20191203 v5.4 next-20191203] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Thomas-Zimmermann/Clean-up-drm_pci-... base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 76bb8b05960c3d1668e6bee7624ed886cbd135ba config: sparc64-allmodconfig (attached as .config) compiler: sparc64-linux-gcc (GCC) 7.5.0 reproduce: wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # save the attached .config to linux build tree GCC_VERSION=7.5.0 make.cross ARCH=sparc64
If you fix the issue, kindly add following tag Reported-by: kbuild test robot lkp@intel.com
All errors (new ones prefixed by >>):
drivers/gpu/drm/ast/ast_drv.c: In function 'ast_pci_probe':
drivers/gpu/drm/ast/ast_drv.c:90:9: error: implicit declaration of function 'drm_get_pci_dev'; did you mean 'drm_get_edid'? [-Werror=implicit-function-declaration]
return drm_get_pci_dev(pdev, ent, &driver); ^~~~~~~~~~~~~~~ drm_get_edid cc1: some warnings being treated as errors
vim +90 drivers/gpu/drm/ast/ast_drv.c
5478ad10e7850c Thomas Zimmermann 2018-11-15 85 56550d94cbaeaa Greg Kroah-Hartman 2012-12-21 86 static int ast_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) 312fec1405dd54 Dave Airlie 2012-02-29 87 { 5478ad10e7850c Thomas Zimmermann 2018-11-15 88 ast_kick_out_firmware_fb(pdev); 5478ad10e7850c Thomas Zimmermann 2018-11-15 89 312fec1405dd54 Dave Airlie 2012-02-29 @90 return drm_get_pci_dev(pdev, ent, &driver); 312fec1405dd54 Dave Airlie 2012-02-29 91 } 312fec1405dd54 Dave Airlie 2012-02-29 92
:::::: The code at line 90 was first introduced by commit :::::: 312fec1405dd546ddb3fa6387d54e78f604dd8f8 drm: Initial KMS driver for AST (ASpeed Technologies) 2000 series (v2)
:::::: TO: Dave Airlie airlied@redhat.com :::::: CC: Dave Airlie airlied@redhat.com
--- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org Intel Corporation
Including <drm/drm_pci.h> is unnecessary in most cases. Replace these instances.
Signed-off-by: Thomas Zimmermann tzimmermann@suse.de --- drivers/gpu/drm/i810/i810_dma.c | 2 +- drivers/gpu/drm/i810/i810_drv.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i810/i810_dma.c b/drivers/gpu/drm/i810/i810_dma.c index e66c38332df4..b88c3d5f92b4 100644 --- a/drivers/gpu/drm/i810/i810_dma.c +++ b/drivers/gpu/drm/i810/i810_dma.c @@ -32,6 +32,7 @@
#include <linux/delay.h> #include <linux/mman.h> +#include <linux/pci.h>
#include <drm/drm_agpsupport.h> #include <drm/drm_device.h> @@ -39,7 +40,6 @@ #include <drm/drm_file.h> #include <drm/drm_ioctl.h> #include <drm/drm_irq.h> -#include <drm/drm_pci.h> #include <drm/drm_print.h> #include <drm/i810_drm.h>
diff --git a/drivers/gpu/drm/i810/i810_drv.c b/drivers/gpu/drm/i810/i810_drv.c index 5dd26a06ee0e..0e53a066d4db 100644 --- a/drivers/gpu/drm/i810/i810_drv.c +++ b/drivers/gpu/drm/i810/i810_drv.c @@ -31,11 +31,12 @@ */
#include "i810_drv.h" + #include <linux/module.h> +#include <linux/pci.h>
#include <drm/drm_drv.h> #include <drm/drm_file.h> -#include <drm/drm_pci.h> #include <drm/drm_pciids.h> #include <drm/i810_drm.h>
Including <drm/drm_pci.h> is unnecessary in most cases. Replace these instances.
Signed-off-by: Thomas Zimmermann tzimmermann@suse.de --- drivers/gpu/drm/mga/mga_drv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/mga/mga_drv.h b/drivers/gpu/drm/mga/mga_drv.h index d5deecb93975..66df51607896 100644 --- a/drivers/gpu/drm/mga/mga_drv.h +++ b/drivers/gpu/drm/mga/mga_drv.h @@ -32,6 +32,7 @@ #define __MGA_DRV_H__
#include <linux/irqreturn.h> +#include <linux/pci.h> #include <linux/slab.h>
#include <drm/drm_agpsupport.h> @@ -40,7 +41,6 @@ #include <drm/drm_ioctl.h> #include <drm/drm_irq.h> #include <drm/drm_legacy.h> -#include <drm/drm_pci.h> #include <drm/drm_print.h> #include <drm/drm_sarea.h> #include <drm/drm_vblank.h>
Including <drm/drm_pci.h> is unnecessary in most cases. Replace these instances.
Signed-off-by: Thomas Zimmermann tzimmermann@suse.de --- drivers/gpu/drm/mgag200/mgag200_cursor.c | 2 +- drivers/gpu/drm/mgag200/mgag200_i2c.c | 3 +-- drivers/gpu/drm/mgag200/mgag200_main.c | 3 ++- drivers/gpu/drm/mgag200/mgag200_mode.c | 2 +- drivers/gpu/drm/mgag200/mgag200_ttm.c | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/mgag200/mgag200_cursor.c b/drivers/gpu/drm/mgag200/mgag200_cursor.c index 79711dbb5b03..5444cf1573a3 100644 --- a/drivers/gpu/drm/mgag200/mgag200_cursor.c +++ b/drivers/gpu/drm/mgag200/mgag200_cursor.c @@ -5,7 +5,7 @@ * Author: Christopher Harvey charvey@matrox.com */
-#include <drm/drm_pci.h> +#include <linux/pci.h>
#include "mgag200_drv.h"
diff --git a/drivers/gpu/drm/mgag200/mgag200_i2c.c b/drivers/gpu/drm/mgag200/mgag200_i2c.c index 51d4037f00d4..9f4635916d32 100644 --- a/drivers/gpu/drm/mgag200/mgag200_i2c.c +++ b/drivers/gpu/drm/mgag200/mgag200_i2c.c @@ -29,8 +29,7 @@ #include <linux/export.h> #include <linux/i2c-algo-bit.h> #include <linux/i2c.h> - -#include <drm/drm_pci.h> +#include <linux/pci.h>
#include "mgag200_drv.h"
diff --git a/drivers/gpu/drm/mgag200/mgag200_main.c b/drivers/gpu/drm/mgag200/mgag200_main.c index e1bc5b0aa774..b1dd569b8c80 100644 --- a/drivers/gpu/drm/mgag200/mgag200_main.c +++ b/drivers/gpu/drm/mgag200/mgag200_main.c @@ -8,9 +8,10 @@ * Dave Airlie */
+#include <linux/pci.h> + #include <drm/drm_crtc_helper.h> #include <drm/drm_gem_framebuffer_helper.h> -#include <drm/drm_pci.h>
#include "mgag200_drv.h"
diff --git a/drivers/gpu/drm/mgag200/mgag200_mode.c b/drivers/gpu/drm/mgag200/mgag200_mode.c index 5ec697148fc1..62a8e9ccb16d 100644 --- a/drivers/gpu/drm/mgag200/mgag200_mode.c +++ b/drivers/gpu/drm/mgag200/mgag200_mode.c @@ -9,10 +9,10 @@ */
#include <linux/delay.h> +#include <linux/pci.h>
#include <drm/drm_crtc_helper.h> #include <drm/drm_fourcc.h> -#include <drm/drm_pci.h> #include <drm/drm_plane_helper.h> #include <drm/drm_probe_helper.h>
diff --git a/drivers/gpu/drm/mgag200/mgag200_ttm.c b/drivers/gpu/drm/mgag200/mgag200_ttm.c index 99997d737362..e89657630ea7 100644 --- a/drivers/gpu/drm/mgag200/mgag200_ttm.c +++ b/drivers/gpu/drm/mgag200/mgag200_ttm.c @@ -26,7 +26,7 @@ * Authors: Dave Airlie airlied@redhat.com */
-#include <drm/drm_pci.h> +#include <linux/pci.h>
#include "mgag200_drv.h"
Including <drm/drm_pci.h> is unnecessary in most cases. Replace these instances.
Signed-off-by: Thomas Zimmermann tzimmermann@suse.de --- drivers/gpu/drm/r128/r128_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/r128/r128_drv.c b/drivers/gpu/drm/r128/r128_drv.c index fd74f744604f..b7a5f162ebae 100644 --- a/drivers/gpu/drm/r128/r128_drv.c +++ b/drivers/gpu/drm/r128/r128_drv.c @@ -30,10 +30,10 @@ */
#include <linux/module.h> +#include <linux/pci.h>
#include <drm/drm_drv.h> #include <drm/drm_file.h> -#include <drm/drm_pci.h> #include <drm/drm_pciids.h> #include <drm/drm_vblank.h> #include <drm/r128_drm.h>
Including <drm/drm_pci.h> is unnecessary in most cases. Replace these instances.
Signed-off-by: Thomas Zimmermann tzimmermann@suse.de --- drivers/gpu/drm/radeon/atom.h | 1 + drivers/gpu/drm/radeon/atombios_encoders.c | 2 +- drivers/gpu/drm/radeon/btc_dpm.c | 3 +-- drivers/gpu/drm/radeon/ci_dpm.c | 3 +-- drivers/gpu/drm/radeon/cik.c | 4 ++-- drivers/gpu/drm/radeon/cypress_dpm.c | 2 +- drivers/gpu/drm/radeon/evergreen.c | 2 +- drivers/gpu/drm/radeon/kv_dpm.c | 3 +-- drivers/gpu/drm/radeon/ni.c | 4 ++-- drivers/gpu/drm/radeon/ni_dpm.c | 3 +-- drivers/gpu/drm/radeon/r100.c | 6 +++--- drivers/gpu/drm/radeon/r300.c | 2 +- drivers/gpu/drm/radeon/r420.c | 2 +- drivers/gpu/drm/radeon/r600.c | 6 +++--- drivers/gpu/drm/radeon/radeon_agp.c | 3 ++- drivers/gpu/drm/radeon/radeon_asic.c | 2 +- drivers/gpu/drm/radeon/radeon_atombios.c | 3 ++- drivers/gpu/drm/radeon/radeon_bios.c | 4 ++-- drivers/gpu/drm/radeon/radeon_clocks.c | 3 ++- drivers/gpu/drm/radeon/radeon_combios.c | 3 ++- drivers/gpu/drm/radeon/radeon_cs.c | 2 +- drivers/gpu/drm/radeon/radeon_device.c | 2 +- drivers/gpu/drm/radeon/radeon_display.c | 2 +- drivers/gpu/drm/radeon/radeon_encoders.c | 3 ++- drivers/gpu/drm/radeon/radeon_fb.c | 2 +- drivers/gpu/drm/radeon/radeon_gart.c | 2 +- drivers/gpu/drm/radeon/radeon_gem.c | 3 ++- drivers/gpu/drm/radeon/radeon_i2c.c | 2 +- drivers/gpu/drm/radeon/radeon_irq_kms.c | 2 +- drivers/gpu/drm/radeon/radeon_kms.c | 2 +- drivers/gpu/drm/radeon/radeon_legacy_encoders.c | 2 +- drivers/gpu/drm/radeon/radeon_pm.c | 2 +- drivers/gpu/drm/radeon/radeon_ttm.c | 2 +- drivers/gpu/drm/radeon/rs600.c | 2 +- drivers/gpu/drm/radeon/rs690.c | 2 +- drivers/gpu/drm/radeon/rs780_dpm.c | 3 +-- drivers/gpu/drm/radeon/rv770.c | 2 +- drivers/gpu/drm/radeon/si.c | 4 ++-- drivers/gpu/drm/radeon/si_dpm.c | 3 +-- drivers/gpu/drm/radeon/trinity_dpm.c | 3 +-- 40 files changed, 54 insertions(+), 54 deletions(-)
diff --git a/drivers/gpu/drm/radeon/atom.h b/drivers/gpu/drm/radeon/atom.h index 364b895e7ebb..1bf06c91cd95 100644 --- a/drivers/gpu/drm/radeon/atom.h +++ b/drivers/gpu/drm/radeon/atom.h @@ -25,6 +25,7 @@ #ifndef ATOM_H #define ATOM_H
+#include <linux/mutex.h> #include <linux/types.h>
#define ATOM_BIOS_MAGIC 0xAA55 diff --git a/drivers/gpu/drm/radeon/atombios_encoders.c b/drivers/gpu/drm/radeon/atombios_encoders.c index cc8f32a1b03c..2a7be5d5e7e6 100644 --- a/drivers/gpu/drm/radeon/atombios_encoders.c +++ b/drivers/gpu/drm/radeon/atombios_encoders.c @@ -26,10 +26,10 @@
#include <linux/backlight.h> #include <linux/dmi.h> +#include <linux/pci.h>
#include <drm/drm_crtc_helper.h> #include <drm/drm_file.h> -#include <drm/drm_pci.h> #include <drm/radeon_drm.h>
#include "atom.h" diff --git a/drivers/gpu/drm/radeon/btc_dpm.c b/drivers/gpu/drm/radeon/btc_dpm.c index ce37de020b91..d1d8aaf8323c 100644 --- a/drivers/gpu/drm/radeon/btc_dpm.c +++ b/drivers/gpu/drm/radeon/btc_dpm.c @@ -22,10 +22,9 @@ * Authors: Alex Deucher */
+#include <linux/pci.h> #include <linux/seq_file.h>
-#include <drm/drm_pci.h> - #include "atom.h" #include "btc_dpm.h" #include "btcd.h" diff --git a/drivers/gpu/drm/radeon/ci_dpm.c b/drivers/gpu/drm/radeon/ci_dpm.c index c6fd123f60b5..a9257bed3484 100644 --- a/drivers/gpu/drm/radeon/ci_dpm.c +++ b/drivers/gpu/drm/radeon/ci_dpm.c @@ -22,10 +22,9 @@ */
#include <linux/firmware.h> +#include <linux/pci.h> #include <linux/seq_file.h>
-#include <drm/drm_pci.h> - #include "atom.h" #include "ci_dpm.h" #include "cikd.h" diff --git a/drivers/gpu/drm/radeon/cik.c b/drivers/gpu/drm/radeon/cik.c index acabeaf28732..4b6f014f1746 100644 --- a/drivers/gpu/drm/radeon/cik.c +++ b/drivers/gpu/drm/radeon/cik.c @@ -23,10 +23,10 @@ */
#include <linux/firmware.h> -#include <linux/slab.h> #include <linux/module.h> +#include <linux/pci.h> +#include <linux/slab.h>
-#include <drm/drm_pci.h> #include <drm/drm_vblank.h>
#include "atom.h" diff --git a/drivers/gpu/drm/radeon/cypress_dpm.c b/drivers/gpu/drm/radeon/cypress_dpm.c index 32ed60f1048b..35b177d77791 100644 --- a/drivers/gpu/drm/radeon/cypress_dpm.c +++ b/drivers/gpu/drm/radeon/cypress_dpm.c @@ -22,7 +22,7 @@ * Authors: Alex Deucher */
-#include <drm/drm_pci.h> +#include <linux/pci.h>
#include "atom.h" #include "cypress_dpm.h" diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c index 44d767ffa4b9..f6123a21dbbb 100644 --- a/drivers/gpu/drm/radeon/evergreen.c +++ b/drivers/gpu/drm/radeon/evergreen.c @@ -23,9 +23,9 @@ */
#include <linux/firmware.h> +#include <linux/pci.h> #include <linux/slab.h>
-#include <drm/drm_pci.h> #include <drm/drm_vblank.h> #include <drm/radeon_drm.h>
diff --git a/drivers/gpu/drm/radeon/kv_dpm.c b/drivers/gpu/drm/radeon/kv_dpm.c index 0d8d30b78f95..5e6086eb1807 100644 --- a/drivers/gpu/drm/radeon/kv_dpm.c +++ b/drivers/gpu/drm/radeon/kv_dpm.c @@ -21,10 +21,9 @@ * */
+#include <linux/pci.h> #include <linux/seq_file.h>
-#include <drm/drm_pci.h> - #include "cikd.h" #include "kv_dpm.h" #include "r600_dpm.h" diff --git a/drivers/gpu/drm/radeon/ni.c b/drivers/gpu/drm/radeon/ni.c index a729a68ad4fc..443b61cac8c5 100644 --- a/drivers/gpu/drm/radeon/ni.c +++ b/drivers/gpu/drm/radeon/ni.c @@ -23,10 +23,10 @@ */
#include <linux/firmware.h> -#include <linux/slab.h> #include <linux/module.h> +#include <linux/pci.h> +#include <linux/slab.h>
-#include <drm/drm_pci.h> #include <drm/radeon_drm.h>
#include "atom.h" diff --git a/drivers/gpu/drm/radeon/ni_dpm.c b/drivers/gpu/drm/radeon/ni_dpm.c index d9e62ca65ab8..b57c37ddd164 100644 --- a/drivers/gpu/drm/radeon/ni_dpm.c +++ b/drivers/gpu/drm/radeon/ni_dpm.c @@ -22,10 +22,9 @@ */
#include <linux/math64.h> +#include <linux/pci.h> #include <linux/seq_file.h>
-#include <drm/drm_pci.h> - #include "atom.h" #include "ni_dpm.h" #include "nid.h" diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c index c61590c09955..79aecf1a7df4 100644 --- a/drivers/gpu/drm/radeon/r100.c +++ b/drivers/gpu/drm/radeon/r100.c @@ -26,16 +26,16 @@ * Jerome Glisse */
-#include <linux/seq_file.h> -#include <linux/slab.h> #include <linux/firmware.h> #include <linux/module.h> +#include <linux/pci.h> +#include <linux/seq_file.h> +#include <linux/slab.h>
#include <drm/drm_debugfs.h> #include <drm/drm_device.h> #include <drm/drm_file.h> #include <drm/drm_fourcc.h> -#include <drm/drm_pci.h> #include <drm/drm_vblank.h> #include <drm/radeon_drm.h>
diff --git a/drivers/gpu/drm/radeon/r300.c b/drivers/gpu/drm/radeon/r300.c index 44856e3a7108..3b7ead5be5bf 100644 --- a/drivers/gpu/drm/radeon/r300.c +++ b/drivers/gpu/drm/radeon/r300.c @@ -26,6 +26,7 @@ * Jerome Glisse */
+#include <linux/pci.h> #include <linux/seq_file.h> #include <linux/slab.h>
@@ -34,7 +35,6 @@ #include <drm/drm_debugfs.h> #include <drm/drm_device.h> #include <drm/drm_file.h> -#include <drm/drm_pci.h> #include <drm/radeon_drm.h>
#include "r100_track.h" diff --git a/drivers/gpu/drm/radeon/r420.c b/drivers/gpu/drm/radeon/r420.c index 83282ee2bde0..1d4c04e0a449 100644 --- a/drivers/gpu/drm/radeon/r420.c +++ b/drivers/gpu/drm/radeon/r420.c @@ -26,13 +26,13 @@ * Jerome Glisse */
+#include <linux/pci.h> #include <linux/seq_file.h> #include <linux/slab.h>
#include <drm/drm_debugfs.h> #include <drm/drm_device.h> #include <drm/drm_file.h> -#include <drm/drm_pci.h>
#include "atom.h" #include "r100d.h" diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c index 033bc466a862..d2e51a9433f5 100644 --- a/drivers/gpu/drm/radeon/r600.c +++ b/drivers/gpu/drm/radeon/r600.c @@ -26,14 +26,14 @@ * Jerome Glisse */
-#include <linux/slab.h> -#include <linux/seq_file.h> #include <linux/firmware.h> #include <linux/module.h> +#include <linux/pci.h> +#include <linux/slab.h> +#include <linux/seq_file.h>
#include <drm/drm_debugfs.h> #include <drm/drm_device.h> -#include <drm/drm_pci.h> #include <drm/drm_vblank.h> #include <drm/radeon_drm.h>
diff --git a/drivers/gpu/drm/radeon/radeon_agp.c b/drivers/gpu/drm/radeon/radeon_agp.c index 4de16f3badb4..0aca7bdf54c7 100644 --- a/drivers/gpu/drm/radeon/radeon_agp.c +++ b/drivers/gpu/drm/radeon/radeon_agp.c @@ -25,9 +25,10 @@ * Jerome Glisse glisse@freedesktop.org */
+#include <linux/pci.h> + #include <drm/drm_agpsupport.h> #include <drm/drm_device.h> -#include <drm/drm_pci.h> #include <drm/radeon_drm.h>
#include "radeon.h" diff --git a/drivers/gpu/drm/radeon/radeon_asic.c b/drivers/gpu/drm/radeon/radeon_asic.c index dc3c2227e06a..495700d16fc9 100644 --- a/drivers/gpu/drm/radeon/radeon_asic.c +++ b/drivers/gpu/drm/radeon/radeon_asic.c @@ -27,10 +27,10 @@ */
#include <linux/console.h> +#include <linux/pci.h> #include <linux/vgaarb.h>
#include <drm/drm_crtc_helper.h> -#include <drm/drm_pci.h> #include <drm/radeon_drm.h>
#include "atom.h" diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c b/drivers/gpu/drm/radeon/radeon_atombios.c index 226a7bf0eb7a..072e6daedf7a 100644 --- a/drivers/gpu/drm/radeon/radeon_atombios.c +++ b/drivers/gpu/drm/radeon/radeon_atombios.c @@ -24,8 +24,9 @@ * Alex Deucher */
+#include <linux/pci.h> + #include <drm/drm_device.h> -#include <drm/drm_pci.h> #include <drm/radeon_drm.h>
#include "radeon.h" diff --git a/drivers/gpu/drm/radeon/radeon_bios.c b/drivers/gpu/drm/radeon/radeon_bios.c index 4d1490fbb075..c84d965c283e 100644 --- a/drivers/gpu/drm/radeon/radeon_bios.c +++ b/drivers/gpu/drm/radeon/radeon_bios.c @@ -26,11 +26,11 @@ * Jerome Glisse */
-#include <linux/slab.h> #include <linux/acpi.h> +#include <linux/pci.h> +#include <linux/slab.h>
#include <drm/drm_device.h> -#include <drm/drm_pci.h>
#include "atom.h" #include "radeon.h" diff --git a/drivers/gpu/drm/radeon/radeon_clocks.c b/drivers/gpu/drm/radeon/radeon_clocks.c index 9057b32f4498..c594ca68e3a7 100644 --- a/drivers/gpu/drm/radeon/radeon_clocks.c +++ b/drivers/gpu/drm/radeon/radeon_clocks.c @@ -26,8 +26,9 @@ * Jerome Glisse */
+#include <linux/pci.h> + #include <drm/drm_device.h> -#include <drm/drm_pci.h> #include <drm/radeon_drm.h>
#include "atom.h" diff --git a/drivers/gpu/drm/radeon/radeon_combios.c b/drivers/gpu/drm/radeon/radeon_combios.c index c18ae15189f3..628a7a499186 100644 --- a/drivers/gpu/drm/radeon/radeon_combios.c +++ b/drivers/gpu/drm/radeon/radeon_combios.c @@ -25,8 +25,9 @@ * Alex Deucher */
+#include <linux/pci.h> + #include <drm/drm_device.h> -#include <drm/drm_pci.h> #include <drm/radeon_drm.h>
#include "radeon.h" diff --git a/drivers/gpu/drm/radeon/radeon_cs.c b/drivers/gpu/drm/radeon/radeon_cs.c index 7b5460678382..0d0ab8e0ff3b 100644 --- a/drivers/gpu/drm/radeon/radeon_cs.c +++ b/drivers/gpu/drm/radeon/radeon_cs.c @@ -26,11 +26,11 @@ */
#include <linux/list_sort.h> +#include <linux/pci.h> #include <linux/uaccess.h>
#include <drm/drm_device.h> #include <drm/drm_file.h> -#include <drm/drm_pci.h> #include <drm/radeon_drm.h>
#include "radeon.h" diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c index 5d017f0aec66..a522e092038b 100644 --- a/drivers/gpu/drm/radeon/radeon_device.c +++ b/drivers/gpu/drm/radeon/radeon_device.c @@ -28,6 +28,7 @@
#include <linux/console.h> #include <linux/efi.h> +#include <linux/pci.h> #include <linux/pm_runtime.h> #include <linux/slab.h> #include <linux/vga_switcheroo.h> @@ -38,7 +39,6 @@ #include <drm/drm_debugfs.h> #include <drm/drm_device.h> #include <drm/drm_file.h> -#include <drm/drm_pci.h> #include <drm/drm_probe_helper.h> #include <drm/radeon_drm.h>
diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c index e81b01f8db90..dfb921899853 100644 --- a/drivers/gpu/drm/radeon/radeon_display.c +++ b/drivers/gpu/drm/radeon/radeon_display.c @@ -24,6 +24,7 @@ * Alex Deucher */
+#include <linux/pci.h> #include <linux/pm_runtime.h> #include <linux/gcd.h>
@@ -36,7 +37,6 @@ #include <drm/drm_fb_helper.h> #include <drm/drm_fourcc.h> #include <drm/drm_gem_framebuffer_helper.h> -#include <drm/drm_pci.h> #include <drm/drm_plane_helper.h> #include <drm/drm_probe_helper.h> #include <drm/drm_vblank.h> diff --git a/drivers/gpu/drm/radeon/radeon_encoders.c b/drivers/gpu/drm/radeon/radeon_encoders.c index a0c99087034a..ced022fae19d 100644 --- a/drivers/gpu/drm/radeon/radeon_encoders.c +++ b/drivers/gpu/drm/radeon/radeon_encoders.c @@ -24,9 +24,10 @@ * Alex Deucher */
+#include <linux/pci.h> + #include <drm/drm_crtc_helper.h> #include <drm/drm_device.h> -#include <drm/drm_pci.h> #include <drm/radeon_drm.h>
#include "radeon.h" diff --git a/drivers/gpu/drm/radeon/radeon_fb.c b/drivers/gpu/drm/radeon/radeon_fb.c index 2c564f4f3468..f4f511796c40 100644 --- a/drivers/gpu/drm/radeon/radeon_fb.c +++ b/drivers/gpu/drm/radeon/radeon_fb.c @@ -25,6 +25,7 @@ */
#include <linux/module.h> +#include <linux/pci.h> #include <linux/pm_runtime.h> #include <linux/slab.h> #include <linux/vga_switcheroo.h> @@ -33,7 +34,6 @@ #include <drm/drm_crtc_helper.h> #include <drm/drm_fb_helper.h> #include <drm/drm_fourcc.h> -#include <drm/drm_pci.h> #include <drm/radeon_drm.h>
#include "radeon.h" diff --git a/drivers/gpu/drm/radeon/radeon_gart.c b/drivers/gpu/drm/radeon/radeon_gart.c index d4d3778d0a98..f178ba321715 100644 --- a/drivers/gpu/drm/radeon/radeon_gart.c +++ b/drivers/gpu/drm/radeon/radeon_gart.c @@ -26,9 +26,9 @@ * Jerome Glisse */
+#include <linux/pci.h> #include <linux/vmalloc.h>
-#include <drm/drm_pci.h> #include <drm/radeon_drm.h> #ifdef CONFIG_X86 #include <asm/set_memory.h> diff --git a/drivers/gpu/drm/radeon/radeon_gem.c b/drivers/gpu/drm/radeon/radeon_gem.c index 67298a0739cb..068c3e5da173 100644 --- a/drivers/gpu/drm/radeon/radeon_gem.c +++ b/drivers/gpu/drm/radeon/radeon_gem.c @@ -26,10 +26,11 @@ * Jerome Glisse */
+#include <linux/pci.h> + #include <drm/drm_debugfs.h> #include <drm/drm_device.h> #include <drm/drm_file.h> -#include <drm/drm_pci.h> #include <drm/radeon_drm.h>
#include "radeon.h" diff --git a/drivers/gpu/drm/radeon/radeon_i2c.c b/drivers/gpu/drm/radeon/radeon_i2c.c index d465a3de7732..545e31e6cc3a 100644 --- a/drivers/gpu/drm/radeon/radeon_i2c.c +++ b/drivers/gpu/drm/radeon/radeon_i2c.c @@ -25,10 +25,10 @@ */
#include <linux/export.h> +#include <linux/pci.h>
#include <drm/drm_device.h> #include <drm/drm_edid.h> -#include <drm/drm_pci.h> #include <drm/radeon_drm.h>
#include "radeon.h" diff --git a/drivers/gpu/drm/radeon/radeon_irq_kms.c b/drivers/gpu/drm/radeon/radeon_irq_kms.c index d9613638f9cc..b86bc88ad430 100644 --- a/drivers/gpu/drm/radeon/radeon_irq_kms.c +++ b/drivers/gpu/drm/radeon/radeon_irq_kms.c @@ -26,12 +26,12 @@ * Jerome Glisse */
+#include <linux/pci.h> #include <linux/pm_runtime.h>
#include <drm/drm_crtc_helper.h> #include <drm/drm_device.h> #include <drm/drm_irq.h> -#include <drm/drm_pci.h> #include <drm/drm_probe_helper.h> #include <drm/drm_vblank.h> #include <drm/radeon_drm.h> diff --git a/drivers/gpu/drm/radeon/radeon_kms.c b/drivers/gpu/drm/radeon/radeon_kms.c index ea24cf6fc046..8583dfaee737 100644 --- a/drivers/gpu/drm/radeon/radeon_kms.c +++ b/drivers/gpu/drm/radeon/radeon_kms.c @@ -26,6 +26,7 @@ * Jerome Glisse */
+#include <linux/pci.h> #include <linux/pm_runtime.h> #include <linux/slab.h> #include <linux/uaccess.h> @@ -34,7 +35,6 @@ #include <drm/drm_fb_helper.h> #include <drm/drm_file.h> #include <drm/drm_ioctl.h> -#include <drm/drm_pci.h> #include <drm/radeon_drm.h>
#include "radeon.h" diff --git a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c index ef100b790463..a33b19566b2d 100644 --- a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c +++ b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c @@ -25,11 +25,11 @@ */
#include <linux/backlight.h> +#include <linux/pci.h>
#include <drm/drm_crtc_helper.h> #include <drm/drm_device.h> #include <drm/drm_file.h> -#include <drm/drm_pci.h> #include <drm/drm_util.h> #include <drm/radeon_drm.h>
diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c index 5d10e11a9225..b37121f2631d 100644 --- a/drivers/gpu/drm/radeon/radeon_pm.c +++ b/drivers/gpu/drm/radeon/radeon_pm.c @@ -23,10 +23,10 @@
#include <linux/hwmon-sysfs.h> #include <linux/hwmon.h> +#include <linux/pci.h> #include <linux/power_supply.h>
#include <drm/drm_debugfs.h> -#include <drm/drm_pci.h> #include <drm/drm_vblank.h>
#include "atom.h" diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c index 91993a233cb0..f4af67035673 100644 --- a/drivers/gpu/drm/radeon/radeon_ttm.c +++ b/drivers/gpu/drm/radeon/radeon_ttm.c @@ -32,6 +32,7 @@
#include <linux/dma-mapping.h> #include <linux/pagemap.h> +#include <linux/pci.h> #include <linux/seq_file.h> #include <linux/slab.h> #include <linux/swap.h> @@ -41,7 +42,6 @@ #include <drm/drm_debugfs.h> #include <drm/drm_device.h> #include <drm/drm_file.h> -#include <drm/drm_pci.h> #include <drm/drm_prime.h> #include <drm/radeon_drm.h> #include <drm/ttm/ttm_bo_api.h> diff --git a/drivers/gpu/drm/radeon/rs600.c b/drivers/gpu/drm/radeon/rs600.c index 2f8ff089f7b1..c88b4906f7bc 100644 --- a/drivers/gpu/drm/radeon/rs600.c +++ b/drivers/gpu/drm/radeon/rs600.c @@ -37,9 +37,9 @@ */
#include <linux/io-64-nonatomic-lo-hi.h> +#include <linux/pci.h>
#include <drm/drm_device.h> -#include <drm/drm_pci.h> #include <drm/drm_vblank.h>
#include "atom.h" diff --git a/drivers/gpu/drm/radeon/rs690.c b/drivers/gpu/drm/radeon/rs690.c index f0dad1224daa..81c491fc3639 100644 --- a/drivers/gpu/drm/radeon/rs690.c +++ b/drivers/gpu/drm/radeon/rs690.c @@ -26,7 +26,7 @@ * Jerome Glisse */
-#include <drm/drm_pci.h> +#include <linux/pci.h>
#include "atom.h" #include "radeon.h" diff --git a/drivers/gpu/drm/radeon/rs780_dpm.c b/drivers/gpu/drm/radeon/rs780_dpm.c index 72dbf3251c53..17390074277a 100644 --- a/drivers/gpu/drm/radeon/rs780_dpm.c +++ b/drivers/gpu/drm/radeon/rs780_dpm.c @@ -22,10 +22,9 @@ * Authors: Alex Deucher */
+#include <linux/pci.h> #include <linux/seq_file.h>
-#include <drm/drm_pci.h> - #include "atom.h" #include "r600_dpm.h" #include "radeon.h" diff --git a/drivers/gpu/drm/radeon/rv770.c b/drivers/gpu/drm/radeon/rv770.c index 7a6fc66d6a40..3fc461defeeb 100644 --- a/drivers/gpu/drm/radeon/rv770.c +++ b/drivers/gpu/drm/radeon/rv770.c @@ -27,10 +27,10 @@ */
#include <linux/firmware.h> +#include <linux/pci.h> #include <linux/slab.h>
#include <drm/drm_device.h> -#include <drm/drm_pci.h> #include <drm/radeon_drm.h>
#include "atom.h" diff --git a/drivers/gpu/drm/radeon/si.c b/drivers/gpu/drm/radeon/si.c index 06130fb89afd..6a1f0bac3d09 100644 --- a/drivers/gpu/drm/radeon/si.c +++ b/drivers/gpu/drm/radeon/si.c @@ -23,10 +23,10 @@ */
#include <linux/firmware.h> -#include <linux/slab.h> #include <linux/module.h> +#include <linux/pci.h> +#include <linux/slab.h>
-#include <drm/drm_pci.h> #include <drm/drm_vblank.h> #include <drm/radeon_drm.h>
diff --git a/drivers/gpu/drm/radeon/si_dpm.c b/drivers/gpu/drm/radeon/si_dpm.c index a0b382a637a6..720a3483f1c3 100644 --- a/drivers/gpu/drm/radeon/si_dpm.c +++ b/drivers/gpu/drm/radeon/si_dpm.c @@ -22,10 +22,9 @@ */
#include <linux/math64.h> +#include <linux/pci.h> #include <linux/seq_file.h>
-#include <drm/drm_pci.h> - #include "atom.h" #include "r600_dpm.h" #include "radeon.h" diff --git a/drivers/gpu/drm/radeon/trinity_dpm.c b/drivers/gpu/drm/radeon/trinity_dpm.c index 65302f9d025e..4d93b84aa739 100644 --- a/drivers/gpu/drm/radeon/trinity_dpm.c +++ b/drivers/gpu/drm/radeon/trinity_dpm.c @@ -21,10 +21,9 @@ * */
+#include <linux/pci.h> #include <linux/seq_file.h>
-#include <drm/drm_pci.h> - #include "r600_dpm.h" #include "radeon.h" #include "radeon_asic.h"
Including <drm/drm_pci.h> is unnecessary in most cases. Replace these instances.
Signed-off-by: Thomas Zimmermann tzimmermann@suse.de --- drivers/gpu/drm/savage/savage_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/savage/savage_drv.c b/drivers/gpu/drm/savage/savage_drv.c index 2966fcfd9548..799bd11adb9c 100644 --- a/drivers/gpu/drm/savage/savage_drv.c +++ b/drivers/gpu/drm/savage/savage_drv.c @@ -24,10 +24,10 @@ */
#include <linux/module.h> +#include <linux/pci.h>
#include <drm/drm_drv.h> #include <drm/drm_file.h> -#include <drm/drm_pci.h> #include <drm/drm_pciids.h>
#include "savage_drv.h"
Including <drm/drm_pci.h> is unnecessary in most cases. Replace these instances.
Signed-off-by: Thomas Zimmermann tzimmermann@suse.de --- drivers/gpu/drm/sis/sis_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/sis/sis_drv.c b/drivers/gpu/drm/sis/sis_drv.c index ee3801201ecc..2c54b33abb54 100644 --- a/drivers/gpu/drm/sis/sis_drv.c +++ b/drivers/gpu/drm/sis/sis_drv.c @@ -26,10 +26,10 @@ */
#include <linux/module.h> +#include <linux/pci.h>
#include <drm/drm_drv.h> #include <drm/drm_file.h> -#include <drm/drm_pci.h> #include <drm/drm_pciids.h> #include <drm/sis_drm.h>
Including <drm/drm_pci.h> is unnecessary in most cases. Replace these instances.
Signed-off-by: Thomas Zimmermann tzimmermann@suse.de --- drivers/gpu/drm/tdfx/tdfx_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/tdfx/tdfx_drv.c b/drivers/gpu/drm/tdfx/tdfx_drv.c index c243af156ee7..ab699bf0ac5c 100644 --- a/drivers/gpu/drm/tdfx/tdfx_drv.c +++ b/drivers/gpu/drm/tdfx/tdfx_drv.c @@ -31,12 +31,12 @@ */
#include <linux/module.h> +#include <linux/pci.h>
#include <drm/drm_drv.h> #include <drm/drm_file.h> #include <drm/drm_ioctl.h> #include <drm/drm_legacy.h> -#include <drm/drm_pci.h> #include <drm/drm_pciids.h>
#include "tdfx_drv.h"
Including <drm/drm_pci.h> is unnecessary in most cases. Replace these instances.
Signed-off-by: Thomas Zimmermann tzimmermann@suse.de --- drivers/gpu/drm/via/via_dmablit.c | 2 +- drivers/gpu/drm/via/via_drv.c | 2 +- drivers/gpu/drm/via/via_map.c | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/via/via_dmablit.c b/drivers/gpu/drm/via/via_dmablit.c index 3db000aacd26..d13a3897506e 100644 --- a/drivers/gpu/drm/via/via_dmablit.c +++ b/drivers/gpu/drm/via/via_dmablit.c @@ -35,11 +35,11 @@ */
#include <linux/pagemap.h> +#include <linux/pci.h> #include <linux/slab.h> #include <linux/vmalloc.h>
#include <drm/drm_device.h> -#include <drm/drm_pci.h> #include <drm/via_drm.h>
#include "via_dmablit.h" diff --git a/drivers/gpu/drm/via/via_drv.c b/drivers/gpu/drm/via/via_drv.c index 666a16de84f9..5da38082821f 100644 --- a/drivers/gpu/drm/via/via_drv.c +++ b/drivers/gpu/drm/via/via_drv.c @@ -23,10 +23,10 @@ */
#include <linux/module.h> +#include <linux/pci.h>
#include <drm/drm_drv.h> #include <drm/drm_file.h> -#include <drm/drm_pci.h> #include <drm/drm_pciids.h> #include <drm/via_drm.h>
diff --git a/drivers/gpu/drm/via/via_map.c b/drivers/gpu/drm/via/via_map.c index 431c150df014..255c5066a939 100644 --- a/drivers/gpu/drm/via/via_map.c +++ b/drivers/gpu/drm/via/via_map.c @@ -22,8 +22,9 @@ * DEALINGS IN THE SOFTWARE. */
+#include <linux/pci.h> + #include <drm/drm_device.h> -#include <drm/drm_pci.h> #include <drm/drm_vblank.h> #include <drm/via_drm.h>
On Tue, 3 Dec 2019 at 10:04, Thomas Zimmermann tzimmermann@suse.de wrote:
This patchset cleans up drm_pci.{c,h}. Patch 1 removes drm_pci.c from non-PCI builds. Declarations of legacy functions are hidden in drm_legacy.h and their implementation is protected by CONFIG_PCI in patch 2. The rest of the patches replace unnecessary include statements for drm_pci.h. Most of the source files only require <linux/pci.h>.
The pathset was built on x86-64 and aarch64 with PCI support and arm without PCI support.
Thomas Zimmermann (12): drm/pci: Only build drm_pci.c if CONFIG_PCI is set drm/pci: Hide legacy PCI functions from non-legacy code drm/ast: Don't include <drm/drm_pci.h> drm/i810: Don't include <drm/drm_pci.h> drm/mga: Don't include <drm/drm_pci.h> drm/mgag200: Don't include <drm/drm_pci.h> drm/r128: Don't include <drm/drm_pci.h> drm/radeon: Don't include <drm/drm_pci.h> drm/savage: Don't include <drm/drm_pci.h> drm/sis: Don't include <drm/drm_pci.h> drm/tdfx: Don't include <drm/drm_pci.h> drm/via: Don't include <drm/drm_pci.h>
Slightly leaning about getting 01 <> 02 swapped, but regardless the series is: Reviewed-by: Emil Velikov emil.velikov@collabora.com
-Emil
Hi Thomas.
The rest of the patches replace unnecessary include statements for drm_pci.h. Most of the source files only require <linux/pci.h>.
I guess I am to blame here. When migrating away from drmP.h I used <drm/drm_pci.h> as preferred way when there were pci related build errors and when it worked I moved on. Sorry for creating extra work for you, but glad to see it cleaned up.
Sam
Am 03.12.19 um 13:13 schrieb Sam Ravnborg:
Hi Thomas.
The rest of the patches replace unnecessary include statements for drm_pci.h. Most of the source files only require <linux/pci.h>.
I guess I am to blame here. When migrating away from drmP.h I used <drm/drm_pci.h> as preferred way when there were pci related build errors and when it worked I moved on. Sorry for creating extra work for you, but glad to see it cleaned up.
No problem, don't worry. :)
Sam _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
On Tue, Dec 3, 2019 at 5:04 AM Thomas Zimmermann tzimmermann@suse.de wrote:
This patchset cleans up drm_pci.{c,h}. Patch 1 removes drm_pci.c from non-PCI builds. Declarations of legacy functions are hidden in drm_legacy.h and their implementation is protected by CONFIG_PCI in patch 2. The rest of the patches replace unnecessary include statements for drm_pci.h. Most of the source files only require <linux/pci.h>.
The pathset was built on x86-64 and aarch64 with PCI support and arm without PCI support.
Series is: Reviewed-by: Alex Deucher alexander.deucher@amd.com
Thomas Zimmermann (12): drm/pci: Only build drm_pci.c if CONFIG_PCI is set drm/pci: Hide legacy PCI functions from non-legacy code drm/ast: Don't include <drm/drm_pci.h> drm/i810: Don't include <drm/drm_pci.h> drm/mga: Don't include <drm/drm_pci.h> drm/mgag200: Don't include <drm/drm_pci.h> drm/r128: Don't include <drm/drm_pci.h> drm/radeon: Don't include <drm/drm_pci.h> drm/savage: Don't include <drm/drm_pci.h> drm/sis: Don't include <drm/drm_pci.h> drm/tdfx: Don't include <drm/drm_pci.h> drm/via: Don't include <drm/drm_pci.h>
drivers/gpu/drm/Makefile | 3 +- drivers/gpu/drm/ast/ast_drv.c | 1 - drivers/gpu/drm/drm_internal.h | 22 ++++++++++++++ drivers/gpu/drm/drm_pci.c | 17 +++-------- drivers/gpu/drm/i810/i810_dma.c | 2 +- drivers/gpu/drm/i810/i810_drv.c | 3 +- drivers/gpu/drm/mga/mga_drv.h | 2 +- drivers/gpu/drm/mgag200/mgag200_cursor.c | 2 +- drivers/gpu/drm/mgag200/mgag200_i2c.c | 3 +- drivers/gpu/drm/mgag200/mgag200_main.c | 3 +- drivers/gpu/drm/mgag200/mgag200_mode.c | 2 +- drivers/gpu/drm/mgag200/mgag200_ttm.c | 2 +- drivers/gpu/drm/r128/r128_drv.c | 2 +- drivers/gpu/drm/radeon/atom.h | 1 + drivers/gpu/drm/radeon/atombios_encoders.c | 2 +- drivers/gpu/drm/radeon/btc_dpm.c | 3 +- drivers/gpu/drm/radeon/ci_dpm.c | 3 +- drivers/gpu/drm/radeon/cik.c | 4 +-- drivers/gpu/drm/radeon/cypress_dpm.c | 2 +- drivers/gpu/drm/radeon/evergreen.c | 2 +- drivers/gpu/drm/radeon/kv_dpm.c | 3 +- drivers/gpu/drm/radeon/ni.c | 4 +-- drivers/gpu/drm/radeon/ni_dpm.c | 3 +- drivers/gpu/drm/radeon/r100.c | 6 ++-- drivers/gpu/drm/radeon/r300.c | 2 +- drivers/gpu/drm/radeon/r420.c | 2 +- drivers/gpu/drm/radeon/r600.c | 6 ++-- drivers/gpu/drm/radeon/radeon_agp.c | 3 +- drivers/gpu/drm/radeon/radeon_asic.c | 2 +- drivers/gpu/drm/radeon/radeon_atombios.c | 3 +- drivers/gpu/drm/radeon/radeon_bios.c | 4 +-- drivers/gpu/drm/radeon/radeon_clocks.c | 3 +- drivers/gpu/drm/radeon/radeon_combios.c | 3 +- drivers/gpu/drm/radeon/radeon_cs.c | 2 +- drivers/gpu/drm/radeon/radeon_device.c | 2 +- drivers/gpu/drm/radeon/radeon_display.c | 2 +- drivers/gpu/drm/radeon/radeon_encoders.c | 3 +- drivers/gpu/drm/radeon/radeon_fb.c | 2 +- drivers/gpu/drm/radeon/radeon_gart.c | 2 +- drivers/gpu/drm/radeon/radeon_gem.c | 3 +- drivers/gpu/drm/radeon/radeon_i2c.c | 2 +- drivers/gpu/drm/radeon/radeon_irq_kms.c | 2 +- drivers/gpu/drm/radeon/radeon_kms.c | 2 +- .../gpu/drm/radeon/radeon_legacy_encoders.c | 2 +- drivers/gpu/drm/radeon/radeon_pm.c | 2 +- drivers/gpu/drm/radeon/radeon_ttm.c | 2 +- drivers/gpu/drm/radeon/rs600.c | 2 +- drivers/gpu/drm/radeon/rs690.c | 2 +- drivers/gpu/drm/radeon/rs780_dpm.c | 3 +- drivers/gpu/drm/radeon/rv770.c | 2 +- drivers/gpu/drm/radeon/si.c | 4 +-- drivers/gpu/drm/radeon/si_dpm.c | 3 +- drivers/gpu/drm/radeon/trinity_dpm.c | 3 +- drivers/gpu/drm/savage/savage_drv.c | 2 +- drivers/gpu/drm/sis/sis_drv.c | 2 +- drivers/gpu/drm/tdfx/tdfx_drv.c | 2 +- drivers/gpu/drm/via/via_dmablit.c | 2 +- drivers/gpu/drm/via/via_drv.c | 2 +- drivers/gpu/drm/via/via_map.c | 3 +- include/drm/drm_legacy.h | 29 ++++++++++++++++++- include/drm/drm_pci.h | 19 ++++++++++-- 61 files changed, 144 insertions(+), 89 deletions(-)
-- 2.23.0
dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
dri-devel@lists.freedesktop.org