Commit 6bcd5cdf authored by Ayan Kumar Halder's avatar Ayan Kumar Halder Committed by Greg Kroah-Hartman

drm/arm/malidp: Preserve LAYER_FORMAT contents when setting format

[ Upstream commit ad7fda2e ]

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: default avatarBrian Starkey <brian.starkey@arm.com>
Reported-by: default avatarLiviu Dudau <liviu.dudau@arm.com>
Signed-off-by: default avatarAyan Kumar halder <ayan.halder@arm.com>
Acked-by: default avatarLiviu Dudau <liviu.dudau@arm.com>
Signed-off-by: default avatarLiviu Dudau <liviu.dudau@arm.com>
Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 0a43cd3e
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
/* Layer specific register offsets */ /* Layer specific register offsets */
#define MALIDP_LAYER_FORMAT 0x000 #define MALIDP_LAYER_FORMAT 0x000
#define LAYER_FORMAT_MASK 0x3f
#define MALIDP_LAYER_CONTROL 0x004 #define MALIDP_LAYER_CONTROL 0x004
#define LAYER_ENABLE (1 << 0) #define LAYER_ENABLE (1 << 0)
#define LAYER_FLOWCFG_MASK 7 #define LAYER_FLOWCFG_MASK 7
...@@ -278,7 +279,9 @@ static void malidp_de_plane_update(struct drm_plane *plane, ...@@ -278,7 +279,9 @@ static void malidp_de_plane_update(struct drm_plane *plane,
dest_w = plane->state->crtc_w; dest_w = plane->state->crtc_w;
dest_h = plane->state->crtc_h; 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++) { for (i = 0; i < ms->n_planes; i++) {
/* calculate the offset for the layer's plane registers */ /* calculate the offset for the layer's plane registers */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment