summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/zte/zx_plane.c
diff options
context:
space:
mode:
authorShawn Guo <shawn.guo@linaro.org>2016-12-29 03:03:03 +0300
committerShawn Guo <shawn.guo@linaro.org>2017-01-28 05:17:40 +0300
commit7254b1f91ebc221ef71f7b23129a2ec0558e50cb (patch)
treef362a64318e12f572d9cae3122e5857eeb372660 /drivers/gpu/drm/zte/zx_plane.c
parent98ae9869d187ab737b5b231e7879d15e1e9a763d (diff)
downloadlinux-7254b1f91ebc221ef71f7b23129a2ec0558e50cb.tar.xz
drm: zte: add .atomic_disable hook to disable graphic layer
There are a few hardware bits for each graphic layer to control main/aux channel and clock selection, as well as the layer enabling. These bits sit outside the layer block itself, but in VOU control glue block. We currently set these bits up at CRTC initialization for once, and do not support disabling the layer. This patch creates a pair of functions zx_vou_layer_enable[disable] to be invoked from plane hooks .atomic_update and .atomic_disable to set up and tear down the layer. This is generic for both graphic and video layers, so it will make the overlay plane support to be added later much easier. Signed-off-by: Shawn Guo <shawn.guo@linaro.org> Reviewed-by: Sean Paul <seanpaul@chromium.org>
Diffstat (limited to 'drivers/gpu/drm/zte/zx_plane.c')
-rw-r--r--drivers/gpu/drm/zte/zx_plane.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/gpu/drm/zte/zx_plane.c b/drivers/gpu/drm/zte/zx_plane.c
index 78d29b1db91c..5445eebf830f 100644
--- a/drivers/gpu/drm/zte/zx_plane.c
+++ b/drivers/gpu/drm/zte/zx_plane.c
@@ -197,12 +197,27 @@ static void zx_gl_plane_atomic_update(struct drm_plane *plane,
/* Enable HBSC block */
zx_writel_mask(hbsc + HBSC_CTRL0, HBSC_CTRL_EN, HBSC_CTRL_EN);
+ zx_vou_layer_enable(plane);
+
zx_gl_set_update(zplane);
}
+static void zx_plane_atomic_disable(struct drm_plane *plane,
+ struct drm_plane_state *old_state)
+{
+ struct zx_plane *zplane = to_zx_plane(plane);
+ void __iomem *hbsc = zplane->hbsc;
+
+ zx_vou_layer_disable(plane);
+
+ /* Disable HBSC block */
+ zx_writel_mask(hbsc + HBSC_CTRL0, HBSC_CTRL_EN, 0);
+}
+
static const struct drm_plane_helper_funcs zx_gl_plane_helper_funcs = {
.atomic_check = zx_gl_plane_atomic_check,
.atomic_update = zx_gl_plane_atomic_update,
+ .atomic_disable = zx_plane_atomic_disable,
};
static void zx_plane_destroy(struct drm_plane *plane)