diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2016-10-18 01:41:12 +0300 |
---|---|---|
committer | Archit Taneja <architt@codeaurora.org> | 2016-10-18 15:21:38 +0530 |
commit | 333d2da5b7cf8046aee88c0412170be5f6f1ed55 (patch) | |
tree | ec5ec3d69990b9d7f0318f5b8c3ab49966093ce5 /include/drm | |
parent | d549349007ed66af325c1363c0e4f8bb7a518c0d (diff) |
drm: WARN when calling drm_format_info() for an unsupported format
The format helpers have historically treated unsupported formats as part
of the default case, returning values that are likely wrong. We can't
change this behaviour now without risking breaking drivers in difficult
to detect ways, but we can WARN on unsupported formats to catch faulty
callers.
The only exception is the framebuffer_check() function that calls
drm_format_info() to validate the format passed from userspace. This is
a valid use case that shouldn't generate a warning.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Archit Taneja <architt@codeaurora.org>
Link: http://patchwork.freedesktop.org/patch/msgid/1476744081-24485-5-git-send-email-laurent.pinchart@ideasonboard.com
Diffstat (limited to 'include/drm')
-rw-r--r-- | include/drm/drm_fourcc.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/drm/drm_fourcc.h b/include/drm/drm_fourcc.h index 135fef050ee6..f73f97afd1e2 100644 --- a/include/drm/drm_fourcc.h +++ b/include/drm/drm_fourcc.h @@ -45,6 +45,7 @@ struct drm_format_info { u8 vsub; }; +const struct drm_format_info *__drm_format_info(u32 format); const struct drm_format_info *drm_format_info(u32 format); uint32_t drm_mode_legacy_fb_format(uint32_t bpp, uint32_t depth); void drm_fb_get_bpp_depth(uint32_t format, unsigned int *depth, int *bpp); |