]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
drm: log errors in drm_gem_fb_init_with_funcs
authorSimon Ser <contact@emersion.fr>
Mon, 3 May 2021 11:39:39 +0000 (11:39 +0000)
committerSimon Ser <contact@emersion.fr>
Tue, 18 May 2021 17:48:18 +0000 (19:48 +0200)
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 <contact@emersion.fr>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Noralf Trønnes <noralf@tronnes.org>
Cc: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/ZS4eX0PtTuNvHezILcTWeWINOkRyMS4krXND3cIE@cp4-web-032.plabs.ch
drivers/gpu/drm/drm_gem_framebuffer_helper.c

index 5ed2067cebb6e30440e14694876a382417a2eac4..e2c68822e05cc19dd431d4a1258c0d23d30c8300 100644 (file)
@@ -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;