[PATCHv4,23/36] drm/komeda: Use helper for common tasks
diff mbox series

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

Commit Message

Andrzej Pietrasiewicz Dec. 13, 2019, 3:58 p.m. UTC
The replaced fragment is 1:1 with the helper code.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
---
 .../gpu/drm/arm/display/komeda/komeda_framebuffer.c | 13 +++----------
 1 file changed, 3 insertions(+), 10 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 1a03318ec73a..74c0caa51bdf 100644
--- a/drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c
+++ b/drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c
@@ -185,17 +185,10 @@  komeda_fb_create(struct drm_device *dev, struct drm_file *file,
 			goto err_cleanup;
 		}
 
-	drm_helper_mode_fill_fb_struct(dev, &kfb->base, mode_cmd);
-
-	for (i = 0; i < info->num_planes; ++i)
-		kfb->base.obj[i] = objs[i];
-
-	ret = drm_framebuffer_init(dev, &kfb->base, &komeda_fb_funcs);
-	if (ret < 0) {
-		DRM_DEBUG_KMS("failed to initialize fb\n");
-
+	ret = drm_gem_fb_init_with_funcs(&kfb->base, dev, mode_cmd, objs,
+					 info->num_planes, &komeda_fb_funcs);
+	if (ret < 0)
 		goto err_cleanup;
-	}
 
 	kfb->is_va = mdev->iommu ? true : false;