diff options
author | Eric Anholt <eric@anholt.net> | 2015-10-23 05:36:27 -0400 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2015-11-17 15:27:03 -0500 |
commit | bf893acc1675516fabf238a5ee3b52859c5687dc (patch) | |
tree | 20c28ae1c025c05ed23e17bd559db8aa6c983d2c | |
parent | 36f4f69a092d766581f2442ddffea051e1ef464e (diff) |
drm/vc4: Make sure that planes aren't scaled.
We would scan out the memory around them if an upscale was attempted,
and would just scan out incorrectly for downscaling.
Signed-off-by: Eric Anholt <eric@anholt.net>
-rw-r--r-- | drivers/gpu/drm/vc4/vc4_plane.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c index 2db509210d62..887f3caad0be 100644 --- a/drivers/gpu/drm/vc4/vc4_plane.c +++ b/drivers/gpu/drm/vc4/vc4_plane.c | |||
@@ -157,6 +157,16 @@ static int vc4_plane_mode_set(struct drm_plane *plane, | |||
157 | int crtc_w = state->crtc_w; | 157 | int crtc_w = state->crtc_w; |
158 | int crtc_h = state->crtc_h; | 158 | int crtc_h = state->crtc_h; |
159 | 159 | ||
160 | if (state->crtc_w << 16 != state->src_w || | ||
161 | state->crtc_h << 16 != state->src_h) { | ||
162 | /* We don't support scaling yet, which involves | ||
163 | * allocating the LBM memory for scaling temporary | ||
164 | * storage, and putting filter kernels in the HVS | ||
165 | * context. | ||
166 | */ | ||
167 | return -EINVAL; | ||
168 | } | ||
169 | |||
160 | if (crtc_x < 0) { | 170 | if (crtc_x < 0) { |
161 | offset += drm_format_plane_cpp(fb->pixel_format, 0) * -crtc_x; | 171 | offset += drm_format_plane_cpp(fb->pixel_format, 0) * -crtc_x; |
162 | crtc_w += crtc_x; | 172 | crtc_w += crtc_x; |