Skip to contentSkip to conversation

FAILED: patch "[PATCH] drm: Reject getfb for multi-plane framebuffers" failed to apply to 4.9-stable tree

PATCH [email protected] 1 participant 1 message Mar 25, 2018

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 4.9-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

Quoted 1 line

From b24791fe00f8b089d5b10cb7bcc4e1ae88b4831b Mon Sep 17 00:00:00 2001

From: Daniel Stone <[email protected]>
Date: Tue, 20 Mar 2018 22:58:39 +0000
Subject: [PATCH] drm: Reject getfb for multi-plane framebuffers

getfb can only return a single plane, so reject attempts to use it with multi-plane framebuffers.

Fixes 308e5bcbdb10 ("drm: add an fb creation ioctl that takes a pixel format v5")

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105518

drivers/gpu/drm/drm_framebuffer.c +7 -0
index c0530a1af5e3..2dc5e8bed172 100644
@@ -461,6 +461,12 @@ int drm_mode_getfb(struct drm_device *dev,
 	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;
@@ -484,6 +490,7 @@ int drm_mode_getfb(struct drm_device *dev,
 		ret = -ENODEV;
 	}
 
+out:
 	drm_framebuffer_put(fb);
 
 	return ret;