[PATCH 3/7] drm/panel: sitronix-st7789v: Specify the expected bus format
Miquel Raynal
miquel.raynal at bootlin.com
Fri Jun 9 14:59:47 UTC 2023
The LCD controller supports RGB444, RGB565 and RGB888. The value that is
written in the COLMOD register indicates using RGB888, so let's clearly
specify the in-use bus format.
Signed-off-by: Miquel Raynal <miquel.raynal at bootlin.com>
---
drivers/gpu/drm/panel/panel-sitronix-st7789v.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7789v.c b/drivers/gpu/drm/panel/panel-sitronix-st7789v.c
index e9ca7ebb458a..0abb45bea18d 100644
--- a/drivers/gpu/drm/panel/panel-sitronix-st7789v.c
+++ b/drivers/gpu/drm/panel/panel-sitronix-st7789v.c
@@ -6,6 +6,7 @@
#include <linux/delay.h>
#include <linux/gpio/consumer.h>
#include <linux/module.h>
+#include <linux/media-bus-format.h>
#include <linux/regulator/consumer.h>
#include <linux/spi/spi.h>
@@ -170,6 +171,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) {
@@ -186,6 +188,8 @@ 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;
}
--
2.34.1
More information about the dri-devel
mailing list