If plat_data->get_output_bus_format() is exist, we can
use it to get hdmi output bus format when dw-hdmi is the
only bridge. The hdmi output bus format can be set by vendor
properties.

Signed-off-by: Algea Cao <algea....@rock-chips.com>
---

 drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c 
b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
index 1eb4736b9b59..878e9e506963 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
@@ -2644,6 +2644,8 @@ static u32 
*dw_hdmi_bridge_atomic_get_output_bus_fmts(struct drm_bridge *bridge,
                                        unsigned int *num_output_fmts)
 {
        struct drm_connector *conn = conn_state->connector;
+       struct dw_hdmi *hdmi = bridge->driver_private;
+       void *data = hdmi->plat_data->phy_data;
        struct drm_display_info *info = &conn->display_info;
        struct drm_display_mode *mode = &crtc_state->mode;
        u8 max_bpc = conn_state->max_requested_bpc;
@@ -2662,7 +2664,11 @@ static u32 
*dw_hdmi_bridge_atomic_get_output_bus_fmts(struct drm_bridge *bridge,
        /* If dw-hdmi is the only bridge, avoid negociating with ourselves */
        if (list_is_singular(&bridge->encoder->bridge_chain)) {
                *num_output_fmts = 1;
-               output_fmts[0] = MEDIA_BUS_FMT_FIXED;
+               if (hdmi->plat_data->get_output_bus_format)
+                       output_fmts[0] =
+                               hdmi->plat_data->get_output_bus_format(data);
+               else
+                       output_fmts[0] = MEDIA_BUS_FMT_FIXED;
 
                return output_fmts;
        }
-- 
2.25.1



Reply via email to