drm/vmwgfx: drop use of drmP.h
Subsystems (3)
v2 cover drm/vmwgfx: drop use of drmP.h
In two steps drop the use of drmP.h
First patch remove drmP.h from header files and fixes fallout. Second patch remove drmP.h from the remaining files.
While touching the list of include files divide them in blocks and sort include files within the blocks.
Patches made on top of drm-misc-next, and checked that they apply to vmwgfx-fixes-5.2 ingit://people.freedesktop.org/~thomash/linux
Build tested with various configs with several architectures.
v2:
- fix warning in i386 build reported by 0-day
(missing include)
Sam
Sam Ravnborg (2):
drm/vmwgfx: drop use of drmP.h in header files drm/vmwgfx: drop reminaing users of drmP.h
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_bo.c | 1 - drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c | 3 +++ drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 17 +++++++++++------ drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 30 +++++++++++++++++++++--------- drivers/gpu/drm/vmwgfx/vmwgfx_fb.c | 8 ++++---- drivers/gpu/drm/vmwgfx/vmwgfx_fence.c | 3 ++- drivers/gpu/drm/vmwgfx/vmwgfx_fence.h | 5 ++++- drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c | 6 ++++-- drivers/gpu/drm/vmwgfx/vmwgfx_gmr.c | 4 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_irq.c | 3 ++- 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_mob.c | 2 ++ drivers/gpu/drm/vmwgfx/vmwgfx_msg.c | 11 +++++------ drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c | 6 ++---- drivers/gpu/drm/vmwgfx/vmwgfx_resource.c | 5 ++--- drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c | 6 ++++-- drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c | 9 ++++++--- drivers/gpu/drm/vmwgfx/vmwgfx_ttm_glue.c | 1 - drivers/gpu/drm/vmwgfx/vmwgfx_validation.h | 3 ++- 24 files changed, 95 insertions(+), 58 deletions(-)
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v2 1/2 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.
--- 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(-)
drivers/gpu/drm/vmwgfx/ttm_lock.h +1 -1
@@ -49,8 +49,8 @@#ifndef _TTM_LOCK_H_#define _TTM_LOCK_H_ -#include <linux/wait.h> #include <linux/atomic.h> +#include <linux/wait.h> #include "ttm_object.h"
drivers/gpu/drm/vmwgfx/ttm_object.h +4 -3
@@ -37,11 +37,12 @@#ifndef _TTM_OBJECT_H_#define _TTM_OBJECT_H_ -#include <linux/list.h> -#include <drm/drm_hashtab.h> +#include <linux/dma-buf.h> #include <linux/kref.h> +#include <linux/list.h> #include <linux/rcupdate.h> -#include <linux/dma-buf.h> + +#include <drm/drm_hashtab.h> #include <drm/ttm/ttm_memory.h> /**
drivers/gpu/drm/vmwgfx/vmwgfx_binding.h +2 -1
@@ -27,9 +27,10 @@#ifndef _VMWGFX_BINDING_H_#define _VMWGFX_BINDING_H_ -#include "device_include/svga3d_reg.h" #include <linux/list.h> +#include "device_include/svga3d_reg.h" +#define VMW_MAX_VIEW_BINDINGS 128struct vmw_private ;
drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c +3 -0
@@ -25,6 +25,9 @@* **************************************************************************/ +#include <linux/dmapool.h> +#include <linux/pci.h> +#include <drm/ttm/ttm_bo_api.h> #include "vmwgfx_drv.h"
drivers/gpu/drm/vmwgfx/vmwgfx_drv.h +21 -9
@@ -28,20 +28,32 @@#ifndef _VMWGFX_DRV_H_#define _VMWGFX_DRV_H_ -#include "vmwgfx_validation.h" -#include "vmwgfx_reg.h" -#include <drm/drmP.h> -#include <drm/vmwgfx_drm.h> -#include <drm/drm_hashtab.h> -#include <drm/drm_auth.h> #include <linux/suspend.h> +#include <linux/sync_file.h> + +#include <drm/drm_auth.h> +#include <drm/drm_device.h> +#include <drm/drm_file.h> +#include <drm/drm_hashtab.h> +#include <drm/drm_rect.h> +#include <drm/ttm/ttm_bo_driver.h> #include <drm/ttm/ttm_execbuf_util.h> #include <drm/ttm/ttm_module.h> -#include "vmwgfx_fence.h" -#include "ttm_object.h" +#include "ttm_lock.h" -#include <linux/sync_file.h> +#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 <drm/vmwgfx_drm.h> +#define VMWGFX_DRIVER_NAME "vmwgfx"#define VMWGFX_DRIVER_DATE "20180704"
drivers/gpu/drm/vmwgfx/vmwgfx_fence.h +4 -1
@@ -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 ;/**
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +7 -3
@@ -25,12 +25,16 @@* **************************************************************************/ -#include "vmwgfx_kms.h" -#include <drm/drm_plane_helper.h> #include <drm/drm_atomic.h> #include <drm/drm_atomic_helper.h> -#include <drm/drm_rect.h> #include <drm/drm_damage_helper.h> +#include <drm/drm_fourcc.h> +#include <drm/drm_plane_helper.h> +#include <drm/drm_rect.h> +#include <drm/drm_sysfs.h> +#include <drm/drm_vblank.h> + +#include "vmwgfx_kms.h" /* Might need a hrtimer here? */ #define VMWGFX_PRESENT_RATE ((HZ / 60 > 0) ? HZ / 60 : 1)
drivers/gpu/drm/vmwgfx/vmwgfx_kms.h +1 -1
@@ -28,9 +28,9 @@#ifndef VMWGFX_KMS_H_ #define VMWGFX_KMS_H_ -#include <drm/drmP.h> #include <drm/drm_encoder.h> #include <drm/drm_probe_helper.h> +#include "vmwgfx_drv.h" /**
drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c +4 -2
@@ -25,11 +25,13 @@* **************************************************************************/ -#include "vmwgfx_kms.h" -#include <drm/drm_plane_helper.h> #include <drm/drm_atomic.h> #include <drm/drm_atomic_helper.h> +#include <drm/drm_fourcc.h> +#include <drm/drm_plane_helper.h> +#include <drm/drm_vblank.h> +#include "vmwgfx_kms.h" #define vmw_crtc_to_ldu (x) \ container_of(x, struct vmw_legacy_display_unit, base.crtc)
drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c +4 -2
@@ -25,12 +25,14 @@* **************************************************************************/ -#include "vmwgfx_kms.h" -#include <drm/drm_plane_helper.h> #include <drm/drm_atomic.h> #include <drm/drm_atomic_helper.h> #include <drm/drm_damage_helper.h> +#include <drm/drm_fourcc.h> +#include <drm/drm_plane_helper.h> +#include <drm/drm_vblank.h> +#include "vmwgfx_kms.h" #define vmw_crtc_to_sou (x) \ container_of(x, struct vmw_screen_object_unit, base.crtc)
drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c +6 -3
@@ -25,12 +25,15 @@* ******************************************************************************/ -#include "vmwgfx_kms.h" -#include "device_include/svga3d_surfacedefs.h" -#include <drm/drm_plane_helper.h> #include <drm/drm_atomic.h> #include <drm/drm_atomic_helper.h> #include <drm/drm_damage_helper.h> +#include <drm/drm_fourcc.h> +#include <drm/drm_plane_helper.h> +#include <drm/drm_vblank.h> + +#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)
drivers/gpu/drm/vmwgfx/vmwgfx_validation.h +2 -1
@@ -28,9 +28,10 @@#ifndef _VMWGFX_VALIDATION_H_#define _VMWGFX_VALIDATION_H_ -#include <drm/drm_hashtab.h> #include <linux/list.h> #include <linux/ww_mutex.h> + +#include <drm/drm_hashtab.h> #include <drm/ttm/ttm_execbuf_util.h> #define VMW_RES_DIRTY_NONE 0
Signature · 6 lines
2.20.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v2 2/2 drm/vmwgfx: drop reminaing users of drmP.h
In reply to Sam RavnborgDrop use of the deprecated drmP.h file from the remaining files.
In several cases the drmP.h include could be removed without furter fixes. Other files required a few header files to be added.
In all files divided includes files in blocks and sort them.
v2:
- fix warning in i386 build wiht HIGHMEM disabled
--- drivers/gpu/drm/vmwgfx/vmwgfx_bo.c | 1 - drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 17 +++++++++++------ drivers/gpu/drm/vmwgfx/vmwgfx_fb.c | 8 ++++---- drivers/gpu/drm/vmwgfx/vmwgfx_fence.c | 3 ++- drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c | 6 ++++-- drivers/gpu/drm/vmwgfx/vmwgfx_gmr.c | 4 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_irq.c | 3 ++- drivers/gpu/drm/vmwgfx/vmwgfx_mob.c | 2 ++ drivers/gpu/drm/vmwgfx/vmwgfx_msg.c | 11 +++++------ drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c | 6 ++---- drivers/gpu/drm/vmwgfx/vmwgfx_resource.c | 5 ++--- drivers/gpu/drm/vmwgfx/vmwgfx_ttm_glue.c | 1 - 12 files changed, 36 insertions(+), 31 deletions(-)
drivers/gpu/drm/vmwgfx/vmwgfx_bo.c +0 -1
@@ -28,7 +28,6 @@#include <drm/ttm/ttm_placement.h> -#include <drm/drmP.h> #include "vmwgfx_drv.h" #include "ttm_object.h"
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +11 -6
@@ -24,17 +24,22 @@* USE OR OTHER DEALINGS IN THE SOFTWARE. * **************************************************************************/ -#include <linux/module.h> +#include <linux/console.h> #include <linux/dma-mapping.h> +#include <linux/module.h> -#include <drm/drmP.h> -#include "vmwgfx_drv.h" -#include "vmwgfx_binding.h" -#include "ttm_object.h" -#include <drm/ttm/ttm_placement.h> +#include <drm/drm_drv.h> +#include <drm/drm_ioctl.h> +#include <drm/drm_pci.h> +#include <drm/drm_sysfs.h> #include <drm/ttm/ttm_bo_driver.h> #include <drm/ttm/ttm_module.h> +#include <drm/ttm/ttm_placement.h> + +#include "ttm_object.h" +#include "vmwgfx_binding.h" +#include "vmwgfx_drv.h" #define VMWGFX_DRIVER_DESC "Linux drm driver for VMware graphics devices"#define VMWGFX_CHIP_SVGAII 0
drivers/gpu/drm/vmwgfx/vmwgfx_fb.c +4 -4
@@ -26,14 +26,14 @@* **************************************************************************/ -#include <linux/export.h> +#include <linux/pci.h> + +#include <drm/drm_fourcc.h> +#include <drm/ttm/ttm_placement.h> -#include <drm/drmP.h> #include "vmwgfx_drv.h" #include "vmwgfx_kms.h" -#include <drm/ttm/ttm_placement.h> -#define VMW_DIRTY_DELAY (HZ / 30)struct vmw_fb_par {
drivers/gpu/drm/vmwgfx/vmwgfx_fence.c +2 -1
@@ -25,7 +25,8 @@* **************************************************************************/ -#include <drm/drmP.h> +#include <linux/sched/signal.h> +#include "vmwgfx_drv.h" #define VMW_FENCE_WRAP (1 << 31)
drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c +4 -2
@@ -25,10 +25,12 @@* **************************************************************************/ -#include "vmwgfx_drv.h" -#include <drm/drmP.h> +#include <linux/sched/signal.h> +#include <drm/ttm/ttm_placement.h> +#include "vmwgfx_drv.h" +struct vmw_temp_set_context {SVGA3dCmdHeader header;SVGA3dCmdDXTempSetContext body;
drivers/gpu/drm/vmwgfx/vmwgfx_gmr.c +2 -2
@@ -25,10 +25,10 @@* **************************************************************************/ -#include "vmwgfx_drv.h" -#include <drm/drmP.h> #include <drm/ttm/ttm_bo_driver.h> +#include "vmwgfx_drv.h" +#define VMW_PPN_SIZE (sizeof(unsigned long))/* A future safe maximum remap size. */ #define VMW_PPN_PER_REMAP ((31 * 1024) / VMW_PPN_SIZE)
drivers/gpu/drm/vmwgfx/vmwgfx_irq.c +2 -1
@@ -25,7 +25,8 @@* **************************************************************************/ -#include <drm/drmP.h> +#include <linux/sched/signal.h> +#include "vmwgfx_drv.h" #define VMW_FENCE_WRAP (1 << 24)
drivers/gpu/drm/vmwgfx/vmwgfx_mob.c +2 -0
@@ -25,6 +25,8 @@* **************************************************************************/ +#include <linux/highmem.h> +#include "vmwgfx_drv.h" /*
drivers/gpu/drm/vmwgfx/vmwgfx_msg.c +5 -6
@@ -24,17 +24,16 @@* */ - -#include <linux/slab.h> -#include <linux/module.h> -#include <linux/kernel.h> #include <linux/frame.h> +#include <linux/kernel.h> +#include <linux/module.h> +#include <linux/slab.h> +#include <asm/hypervisor.h> -#include <drm/drmP.h> +#include "vmwgfx_drv.h" #include "vmwgfx_msg.h" -#define MESSAGE_STATUS_SUCCESS 0x0001#define MESSAGE_STATUS_DORECV 0x0002#define MESSAGE_STATUS_CPT 0x0010
drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c +2 -4
@@ -25,15 +25,13 @@* **************************************************************************/ - -#include <drm/drmP.h> -#include "vmwgfx_drv.h" -#include <drm/ttm/ttm_placement.h> #include "device_include/svga_overlay.h" #include "device_include/svga_escape.h" +#include "vmwgfx_drv.h" +#define VMW_MAX_NUM_STREAMS 1#define VMW_OVERLAY_CAP_MASK (SVGA_FIFO_CAP_VIDEO | SVGA_FIFO_CAP_ESCAPE)
drivers/gpu/drm/vmwgfx/vmwgfx_resource.c +2 -3
@@ -25,12 +25,11 @@* **************************************************************************/ -#include "vmwgfx_drv.h" -#include <drm/vmwgfx_drm.h> #include <drm/ttm/ttm_placement.h> -#include <drm/drmP.h> +#include "vmwgfx_resource_priv.h" #include "vmwgfx_binding.h" +#include "vmwgfx_drv.h" #define VMW_RES_EVICT_ERR_COUNT 10
drivers/gpu/drm/vmwgfx/vmwgfx_ttm_glue.c +0 -1
@@ -25,7 +25,6 @@* **************************************************************************/ -#include <drm/drmP.h> #include "vmwgfx_drv.h" int vmw_mmap (struct file *filp,struct vm_area_struct *vma)
Signature · 6 lines
2.20.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Hi Sam,
Thanks for doing this.
I did some compile/basic run test on your patchs. Things look fine. Will include this for vmwgfx-next so can run more automated test.
Quoted 41 lines · Sam Ravnborg
In two steps drop the use of
drmP.h
First patch removedrmP.hfrom header files and fixes fallout. Second patch removedrmP.hfrom the remaining files.While touching the list of include files divide them in blocks and sort include files within the blocks.
Patches made on top of drm-misc-next, and checked that they apply to vmwgfx-fixes-5.2 in
git://people.freedesktop.org/~thomash/linuxBuild tested with various configs with several architectures.
v2:
- fix warning in i386 build reported by 0-day
(missing include)Sam
Sam Ravnborg (2):
drm/vmwgfx: drop use ofdrmP.hin header files drm/vmwgfx: drop reminaing users ofdrmP.hdrivers/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_bo.c | 1 - drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c | 3 +++ drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 17 +++++++++++------ drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 30 +++++++++++++++++++++--------- drivers/gpu/drm/vmwgfx/vmwgfx_fb.c | 8 ++++---- drivers/gpu/drm/vmwgfx/vmwgfx_fence.c | 3 ++- drivers/gpu/drm/vmwgfx/vmwgfx_fence.h | 5 ++++- drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c | 6 ++++-- drivers/gpu/drm/vmwgfx/vmwgfx_gmr.c | 4 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_irq.c | 3 ++- 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_mob.c | 2 ++
Quoted 10 lines
drivers/gpu/drm/vmwgfx/vmwgfx_msg.c | 11 +++++------ drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c | 6 ++---- drivers/gpu/drm/vmwgfx/vmwgfx_resource.c | 5 ++--- drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c | 6 ++++-- drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c | 9 ++++++--- drivers/gpu/drm/vmwgfx/vmwgfx_ttm_glue.c | 1 - drivers/gpu/drm/vmwgfx/vmwgfx_validation.h | 3 ++- 24 files changed, 95 insertions(+), 58 deletions(-)
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel