diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c index c52a8e7bc443..52374e943c57 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c @@ -42,8 +42,6 @@ #include "dw-hdmi-hdcp.h" #include "dw-hdmi.h" -#include "../../rockchip/rockchip_drm_drv.h" - #define DDC_CI_ADDR 0x37 #define DDC_SEGMENT_ADDR 0x30 @@ -2907,7 +2905,8 @@ static int dw_hdmi_connector_get_modes(struct drm_connector *connector) drm_connector_update_edid_property(connector, edid); cec_notifier_set_phys_addr_from_edid(hdmi->cec_notifier, edid); ret = drm_add_edid_modes(connector, edid); - rockchip_drm_get_yuv422_format(connector, edid); + if (hdmi->plat_data->get_color_changed) + hdmi->plat_data->get_yuv422_format(connector, edid); dw_hdmi_update_hdr_property(connector); kfree(edid); } else { diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c index ba7fe7cac9da..8fa64091bace 100644 --- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c +++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c @@ -940,6 +940,16 @@ dw_hdmi_rockchip_get_color_changed(void *data) return ret; } +static int +dw_hdmi_rockchip_get_yuv422_format(struct drm_connector *connector, + struct edid *edid) +{ + if (!connector || !edid) + return -EINVAL; + + return rockchip_drm_get_yuv422_format(connector, edid); +} + static const struct drm_prop_enum_list color_depth_enum_list[] = { { 0, "Automatic" }, /* Prefer highest color depth */ { 8, "24bit" }, @@ -1600,6 +1610,8 @@ static int dw_hdmi_rockchip_bind(struct device *dev, struct device *master, dw_hdmi_rockchip_get_hdr_blob; plat_data->get_color_changed = dw_hdmi_rockchip_get_color_changed; + plat_data->get_yuv422_format = + dw_hdmi_rockchip_get_yuv422_format; plat_data->property_ops = &dw_hdmi_rockchip_property_ops; encoder = &hdmi->encoder; diff --git a/include/drm/bridge/dw_hdmi.h b/include/drm/bridge/dw_hdmi.h index e94938ad720b..54ae0fbd2257 100644 --- a/include/drm/bridge/dw_hdmi.h +++ b/include/drm/bridge/dw_hdmi.h @@ -196,6 +196,8 @@ struct dw_hdmi_plat_data { struct drm_property *(*get_hdr_property)(void *data); struct drm_property_blob *(*get_hdr_blob)(void *data); bool (*get_color_changed)(void *data); + int (*get_yuv422_format)(struct drm_connector *connector, + struct edid *edid); /* Vendor Property support */ const struct dw_hdmi_property_ops *property_ops;