Skip to content

Commit 8985f8f

Browse files
6by9popcornmix
authored andcommitted
drm/framebuffer: Pitch checks aren't valid for non-linear modifiers
Pitch has no meaning if the modifier isn't DRM_FORMAT_MOD_LINEAR as there is no guarantee that the value passed follows the pattern that pitch * height = size. Remove that check from framebuffer_check. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
1 parent 5fabbfd commit 8985f8f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/gpu/drm/drm_framebuffer.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,8 @@ static int framebuffer_check(struct drm_device *dev,
199199
if ((uint64_t) height * r->pitches[i] + r->offsets[i] > UINT_MAX)
200200
return -ERANGE;
201201

202-
if (block_size && r->pitches[i] < min_pitch) {
202+
if (r->modifier[i] == DRM_FORMAT_MOD_LINEAR && block_size &&
203+
r->pitches[i] < min_pitch) {
203204
drm_dbg_kms(dev, "bad pitch %u for plane %d\n", r->pitches[i], i);
204205
return -EINVAL;
205206
}

0 commit comments

Comments
 (0)