[1/7] drm/panel: sitronix-st7789v: propagate RGB666 format

Message ID 20230314115644.3775169-2-gerald.loacker@wolfvision.net
State New
Headers
Series Add timing override to sitronix,st7789v |

Commit Message

Gerald Loacker March 14, 2023, 11:56 a.m. UTC
  From: Michael Riesch <michael.riesch@wolfvision.net>

The ST7789V display is operated in RGB666 (18-bit) mode. Propagate
this format via the display info.

Signed-off-by: Michael Riesch <michael.riesch@wolfvision.net>
Signed-off-by: Gerald Loacker <gerald.loacker@wolfvision.net>
---
 drivers/gpu/drm/panel/panel-sitronix-st7789v.c | 5 +++++
 1 file changed, 5 insertions(+)
  

Patch

diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7789v.c b/drivers/gpu/drm/panel/panel-sitronix-st7789v.c
index bbc4569cbcdc..9535437271d3 100644
--- a/drivers/gpu/drm/panel/panel-sitronix-st7789v.c
+++ b/drivers/gpu/drm/panel/panel-sitronix-st7789v.c
@@ -5,6 +5,7 @@ 
 
 #include <linux/delay.h>
 #include <linux/gpio/consumer.h>
+#include <linux/media-bus-format.h>
 #include <linux/module.h>
 #include <linux/regulator/consumer.h>
 #include <linux/spi/spi.h>
@@ -171,6 +172,7 @@  static int st7789v_get_modes(struct drm_panel *panel,
 			     struct drm_connector *connector)
 {
 	struct drm_display_mode *mode;
+	u32 bus_format = MEDIA_BUS_FMT_RGB666_1X18;
 
 	mode = drm_mode_duplicate(connector->dev, &default_mode);
 	if (!mode) {
@@ -188,6 +190,9 @@  static int st7789v_get_modes(struct drm_panel *panel,
 	connector->display_info.width_mm = 61;
 	connector->display_info.height_mm = 103;
 
+	drm_display_info_set_bus_formats(&connector->display_info, &bus_format,
+					 1);
+
 	return 1;
 }