[PATCHv5 09/34] drm/komeda: Explicitly require 1 plane for AFBC

Andrzej Pietrasiewicz andrzej.p at collabora.com
Tue Dec 17 14:49:55 UTC 2019


Apparently komeda silently assumes that there is only 1 plane in an AFBC
buffer. Make this assumption explicit.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p at collabora.com>
---
 drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c b/drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c
index 7004c3c8f8de..c0bc499a9c29 100644
--- a/drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c
+++ b/drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c
@@ -169,6 +169,11 @@ komeda_fb_create(struct drm_device *dev, struct drm_file *file,
 	info = kfb->base.format;
 
 	if (kfb->base.modifier) {
+		if (info->num_planes != 1) {
+			DRM_DEBUG_KMS("AFBC requires exactly 1 plane.\n");
+			kfree(kfb);
+			return ERR_PTR(-EINVAL);
+		}
 		ret = komeda_fb_afbc_size_check(kfb, info, file, mode_cmd);
 	} else {
 		if (komeda_fb_check_src_coords(kfb, 0, 0, kfb->base.width,
-- 
2.17.1



More information about the dri-devel mailing list