1 From 3747cef056a2b6def75521dc2fd9157b009715e2 Mon Sep 17 00:00:00 2001
2 From: Stefan Schake <stschake@gmail.com>
3 Date: Fri, 9 Mar 2018 01:53:36 +0100
4 Subject: [PATCH 346/454] drm/vc4: Move plane state to header
6 commit 823646983b5a31732ae82ffa60b74555857eb8a0 upstream.
8 We need to reference it from the CRTC to make a decision for enabling
11 Signed-off-by: Stefan Schake <stschake@gmail.com>
12 Signed-off-by: Eric Anholt <eric@anholt.net>
13 Reviewed-by: Eric Anholt <eric@anholt.net>
14 Link: https://patchwork.freedesktop.org/patch/msgid/1520556817-97297-4-git-send-email-stschake@gmail.com
16 drivers/gpu/drm/vc4/vc4_drv.h | 60 +++++++++++++++++++++++++++++++++
17 drivers/gpu/drm/vc4/vc4_plane.c | 60 ---------------------------------
18 2 files changed, 60 insertions(+), 60 deletions(-)
20 --- a/drivers/gpu/drm/vc4/vc4_drv.h
21 +++ b/drivers/gpu/drm/vc4/vc4_drv.h
22 @@ -278,6 +278,66 @@ to_vc4_plane(struct drm_plane *plane)
23 return (struct vc4_plane *)plane;
26 +enum vc4_scaling_mode {
32 +struct vc4_plane_state {
33 + struct drm_plane_state base;
34 + /* System memory copy of the display list for this element, computed
35 + * at atomic_check time.
38 + u32 dlist_size; /* Number of dwords allocated for the display list */
39 + u32 dlist_count; /* Number of used dwords in the display list. */
41 + /* Offset in the dlist to various words, for pageflip or
48 + /* Offset where the plane's dlist was last stored in the
49 + * hardware at vc4_crtc_atomic_flush() time.
51 + u32 __iomem *hw_dlist;
53 + /* Clipped coordinates of the plane on the display. */
54 + int crtc_x, crtc_y, crtc_w, crtc_h;
55 + /* Clipped area being scanned from in the FB. */
58 + u32 src_w[2], src_h[2];
60 + /* Scaling selection for the RGB/Y plane and the Cb/Cr planes. */
61 + enum vc4_scaling_mode x_scaling[2], y_scaling[2];
65 + /* Offset to start scanning out from the start of the plane's
70 + /* Our allocation in LBM for temporary storage during scaling. */
71 + struct drm_mm_node lbm;
73 + /* Set when the plane has per-pixel alpha content or does not cover
74 + * the entire screen. This is a hint to the CRTC that it might need
75 + * to enable background color fill.
80 +static inline struct vc4_plane_state *
81 +to_vc4_plane_state(struct drm_plane_state *state)
83 + return (struct vc4_plane_state *)state;
86 enum vc4_encoder_type {
87 VC4_ENCODER_TYPE_NONE,
88 VC4_ENCODER_TYPE_HDMI,
89 --- a/drivers/gpu/drm/vc4/vc4_plane.c
90 +++ b/drivers/gpu/drm/vc4/vc4_plane.c
95 -enum vc4_scaling_mode {
101 -struct vc4_plane_state {
102 - struct drm_plane_state base;
103 - /* System memory copy of the display list for this element, computed
104 - * at atomic_check time.
107 - u32 dlist_size; /* Number of dwords allocated for the display list */
108 - u32 dlist_count; /* Number of used dwords in the display list. */
110 - /* Offset in the dlist to various words, for pageflip or
117 - /* Offset where the plane's dlist was last stored in the
118 - * hardware at vc4_crtc_atomic_flush() time.
120 - u32 __iomem *hw_dlist;
122 - /* Clipped coordinates of the plane on the display. */
123 - int crtc_x, crtc_y, crtc_w, crtc_h;
124 - /* Clipped area being scanned from in the FB. */
127 - u32 src_w[2], src_h[2];
129 - /* Scaling selection for the RGB/Y plane and the Cb/Cr planes. */
130 - enum vc4_scaling_mode x_scaling[2], y_scaling[2];
134 - /* Offset to start scanning out from the start of the plane's
139 - /* Our allocation in LBM for temporary storage during scaling. */
140 - struct drm_mm_node lbm;
142 - /* Set when the plane has per-pixel alpha content or does not cover
143 - * the entire screen. This is a hint to the CRTC that it might need
144 - * to enable background color fill.
146 - bool needs_bg_fill;
149 -static inline struct vc4_plane_state *
150 -to_vc4_plane_state(struct drm_plane_state *state)
152 - return (struct vc4_plane_state *)state;
155 static const struct hvs_format {
156 u32 drm; /* DRM_FORMAT_* */
157 u32 hvs; /* HVS_FORMAT_* */