]> git.baikalelectronics.ru Git - kernel.git/commit
drm: WARN when calling drm_format_info() for an unsupported format
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Mon, 17 Oct 2016 22:41:12 +0000 (01:41 +0300)
committerArchit Taneja <architt@codeaurora.org>
Tue, 18 Oct 2016 09:51:38 +0000 (15:21 +0530)
commit57dcb3947ff18b0a3b27e6b4b460cccd31af3728
treeec5ec3d69990b9d7f0318f5b8c3ab49966093ce5
parent3a07d30bde5c9cb5befaaac71554e9de0ccd8bd6
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
drivers/gpu/drm/drm_fourcc.c
drivers/gpu/drm/drm_framebuffer.c
include/drm/drm_fourcc.h