[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180327162753.435586616@linuxfoundation.org>
Date: Tue, 27 Mar 2018 18:27:28 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Daniel Stone <daniels@...labora.com>,
Daniel van Vugt <daniel.van.vugt@...onical.com>,
Rob Clark <robdclark@...il.com>,
Daniel Vetter <daniel.vetter@...ll.ch>
Subject: [PATCH 4.14 056/101] drm: Reject getfb for multi-plane framebuffers
4.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Stone <daniels@...labora.com>
commit b24791fe00f8b089d5b10cb7bcc4e1ae88b4831b upstream.
getfb can only return a single plane, so reject attempts to use it with
multi-plane framebuffers.
Signed-off-by: Daniel Stone <daniels@...labora.com>
Reported-by: Daniel van Vugt <daniel.van.vugt@...onical.com>
Reviewed-by: Rob Clark <robdclark@...il.com>
Reviewed-by: Daniel Vetter <daniel.vetter@...ll.ch>
Fixes: 308e5bcbdb10 ("drm: add an fb creation ioctl that takes a pixel format v5")
Cc: stable@...r.kernel.org # v3.3+
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105518
Link: https://patchwork.freedesktop.org/patch/msgid/20180320225839.30905-1-daniels@collabora.com
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
drivers/gpu/drm/drm_framebuffer.c | 7 +++++++
1 file changed, 7 insertions(+)
--- a/drivers/gpu/drm/drm_framebuffer.c
+++ b/drivers/gpu/drm/drm_framebuffer.c
@@ -458,6 +458,12 @@ int drm_mode_getfb(struct drm_device *de
if (!fb)
return -ENOENT;
+ /* Multi-planar framebuffers need getfb2. */
+ if (fb->format->num_planes > 1) {
+ ret = -EINVAL;
+ goto out;
+ }
+
r->height = fb->height;
r->width = fb->width;
r->depth = fb->format->depth;
@@ -481,6 +487,7 @@ int drm_mode_getfb(struct drm_device *de
ret = -ENODEV;
}
+out:
drm_framebuffer_put(fb);
return ret;
Powered by blists - more mailing lists