From c76426883c8f44bc7d2aee123e28867c67b87384 Mon Sep 17 00:00:00 2001 From: Jani Nikula Date: Fri, 28 Dec 2018 15:04:46 +0200 Subject: drm: un-inline drm_legacy_findmap() Un-inline drm_legacy_findmap() to not depend on struct drm_device definition within drm_legacy.h, so that a forward declaration suffices. Also include drm_hashtab.h in drm_legacy.h to make it more self-contained. Make it easier to drop drmP.h includes. v2: avoid including drm_device.h by un-inlining (Daniel) [Updated commit message per Laurent's review while applying.] Cc: Sam Ravnborg Cc: Daniel Vetter Cc: Laurent Pinchart Reviewed-by: Daniel Vetter Reviewed-by: Laurent Pinchart Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20181228130446.22141-1-jani.nikula@intel.com --- include/drm/drm_legacy.h | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'include/drm') diff --git a/include/drm/drm_legacy.h b/include/drm/drm_legacy.h index 8fad66f88e4f..3e99ab69c122 100644 --- a/include/drm/drm_legacy.h +++ b/include/drm/drm_legacy.h @@ -2,6 +2,9 @@ #define __DRM_DRM_LEGACY_H__ #include +#include + +struct drm_device; /* * Legacy driver interfaces for the Direct Rendering Manager @@ -156,6 +159,7 @@ struct drm_map_list { int drm_legacy_addmap(struct drm_device *d, resource_size_t offset, unsigned int size, enum drm_map_type type, enum drm_map_flags flags, struct drm_local_map **map_p); +struct drm_local_map *drm_legacy_findmap(struct drm_device *dev, unsigned int token); void drm_legacy_rmmap(struct drm_device *d, struct drm_local_map *map); int drm_legacy_rmmap_locked(struct drm_device *d, struct drm_local_map *map); void drm_legacy_master_rmmaps(struct drm_device *dev, @@ -194,14 +198,4 @@ void drm_legacy_ioremap(struct drm_local_map *map, struct drm_device *dev); void drm_legacy_ioremap_wc(struct drm_local_map *map, struct drm_device *dev); void drm_legacy_ioremapfree(struct drm_local_map *map, struct drm_device *dev); -static inline struct drm_local_map *drm_legacy_findmap(struct drm_device *dev, - unsigned int token) -{ - struct drm_map_list *_entry; - list_for_each_entry(_entry, &dev->maplist, head) - if (_entry->user_token == token) - return _entry->map; - return NULL; -} - #endif /* __DRM_DRM_LEGACY_H__ */ -- cgit v1.2.3 From 5c27b9fafeadc919fd58a3b4fbd718a1cb7b1b1a Mon Sep 17 00:00:00 2001 From: Jani Nikula Date: Thu, 27 Dec 2018 14:56:37 +0200 Subject: drm: include kernel.h and agp_backend.h from intel-gtt.h intel-gtt.h uses kernel and agp pointers, make it self-contained by including the relevant headers. This prepares for dropping drmP.h from files including intel-gtt.h. [Updated commit message per Laurent's review while applying.] Cc: Sam Ravnborg Cc: Daniel Vetter Cc: Laurent Pinchart Reviewed-by: Daniel Vetter Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/9414800f89d6f326c6e9173233bf6c4dee254d9a.1545915059.git.jani.nikula@intel.com --- include/drm/intel-gtt.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/drm') diff --git a/include/drm/intel-gtt.h b/include/drm/intel-gtt.h index 2324c84a25c0..71d81923e6b0 100644 --- a/include/drm/intel-gtt.h +++ b/include/drm/intel-gtt.h @@ -4,6 +4,9 @@ #ifndef _DRM_INTEL_GTT_H #define _DRM_INTEL_GTT_H +#include +#include + void intel_gtt_get(u64 *gtt_total, phys_addr_t *mappable_base, resource_size_t *mappable_end); -- cgit v1.2.3 From 39e23674809b0fab008e32c268d7c5ef4a019c8b Mon Sep 17 00:00:00 2001 From: Jani Nikula Date: Thu, 27 Dec 2018 14:56:38 +0200 Subject: drm: include idr.h from drm_file.h drm_file.h embeds idr structures in DRM-specific structures. Include the corresponding header to make drm_file.h self-contained. Make it easier to drop drmP.h includes. [Updated commit message per Laurent's review while applying.] Cc: Sam Ravnborg Cc: Daniel Vetter Cc: Laurent Pinchart Reviewed-by: Daniel Vetter Reviewed-by: Laurent Pinchart Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/2818b15332ab562722dfc324cf977b7eb4a04401.1545915059.git.jani.nikula@intel.com --- include/drm/drm_file.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/drm') diff --git a/include/drm/drm_file.h b/include/drm/drm_file.h index 84ac79219e4c..6710b612e2f6 100644 --- a/include/drm/drm_file.h +++ b/include/drm/drm_file.h @@ -32,6 +32,7 @@ #include #include +#include #include -- cgit v1.2.3 From f7e271de230b20ea3f9cecf71c45ca23c58aa055 Mon Sep 17 00:00:00 2001 From: Jani Nikula Date: Thu, 27 Dec 2018 14:56:39 +0200 Subject: drm: include types.h from drm_hdcp.h drm_hdcp.h uses kernel integer types, make it self-contained by including linux/kernel.h. This prepares for dropping drmP.h from files including drm_hdcp.h. [Updated commit message per Laurent's review while applying.] Cc: Sam Ravnborg Cc: Daniel Vetter Cc: Laurent Pinchart Reviewed-by: Daniel Vetter Reviewed-by: Laurent Pinchart Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/adfc79941e827b49eb6186f317cbeff0fb365f33.1545915059.git.jani.nikula@intel.com --- include/drm/drm_hdcp.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/drm') diff --git a/include/drm/drm_hdcp.h b/include/drm/drm_hdcp.h index a6de09c5e47f..d6dfef8cff6a 100644 --- a/include/drm/drm_hdcp.h +++ b/include/drm/drm_hdcp.h @@ -9,6 +9,8 @@ #ifndef _DRM_HDCP_H_INCLUDED_ #define _DRM_HDCP_H_INCLUDED_ +#include + /* Period of hdcp checks (to ensure we're still authenticated) */ #define DRM_HDCP_CHECK_PERIOD_MS (128 * 16) -- cgit v1.2.3 From dd7ece7f6e220e4d1a2a8ba4c42622d7d73e6376 Mon Sep 17 00:00:00 2001 From: Jani Nikula Date: Fri, 28 Dec 2018 10:28:15 +0200 Subject: drm: forward declare struct drm_file in drm_syncobj.h drm_syncobj.h uses struct drm_file pointers, forward declare struct drm_file to make the header self-contained. This prepares for dropping drmP.h from files including drm_syncobj.h. Switch from "" to <> includes while at it. v2: forward declare instead of including drm_file.h (Daniel) [Updated commit message per Laurent's review while applying.] Cc: Sam Ravnborg Cc: Daniel Vetter Cc: Laurent Pinchart Reviewed-by: Daniel Vetter Reviewed-by: Laurent Pinchart Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20181228082815.10797-1-jani.nikula@intel.com --- include/drm/drm_syncobj.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include/drm') diff --git a/include/drm/drm_syncobj.h b/include/drm/drm_syncobj.h index 29244cbcd05e..ef5721512632 100644 --- a/include/drm/drm_syncobj.h +++ b/include/drm/drm_syncobj.h @@ -26,7 +26,9 @@ #ifndef __DRM_SYNCOBJ_H__ #define __DRM_SYNCOBJ_H__ -#include "linux/dma-fence.h" +#include + +struct drm_file; struct drm_syncobj_cb; -- cgit v1.2.3