Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm: Don't include <drm/drm_encoder.h> in <drm/drm_crtc.h>

<drm/drm_crtc.h> used to define most of the in-kernel KMS API. It has
now been split into separate files for each object type, but still
includes most other KMS headers to avoid breaking driver compilation.

As a step towards fixing that problem, remove the inclusion of
<drm/drm_encoder.h> from <drm/drm_crtc.h> and include it instead where
appropriate. Also remove the forward declarations of the drm_encoder and
drm_encoder_helper_funcs structures from <drm/drm_crtc.h> as they're not
needed in the header.

<drm/drm_encoder.h> now has to include <drm/drm_mode.h> and contain a
forward declaration of struct drm_encoder in order to allow including it
as the first header in a compilation unit.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Sinclair Yeh <syeh@vmware.com> # For vmwgfx
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Archit Taneja <architt@codeaurora.org>
Link: http://patchwork.freedesktop.org/patch/msgid/1481709550-29226-2-git-send-email-laurent.pinchart+renesas@ideasonboard.com

authored by

Laurent Pinchart and committed by
Archit Taneja
9338203c b44f97fd

+30 -3
+1
drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h
··· 32 32 33 33 #include <drm/drm_crtc.h> 34 34 #include <drm/drm_edid.h> 35 + #include <drm/drm_encoder.h> 35 36 #include <drm/drm_dp_helper.h> 36 37 #include <drm/drm_fixed.h> 37 38 #include <drm/drm_crtc_helper.h>
+1
drivers/gpu/drm/ast/ast_drv.h
··· 28 28 #ifndef __AST_DRV_H__ 29 29 #define __AST_DRV_H__ 30 30 31 + #include <drm/drm_encoder.h> 31 32 #include <drm/drm_fb_helper.h> 32 33 33 34 #include <drm/ttm/ttm_bo_api.h>
+1
drivers/gpu/drm/bochs/bochs.h
··· 4 4 #include <drm/drmP.h> 5 5 #include <drm/drm_crtc.h> 6 6 #include <drm/drm_crtc_helper.h> 7 + #include <drm/drm_encoder.h> 7 8 #include <drm/drm_fb_helper.h> 8 9 9 10 #include <drm/drm_gem.h>
+1
drivers/gpu/drm/cirrus/cirrus_drv.h
··· 13 13 14 14 #include <video/vga.h> 15 15 16 + #include <drm/drm_encoder.h> 16 17 #include <drm/drm_fb_helper.h> 17 18 18 19 #include <drm/ttm/ttm_bo_api.h>
+1
drivers/gpu/drm/drm_connector.c
··· 23 23 #include <drm/drmP.h> 24 24 #include <drm/drm_connector.h> 25 25 #include <drm/drm_edid.h> 26 + #include <drm/drm_encoder.h> 26 27 27 28 #include "drm_crtc_internal.h" 28 29 #include "drm_internal.h"
+1
drivers/gpu/drm/drm_crtc_helper.c
··· 36 36 #include <drm/drmP.h> 37 37 #include <drm/drm_atomic.h> 38 38 #include <drm/drm_crtc.h> 39 + #include <drm/drm_encoder.h> 39 40 #include <drm/drm_fourcc.h> 40 41 #include <drm/drm_crtc_helper.h> 41 42 #include <drm/drm_fb_helper.h>
+1
drivers/gpu/drm/drm_edid.c
··· 35 35 #include <linux/vga_switcheroo.h> 36 36 #include <drm/drmP.h> 37 37 #include <drm/drm_edid.h> 38 + #include <drm/drm_encoder.h> 38 39 #include <drm/drm_displayid.h> 39 40 40 41 #define version_greater(edid, maj, min) \
+1
drivers/gpu/drm/drm_mode_config.c
··· 20 20 * OF THIS SOFTWARE. 21 21 */ 22 22 23 + #include <drm/drm_encoder.h> 23 24 #include <drm/drm_mode_config.h> 24 25 #include <drm/drmP.h> 25 26
+1
drivers/gpu/drm/drm_of.c
··· 4 4 #include <linux/of_graph.h> 5 5 #include <drm/drmP.h> 6 6 #include <drm/drm_crtc.h> 7 + #include <drm/drm_encoder.h> 7 8 #include <drm/drm_of.h> 8 9 9 10 static void drm_release_of(struct device *dev, void *data)
+1
drivers/gpu/drm/drm_plane_helper.c
··· 29 29 #include <drm/drm_rect.h> 30 30 #include <drm/drm_atomic.h> 31 31 #include <drm/drm_crtc_helper.h> 32 + #include <drm/drm_encoder.h> 32 33 #include <drm/drm_atomic_helper.h> 33 34 34 35 #define SUBPIXEL_MASK 0xffff
+2
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.h
··· 12 12 #ifndef __FSL_DCU_DRM_DRV_H__ 13 13 #define __FSL_DCU_DRM_DRV_H__ 14 14 15 + #include <drm/drm_encoder.h> 16 + 15 17 #include "fsl_dcu_drm_crtc.h" 16 18 #include "fsl_dcu_drm_output.h" 17 19 #include "fsl_dcu_drm_plane.h"
+1
drivers/gpu/drm/gma500/psb_intel_drv.h
··· 23 23 #include <linux/i2c-algo-bit.h> 24 24 #include <drm/drm_crtc.h> 25 25 #include <drm/drm_crtc_helper.h> 26 + #include <drm/drm_encoder.h> 26 27 #include <linux/gpio.h> 27 28 #include "gma_display.h" 28 29
+1
drivers/gpu/drm/i915/intel_drv.h
··· 32 32 #include "i915_drv.h" 33 33 #include <drm/drm_crtc.h> 34 34 #include <drm/drm_crtc_helper.h> 35 + #include <drm/drm_encoder.h> 35 36 #include <drm/drm_fb_helper.h> 36 37 #include <drm/drm_dp_dual_mode_helper.h> 37 38 #include <drm/drm_dp_mst_helper.h>
+1
drivers/gpu/drm/mgag200/mgag200_drv.h
··· 15 15 16 16 #include <video/vga.h> 17 17 18 + #include <drm/drm_encoder.h> 18 19 #include <drm/drm_fb_helper.h> 19 20 #include <drm/ttm/ttm_bo_api.h> 20 21 #include <drm/ttm/ttm_bo_driver.h>
+1
drivers/gpu/drm/nouveau/nouveau_connector.h
··· 30 30 #include <nvif/notify.h> 31 31 32 32 #include <drm/drm_edid.h> 33 + #include <drm/drm_encoder.h> 33 34 #include <drm/drm_dp_helper.h> 34 35 #include "nouveau_crtc.h" 35 36
+1
drivers/gpu/drm/qxl/qxl_drv.h
··· 43 43 #include <ttm/ttm_placement.h> 44 44 #include <ttm/ttm_module.h> 45 45 46 + #include <drm/drm_encoder.h> 46 47 #include <drm/drm_gem.h> 47 48 48 49 /* just for ttm_validate_buffer */
+1
drivers/gpu/drm/radeon/radeon_mode.h
··· 32 32 33 33 #include <drm/drm_crtc.h> 34 34 #include <drm/drm_edid.h> 35 + #include <drm/drm_encoder.h> 35 36 #include <drm/drm_dp_helper.h> 36 37 #include <drm/drm_dp_mst_helper.h> 37 38 #include <drm/drm_fixed.h>
+1
drivers/gpu/drm/rcar-du/rcar_du_encoder.h
··· 15 15 #define __RCAR_DU_ENCODER_H__ 16 16 17 17 #include <drm/drm_crtc.h> 18 + #include <drm/drm_encoder.h> 18 19 19 20 struct rcar_du_device; 20 21 struct rcar_du_hdmienc;
+1
drivers/gpu/drm/shmobile/shmob_drm_crtc.h
··· 16 16 17 17 #include <drm/drmP.h> 18 18 #include <drm/drm_crtc.h> 19 + #include <drm/drm_encoder.h> 19 20 20 21 struct backlight_device; 21 22 struct shmob_drm_device;
+1
drivers/gpu/drm/tegra/drm.h
··· 17 17 #include <drm/drmP.h> 18 18 #include <drm/drm_crtc_helper.h> 19 19 #include <drm/drm_edid.h> 20 + #include <drm/drm_encoder.h> 20 21 #include <drm/drm_fb_helper.h> 21 22 #include <drm/drm_fixed.h> 22 23
+2
drivers/gpu/drm/vc4/vc4_drv.h
··· 9 9 #include "drmP.h" 10 10 #include "drm_gem_cma_helper.h" 11 11 12 + #include <drm/drm_encoder.h> 13 + 12 14 struct vc4_dev { 13 15 struct drm_device *dev; 14 16
+1
drivers/gpu/drm/virtio/virtgpu_drv.h
··· 35 35 #include <drm/drm_gem.h> 36 36 #include <drm/drm_atomic.h> 37 37 #include <drm/drm_crtc_helper.h> 38 + #include <drm/drm_encoder.h> 38 39 #include <ttm/ttm_bo_api.h> 39 40 #include <ttm/ttm_bo_driver.h> 40 41 #include <ttm/ttm_placement.h>
+1
drivers/gpu/drm/vmwgfx/vmwgfx_kms.h
··· 30 30 31 31 #include <drm/drmP.h> 32 32 #include <drm/drm_crtc_helper.h> 33 + #include <drm/drm_encoder.h> 33 34 #include "vmwgfx_drv.h" 34 35 35 36 /**
-3
include/drm/drm_crtc.h
··· 39 39 #include <drm/drm_framebuffer.h> 40 40 #include <drm/drm_modes.h> 41 41 #include <drm/drm_connector.h> 42 - #include <drm/drm_encoder.h> 43 42 #include <drm/drm_property.h> 44 43 #include <drm/drm_bridge.h> 45 44 #include <drm/drm_edid.h> ··· 67 68 } 68 69 69 70 struct drm_crtc; 70 - struct drm_encoder; 71 71 struct drm_pending_vblank_event; 72 72 struct drm_plane; 73 73 struct drm_bridge; 74 74 struct drm_atomic_state; 75 75 76 76 struct drm_crtc_helper_funcs; 77 - struct drm_encoder_helper_funcs; 78 77 struct drm_plane_helper_funcs; 79 78 80 79 /**
+3
include/drm/drm_encoder.h
··· 25 25 26 26 #include <linux/list.h> 27 27 #include <linux/ctype.h> 28 + #include <drm/drm_mode.h> 28 29 #include <drm/drm_mode_object.h> 30 + 31 + struct drm_encoder; 29 32 30 33 /** 31 34 * struct drm_encoder_funcs - encoder controls
+1
include/drm/drm_encoder_slave.h
··· 29 29 30 30 #include <drm/drmP.h> 31 31 #include <drm/drm_crtc.h> 32 + #include <drm/drm_encoder.h> 32 33 33 34 /** 34 35 * struct drm_encoder_slave_funcs - Entry points exposed by a slave encoder driver
+1
include/drm/drm_modeset_helper_vtables.h
··· 30 30 #define __DRM_MODESET_HELPER_VTABLES_H__ 31 31 32 32 #include <drm/drm_crtc.h> 33 + #include <drm/drm_encoder.h> 33 34 34 35 /** 35 36 * DOC: overview