[PATCHv5,13/34] drm/komeda: Make komeda_fb_none_size_check independent from framebuffer
diff mbox series

Message ID 20191217145020.14645-14-andrzej.p@collabora.com
State New
Headers show
Series
  • Add AFBC support for Rockchip
Related show

Commit Message

Andrzej Pietrasiewicz Dec. 17, 2019, 2:49 p.m. UTC
All necessary data is now available in other data structures.

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

Patch
diff mbox series

diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c b/drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c
index 2014cd843aeb..43db95a76291 100644
--- a/drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c
+++ b/drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c
@@ -98,13 +98,11 @@  komeda_fb_afbc_size_check(struct komeda_fb *kfb,
 
 static int
 komeda_fb_none_afbc_size_check(struct komeda_dev *mdev,
-			       struct komeda_fb *kfb,
 			       const struct drm_format_info *info,
 			       struct drm_gem_object **objs,
 			       struct drm_file *file,
 			       const struct drm_mode_fb_cmd2 *mode_cmd)
 {
-	struct drm_framebuffer *fb = &kfb->base;
 	struct drm_gem_object *obj;
 	u32 i, block_h;
 	u64 min_size;
@@ -113,9 +111,10 @@  komeda_fb_none_afbc_size_check(struct komeda_dev *mdev,
 		obj = objs[i];
 
 		block_h = drm_format_info_block_height(info, i);
-		if ((fb->pitches[i] * block_h) % mdev->chip.bus_width) {
+		if ((mode_cmd->pitches[i] * block_h) % mdev->chip.bus_width) {
 			DRM_DEBUG_KMS("Pitch[%d]: 0x%x doesn't align to 0x%x\n",
-				      i, fb->pitches[i], mdev->chip.bus_width);
+				      i, mode_cmd->pitches[i],
+				      mdev->chip.bus_width);
 			return -EINVAL;
 		}
 
@@ -183,7 +182,7 @@  komeda_fb_create(struct drm_device *dev, struct drm_file *file,
 			return ERR_PTR(ret);
 		}
 
-		ret = komeda_fb_none_afbc_size_check(mdev, kfb, info, objs,
+		ret = komeda_fb_none_afbc_size_check(mdev, info, objs,
 						     file, mode_cmd);
 		for (i = 0; i < info->num_planes; ++i)
 			kfb->base.obj[i] = objs[i];