Skip to content

Commit

Permalink
drm: Don't include <drm/drm_encoder.h> in <drm/drm_crtc.h>
Browse files Browse the repository at this point in the history
<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 <[email protected]>
Reviewed-by: Daniel Vetter <[email protected]>
Reviewed-by: Sinclair Yeh <[email protected]> # For vmwgfx
Reviewed-by: Alex Deucher <[email protected]>
Signed-off-by: Archit Taneja <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/1481709550-29226-2-git-send-email-laurent.pinchart+renesas@ideasonboard.com
  • Loading branch information
Laurent Pinchart authored and boddob committed Dec 18, 2016
1 parent b44f97f commit 9338203
Show file tree
Hide file tree
Showing 27 changed files with 30 additions and 3 deletions.
1 change: 1 addition & 0 deletions drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

#include <drm/drm_crtc.h>
#include <drm/drm_edid.h>
#include <drm/drm_encoder.h>
#include <drm/drm_dp_helper.h>
#include <drm/drm_fixed.h>
#include <drm/drm_crtc_helper.h>
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/ast/ast_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#ifndef __AST_DRV_H__
#define __AST_DRV_H__

#include <drm/drm_encoder.h>
#include <drm/drm_fb_helper.h>

#include <drm/ttm/ttm_bo_api.h>
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/bochs/bochs.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <drm/drmP.h>
#include <drm/drm_crtc.h>
#include <drm/drm_crtc_helper.h>
#include <drm/drm_encoder.h>
#include <drm/drm_fb_helper.h>

#include <drm/drm_gem.h>
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/cirrus/cirrus_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

#include <video/vga.h>

#include <drm/drm_encoder.h>
#include <drm/drm_fb_helper.h>

#include <drm/ttm/ttm_bo_api.h>
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/drm_connector.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <drm/drmP.h>
#include <drm/drm_connector.h>
#include <drm/drm_edid.h>
#include <drm/drm_encoder.h>

#include "drm_crtc_internal.h"
#include "drm_internal.h"
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/drm_crtc_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include <drm/drmP.h>
#include <drm/drm_atomic.h>
#include <drm/drm_crtc.h>
#include <drm/drm_encoder.h>
#include <drm/drm_fourcc.h>
#include <drm/drm_crtc_helper.h>
#include <drm/drm_fb_helper.h>
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/drm_edid.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include <linux/vga_switcheroo.h>
#include <drm/drmP.h>
#include <drm/drm_edid.h>
#include <drm/drm_encoder.h>
#include <drm/drm_displayid.h>

#define version_greater(edid, maj, min) \
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/drm_mode_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
* OF THIS SOFTWARE.
*/

#include <drm/drm_encoder.h>
#include <drm/drm_mode_config.h>
#include <drm/drmP.h>

Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/drm_of.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <linux/of_graph.h>
#include <drm/drmP.h>
#include <drm/drm_crtc.h>
#include <drm/drm_encoder.h>
#include <drm/drm_of.h>

static void drm_release_of(struct device *dev, void *data)
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/drm_plane_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <drm/drm_rect.h>
#include <drm/drm_atomic.h>
#include <drm/drm_crtc_helper.h>
#include <drm/drm_encoder.h>
#include <drm/drm_atomic_helper.h>

#define SUBPIXEL_MASK 0xffff
Expand Down
2 changes: 2 additions & 0 deletions drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
#ifndef __FSL_DCU_DRM_DRV_H__
#define __FSL_DCU_DRM_DRV_H__

#include <drm/drm_encoder.h>

#include "fsl_dcu_drm_crtc.h"
#include "fsl_dcu_drm_output.h"
#include "fsl_dcu_drm_plane.h"
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/gma500/psb_intel_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <linux/i2c-algo-bit.h>
#include <drm/drm_crtc.h>
#include <drm/drm_crtc_helper.h>
#include <drm/drm_encoder.h>
#include <linux/gpio.h>
#include "gma_display.h"

Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/i915/intel_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include "i915_drv.h"
#include <drm/drm_crtc.h>
#include <drm/drm_crtc_helper.h>
#include <drm/drm_encoder.h>
#include <drm/drm_fb_helper.h>
#include <drm/drm_dp_dual_mode_helper.h>
#include <drm/drm_dp_mst_helper.h>
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/mgag200/mgag200_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

#include <video/vga.h>

#include <drm/drm_encoder.h>
#include <drm/drm_fb_helper.h>
#include <drm/ttm/ttm_bo_api.h>
#include <drm/ttm/ttm_bo_driver.h>
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/nouveau/nouveau_connector.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include <nvif/notify.h>

#include <drm/drm_edid.h>
#include <drm/drm_encoder.h>
#include <drm/drm_dp_helper.h>
#include "nouveau_crtc.h"

Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/qxl/qxl_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
#include <ttm/ttm_placement.h>
#include <ttm/ttm_module.h>

#include <drm/drm_encoder.h>
#include <drm/drm_gem.h>

/* just for ttm_validate_buffer */
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/radeon/radeon_mode.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

#include <drm/drm_crtc.h>
#include <drm/drm_edid.h>
#include <drm/drm_encoder.h>
#include <drm/drm_dp_helper.h>
#include <drm/drm_dp_mst_helper.h>
#include <drm/drm_fixed.h>
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/rcar-du/rcar_du_encoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#define __RCAR_DU_ENCODER_H__

#include <drm/drm_crtc.h>
#include <drm/drm_encoder.h>

struct rcar_du_device;
struct rcar_du_hdmienc;
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/shmobile/shmob_drm_crtc.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

#include <drm/drmP.h>
#include <drm/drm_crtc.h>
#include <drm/drm_encoder.h>

struct backlight_device;
struct shmob_drm_device;
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/tegra/drm.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <drm/drmP.h>
#include <drm/drm_crtc_helper.h>
#include <drm/drm_edid.h>
#include <drm/drm_encoder.h>
#include <drm/drm_fb_helper.h>
#include <drm/drm_fixed.h>

Expand Down
2 changes: 2 additions & 0 deletions drivers/gpu/drm/vc4/vc4_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#include "drmP.h"
#include "drm_gem_cma_helper.h"

#include <drm/drm_encoder.h>

struct vc4_dev {
struct drm_device *dev;

Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/virtio/virtgpu_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include <drm/drm_gem.h>
#include <drm/drm_atomic.h>
#include <drm/drm_crtc_helper.h>
#include <drm/drm_encoder.h>
#include <ttm/ttm_bo_api.h>
#include <ttm/ttm_bo_driver.h>
#include <ttm/ttm_placement.h>
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/vmwgfx/vmwgfx_kms.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

#include <drm/drmP.h>
#include <drm/drm_crtc_helper.h>
#include <drm/drm_encoder.h>
#include "vmwgfx_drv.h"

/**
Expand Down
3 changes: 0 additions & 3 deletions include/drm/drm_crtc.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
#include <drm/drm_framebuffer.h>
#include <drm/drm_modes.h>
#include <drm/drm_connector.h>
#include <drm/drm_encoder.h>
#include <drm/drm_property.h>
#include <drm/drm_bridge.h>
#include <drm/drm_edid.h>
Expand Down Expand Up @@ -68,14 +67,12 @@ static inline uint64_t I642U64(int64_t val)
}

struct drm_crtc;
struct drm_encoder;
struct drm_pending_vblank_event;
struct drm_plane;
struct drm_bridge;
struct drm_atomic_state;

struct drm_crtc_helper_funcs;
struct drm_encoder_helper_funcs;
struct drm_plane_helper_funcs;

/**
Expand Down
3 changes: 3 additions & 0 deletions include/drm/drm_encoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,11 @@

#include <linux/list.h>
#include <linux/ctype.h>
#include <drm/drm_mode.h>
#include <drm/drm_mode_object.h>

struct drm_encoder;

/**
* struct drm_encoder_funcs - encoder controls
*
Expand Down
1 change: 1 addition & 0 deletions include/drm/drm_encoder_slave.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

#include <drm/drmP.h>
#include <drm/drm_crtc.h>
#include <drm/drm_encoder.h>

/**
* struct drm_encoder_slave_funcs - Entry points exposed by a slave encoder driver
Expand Down
1 change: 1 addition & 0 deletions include/drm/drm_modeset_helper_vtables.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#define __DRM_MODESET_HELPER_VTABLES_H__

#include <drm/drm_crtc.h>
#include <drm/drm_encoder.h>

/**
* DOC: overview
Expand Down

0 comments on commit 9338203

Please sign in to comment.