[PATCHv5 06/34] drm/komeda: Move checking src coordinates to komeda_fb_create

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Next step towards unifying afbc and non-afbc cases as much as possible.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@xxxxxxxxxxxxx>
---
 .../drm/arm/display/komeda/komeda_framebuffer.c    | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c b/drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c
index 2f993a9cfb8b..5a1e5f621a8f 100644
--- a/drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c
+++ b/drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c
@@ -106,9 +106,6 @@ komeda_fb_none_afbc_size_check(struct komeda_dev *mdev, struct komeda_fb *kfb,
 	u32 i, block_h;
 	u64 min_size;
 
-	if (komeda_fb_check_src_coords(kfb, 0, 0, fb->width, fb->height))
-		return -EINVAL;
-
 	for (i = 0; i < info->num_planes; i++) {
 		obj = drm_gem_object_lookup(file, mode_cmd->handles[i]);
 		if (!obj) {
@@ -167,10 +164,17 @@ komeda_fb_create(struct drm_device *dev, struct drm_file *file,
 
 	drm_helper_mode_fill_fb_struct(dev, &kfb->base, mode_cmd);
 
-	if (kfb->base.modifier)
+	if (kfb->base.modifier) {
 		ret = komeda_fb_afbc_size_check(kfb, file, mode_cmd);
-	else
+	} else {
+		if (komeda_fb_check_src_coords(kfb, 0, 0, kfb->base.width,
+					       kfb->base.height)) {
+			kfree(kfb);
+			return ERR_PTR(-EINVAL);
+		}
+
 		ret = komeda_fb_none_afbc_size_check(mdev, kfb, file, mode_cmd);
+	}
 	if (ret < 0)
 		goto err_cleanup;
 
-- 
2.17.1

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel



[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux