summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/arm
diff options
context:
space:
mode:
authorAyan Kumar Halder <ayan.halder@arm.com>2018-04-10 19:25:03 +0100
committerLiviu Dudau <Liviu.Dudau@arm.com>2018-06-18 18:02:42 +0100
commitad7fda2e378f4356df621a39655f7c200b495d81 (patch)
treea743f97438384b1946b4a2c51b4e487f065d30b0 /drivers/gpu/drm/arm
parent89610dc2c235e7b02bb9fba0ce247e12d4dde7cd (diff)
drm/arm/malidp: Preserve LAYER_FORMAT contents when setting format
On some Mali-DP processors, the LAYER_FORMAT register contains fields other than the format. These bits were unconditionally cleared when setting the pixel format, whereas they should be preserved at their reset values. Reported-by: Brian Starkey <brian.starkey@arm.com> Reported-by: Liviu Dudau <liviu.dudau@arm.com> Signed-off-by: Ayan Kumar halder <ayan.halder@arm.com> Acked-by: Liviu Dudau <liviu.dudau@arm.com> Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>
Diffstat (limited to 'drivers/gpu/drm/arm')
-rw-r--r--drivers/gpu/drm/arm/malidp_planes.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/gpu/drm/arm/malidp_planes.c b/drivers/gpu/drm/arm/malidp_planes.c
index 7a44897c50fe..4af3c1fabb23 100644
--- a/drivers/gpu/drm/arm/malidp_planes.c
+++ b/drivers/gpu/drm/arm/malidp_planes.c
@@ -23,6 +23,7 @@
/* Layer specific register offsets */
#define MALIDP_LAYER_FORMAT 0x000
+#define LAYER_FORMAT_MASK 0x3f
#define MALIDP_LAYER_CONTROL 0x004
#define LAYER_ENABLE (1 << 0)
#define LAYER_FLOWCFG_MASK 7
@@ -337,7 +338,9 @@ static void malidp_de_plane_update(struct drm_plane *plane,
dest_w = plane->state->crtc_w;
dest_h = plane->state->crtc_h;
- malidp_hw_write(mp->hwdev, ms->format, mp->layer->base);
+ val = malidp_hw_read(mp->hwdev, mp->layer->base);
+ val = (val & ~LAYER_FORMAT_MASK) | ms->format;
+ malidp_hw_write(mp->hwdev, val, mp->layer->base);
for (i = 0; i < ms->n_planes; i++) {
/* calculate the offset for the layer's plane registers */