From f7f525030854b1c093d593dfc6edb1f75593a528 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Mon, 3 May 2021 11:39:39 +0000 Subject: [PATCH] drm: log errors in drm_gem_fb_init_with_funcs MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Let the user know what went wrong in drm_gem_fb_init_with_funcs failure paths. v2: use proper format specifier for size_t (kernel test robot) Signed-off-by: Simon Ser Reviewed-by: Michel Dänzer Cc: Daniel Vetter Cc: Sam Ravnborg Cc: Noralf Trønnes Cc: Andrzej Pietrasiewicz Link: https://patchwork.freedesktop.org/patch/msgid/ZS4eX0PtTuNvHezILcTWeWINOkRyMS4krXND3cIE@cp4-web-032.plabs.ch --- drivers/gpu/drm/drm_gem_framebuffer_helper.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_gem_framebuffer_helper.c b/drivers/gpu/drm/drm_gem_framebuffer_helper.c index 5ed2067cebb6..e2c68822e05c 100644 --- a/drivers/gpu/drm/drm_gem_framebuffer_helper.c +++ b/drivers/gpu/drm/drm_gem_framebuffer_helper.c @@ -149,8 +149,10 @@ int drm_gem_fb_init_with_funcs(struct drm_device *dev, int ret, i; info = drm_get_format_info(dev, mode_cmd); - if (!info) + if (!info) { + drm_dbg_kms(dev, "Failed to get FB format info\n"); return -EINVAL; + } for (i = 0; i < info->num_planes; i++) { unsigned int width = mode_cmd->width / (i ? info->hsub : 1); @@ -169,6 +171,9 @@ int drm_gem_fb_init_with_funcs(struct drm_device *dev, + mode_cmd->offsets[i]; if (objs[i]->size < min_size) { + drm_dbg_kms(dev, + "GEM object size (%zu) smaller than minimum size (%u) for plane %d\n", + objs[i]->size, min_size, i); drm_gem_object_put(objs[i]); ret = -EINVAL; goto err_gem_object_put; -- 2.39.5