Commit f7f52503 authored by Simon Ser's avatar Simon Ser

drm: log errors in drm_gem_fb_init_with_funcs

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: default avatarSimon Ser <contact@emersion.fr>
Reviewed-by: default avatarMichel 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
parent 44602b10
...@@ -149,8 +149,10 @@ int drm_gem_fb_init_with_funcs(struct drm_device *dev, ...@@ -149,8 +149,10 @@ int drm_gem_fb_init_with_funcs(struct drm_device *dev,
int ret, i; int ret, i;
info = drm_get_format_info(dev, mode_cmd); 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; return -EINVAL;
}
for (i = 0; i < info->num_planes; i++) { for (i = 0; i < info->num_planes; i++) {
unsigned int width = mode_cmd->width / (i ? info->hsub : 1); 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, ...@@ -169,6 +171,9 @@ int drm_gem_fb_init_with_funcs(struct drm_device *dev,
+ mode_cmd->offsets[i]; + mode_cmd->offsets[i];
if (objs[i]->size < min_size) { 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]); drm_gem_object_put(objs[i]);
ret = -EINVAL; ret = -EINVAL;
goto err_gem_object_put; goto err_gem_object_put;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment