[PATCH] drm: warn if drivers supporting planar formats try to use drm_fb_get_bpp_depth

Philipp Zabel p.zabel at pengutronix.de
Wed May 20 06:21:06 PDT 2015


drm_fb_get_bpp_depth is to be used by legacy drivers only. None of those
support multi-planar formats, so add a WARN_ON if this function is ever
called with a format with more than one plane.

Suggested-by: Daniel Vetter <daniel at ffwll.ch>
Signed-off-by: Philipp Zabel <p.zabel at pengutronix.de>
---
 drivers/gpu/drm/drm_crtc.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index 6112a20..4c5f7d3 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -5186,6 +5186,12 @@ int drm_mode_destroy_dumb_ioctl(struct drm_device *dev,
 void drm_fb_get_bpp_depth(uint32_t format, unsigned int *depth,
 			  int *bpp)
 {
+	/*
+	 * This function is to be used for legacy drivers only, no new formats
+	 * formats should be added here.
+	 */
+	WARN_ON(drm_format_num_planes(format) != 1);
+
 	switch (format) {
 	case DRM_FORMAT_C8:
 	case DRM_FORMAT_RGB332:
-- 
2.1.4



More information about the dri-devel mailing list