These patches were generated from: https://github.com/raspberrypi/linux/commits/rpi-6.12.y With the following command: git format-patch -N v6.12.27..HEAD (HEAD -> 8d3206ee456a5ecdf9ddbfd8e5e231e4f0cd716e) Exceptions: - (def)configs patches - github workflows patches - applied & reverted patches - readme patches - wireless patches Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
29 lines
1.1 KiB
Diff
29 lines
1.1 KiB
Diff
From 7e3f5adacdc3d17fb4d51096822219234ea1360c Mon Sep 17 00:00:00 2001
|
|
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
|
Date: Thu, 27 Feb 2025 17:55:02 +0000
|
|
Subject: [PATCH] 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>
|
|
---
|
|
drivers/gpu/drm/drm_framebuffer.c | 3 ++-
|
|
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
|
|
--- a/drivers/gpu/drm/drm_framebuffer.c
|
|
+++ b/drivers/gpu/drm/drm_framebuffer.c
|
|
@@ -199,7 +199,8 @@ static int framebuffer_check(struct drm_
|
|
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;
|
|
}
|