[PATCH 3/3] drm/tilcdc: Advertise the DRM_FORMATs according to the IP revision

Karl Beldan kbeldan at baylibre.com
Tue Aug 23 12:57:01 UTC 2016


ATM the driver unconditionally advertises support for some 24bpp and
32bpp formats while version 1 of the IP only supports up to 16bpp.

Signed-off-by: Karl Beldan <kbeldan at baylibre.com>
---
 drivers/gpu/drm/tilcdc/tilcdc_plane.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/tilcdc/tilcdc_plane.c b/drivers/gpu/drm/tilcdc/tilcdc_plane.c
index 41911e3..11285f6 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_plane.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_plane.c
@@ -114,12 +114,17 @@ static const struct drm_plane_helper_funcs plane_helper_funcs = {
 int tilcdc_plane_init(struct drm_device *dev,
 		      struct drm_plane *plane)
 {
+	struct tilcdc_drm_private *priv = dev->dev_private;
+	unsigned int num_formats = ARRAY_SIZE(tilcdc_formats);
 	int ret;
 
+	if (priv->rev == 1)
+		num_formats = 1;
+
 	ret = drm_plane_init(dev, plane, 1,
 			     &tilcdc_plane_funcs,
 			     tilcdc_formats,
-			     ARRAY_SIZE(tilcdc_formats),
+			     num_formats,
 			     true);
 	if (ret) {
 		dev_err(dev->dev, "Failed to initialize plane: %d\n", ret);
-- 
2.9.2



More information about the dri-devel mailing list