drm: minimize drmP.h dependencies
Subsystems (13)
v3 cover drm: minimize drmP.h dependencies
- drmP.h is now stripped down to include files and forward declarations.
- All header files in include/drm/ no longer include drmP.h.
The series was made on top of drm-misc-next
Build tested using arm and x86 all{yes,mod}config
The patches are trivial but touches a lot of files, so a lot of people on cc: for the individual patches.
I expect the full series to be applied to drm-misc-next
There are still ~700 uses of drmP.h so a long way ahead of us to get rid of it.
The kernel-doc parts that I authored in the following may require some extra info as I know too little about DRM to be able to write something really useful. Or at least review by someone with knowledge of DRM, but that goes for everything.
v3:
- Added Acks/Reviewed annotations (thanks!)
- Add forward of drm_gem_object to drm_framebuffer.h (Noralf)
- Drop "drm: move DRM_IF_VERSION to drm_internal.h" as it is applied to drm-misc
- Drop "drm: make drm_file.h self contained" as Jan made a similar patch that was appleid to drm-misc
- Rebased on top of drm-misc-next
v2:
- DRM_SWITCH_POWER as enum (Daniel Vetter)
- Prefer forward decalration over includes (Laurent Pinchart)
- Updated drm_device to use kerneldoc style (Daniel Vetter)
- Improved commit messages (David Lechner)
- Split up patch when removing drmP.h from drm_gem_cma_helper.h
- rebased on top of drm-misc-next
- dropped patch already applied
- added reviewed-by from Laurent Pinchart (Laurent Pinchart)
- add drm_framebuffer.h patch
- add kernel-doc comments to drm_util.h
- moved EXPORT_SYMBOL_FOR_TESTS_ONLY to drm_util.h
- added note to drmP.h not to add new stuff and not to use in new files
Sam
Sam Ravnborg (12):
drm: drm_device.h: update comments to kernel-doc style
drm: move DRM_SWITCH_POWER defines to drm_device.h
drm: make drm_framebuffer.h self contained
drm: move drm_can_sleep() to drm_util.h
drm: move EXPORT_SYMBOL_FOR_TESTS_ONLY to drm_util.h
drm: remove include of drmP.h from bridge/dw_hdmi.h
drm: remove include of drmP.h from drm_encoder_slave.h
drm: remove include of drmP.h from drm_modeset_helper.h drm/arc: do not reply on drmP.h from drm_gem_cma_helper.h drm/stm: do not reply on drmP.h from drm_gem_cma_helper.h drm/tinydrm: do not reply on drmP.h from drm_gem_cma_helper.h
drm: remove drmP.h from drm_gem_cma_helper.h
drivers/gpu/drm/amd/amdgpu/atom.c | 2 + drivers/gpu/drm/arc/arcpgu_crtc.c | 2 + drivers/gpu/drm/arc/arcpgu_drv.c | 6 + drivers/gpu/drm/arc/arcpgu_sim.c | 1 + drivers/gpu/drm/ast/ast_fb.c | 2 + drivers/gpu/drm/bridge/cdns-dsi.c | 2 + .../gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c | 4 + drivers/gpu/drm/cirrus/cirrus_fbdev.c | 1 + drivers/gpu/drm/drm_flip_work.c | 1 + drivers/gpu/drm/drm_framebuffer.c | 1 + drivers/gpu/drm/drm_modeset_helper.c | 2 + drivers/gpu/drm/mgag200/mgag200_fb.c | 1 + drivers/gpu/drm/msm/disp/mdp5/mdp5_smp.c | 1 + drivers/gpu/drm/omapdrm/omap_fbdev.c | 1 + drivers/gpu/drm/qxl/qxl_cmd.c | 2 + drivers/gpu/drm/radeon/atom.c | 2 + drivers/gpu/drm/radeon/radeon_legacy_encoders.c | 1 + drivers/gpu/drm/rcar-du/rcar_dw_hdmi.c | 1 + drivers/gpu/drm/rcar-du/rcar_lvds.c | 1 + drivers/gpu/drm/stm/drv.c | 6 +- drivers/gpu/drm/stm/ltdc.c | 9 +- drivers/gpu/drm/tinydrm/core/tinydrm-core.c | 3 + drivers/gpu/drm/tinydrm/core/tinydrm-pipe.c | 3 + drivers/gpu/drm/tinydrm/hx8357d.c | 1 + drivers/gpu/drm/tinydrm/ili9225.c | 2 + drivers/gpu/drm/tinydrm/ili9341.c | 1 + drivers/gpu/drm/tinydrm/mi0283qt.c | 1 + drivers/gpu/drm/tinydrm/mipi-dbi.c | 3 + drivers/gpu/drm/tinydrm/repaper.c | 1 + drivers/gpu/drm/tinydrm/st7586.c | 1 + drivers/gpu/drm/tinydrm/st7735r.c | 1 + drivers/gpu/drm/vc4/vc4_drv.h | 1 + include/drm/bridge/dw_hdmi.h | 6 +- include/drm/drmP.h | 24 +-- include/drm/drm_device.h | 228 +++++++++++++++------ include/drm/drm_encoder_slave.h | 1 - include/drm/drm_framebuffer.h | 10 +- include/drm/drm_gem_cma_helper.h | 5 +- include/drm/drm_modeset_helper.h | 6 +- include/drm/drm_util.h | 52 ++++- 40 files changed, 304 insertions(+), 95 deletions(-)
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v3 1/12 drm: drm_device.h: update comments to kernel-doc style
Updated comment style to kernel-doc format in drm_device.h
In struct drm_device there are 12 struct members without doc:
- registered
- filelist_mutex
- filelist
- irq
- vbl_lock
- event_lock
- hose
- sigdata
- sigdata.context
- sigdata.lock
- agp_buffer_map
- agp_buffer_token
They all need proper documentation, a task left for someone that knows their usage.
drm_device is not plugged into Documentation/gpu/drm-internals.rst as this would create a new load of warnings.
--- include/drm/drm_device.h | 199 +++++++++++++++++++++++++++++++---------------- 1 file changed, 134 insertions(+), 65 deletions(-)
include/drm/drm_device.h +134 -65
@@ -25,24 +25,48 @@ struct pci_dev;struct pci_controller ;/** -* DRM device structure. This structure represent a complete card that +* struct drm_device - DRM device structure +* +* This structure represent a complete card that * may contain multiple heads. */ struct drm_device { -struct list_head legacy_dev_list;/**< list of devices per driver for stealth attach cleanup */ -int if_version;/**< Highest interface version set */ - -/** \name Lifetime Management */ -/*@{ */ -struct kref ref;/**< Object ref-count */ -struct device *dev;/**< Device structure of bus-device */ -struct drm_driver *driver;/**< DRM driver managing the device */ -void *dev_private;/**< DRM driver private data */ -struct drm_minor *primary;/**< Primary node */ -struct drm_minor *render;/**< Render node */ +/** +* @legacy_dev_list: +* +* List of devices per driver for stealth attach cleanup +*/ +struct list_head legacy_dev_list; + +/** @if_version: Highest interface version set */ +int if_version; + +/** @ref: Object ref-count */ +struct kref ref; + +/** @dev: Device structure of bus-device */ +struct device *dev; + +/** @driver: DRM driver managing the device */ +struct drm_driver *driver; + +/** @dev_private: DRM driver private data */ +void *dev_private; + +/** @primary: Primary node */ +struct drm_minor *primary; + +/** @render: Render node */ +struct drm_minor *render; +bool registered; -/* currently active master for this device. Protected by master_mutex */ +/** +* @master: +* +* Currently active master for this device. +* Protected by &master_mutex +*/ struct drm_master *master;/**
@@ -63,23 +87,42 @@ struct drm_device {*/ bool unplugged; -struct inode *anon_inode;/**< inode for private address-space */ -char *unique;/**< unique name of the device */ -/*@} */ +/** @anon_inode: inode for private address-space */ +struct inode *anon_inode; + +/** @unique: Unique name of the device */ +char *unique; + +/** +* @struct_mutex: +* +* Lock for others (not &drm_minor.master and &drm_file.is_master) +*/ +struct mutex struct_mutex; + +/** +* @master_mutex: +* +* Lock for &drm_minor.master and &drm_file.is_master +*/ +struct mutex master_mutex; + +/** +* @open_count: +* +* Usage counter for outstanding files open, +* protected by drm_global_mutex +*/ +int open_count; + +/** @buf_lock: Lock for &buf_use and a few other things. */ +spinlock_t buf_lock; -/** \name Locks */ -/*@{ */ -struct mutex struct_mutex;/**< For others */ -struct mutex master_mutex;/**< For drm_minor::master and drm_file::is_master */ -/*@} */ +/** @buf_use: Usage counter for buffers in use -- cannot alloc */ +int buf_use; -/** \name Usage Counters */ -/*@{ */ -int open_count;/**< Outstanding files open, protected by drm_global_mutex. */ -spinlock_t buf_lock;/**< For drm_device::buf_use and a few other things. */ -int buf_use;/**< Buffers in use -- cannot alloc */ -atomic_t buf_alloc;/**< Buffer allocation in progress */ -/*@} */ +/** @buf_alloc: Buffer allocation in progress */ +atomic_t buf_alloc;struct mutex filelist_mutex;struct list_head filelist;
@@ -87,51 +130,64 @@ struct drm_device {/** * @filelist_internal: * -* List of open DRM files for in-kernel clients. Protected by @filelist_mutex. +* List of open DRM files for in-kernel clients. +* Protected by &filelist_mutex. */ struct list_head filelist_internal;/** * @clientlist_mutex: * -* Protects @clientlist access. +* Protects &clientlist access. */ struct mutex clientlist_mutex;/** * @clientlist: * -* List of in-kernel clients. Protected by @clientlist_mutex. +* List of in-kernel clients. Protected by &clientlist_mutex. */ struct list_head clientlist; -/** \name Memory management */ -/*@{ */ -struct list_head maplist;/**< Linked list of regions */ -struct drm_open_hash map_hash;/**< User token hash table for maps */ +/** @maplist: Memory management - linked list of regions */ +struct list_head maplist; -/** \name Context handle management */ -/*@{ */ -struct list_head ctxlist;/**< Linked list of context handles */ -struct mutex ctxlist_mutex;/**< For ctxlist */ +/** @map_hash: Memory management - user token hash table for maps */ +struct drm_open_hash map_hash; -struct idr ctx_idr; +/** +* @ctxlist: +* Context handle management - linked list of context handles +*/ +struct list_head ctxlist; -struct list_head vmalist;/**< List of vmas (for debugging) */ +/** +* @ctxlist_mutex: +* +* Context handle management - mutex for &ctxlist +*/ +struct mutex ctxlist_mutex; -/*@} */ +/** +* @ctx_idr: +* Context handle management +*/ +struct idr ctx_idr; -/** \name DMA support */ -/*@{ */ -struct drm_device_dma *dma;/**< Optional pointer for DMA support */ -/*@} */ +/** +* @vmalist: +* Context handle management - list of vmas (for debugging) +*/ +struct list_head vmalist; + +/** @dma: Optional pointer for DMA support */ +struct drm_device_dma *dma; -/** \name Context support */ -/*@{ */ +/** @context_flag: Context swapping flag */ +__volatile__ long context_flag; -__volatile__ long context_flag;/**< Context swapping flag */ -int last_context;/**< Last current context */ -/*@} */ +/** @last_context: Last current context */ +int last_context;/** * @irq_enabled:
@@ -168,7 +224,12 @@ struct drm_device {*/ struct drm_vblank_crtc *vblank; -spinlock_t vblank_time_lock;/**< Protects vblank count and time updates during vblank enable/disable */ +/** +* @vblank_time_lock: +* +* Protects vblank count and time updates during vblank enable/disable +*/ +spinlock_t vblank_time_lock;spinlock_t vbl_lock;/**
@@ -186,25 +247,29 @@ struct drm_device {* * If non-zeor, &drm_crtc_funcs.get_vblank_counter must be set. */ -u32 max_vblank_count;/**< size of vblank counter register */ -/** -* List of events -*/ +/** @max_vblank_count: Size of vblank counter register */ +u32 max_vblank_count; + +/** @vblank_event_list: List of vblank events */ struct list_head vblank_event_list;spinlock_t event_lock; -/*@} */ +/** @agp: AGP data */ +struct drm_agp_head *agp; -struct drm_agp_head *agp;/**< AGP data */ +/** @pdev: PCI device structure */ +struct pci_dev *pdev; -struct pci_dev *pdev;/**< PCI device structure */ #ifdef __alpha__struct pci_controller *hose;#endif -struct drm_sg_mem *sg;/**< Scatter gather memory */ -unsigned int num_crtcs;/**< Number of CRTCs on this device */ +/** @sg: Scatter gather memory */ +struct drm_sg_mem *sg; + +/** @num_crtcs: Number of CRTCs on this device */ +unsigned int num_crtcs;struct {int context;
@@ -214,14 +279,18 @@ struct drm_device {struct drm_local_map *agp_buffer_map;unsigned int agp_buffer_token; -struct drm_mode_config mode_config;/**< Current mode config */ +/** @mode_config: Current mode config */ +struct drm_mode_config mode_config; -/** \name GEM information */ -/*@{ */ +/** @object_name_lock: GEM information */ struct mutex object_name_lock; + +/** @object_name_idr: GEM information */ struct idr object_name_idr; + +/** @vma_offset_manager: GEM information */ struct drm_vma_offset_manager *vma_offset_manager; -/*@} */ +int switch_power_state;/**
Signature · 6 lines
2.12.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v3 2/12 drm: move DRM_SWITCH_POWER defines to drm_device.h
In reply to Sam RavnborgMove DRM_SWITCH_POWER out of drmP.h to allow users to get rid of the drmP include.
Moved to drm_device.h because drm_device.switch_power_state is the only user.
Converted to enum and added sparse kerneldoc comments.
--- include/drm/drmP.h | 5 ----- include/drm/drm_device.h | 29 ++++++++++++++++++++++++++++- 2 files changed, 28 insertions(+), 6 deletions(-)
include/drm/drmP.h +0 -5
@@ -94,11 +94,6 @@ struct dma_buf_attachment;struct pci_dev ;struct pci_controller ; -#define DRM_SWITCH_POWER_ON 0 -#define DRM_SWITCH_POWER_OFF 1 -#define DRM_SWITCH_POWER_CHANGING 2 -#define DRM_SWITCH_POWER_DYNAMIC_OFF 3 -/* returns true if currently okay to sleep */ static inline bool drm_can_sleep (void ) {
include/drm/drm_device.h +28 -1
@@ -24,6 +24,25 @@ struct inode;struct pci_dev ;struct pci_controller ; + +/** +* enum drm_switch_power - power state of drm device +*/ + +enum switch_power_state { +/** @DRM_SWITCH_POWER_ON: Power state is ON */ +DRM_SWITCH_POWER_ON =0 , + +/** @DRM_SWITCH_POWER_OFF: Power state is OFF */ +DRM_SWITCH_POWER_OFF =1 , + +/** @DRM_SWITCH_POWER_CHANGING: Power state is changing */ +DRM_SWITCH_POWER_CHANGING =2 , + +/** @DRM_SWITCH_POWER_DYNAMIC_OFF: Suspended */ +DRM_SWITCH_POWER_DYNAMIC_OFF =3 , +}; +/** * struct drm_device - DRM device structure *
@@ -291,7 +310,15 @@ struct drm_device {/** @vma_offset_manager: GEM information */ struct drm_vma_offset_manager *vma_offset_manager; -int switch_power_state; +/** +* @switch_power_state: +* +* Power state of the client. +* Used by drivers supporting the switcheroo driver. +* The state is maintained in the +* &vga_switcheroo_client_ops.set_gpu_state callback +*/ +enum switch_power_state switch_power_state;/** * @fb_helper:
Signature · 6 lines
2.12.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v3 3/12 drm: make drm_framebuffer.h self contained
In reply to Sam RavnborgAdd forward declaration and pull in include
file to make drm_framebuffer.h self contained.
While add it order include files alphabetically.
The use of TASK_COMM_LEN is the reason for including sched.h. I could not see any good way to avoid this dependency, and users of drm_framebuffer.comm already use TASK_COMM_LEN to check for length etc.
v2:
- Added forward declaration of drm_gem_object (Noralf)
- Added ack from Noralf
--- include/drm/drm_framebuffer.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
include/drm/drm_framebuffer.h +7 -3
@@ -23,13 +23,17 @@#ifndef __DRM_FRAMEBUFFER_H__#define __DRM_FRAMEBUFFER_H__ -#include <linux/list.h> #include <linux/ctype.h> +#include <linux/list.h> +#include <linux/sched.h> +#include <drm/drm_mode_object.h> -struct drm_framebuffer ; -struct drm_file ; +struct drm_clip_rect ;struct drm_device ; +struct drm_file ; +struct drm_framebuffer ; +struct drm_gem_object ;/** * struct drm_framebuffer_funcs - framebuffer hooks
Signature · 6 lines
2.12.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v3 4/12 drm: move drm_can_sleep() to drm_util.h
In reply to Sam RavnborgMove drm_can_sleep() out of drmP.h to allow users
to get rid of the drmP.h include.
There was no header file that was a good match for this helper function. So add this to drm_util with the relevant includes.
Update comments to use kernel-doc style.
Add FIXME to drm_can_sleep and add note
that this function should not be used in new code
Add include of drm_util.h to all users.
--- drivers/gpu/drm/amd/amdgpu/atom.c | 2 ++ drivers/gpu/drm/ast/ast_fb.c | 2 ++ drivers/gpu/drm/cirrus/cirrus_fbdev.c | 1 + drivers/gpu/drm/drm_flip_work.c | 1 + drivers/gpu/drm/mgag200/mgag200_fb.c | 1 + drivers/gpu/drm/msm/disp/mdp5/mdp5_smp.c | 1 + drivers/gpu/drm/omapdrm/omap_fbdev.c | 1 + drivers/gpu/drm/qxl/qxl_cmd.c | 2 ++ drivers/gpu/drm/radeon/atom.c | 2 ++ drivers/gpu/drm/radeon/radeon_legacy_encoders.c | 1 + drivers/gpu/drm/vc4/vc4_drv.h | 1 + include/drm/drmP.h | 8 ----- include/drm/drm_util.h | 42 ++++++++++++++++++++++++- 13 files changed, 56 insertions(+), 9 deletions(-)
drivers/gpu/drm/amd/amdgpu/atom.c +2 -0
@@ -27,6 +27,8 @@#include <linux/slab.h> #include <asm/unaligned.h> +#include <drm/drm_util.h> +#define ATOM_DEBUG #include "atom.h"
drivers/gpu/drm/ast/ast_fb.c +2 -0
@@ -39,7 +39,9 @@#include <drm/drmP.h> #include <drm/drm_crtc.h> #include <drm/drm_fb_helper.h> +#include <drm/drm_util.h> #include <drm/drm_crtc_helper.h> +#include "ast_drv.h" static void ast_dirty_update(struct ast_fbdev *afbdev,
drivers/gpu/drm/cirrus/cirrus_fbdev.c +1 -0
@@ -10,6 +10,7 @@*/ #include <linux/module.h> #include <drm/drmP.h> +#include <drm/drm_util.h> #include <drm/drm_fb_helper.h> #include <drm/drm_crtc_helper.h>
drivers/gpu/drm/drm_flip_work.c +1 -0
@@ -22,6 +22,7 @@*/ #include <drm/drmP.h> +#include <drm/drm_util.h> #include <drm/drm_flip_work.h> /**
drivers/gpu/drm/mgag200/mgag200_fb.c +1 -0
@@ -12,6 +12,7 @@*/ #include <linux/module.h> #include <drm/drmP.h> +#include <drm/drm_util.h> #include <drm/drm_fb_helper.h> #include <drm/drm_crtc_helper.h>
drivers/gpu/drm/msm/disp/mdp5/mdp5_smp.c +1 -0
@@ -16,6 +16,7 @@* this program. If not, see <http://www.gnu.org/licenses/>. */ +#include <drm/drm_util.h> #include "mdp5_kms.h" #include "mdp5_smp.h"
drivers/gpu/drm/omapdrm/omap_fbdev.c +1 -0
@@ -16,6 +16,7 @@*/ #include <drm/drm_crtc.h> +#include <drm/drm_util.h> #include <drm/drm_fb_helper.h> #include "omap_drv.h"
drivers/gpu/drm/qxl/qxl_cmd.c +2 -0
@@ -25,6 +25,8 @@/* QXL cmd/ring handling */ +#include <drm/drm_util.h> +#include "qxl_drv.h" #include "qxl_object.h"
drivers/gpu/drm/radeon/atom.c +2 -0
@@ -27,6 +27,8 @@#include <linux/slab.h> #include <asm/unaligned.h> +#include <drm/drm_util.h> +#define ATOM_DEBUG #include "atom.h"
drivers/gpu/drm/radeon/radeon_legacy_encoders.c +1 -0
@@ -24,6 +24,7 @@* Alex Deucher */ #include <drm/drmP.h> +#include <drm/drm_util.h> #include <drm/drm_crtc_helper.h> #include <drm/radeon_drm.h> #include "radeon.h"
drivers/gpu/drm/vc4/vc4_drv.h +1 -0
@@ -9,6 +9,7 @@#include <linux/mm_types.h> #include <linux/reservation.h> #include <drm/drmP.h> +#include <drm/drm_util.h> #include <drm/drm_encoder.h> #include <drm/drm_gem_cma_helper.h> #include <drm/drm_atomic.h>
include/drm/drmP.h +0 -8
@@ -94,14 +94,6 @@ struct dma_buf_attachment;struct pci_dev ;struct pci_controller ; -/* returns true if currently okay to sleep */ -static inline bool drm_can_sleep (void ) -{ -if (in_atomic () ||in_dbg_master () ||irqs_disabled ()) -return false; -return true; -} -#if defined(CONFIG_DRM_DEBUG_SELFTEST_MODULE )#define EXPORT_SYMBOL_FOR_TESTS_ONLY (x) EXPORT_SYMBOL(x)#else
include/drm/drm_util.h +41 -1
48 lines not on this page · raw message
Signature · 6 lines
2.12.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v3 04/12] drm: move drm_can_sleep() to drm_util.h
Quoted 202 lines · Sam Ravnborg
Move
drm_can_sleep()out ofdrmP.hto allow users
to get rid of thedrmP.hinclude.There was no header file that was a good match for this helper function. So add this to
drm_utilwith the relevant includes.Update comments to use kernel-doc style.
Add FIXME todrm_can_sleepand add note
that this function should not be used in new codeAdd include of
drm_util.hto all users.Signed-off-by Sam Ravnborg <[email protected]>Cc Maarten Lankhorst <[email protected]>Cc Maxime Ripard <[email protected]>Cc Sean Paul <[email protected]>Cc David Airlie <[email protected]>Cc Daniel Vetter <[email protected]>Cc Alex Deucher <[email protected]>Cc "Christian König" <[email protected]>Cc "David (ChunMing) Zhou" <[email protected]>Cc Gerd Hoffmann <[email protected]>Cc Rob Clark <[email protected]>Cc Tomi Valkeinen <[email protected]>Cc Eric Anholt <[email protected]>--- drivers/gpu/drm/amd/amdgpu/atom.c | 2 ++ drivers/gpu/drm/ast/ast_fb.c | 2 ++ drivers/gpu/drm/cirrus/cirrus_fbdev.c | 1 + drivers/gpu/drm/drm_flip_work.c | 1 + drivers/gpu/drm/mgag200/mgag200_fb.c | 1 + drivers/gpu/drm/msm/disp/mdp5/mdp5_smp.c | 1 + drivers/gpu/drm/omapdrm/omap_fbdev.c | 1 + drivers/gpu/drm/qxl/qxl_cmd.c | 2 ++ drivers/gpu/drm/radeon/atom.c | 2 ++ drivers/gpu/drm/radeon/radeon_legacy_encoders.c | 1 + drivers/gpu/drm/vc4/vc4_drv.h | 1 + include/drm/drmP.h | 8 ----- include/drm/drm_util.h | 42 ++++++++++++++++++++++++- 13 files changed, 56 insertions(+), 9 deletions(-)drivers/gpu/drm/amd/amdgpu/atom.c +2
-0@@ -27,6 +27,8 @@#include <linux/slab.h> #include <asm/unaligned.h> +#include <drm/drm_util.h> +#define ATOM_DEBUG #include "atom.h" drivers/gpu/drm/ast/ast_fb.c +2
-0@@ -39,7 +39,9 @@#include <drm/drmP.h> #include <drm/drm_crtc.h> #include <drm/drm_fb_helper.h> +#include <drm/drm_util.h> #include <drm/drm_crtc_helper.h> +#include "ast_drv.h" static void ast_dirty_update(struct ast_fbdev *afbdev,drivers/gpu/drm/cirrus/cirrus_fbdev.c +1
-0@@ -10,6 +10,7 @@*/ #include <linux/module.h> #include <drm/drmP.h> +#include <drm/drm_util.h> #include <drm/drm_fb_helper.h> #include <drm/drm_crtc_helper.h> drivers/gpu/drm/drm_flip_work.c +1
-0@@ -22,6 +22,7 @@*/ #include <drm/drmP.h> +#include <drm/drm_util.h> #include <drm/drm_flip_work.h> /** drivers/gpu/drm/mgag200/mgag200_fb.c +1
-0@@ -12,6 +12,7 @@*/ #include <linux/module.h> #include <drm/drmP.h> +#include <drm/drm_util.h> #include <drm/drm_fb_helper.h> #include <drm/drm_crtc_helper.h> drivers/gpu/drm/msm/disp/mdp5/mdp5_smp.c +1
-0@@ -16,6 +16,7 @@* this program. If not, see <http://www.gnu.org/licenses/>. */ +#include <drm/drm_util.h> #include "mdp5_kms.h" #include "mdp5_smp.h" drivers/gpu/drm/omapdrm/omap_fbdev.c +1
-0@@ -16,6 +16,7 @@*/ #include <drm/drm_crtc.h> +#include <drm/drm_util.h> #include <drm/drm_fb_helper.h> #include "omap_drv.h" drivers/gpu/drm/qxl/qxl_cmd.c +2
-0@@ -25,6 +25,8 @@/* QXL cmd/ring handling */ +#include <drm/drm_util.h> +#include "qxl_drv.h" #include "qxl_object.h" drivers/gpu/drm/radeon/atom.c +2
-0@@ -27,6 +27,8 @@#include <linux/slab.h> #include <asm/unaligned.h> +#include <drm/drm_util.h> +#define ATOM_DEBUG #include "atom.h" drivers/gpu/drm/radeon/radeon_legacy_encoders.c +1
-0@@ -24,6 +24,7 @@* Alex Deucher */ #include <drm/drmP.h> +#include <drm/drm_util.h> #include <drm/drm_crtc_helper.h> #include <drm/radeon_drm.h> #include "radeon.h" drivers/gpu/drm/vc4/vc4_drv.h +1
-0@@ -9,6 +9,7 @@#include <linux/mm_types.h> #include <linux/reservation.h> #include <drm/drmP.h> +#include <drm/drm_util.h> #include <drm/drm_encoder.h> #include <drm/drm_gem_cma_helper.h> #include <drm/drm_atomic.h> include/drm/drmP.h +0
-8@@ -94,14 +94,6 @@ struct dma_buf_attachment;struct pci_dev ;struct pci_controller ; -/* returns true if currently okay to sleep */ -static inline bool drm_can_sleep (void ) -{ -if (in_atomic () ||in_dbg_master () ||irqs_disabled ()) -return false; -return true; -} -#if defined(CONFIG_DRM_DEBUG_SELFTEST_MODULE )#define EXPORT_SYMBOL_FOR_TESTS_ONLY (x) EXPORT_SYMBOL(x)#else include/drm/drm_util.h +0
-0
include/drm/drm_util.h line 33
Quoted 9 lines
include/drm/drm_util.h +5
-1@@ -26,7 +26,47 @@#ifndef _DRM_UTIL_H_#define _DRM_UTIL_H_ -/* helper for handling conditionals in various for_each macros */ +/** +* DOC: drm utils +* +* Macros and inline functions that does not naturally belong in other places +*/
The nice new docs here aren't included anywhere. We already have a "Misc Utilities" in drm-internals.rst, including this there under a "Utilities" subheading makes sense I think - yes I know, not the most creative name :-)
Quoted 4 lines
include/drm/drm_util.h +4
-0+ +#include <linux/irqflags.h> +#include <linux/preempt.h> +#include <linux/kgdb.h>
include/drm/drm_util.h line 47
Quoted 10 lines
include/drm/drm_util.h +10
-0+#include <linux/smp.h> + +/** +* for_each_if - helper for handling conditionals in various for_each macros +* @condition The condition to check +* +* Typical use: +* #define for_each_foo_bar(x, y) \ +* list_for_each_entry(x, y->list, head) \ +* for_each_if(x->something == SOMETHING)
I think the formatting of this in the html output will look off:
Double-colon plus indenting should fix that.
Merged the first 3 patches of this series thus far.
Thanks, Daniel
Quoted 28 lines
include/drm/drm_util.h +22
-0+* +* The for_each_if() macro makes the use of for_each_foo_bar() less error +* prone. +*/ #define for_each_if (condition) if (!(condition)) {} else +/** +* drm_can_sleep - returns true if currently okay to sleep +* +* This function shall not be used in new code. +* The check for running in atomic context may not work - see linux/preempt.h. +* +* FIXME: All users of drm_can_sleep should be removed (see todo.rst) +* +* Returns: +* True if kgdb is active or we are in an atomic context or irqs are disabled +*/ +static inline bool drm_can_sleep (void ) +{ +if (in_atomic () ||in_dbg_master () ||irqs_disabled ()) +return false; +return true; +} +#endif Signature · 1 line
2.12.0
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v3 5/12 drm: move EXPORT_SYMBOL_FOR_TESTS_ONLY to drm_util.h
In reply to Sam RavnborgIn the quest to get rid of drmP.h move the newly added EXPORT_SYMBOL_FOR_TESTS_ONLY to drm_util.h. Fix the single user.
Add a note to drmP.h to avoid further use of it.
--- drivers/gpu/drm/drm_framebuffer.c | 1 + include/drm/drmP.h | 11 ++++++----- include/drm/drm_util.h | 10 ++++++++++ 3 files changed, 17 insertions(+), 5 deletions(-)
drivers/gpu/drm/drm_framebuffer.c +1 -0
@@ -27,6 +27,7 @@#include <drm/drm_atomic.h> #include <drm/drm_atomic_uapi.h> #include <drm/drm_print.h> +#include <drm/drm_util.h> #include "drm_internal.h" #include "drm_crtc_internal.h"
include/drm/drmP.h +6 -5
@@ -94,10 +94,11 @@ struct dma_buf_attachment;struct pci_dev ;struct pci_controller ; -#if defined(CONFIG_DRM_DEBUG_SELFTEST_MODULE ) -#define EXPORT_SYMBOL_FOR_TESTS_ONLY (x) EXPORT_SYMBOL(x) -#else -#define EXPORT_SYMBOL_FOR_TESTS_ONLY (x) -#endif +/* +* NOTE: drmP.h is obsolete - do NOT add anything to this file +* +* Do not include drmP.h in new files. +* Work is ongoing to remove drmP.h includes from existing files +*/ #endif
include/drm/drm_util.h +10 -0
@@ -37,6 +37,16 @@#include <linux/kgdb.h> #include <linux/smp.h> +/* +* Use EXPORT_SYMBOL_FOR_TESTS_ONLY() for functions that shall +* only be visible for drmselftests. +*/ +#if defined(CONFIG_DRM_DEBUG_SELFTEST_MODULE ) +#define EXPORT_SYMBOL_FOR_TESTS_ONLY (x) EXPORT_SYMBOL(x) +#else +#define EXPORT_SYMBOL_FOR_TESTS_ONLY (x) +#endif +/** * for_each_if - helper for handling conditionals in various for_each macros * @condition The condition to check
Signature · 6 lines
2.12.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v3 05/12] drm: move EXPORT_SYMBOL_FOR_TESTS_ONLY to drm_util.h
Quoted 4 lines · Sam Ravnborg
In the quest to get rid of
drmP.hmove the newly addedEXPORT_SYMBOL_FOR_TESTS_ONLYtodrm_util.h. Fix the single user.
Quoted 8 lines
Add a note to
drmP.hto avoid further use of it.Signed-off-by Sam Ravnborg <[email protected]>Cc Maarten Lankhorst <[email protected]>Cc Maxime Ripard <[email protected]>Cc Sean Paul <[email protected]>Cc David Airlie <[email protected]>Cc Daniel Vetter <[email protected]>
Skipping this one for now, since it doesn't apply cleanly without patch 4. Seems like none of the later patches requires it.
-Daniel
Quoted 63 lines
--- drivers/gpu/drm/drm_framebuffer.c | 1 + include/drm/drmP.h | 11 ++++++----- include/drm/drm_util.h | 10 ++++++++++ 3 files changed, 17 insertions(+), 5 deletions(-)drivers/gpu/drm/drm_framebuffer.c +1
-0@@ -27,6 +27,7 @@#include <drm/drm_atomic.h> #include <drm/drm_atomic_uapi.h> #include <drm/drm_print.h> +#include <drm/drm_util.h> #include "drm_internal.h" #include "drm_crtc_internal.h" include/drm/drmP.h +6
-5@@ -94,10 +94,11 @@ struct dma_buf_attachment;struct pci_dev ;struct pci_controller ; -#if defined(CONFIG_DRM_DEBUG_SELFTEST_MODULE ) -#define EXPORT_SYMBOL_FOR_TESTS_ONLY (x) EXPORT_SYMBOL(x) -#else -#define EXPORT_SYMBOL_FOR_TESTS_ONLY (x) -#endif +/* +* NOTE: drmP.h is obsolete - do NOT add anything to this file +* +* Do not include drmP.h in new files. +* Work is ongoing to remove drmP.h includes from existing files +*/ #endif include/drm/drm_util.h +10
-0@@ -37,6 +37,16 @@#include <linux/kgdb.h> #include <linux/smp.h> +/* +* Use EXPORT_SYMBOL_FOR_TESTS_ONLY() for functions that shall +* only be visible for drmselftests. +*/ +#if defined(CONFIG_DRM_DEBUG_SELFTEST_MODULE ) +#define EXPORT_SYMBOL_FOR_TESTS_ONLY (x) EXPORT_SYMBOL(x) +#else +#define EXPORT_SYMBOL_FOR_TESTS_ONLY (x) +#endif +/** * for_each_if - helper for handling conditionals in various for_each macros * @condition The condition to check Signature · 1 line
2.12.0
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v3 6/12 drm: remove include of drmP.h from bridge/dw_hdmi.h
In reply to Sam RavnborgdrmP.h is an relic from the days when there was a single header file. To enable the removal of drmP.h from all users drop include of drmP.h from bridge/dw_hdmi.h.
A few files relied on the file included in drmP.h - add explicit include statements or forward declarations to these files. Build tested with arm and x86.
v2:
- prefer forward declarations when possible (Laurent Pinchart)
- sort include files (Laurent Pinchart)
--- drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c | 4 ++++ drivers/gpu/drm/rcar-du/rcar_dw_hdmi.c | 1 + include/drm/bridge/dw_hdmi.h | 6 ++++-- 3 files changed, 9 insertions(+), 2 deletions(-)
drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c +4 -0
@@ -5,6 +5,10 @@* Copyright (c) 2017 Renesas Solutions Corp. * Kuninori Morimoto <[email protected]> */ + +#include <linux/dma-mapping.h> +#include <linux/module.h> +#include <drm/bridge/dw_hdmi.h> #include <sound/hdmi-codec.h>
drivers/gpu/drm/rcar-du/rcar_dw_hdmi.c +1 -0
@@ -7,6 +7,7 @@* Contact: Laurent Pinchart ([email protected]) */ +#include <linux/mod_devicetable.h> #include <linux/module.h> #include <linux/platform_device.h>
include/drm/bridge/dw_hdmi.h +4 -2
@@ -10,9 +10,11 @@#ifndef __DW_HDMI__#define __DW_HDMI__ -#include <drm/drmP.h> - +struct drm_connector ; +struct drm_display_mode ; +struct drm_encoder ;struct dw_hdmi ; +struct platform_device ;/** * DOC: Supported input formats and encodings
Signature · 6 lines
2.12.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v3 7/12 drm: remove include of drmP.h from drm_encoder_slave.h
In reply to Sam RavnborgNo further changes required.
--- include/drm/drm_encoder_slave.h | 1 - 1 file changed, 1 deletion(-)
include/drm/drm_encoder_slave.h +0 -1
@@ -27,7 +27,6 @@#ifndef __DRM_ENCODER_SLAVE_H__#define __DRM_ENCODER_SLAVE_H__ -#include <drm/drmP.h> #include <drm/drm_crtc.h> #include <drm/drm_encoder.h>
Signature · 6 lines
2.12.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v3 8/12 drm: remove include of drmP.h from drm_modeset_helper.h
In reply to Sam RavnborgdrmP.h is an relic from the days when there was a single header file. To enable the removal of drmP.h from all users drop include of drmP.h from drm_modeset_helper.h.
A few files relied on the file included in drmP.h - add explicit include statements to these files.
Build tested with arm and x86.
v2:
- Add forward declarations to drm_modeset_helper.h (Laurent Pinchart)
--- drivers/gpu/drm/arc/arcpgu_sim.c | 1 + drivers/gpu/drm/bridge/cdns-dsi.c | 2 ++ drivers/gpu/drm/drm_modeset_helper.c | 2 ++ drivers/gpu/drm/rcar-du/rcar_lvds.c | 1 + include/drm/drm_modeset_helper.h | 6 +++++- 5 files changed, 11 insertions(+), 1 deletion(-)
drivers/gpu/drm/arc/arcpgu_sim.c +1 -0
@@ -14,6 +14,7 @@* */ +#include <drm/drm_device.h> #include <drm/drm_crtc_helper.h> #include <drm/drm_atomic_helper.h>
drivers/gpu/drm/bridge/cdns-dsi.c +2 -0
@@ -8,11 +8,13 @@#include <drm/drm_atomic_helper.h> #include <drm/drm_bridge.h> #include <drm/drm_crtc_helper.h> +#include <drm/drm_drv.h> #include <drm/drm_mipi_dsi.h> #include <drm/drm_panel.h> #include <video/mipi_display.h> #include <linux/clk.h> +#include <linux/interrupt.h> #include <linux/iopoll.h> #include <linux/module.h> #include <linux/of_address.h>
drivers/gpu/drm/drm_modeset_helper.c +2 -0
@@ -23,8 +23,10 @@#include <drm/drm_atomic_helper.h> #include <drm/drm_crtc_helper.h> #include <drm/drm_fb_helper.h> +#include <drm/drm_fourcc.h> #include <drm/drm_modeset_helper.h> #include <drm/drm_plane_helper.h> +#include <drm/drm_print.h> /** * DOC: aux kms helpers
drivers/gpu/drm/rcar-du/rcar_lvds.c +1 -0
@@ -10,6 +10,7 @@#include <linux/clk.h> #include <linux/delay.h> #include <linux/io.h> +#include <linux/module.h> #include <linux/of.h> #include <linux/of_device.h> #include <linux/of_graph.h>
include/drm/drm_modeset_helper.h +5 -1
@@ -23,7 +23,11 @@#ifndef __DRM_KMS_HELPER_H__#define __DRM_KMS_HELPER_H__ -#include <drm/drmP.h> +struct drm_crtc ; +struct drm_crtc_funcs ; +struct drm_device ; +struct drm_framebuffer ; +struct drm_mode_fb_cmd2 ;void drm_helper_move_panel_connectors_to_head (struct drm_device *);
Signature · 6 lines
2.12.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v3 08/12] drm: remove include of drmP.h from drm_modeset_helper.h
Quoted 11 lines · Sam Ravnborg
drmP.his an relic from the days when there was a single header file. To enable the removal ofdrmP.hfrom all users drop include ofdrmP.hfromdrm_modeset_helper.h.A few files relied on the file included in
drmP.h- add explicit include statements to these files.
Build tested with arm and x86.v2:
- Add forward declarations todrm_modeset_helper.h(Laurent Pinchart)
Quoted 11 lines
Signed-off-by Sam Ravnborg <[email protected]>Reviewed-by Laurent Pinchart <[email protected]>Cc Alexey Brodkin <[email protected]>Cc David Airlie <[email protected]>Cc Daniel Vetter <[email protected]>Cc Archit Taneja <[email protected]>Cc Andrzej Hajda <[email protected]>Cc Maarten Lankhorst <[email protected]>Cc Maxime Ripard <[email protected]>Cc Sean Paul <[email protected]>Cc Kieran Bingham <[email protected]>
This one here breaks tinydrm without the tinydrm patch first. I reorderd while applying. It also breaks kirin (and maybe more, I didn't check), so I've left this one out for now.
-Daniel
Quoted 85 lines
--- drivers/gpu/drm/arc/arcpgu_sim.c | 1 + drivers/gpu/drm/bridge/cdns-dsi.c | 2 ++ drivers/gpu/drm/drm_modeset_helper.c | 2 ++ drivers/gpu/drm/rcar-du/rcar_lvds.c | 1 + include/drm/drm_modeset_helper.h | 6 +++++- 5 files changed, 11 insertions(+), 1 deletion(-)drivers/gpu/drm/arc/arcpgu_sim.c +1
-0@@ -14,6 +14,7 @@* */ +#include <drm/drm_device.h> #include <drm/drm_crtc_helper.h> #include <drm/drm_atomic_helper.h> drivers/gpu/drm/bridge/cdns-dsi.c +2
-0@@ -8,11 +8,13 @@#include <drm/drm_atomic_helper.h> #include <drm/drm_bridge.h> #include <drm/drm_crtc_helper.h> +#include <drm/drm_drv.h> #include <drm/drm_mipi_dsi.h> #include <drm/drm_panel.h> #include <video/mipi_display.h> #include <linux/clk.h> +#include <linux/interrupt.h> #include <linux/iopoll.h> #include <linux/module.h> #include <linux/of_address.h> drivers/gpu/drm/drm_modeset_helper.c +2
-0@@ -23,8 +23,10 @@#include <drm/drm_atomic_helper.h> #include <drm/drm_crtc_helper.h> #include <drm/drm_fb_helper.h> +#include <drm/drm_fourcc.h> #include <drm/drm_modeset_helper.h> #include <drm/drm_plane_helper.h> +#include <drm/drm_print.h> /** * DOC: aux kms helpers drivers/gpu/drm/rcar-du/rcar_lvds.c +1
-0@@ -10,6 +10,7 @@#include <linux/clk.h> #include <linux/delay.h> #include <linux/io.h> +#include <linux/module.h> #include <linux/of.h> #include <linux/of_device.h> #include <linux/of_graph.h> include/drm/drm_modeset_helper.h +5
-1@@ -23,7 +23,11 @@#ifndef __DRM_KMS_HELPER_H__#define __DRM_KMS_HELPER_H__ -#include <drm/drmP.h> +struct drm_crtc ; +struct drm_crtc_funcs ; +struct drm_device ; +struct drm_framebuffer ; +struct drm_mode_fb_cmd2 ;void drm_helper_move_panel_connectors_to_head (struct drm_device *);Signature · 1 line
2.12.0
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v3 08/12] drm: remove include of drmP.h from drm_modeset_helper.h
Quoted 24 lines · Daniel Vetter
Quoted 11 lines · Sam Ravnborg
drmP.his an relic from the days when there was a single header file. To enable the removal ofdrmP.hfrom all users drop include ofdrmP.hfromdrm_modeset_helper.h.A few files relied on the file included in
drmP.h- add explicit include statements to these files.
Build tested with arm and x86.v2:
- Add forward declarations todrm_modeset_helper.h(Laurent Pinchart)Quoted 11 lines
Signed-off-by Sam Ravnborg <[email protected]>Reviewed-by Laurent Pinchart <[email protected]>Cc Alexey Brodkin <[email protected]>Cc David Airlie <[email protected]>Cc Daniel Vetter <[email protected]>Cc Archit Taneja <[email protected]>Cc Andrzej Hajda <[email protected]>Cc Maarten Lankhorst <[email protected]>Cc Maxime Ripard <[email protected]>Cc Sean Paul <[email protected]>Cc Kieran Bingham <[email protected]>
Quoted 3 lines
This one here breaks tinydrm without the tinydrm patch first. I reorderd while applying. It also breaks kirin (and maybe more, I didn't check), so I've left this one out for now.
Note that I've just fixed up a large pile of these in i915 because I've been rebasing a patch that removes lots of drm_modeset_helper.h includes.
Getting this all merged will be fun :-/
-Daniel
Quoted 92 lines
-Daniel
Quoted 85 lines
--- drivers/gpu/drm/arc/arcpgu_sim.c | 1 + drivers/gpu/drm/bridge/cdns-dsi.c | 2 ++ drivers/gpu/drm/drm_modeset_helper.c | 2 ++ drivers/gpu/drm/rcar-du/rcar_lvds.c | 1 + include/drm/drm_modeset_helper.h | 6 +++++- 5 files changed, 11 insertions(+), 1 deletion(-)drivers/gpu/drm/arc/arcpgu_sim.c +1
-0@@ -14,6 +14,7 @@* */ +#include <drm/drm_device.h> #include <drm/drm_crtc_helper.h> #include <drm/drm_atomic_helper.h> drivers/gpu/drm/bridge/cdns-dsi.c +2
-0@@ -8,11 +8,13 @@#include <drm/drm_atomic_helper.h> #include <drm/drm_bridge.h> #include <drm/drm_crtc_helper.h> +#include <drm/drm_drv.h> #include <drm/drm_mipi_dsi.h> #include <drm/drm_panel.h> #include <video/mipi_display.h> #include <linux/clk.h> +#include <linux/interrupt.h> #include <linux/iopoll.h> #include <linux/module.h> #include <linux/of_address.h> drivers/gpu/drm/drm_modeset_helper.c +2
-0@@ -23,8 +23,10 @@#include <drm/drm_atomic_helper.h> #include <drm/drm_crtc_helper.h> #include <drm/drm_fb_helper.h> +#include <drm/drm_fourcc.h> #include <drm/drm_modeset_helper.h> #include <drm/drm_plane_helper.h> +#include <drm/drm_print.h> /** * DOC: aux kms helpers drivers/gpu/drm/rcar-du/rcar_lvds.c +1
-0@@ -10,6 +10,7 @@#include <linux/clk.h> #include <linux/delay.h> #include <linux/io.h> +#include <linux/module.h> #include <linux/of.h> #include <linux/of_device.h> #include <linux/of_graph.h> include/drm/drm_modeset_helper.h +5
-1@@ -23,7 +23,11 @@#ifndef __DRM_KMS_HELPER_H__#define __DRM_KMS_HELPER_H__ -#include <drm/drmP.h> +struct drm_crtc ; +struct drm_crtc_funcs ; +struct drm_device ; +struct drm_framebuffer ; +struct drm_mode_fb_cmd2 ;void drm_helper_move_panel_connectors_to_head (struct drm_device *);Signature · 1 line
2.12.0Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v3 9/12 drm/arc: do not reply on drmP.h from drm_gem_cma_helper.h
In reply to Sam RavnborgdrmP.h was the only header file in the past and a lot of files rely on that drmP.h defines everything. The goal is to one day to delete drmP.h and
as a step towards this it will no longer be included in the headers files in include/drm/
To prepare arc/ for this add dependencies that othwewise was pulled in by drmP.h from drm_gem_cma_helper.h
--- drivers/gpu/drm/arc/arcpgu_crtc.c | 2 ++ drivers/gpu/drm/arc/arcpgu_drv.c | 6 ++++++ 2 files changed, 8 insertions(+)
drivers/gpu/drm/arc/arcpgu_crtc.c +2 -0
@@ -16,8 +16,10 @@#include <drm/drm_atomic_helper.h> #include <drm/drm_crtc_helper.h> +#include <drm/drm_device.h> #include <drm/drm_fb_cma_helper.h> #include <drm/drm_gem_cma_helper.h> +#include <drm/drm_vblank.h> #include <drm/drm_plane_helper.h> #include <linux/clk.h> #include <linux/platform_data/simplefb.h>
drivers/gpu/drm/arc/arcpgu_drv.c +6 -0
@@ -16,12 +16,18 @@#include <linux/clk.h> #include <drm/drm_crtc_helper.h> +#include <drm/drm_device.h> +#include <drm/drm_debugfs.h> +#include <drm/drm_drv.h> #include <drm/drm_fb_cma_helper.h> #include <drm/drm_fb_helper.h> #include <drm/drm_gem_cma_helper.h> #include <drm/drm_gem_framebuffer_helper.h> #include <drm/drm_atomic_helper.h> +#include <linux/dma-mapping.h> +#include <linux/module.h> #include <linux/of_reserved_mem.h> +#include <linux/platform_device.h> #include "arcpgu.h" #include "arcpgu_regs.h"
Signature · 6 lines
2.12.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v3 10/12 drm/stm: do not reply on drmP.h from drm_gem_cma_helper.h
In reply to Sam RavnborgdrmP.h was the only header file in the past and a lot of files rely on that drmP.h defines everything. The goal is to one day to delete drmP.h and
as a step towards this it will no longer be included in the headers files in include/drm/
To prepare stm/ for this add dependencies that othwewise was pulled in by drmP.h from drm_gem_cma_helper.h
Sort the include list when we anyway modify it.
--- drivers/gpu/drm/stm/drv.c | 6 +++++- drivers/gpu/drm/stm/ltdc.c | 9 ++++++++- 2 files changed, 13 insertions(+), 2 deletions(-)
drivers/gpu/drm/stm/drv.c +5 -1
@@ -9,15 +9,19 @@*/ #include <linux/component.h> +#include <linux/dma-mapping.h> +#include <linux/module.h> #include <linux/of_platform.h> #include <drm/drm_atomic.h> #include <drm/drm_atomic_helper.h> #include <drm/drm_crtc_helper.h> #include <drm/drm_fb_helper.h> -#include <drm/drm_fb_cma_helper.h> +#include <drm/drm_drv.h> #include <drm/drm_gem_cma_helper.h> #include <drm/drm_gem_framebuffer_helper.h> +#include <drm/drm_fb_cma_helper.h> +#include <drm/drm_vblank.h> #include "ltdc.h"
drivers/gpu/drm/stm/ltdc.c +8 -1
@@ -10,17 +10,24 @@#include <linux/clk.h> #include <linux/component.h> +#include <linux/delay.h> +#include <linux/interrupt.h> +#include <linux/module.h> #include <linux/of_address.h> #include <linux/of_graph.h> +#include <linux/platform_device.h> #include <linux/reset.h> #include <drm/drm_atomic.h> #include <drm/drm_atomic_helper.h> +#include <drm/drm_bridge.h> #include <drm/drm_crtc_helper.h> +#include <drm/drm_device.h> #include <drm/drm_fb_cma_helper.h> +#include <drm/drm_fourcc.h> #include <drm/drm_gem_cma_helper.h> #include <drm/drm_of.h> -#include <drm/drm_bridge.h> +#include <drm/drm_vblank.h> #include <drm/drm_plane_helper.h> #include <video/videomode.h>
Signature · 6 lines
2.12.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v3 10/12] drm/stm: do not reply on drmP.h from drm_gem_cma_helper.h
Le mar. 8 janv. 2019 à 20:30, Sam Ravnborg <[email protected]> a écrit :
I just notice the a typo in the title of the commit message reply ->rely ?
Quoted 87 lines
drmP.hwas the only header file in the past and a lot of files rely on thatdrmP.hdefines everything. The goal is to one day to deletedrmP.hand
as a step towards this it will no longer be included in the headers files ininclude/drm/To prepare stm/ for this add dependencies that othwewise was pulled in by
drmP.hfromdrm_gem_cma_helper.hSort the include list when we anyway modify it.
Signed-off-by Sam Ravnborg <[email protected]>Acked-by Noralf Trønnes <[email protected]>Cc Yannick Fertre <[email protected]>Cc Philippe Cornu <[email protected]>Cc Vincent Abriou <[email protected]>Cc David Airlie <[email protected]>Cc Daniel Vetter <[email protected]>--- drivers/gpu/drm/stm/drv.c | 6 +++++- drivers/gpu/drm/stm/ltdc.c | 9 ++++++++- 2 files changed, 13 insertions(+), 2 deletions(-)drivers/gpu/drm/stm/drv.c +5
-1@@ -9,15 +9,19 @@*/ #include <linux/component.h> +#include <linux/dma-mapping.h> +#include <linux/module.h> #include <linux/of_platform.h> #include <drm/drm_atomic.h> #include <drm/drm_atomic_helper.h> #include <drm/drm_crtc_helper.h> #include <drm/drm_fb_helper.h> -#include <drm/drm_fb_cma_helper.h> +#include <drm/drm_drv.h> #include <drm/drm_gem_cma_helper.h> #include <drm/drm_gem_framebuffer_helper.h> +#include <drm/drm_fb_cma_helper.h> +#include <drm/drm_vblank.h> #include "ltdc.h" drivers/gpu/drm/stm/ltdc.c +8
-2@@ -10,17 +10,24 @@#include <linux/clk.h> #include <linux/component.h> +#include <linux/delay.h> +#include <linux/interrupt.h> +#include <linux/module.h> #include <linux/of_address.h> #include <linux/of_graph.h> +#include <linux/platform_device.h> #include <linux/reset.h> #include <drm/drm_atomic.h> #include <drm/drm_atomic_helper.h> +#include <drm/drm_bridge.h> #include <drm/drm_crtc_helper.h> +#include <drm/drm_device.h> #include <drm/drm_fb_cma_helper.h> +#include <drm/drm_fourcc.h> #include <drm/drm_gem_cma_helper.h> #include <drm/drm_of.h> -#include <drm/drm_bridge.h> +#include <drm/drm_vblank.h> #include <drm/drm_plane_helper.h> #include <video/videomode.h> --2.12.0
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v3 10/12] drm/stm: do not reply on drmP.h from drm_gem_cma_helper.h
Hi Benjamin.
Quoted 2 lines · Benjamin Gaignard
Le mar. 8 janv. 2019 à 20:30, Sam Ravnborg <[email protected]> a écrit :
I just notice the a typo in the title of the commit message reply ->rely ?
Randy already told me this, but I missed that in the update.
Will fix in v4 if this set do not get applied.
Sam
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v3 11/12 drm/tinydrm: do not reply on drmP.h from drm_gem_cma_helper.h
In reply to Sam RavnborgdrmP.h was the only header file in the past and a lot of files rely on that drmP.h defines everything. The goal is to one day to delete drmP.h and
as a step towards this it will no longer be included in the headers files in include/drm/
To prepare tinydrm/ for this add dependencies that othwewise was pulled in by drmP.h from drm_gem_cma_helper.h
To avoid that tinydrm.h became "include everything", push include files to the individual drivers.
--- drivers/gpu/drm/tinydrm/core/tinydrm-core.c | 3 +++ drivers/gpu/drm/tinydrm/core/tinydrm-pipe.c | 3 +++ drivers/gpu/drm/tinydrm/hx8357d.c | 1 + drivers/gpu/drm/tinydrm/ili9225.c | 2 ++ drivers/gpu/drm/tinydrm/ili9341.c | 1 + drivers/gpu/drm/tinydrm/mi0283qt.c | 1 + drivers/gpu/drm/tinydrm/mipi-dbi.c | 3 +++ drivers/gpu/drm/tinydrm/repaper.c | 1 + drivers/gpu/drm/tinydrm/st7586.c | 1 + drivers/gpu/drm/tinydrm/st7735r.c | 1 + 10 files changed, 17 insertions(+)
drivers/gpu/drm/tinydrm/core/tinydrm-core.c +3 -0
@@ -10,11 +10,14 @@#include <drm/drm_atomic.h> #include <drm/drm_atomic_helper.h> #include <drm/drm_crtc_helper.h> +#include <drm/drm_drv.h> #include <drm/drm_fb_helper.h> #include <drm/drm_gem_framebuffer_helper.h> +#include <drm/drm_print.h> #include <drm/tinydrm/tinydrm.h> #include <linux/device.h> #include <linux/dma-buf.h> +#include <linux/module.h> /** * DOC: overview
drivers/gpu/drm/tinydrm/core/tinydrm-pipe.c +3 -0
@@ -9,8 +9,11 @@#include <drm/drm_atomic_helper.h> #include <drm/drm_crtc_helper.h> +#include <drm/drm_drv.h> #include <drm/drm_gem_framebuffer_helper.h> #include <drm/drm_modes.h> +#include <drm/drm_print.h> +#include <drm/drm_vblank.h> #include <drm/tinydrm/tinydrm.h> struct tinydrm_connector {
drivers/gpu/drm/tinydrm/hx8357d.c +1 -0
@@ -16,6 +16,7 @@#include <linux/property.h> #include <linux/spi/spi.h> +#include <drm/drm_drv.h> #include <drm/drm_gem_cma_helper.h> #include <drm/drm_gem_framebuffer_helper.h> #include <drm/drm_modeset_helper.h>
drivers/gpu/drm/tinydrm/ili9225.c +2 -0
@@ -20,7 +20,9 @@#include <linux/spi/spi.h> #include <video/mipi_display.h> +#include <drm/drm_drv.h> #include <drm/drm_fb_cma_helper.h> +#include <drm/drm_fourcc.h> #include <drm/drm_gem_cma_helper.h> #include <drm/drm_gem_framebuffer_helper.h> #include <drm/tinydrm/mipi-dbi.h>
drivers/gpu/drm/tinydrm/ili9341.c +1 -0
@@ -15,6 +15,7 @@#include <linux/property.h> #include <linux/spi/spi.h> +#include <drm/drm_drv.h> #include <drm/drm_gem_cma_helper.h> #include <drm/drm_gem_framebuffer_helper.h> #include <drm/drm_modeset_helper.h>
drivers/gpu/drm/tinydrm/mi0283qt.c +1 -0
@@ -17,6 +17,7 @@#include <linux/regulator/consumer.h> #include <linux/spi/spi.h> +#include <drm/drm_drv.h> #include <drm/drm_gem_cma_helper.h> #include <drm/drm_gem_framebuffer_helper.h> #include <drm/drm_modeset_helper.h>
drivers/gpu/drm/tinydrm/mipi-dbi.c +3 -0
@@ -10,14 +10,17 @@*/ #include <linux/debugfs.h> +#include <linux/delay.h> #include <linux/dma-buf.h> #include <linux/gpio/consumer.h> #include <linux/module.h> #include <linux/regulator/consumer.h> #include <linux/spi/spi.h> +#include <drm/drm_drv.h> #include <drm/drm_fb_cma_helper.h> #include <drm/drm_gem_cma_helper.h> +#include <drm/drm_fourcc.h> #include <drm/drm_gem_framebuffer_helper.h> #include <drm/tinydrm/mipi-dbi.h> #include <drm/tinydrm/tinydrm-helpers.h>
drivers/gpu/drm/tinydrm/repaper.c +1 -0
@@ -26,6 +26,7 @@#include <linux/spi/spi.h> #include <linux/thermal.h> +#include <drm/drm_drv.h> #include <drm/drm_fb_cma_helper.h> #include <drm/drm_gem_cma_helper.h> #include <drm/drm_gem_framebuffer_helper.h>
drivers/gpu/drm/tinydrm/st7586.c +1 -0
@@ -17,6 +17,7 @@#include <linux/spi/spi.h> #include <video/mipi_display.h> +#include <drm/drm_drv.h> #include <drm/drm_fb_cma_helper.h> #include <drm/drm_gem_cma_helper.h> #include <drm/drm_gem_framebuffer_helper.h>
drivers/gpu/drm/tinydrm/st7735r.c +1 -0
@@ -14,6 +14,7 @@#include <linux/spi/spi.h> #include <video/mipi_display.h> +#include <drm/drm_drv.h> #include <drm/drm_gem_cma_helper.h> #include <drm/drm_gem_framebuffer_helper.h> #include <drm/tinydrm/mipi-dbi.h>
Signature · 6 lines
2.12.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v3 12/12 drm: remove drmP.h from drm_gem_cma_helper.h
In reply to Sam RavnborgWith all dependencies fixed we can now remove drmP.h from drm_gem_cma_helper.h.
It is replaced by the include files required,
or forward declarations as appropritate.
--- include/drm/drm_gem_cma_helper.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
include/drm/drm_gem_cma_helper.h +4 -1
@@ -2,9 +2,12 @@#ifndef __DRM_GEM_CMA_HELPER_H__#define __DRM_GEM_CMA_HELPER_H__ -#include <drm/drmP.h> +#include <drm/drm_file.h> +#include <drm/drm_ioctl.h> #include <drm/drm_gem.h> +struct drm_mode_create_dumb ; +/** * struct drm_gem_cma_object - GEM object backed by CMA memory allocations * @base: base GEM object
Signature · 6 lines
2.12.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v3 12/12] drm: remove drmP.h from drm_gem_cma_helper.h
Quoted 5 lines · Sam Ravnborg
With all dependencies fixed we can now remove
drmP.hfromdrm_gem_cma_helper.h.
It is replaced by the include files required,
or forward declarations as appropritate.
Quoted 7 lines
Signed-off-by Sam Ravnborg <[email protected]>Acked-by Noralf Trønnes <[email protected]>Cc Maarten Lankhorst <[email protected]>Cc Maxime Ripard <[email protected]>Cc Sean Paul <[email protected]>Cc David Airlie <[email protected]>Cc Daniel Vetter <[email protected]>
Except for the ones I commented on, all patches applied. I also fixed the one typo in the summary.
Thanks, Daniel
Quoted 25 lines
--- include/drm/drm_gem_cma_helper.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)include/drm/drm_gem_cma_helper.h +4
-1@@ -2,9 +2,12 @@#ifndef __DRM_GEM_CMA_HELPER_H__#define __DRM_GEM_CMA_HELPER_H__ -#include <drm/drmP.h> +#include <drm/drm_file.h> +#include <drm/drm_ioctl.h> #include <drm/drm_gem.h> +struct drm_mode_create_dumb ; +/** * struct drm_gem_cma_object - GEM object backed by CMA memory allocations * @base: base GEM object Signature · 1 line
2.12.0
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v3 12/12] drm: remove drmP.h from drm_gem_cma_helper.h
Quoted 14 lines · Daniel Vetter
Quoted 5 lines · Sam Ravnborg
With all dependencies fixed we can now remove
drmP.hfromdrm_gem_cma_helper.h.
It is replaced by the include files required,
or forward declarations as appropritate.Quoted 7 lines
Signed-off-by Sam Ravnborg <[email protected]>Acked-by Noralf Trønnes <[email protected]>Cc Maarten Lankhorst <[email protected]>Cc Maxime Ripard <[email protected]>Cc Sean Paul <[email protected]>Cc David Airlie <[email protected]>Cc Daniel Vetter <[email protected]>
Quoted 2 lines
Except for the ones I commented on, all patches applied. I also fixed the one typo in the summary.
Thanks, I will rebase, address comments, do a new set of build tests etc. and repost.
Sam