bcm27xx: import latest patches from the RPi foundation
[openwrt/staging/noltari.git] / target / linux / bcm27xx / patches-5.4 / 950-0547-drm-vc4-crtc-Move-crtc-state-to-common-header.patch
1 From 05293c3b61cdeb0004722cc86e03123183557de1 Mon Sep 17 00:00:00 2001
2 From: Maxime Ripard <maxime@cerno.tech>
3 Date: Thu, 26 Dec 2019 15:45:04 +0100
4 Subject: [PATCH] drm/vc4: crtc: Move crtc state to common header
5
6 We'll need to access the crtc_state from outside of vc4_crtc.c, so let's
7 move it to vc4_drv.h
8
9 Signed-off-by: Maxime Ripard <maxime@cerno.tech>
10 ---
11 drivers/gpu/drm/vc4/vc4_crtc.c | 21 ---------------------
12 drivers/gpu/drm/vc4/vc4_drv.h | 21 +++++++++++++++++++++
13 2 files changed, 21 insertions(+), 21 deletions(-)
14
15 --- a/drivers/gpu/drm/vc4/vc4_crtc.c
16 +++ b/drivers/gpu/drm/vc4/vc4_crtc.c
17 @@ -44,27 +44,6 @@
18 #include "vc4_drv.h"
19 #include "vc4_regs.h"
20
21 -struct vc4_crtc_state {
22 - struct drm_crtc_state base;
23 - /* Dlist area for this CRTC configuration. */
24 - struct drm_mm_node mm;
25 - bool feed_txp;
26 - bool txp_armed;
27 -
28 - struct {
29 - unsigned int left;
30 - unsigned int right;
31 - unsigned int top;
32 - unsigned int bottom;
33 - } margins;
34 -};
35 -
36 -static inline struct vc4_crtc_state *
37 -to_vc4_crtc_state(struct drm_crtc_state *crtc_state)
38 -{
39 - return (struct vc4_crtc_state *)crtc_state;
40 -}
41 -
42 #define CRTC_WRITE(offset, val) writel(val, vc4_crtc->regs + (offset))
43 #define CRTC_READ(offset) readl(vc4_crtc->regs + (offset))
44
45 --- a/drivers/gpu/drm/vc4/vc4_drv.h
46 +++ b/drivers/gpu/drm/vc4/vc4_drv.h
47 @@ -488,6 +488,27 @@ to_vc4_crtc(struct drm_crtc *crtc)
48 return (struct vc4_crtc *)crtc;
49 }
50
51 +struct vc4_crtc_state {
52 + struct drm_crtc_state base;
53 + /* Dlist area for this CRTC configuration. */
54 + struct drm_mm_node mm;
55 + bool feed_txp;
56 + bool txp_armed;
57 +
58 + struct {
59 + unsigned int left;
60 + unsigned int right;
61 + unsigned int top;
62 + unsigned int bottom;
63 + } margins;
64 +};
65 +
66 +static inline struct vc4_crtc_state *
67 +to_vc4_crtc_state(struct drm_crtc_state *crtc_state)
68 +{
69 + return (struct vc4_crtc_state *)crtc_state;
70 +}
71 +
72 #define V3D_READ(offset) readl(vc4->v3d->regs + offset)
73 #define V3D_WRITE(offset, val) writel(val, vc4->v3d->regs + offset)
74 #define HVS_READ(offset) readl(vc4->hvs->regs + offset)