Patch does not introduce any functional change but would help out when
introducing DRM_COLOR_FORMAT enum in a sub-sequent patch.

Auto will implictly fallthrough to RGB as that should be further
driver-defined.

Signed-off-by: Marius Vlad <marius.v...@collabora.com>
---
 drivers/gpu/drm/display/drm_hdmi_state_helper.c | 3 +++
 drivers/gpu/drm/drm_connector.c                 | 1 +
 drivers/video/hdmi.c                            | 4 ++--
 include/linux/hdmi.h                            | 2 +-
 4 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/display/drm_hdmi_state_helper.c 
b/drivers/gpu/drm/display/drm_hdmi_state_helper.c
index a561f124be99..f9aa922d25d3 100644
--- a/drivers/gpu/drm/display/drm_hdmi_state_helper.c
+++ b/drivers/gpu/drm/display/drm_hdmi_state_helper.c
@@ -417,6 +417,9 @@ sink_supports_format_bpc(const struct drm_connector 
*connector,
        }
 
        switch (format) {
+       case HDMI_COLORSPACE_AUTO:
+               drm_dbg_kms(dev, "AUTO format. Fallback to RGB.\n");
+               fallthrough;
        case HDMI_COLORSPACE_RGB:
                drm_dbg_kms(dev, "RGB Format, checking the constraints.\n");
 
diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
index 272d6254ea47..24edba01f2f0 100644
--- a/drivers/gpu/drm/drm_connector.c
+++ b/drivers/gpu/drm/drm_connector.c
@@ -1424,6 +1424,7 @@ static const char * const output_format_str[] = {
        [HDMI_COLORSPACE_YUV420]        = "YUV 4:2:0",
        [HDMI_COLORSPACE_YUV422]        = "YUV 4:2:2",
        [HDMI_COLORSPACE_YUV444]        = "YUV 4:4:4",
+       [HDMI_COLORSPACE_AUTO]          = "AUTO",
 };
 
 /*
diff --git a/drivers/video/hdmi.c b/drivers/video/hdmi.c
index 45b42f14a750..74fe925c69a2 100644
--- a/drivers/video/hdmi.c
+++ b/drivers/video/hdmi.c
@@ -1031,8 +1031,8 @@ static const char *hdmi_colorspace_get_name(enum 
hdmi_colorspace colorspace)
                return "YCbCr 4:4:4";
        case HDMI_COLORSPACE_YUV420:
                return "YCbCr 4:2:0";
-       case HDMI_COLORSPACE_RESERVED4:
-               return "Reserved (4)";
+       case HDMI_COLORSPACE_AUTO:
+               return "Auto";
        case HDMI_COLORSPACE_RESERVED5:
                return "Reserved (5)";
        case HDMI_COLORSPACE_RESERVED6:
diff --git a/include/linux/hdmi.h b/include/linux/hdmi.h
index 96bda41d9148..045402033763 100644
--- a/include/linux/hdmi.h
+++ b/include/linux/hdmi.h
@@ -82,7 +82,7 @@ enum hdmi_colorspace {
        HDMI_COLORSPACE_YUV422,
        HDMI_COLORSPACE_YUV444,
        HDMI_COLORSPACE_YUV420,
-       HDMI_COLORSPACE_RESERVED4,
+       HDMI_COLORSPACE_AUTO,
        HDMI_COLORSPACE_RESERVED5,
        HDMI_COLORSPACE_RESERVED6,
        HDMI_COLORSPACE_IDO_DEFINED,
-- 
2.47.2

Reply via email to