Skip to content

Commit 9563c45

Browse files
stschakePhil Elwell
authored and
Phil Elwell
committed
drm/vc4: Move plane state to header
commit 8236469 upstream. We need to reference it from the CRTC to make a decision for enabling background color fill. Signed-off-by: Stefan Schake <[email protected]> Signed-off-by: Eric Anholt <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 3d4165e commit 9563c45

File tree

2 files changed

+60
-60
lines changed

2 files changed

+60
-60
lines changed

drivers/gpu/drm/vc4/vc4_drv.h

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,66 @@ to_vc4_plane(struct drm_plane *plane)
278278
return (struct vc4_plane *)plane;
279279
}
280280

281+
enum vc4_scaling_mode {
282+
VC4_SCALING_NONE,
283+
VC4_SCALING_TPZ,
284+
VC4_SCALING_PPF,
285+
};
286+
287+
struct vc4_plane_state {
288+
struct drm_plane_state base;
289+
/* System memory copy of the display list for this element, computed
290+
* at atomic_check time.
291+
*/
292+
u32 *dlist;
293+
u32 dlist_size; /* Number of dwords allocated for the display list */
294+
u32 dlist_count; /* Number of used dwords in the display list. */
295+
296+
/* Offset in the dlist to various words, for pageflip or
297+
* cursor updates.
298+
*/
299+
u32 pos0_offset;
300+
u32 pos2_offset;
301+
u32 ptr0_offset;
302+
303+
/* Offset where the plane's dlist was last stored in the
304+
* hardware at vc4_crtc_atomic_flush() time.
305+
*/
306+
u32 __iomem *hw_dlist;
307+
308+
/* Clipped coordinates of the plane on the display. */
309+
int crtc_x, crtc_y, crtc_w, crtc_h;
310+
/* Clipped area being scanned from in the FB. */
311+
u32 src_x, src_y;
312+
313+
u32 src_w[2], src_h[2];
314+
315+
/* Scaling selection for the RGB/Y plane and the Cb/Cr planes. */
316+
enum vc4_scaling_mode x_scaling[2], y_scaling[2];
317+
bool is_unity;
318+
bool is_yuv;
319+
320+
/* Offset to start scanning out from the start of the plane's
321+
* BO.
322+
*/
323+
u32 offsets[3];
324+
325+
/* Our allocation in LBM for temporary storage during scaling. */
326+
struct drm_mm_node lbm;
327+
328+
/* Set when the plane has per-pixel alpha content or does not cover
329+
* the entire screen. This is a hint to the CRTC that it might need
330+
* to enable background color fill.
331+
*/
332+
bool needs_bg_fill;
333+
};
334+
335+
static inline struct vc4_plane_state *
336+
to_vc4_plane_state(struct drm_plane_state *state)
337+
{
338+
return (struct vc4_plane_state *)state;
339+
}
340+
281341
enum vc4_encoder_type {
282342
VC4_ENCODER_TYPE_NONE,
283343
VC4_ENCODER_TYPE_HDMI,

drivers/gpu/drm/vc4/vc4_plane.c

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -27,66 +27,6 @@
2727
#include "vc4_drv.h"
2828
#include "vc4_regs.h"
2929

30-
enum vc4_scaling_mode {
31-
VC4_SCALING_NONE,
32-
VC4_SCALING_TPZ,
33-
VC4_SCALING_PPF,
34-
};
35-
36-
struct vc4_plane_state {
37-
struct drm_plane_state base;
38-
/* System memory copy of the display list for this element, computed
39-
* at atomic_check time.
40-
*/
41-
u32 *dlist;
42-
u32 dlist_size; /* Number of dwords allocated for the display list */
43-
u32 dlist_count; /* Number of used dwords in the display list. */
44-
45-
/* Offset in the dlist to various words, for pageflip or
46-
* cursor updates.
47-
*/
48-
u32 pos0_offset;
49-
u32 pos2_offset;
50-
u32 ptr0_offset;
51-
52-
/* Offset where the plane's dlist was last stored in the
53-
* hardware at vc4_crtc_atomic_flush() time.
54-
*/
55-
u32 __iomem *hw_dlist;
56-
57-
/* Clipped coordinates of the plane on the display. */
58-
int crtc_x, crtc_y, crtc_w, crtc_h;
59-
/* Clipped area being scanned from in the FB. */
60-
u32 src_x, src_y;
61-
62-
u32 src_w[2], src_h[2];
63-
64-
/* Scaling selection for the RGB/Y plane and the Cb/Cr planes. */
65-
enum vc4_scaling_mode x_scaling[2], y_scaling[2];
66-
bool is_unity;
67-
bool is_yuv;
68-
69-
/* Offset to start scanning out from the start of the plane's
70-
* BO.
71-
*/
72-
u32 offsets[3];
73-
74-
/* Our allocation in LBM for temporary storage during scaling. */
75-
struct drm_mm_node lbm;
76-
77-
/* Set when the plane has per-pixel alpha content or does not cover
78-
* the entire screen. This is a hint to the CRTC that it might need
79-
* to enable background color fill.
80-
*/
81-
bool needs_bg_fill;
82-
};
83-
84-
static inline struct vc4_plane_state *
85-
to_vc4_plane_state(struct drm_plane_state *state)
86-
{
87-
return (struct vc4_plane_state *)state;
88-
}
89-
9030
static const struct hvs_format {
9131
u32 drm; /* DRM_FORMAT_* */
9232
u32 hvs; /* HVS_FORMAT_* */

0 commit comments

Comments
 (0)