Commit 23c453a4 authored by Ville Syrjälä's avatar Ville Syrjälä Committed by Dave Airlie

drm: Pretty print pixel format in drm_fb_get_bpp_depth() and format_check()

drm_fb_get_bpp_depth() likes to complain about unsupported pixel formats
but doesn't bother telling us what the format was. Also format_check()
just returns an error when it encouters an invalid format, leaving the
user scratching his head trying to figure out why addfb failed. Make
life a bit easier by using drm_get_format_name() in both places.
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Reviewed-by: default avatarDamien Lespiau <damien.lespiau@intel.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent e7bfa5c4
...@@ -2489,6 +2489,8 @@ static int format_check(const struct drm_mode_fb_cmd2 *r) ...@@ -2489,6 +2489,8 @@ static int format_check(const struct drm_mode_fb_cmd2 *r)
case DRM_FORMAT_YVU444: case DRM_FORMAT_YVU444:
return 0; return 0;
default: default:
DRM_DEBUG_KMS("invalid pixel format %s\n",
drm_get_format_name(r->pixel_format));
return -EINVAL; return -EINVAL;
} }
} }
...@@ -3828,7 +3830,8 @@ void drm_fb_get_bpp_depth(uint32_t format, unsigned int *depth, ...@@ -3828,7 +3830,8 @@ void drm_fb_get_bpp_depth(uint32_t format, unsigned int *depth,
*bpp = 32; *bpp = 32;
break; break;
default: default:
DRM_DEBUG_KMS("unsupported pixel format\n"); DRM_DEBUG_KMS("unsupported pixel format %s\n",
drm_get_format_name(format));
*depth = 0; *depth = 0;
*bpp = 0; *bpp = 0;
break; break;
......
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