From c9a302bbe4d7f7450803e926a697ef56b885c745 Mon Sep 17 00:00:00 2001 From: Sam Ravnborg Date: Sun, 23 Jun 2019 12:23:33 +0200 Subject: [PATCH] drm/vmwgfx: drop use of drmP.h in header files To facilitate removal of drmP.h in the .c files remove the use from header files first. Fix fallout in the other files. Sorted include files in blocks and sorted files within each block in alphabetical order. This revealed a dependency from an uapi header to a header located below drivers/gpu/drm/vmwgfx/. Added FIXME to remind someone to fix this. Signed-off-by: Sam Ravnborg Cc: VMware Graphics Cc: Thomas Hellstrom Cc: David Airlie Cc: Daniel Vetter Reviewed-by: Deepak Rawat Signed-off-by: Deepak Rawat Signed-off-by: Thomas Hellstrom --- drivers/gpu/drm/vmwgfx/ttm_lock.h | 2 +- drivers/gpu/drm/vmwgfx/ttm_object.h | 7 ++--- drivers/gpu/drm/vmwgfx/vmwgfx_binding.h | 3 ++- drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c | 3 +++ drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 30 +++++++++++++++------- drivers/gpu/drm/vmwgfx/vmwgfx_fence.h | 5 +++- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 10 +++++--- drivers/gpu/drm/vmwgfx/vmwgfx_kms.h | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c | 6 +++-- drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c | 6 +++-- drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c | 9 ++++--- drivers/gpu/drm/vmwgfx/vmwgfx_validation.h | 3 ++- 12 files changed, 59 insertions(+), 27 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/ttm_lock.h b/drivers/gpu/drm/vmwgfx/ttm_lock.h index 3d454e8b491f5..af8b28ca546fa 100644 --- a/drivers/gpu/drm/vmwgfx/ttm_lock.h +++ b/drivers/gpu/drm/vmwgfx/ttm_lock.h @@ -49,8 +49,8 @@ #ifndef _TTM_LOCK_H_ #define _TTM_LOCK_H_ -#include #include +#include #include "ttm_object.h" diff --git a/drivers/gpu/drm/vmwgfx/ttm_object.h b/drivers/gpu/drm/vmwgfx/ttm_object.h index 50d26c7ff42d1..ede26df87c93c 100644 --- a/drivers/gpu/drm/vmwgfx/ttm_object.h +++ b/drivers/gpu/drm/vmwgfx/ttm_object.h @@ -37,11 +37,12 @@ #ifndef _TTM_OBJECT_H_ #define _TTM_OBJECT_H_ -#include -#include +#include #include +#include #include -#include + +#include #include /** diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_binding.h b/drivers/gpu/drm/vmwgfx/vmwgfx_binding.h index f6ab79d239230..cd9805c045cbf 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_binding.h +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_binding.h @@ -27,9 +27,10 @@ #ifndef _VMWGFX_BINDING_H_ #define _VMWGFX_BINDING_H_ -#include "device_include/svga3d_reg.h" #include +#include "device_include/svga3d_reg.h" + #define VMW_MAX_VIEW_BINDINGS 128 struct vmw_private; diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c b/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c index 56979e412ca89..065015d2a8f63 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c @@ -25,6 +25,9 @@ * **************************************************************************/ +#include +#include + #include #include "vmwgfx_drv.h" diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h index 241c5f78303aa..bec80e6af5a87 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h @@ -28,20 +28,32 @@ #ifndef _VMWGFX_DRV_H_ #define _VMWGFX_DRV_H_ -#include "vmwgfx_validation.h" -#include "vmwgfx_reg.h" -#include -#include -#include -#include #include +#include + +#include +#include +#include +#include +#include + #include #include #include -#include "vmwgfx_fence.h" -#include "ttm_object.h" + #include "ttm_lock.h" -#include +#include "ttm_object.h" + +#include "vmwgfx_fence.h" +#include "vmwgfx_reg.h" +#include "vmwgfx_validation.h" + +/* + * FIXME: vmwgfx_drm.h needs to be last due to dependencies. + * uapi headers should not depend on header files outside uapi/. + */ +#include + #define VMWGFX_DRIVER_NAME "vmwgfx" #define VMWGFX_DRIVER_DATE "20180704" diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fence.h b/drivers/gpu/drm/vmwgfx/vmwgfx_fence.h index c9382933c2b94..50e9fdd7acf1d 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_fence.h +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fence.h @@ -32,8 +32,11 @@ #define VMW_FENCE_WAIT_TIMEOUT (5*HZ) -struct vmw_private; +struct drm_device; +struct drm_file; +struct drm_pending_event; +struct vmw_private; struct vmw_fence_manager; /** diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c index a7c9e721218c2..f47d5710cc951 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c @@ -25,12 +25,16 @@ * **************************************************************************/ -#include "vmwgfx_kms.h" -#include #include #include -#include #include +#include +#include +#include +#include +#include + +#include "vmwgfx_kms.h" /* Might need a hrtimer here? */ #define VMWGFX_PRESENT_RATE ((HZ / 60 > 0) ? HZ / 60 : 1) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.h b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.h index 535b03599e558..3ee03227607c6 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.h +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.h @@ -28,9 +28,9 @@ #ifndef VMWGFX_KMS_H_ #define VMWGFX_KMS_H_ -#include #include #include + #include "vmwgfx_drv.h" /** diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c b/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c index 25e6343bcf217..5702219ec38f6 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c @@ -25,11 +25,13 @@ * **************************************************************************/ -#include "vmwgfx_kms.h" -#include #include #include +#include +#include +#include +#include "vmwgfx_kms.h" #define vmw_crtc_to_ldu(x) \ container_of(x, struct vmw_legacy_display_unit, base.crtc) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c b/drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c index 9a2a3836d89a8..e5a283263211f 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c @@ -25,12 +25,14 @@ * **************************************************************************/ -#include "vmwgfx_kms.h" -#include #include #include #include +#include +#include +#include +#include "vmwgfx_kms.h" #define vmw_crtc_to_sou(x) \ container_of(x, struct vmw_screen_object_unit, base.crtc) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c b/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c index f803bb5e782ba..41a96fb498357 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c @@ -25,12 +25,15 @@ * ******************************************************************************/ -#include "vmwgfx_kms.h" -#include "device_include/svga3d_surfacedefs.h" -#include #include #include #include +#include +#include +#include + +#include "vmwgfx_kms.h" +#include "device_include/svga3d_surfacedefs.h" #define vmw_crtc_to_stdu(x) \ container_of(x, struct vmw_screen_target_display_unit, base.crtc) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_validation.h b/drivers/gpu/drm/vmwgfx/vmwgfx_validation.h index 1d2322ad6fd59..0e063743dd86d 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_validation.h +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_validation.h @@ -28,9 +28,10 @@ #ifndef _VMWGFX_VALIDATION_H_ #define _VMWGFX_VALIDATION_H_ -#include #include #include + +#include #include #define VMW_RES_DIRTY_NONE 0 -- 2.39.5