diff options
author | Liviu Dudau <Liviu.Dudau@arm.com> | 2017-12-05 19:51:03 +0300 |
---|---|---|
committer | Liviu Dudau <Liviu.Dudau@arm.com> | 2018-03-14 14:38:02 +0300 |
commit | fcad73b9b1fb9580fd43f1349fd8ab34d5d456e9 (patch) | |
tree | 9561b1000b6bf2922fefbd85846bf08f398fd685 /drivers/gpu/drm/arm/malidp_planes.c | |
parent | 963976cfe9c54d4d9e725e61c90c47a4af6b5ea2 (diff) | |
download | linux-fcad73b9b1fb9580fd43f1349fd8ab34d5d456e9.tar.xz |
drm/mali-dp: Rotated planes need a larger pitch size.
Rotated planes need a pitch size that is aligned to 8 bytes
for older DP500 and DP550 and at least 64 bytes for DP650. Replace
the malidp_hw_pitch_valid() function with one that calculates
the correct pitch alignment to take into account rotation.
Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>
Diffstat (limited to 'drivers/gpu/drm/arm/malidp_planes.c')
-rw-r--r-- | drivers/gpu/drm/arm/malidp_planes.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpu/drm/arm/malidp_planes.c b/drivers/gpu/drm/arm/malidp_planes.c index ee32361c87ac..a307fc2f2abc 100644 --- a/drivers/gpu/drm/arm/malidp_planes.c +++ b/drivers/gpu/drm/arm/malidp_planes.c @@ -175,6 +175,7 @@ static int malidp_de_plane_check(struct drm_plane *plane, { struct malidp_plane *mp = to_malidp_plane(plane); struct malidp_plane_state *ms = to_malidp_plane_state(state); + bool rotated = state->rotation & MALIDP_ROTATED_MASK; struct drm_framebuffer *fb; int i, ret; @@ -191,7 +192,8 @@ static int malidp_de_plane_check(struct drm_plane *plane, ms->n_planes = fb->format->num_planes; for (i = 0; i < ms->n_planes; i++) { - if (!malidp_hw_pitch_valid(mp->hwdev, fb->pitches[i])) { + u8 alignment = malidp_hw_get_pitch_align(mp->hwdev, rotated); + if (fb->pitches[i] & (alignment - 1)) { DRM_DEBUG_KMS("Invalid pitch %u for plane %d\n", fb->pitches[i], i); return -EINVAL; |