mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 01:49:46 +00:00
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>
This commit is contained in:
committed by
Dom Cobley
parent
69bc83d33e
commit
e2d4573825
@@ -190,7 +190,8 @@ static int framebuffer_check(struct drm_device *dev,
|
||||
if ((uint64_t) height * r->pitches[i] + r->offsets[i] > UINT_MAX)
|
||||
return -ERANGE;
|
||||
|
||||
if (block_size && r->pitches[i] < min_pitch) {
|
||||
if (r->modifier[i] == DRM_FORMAT_MOD_LINEAR && block_size &&
|
||||
r->pitches[i] < min_pitch) {
|
||||
drm_dbg_kms(dev, "bad pitch %u for plane %d\n", r->pitches[i], i);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user