@@ -156,6 +156,8 @@ void dw_hdmi_prep_avi_infoframe(struct hdmi_avi_infoframe *frame,
const struct drm_display_mode *mode);
struct hdmi_vmode *dw_hdmi_prep_vmode(struct dw_hdmi *hdmi,
const struct drm_display_mode *mode);
+void dw_hdmi_prep_data(struct dw_hdmi *hdmi,
+ const struct drm_display_mode *mode);
enum drm_connector_status
dw_hdmi_connector_detect(struct drm_connector *connector, bool force);
@@ -2133,14 +2133,9 @@ static void hdmi_disable_overflow_interrupts(struct dw_hdmi *hdmi)
HDMI_IH_MUTE_FC_STAT2);
}
-static int dw_hdmi_setup(struct dw_hdmi *hdmi,
- const struct drm_connector *connector,
- const struct drm_display_mode *mode)
+void dw_hdmi_prep_data(struct dw_hdmi *hdmi,
+ const struct drm_display_mode *mode)
{
- int ret;
-
- hdmi_disable_overflow_interrupts(hdmi);
-
hdmi->vic = drm_match_cea_mode(mode);
if (!hdmi->vic) {
@@ -2180,6 +2175,18 @@ static int dw_hdmi_setup(struct dw_hdmi *hdmi,
hdmi->hdmi_data.pix_repet_factor = 0;
hdmi->hdmi_data.hdcp_enable = 0;
hdmi->hdmi_data.video_mode.mdataenablepolarity = true;
+}
+EXPORT_SYMBOL_GPL(dw_hdmi_prep_data);
+
+static int dw_hdmi_setup(struct dw_hdmi *hdmi,
+ const struct drm_connector *connector,
+ const struct drm_display_mode *mode)
+{
+ int ret;
+
+ hdmi_disable_overflow_interrupts(hdmi);
+
+ dw_hdmi_prep_data(hdmi, mode);
/* HDMI Initialization Step B.1 */
hdmi_av_composer(hdmi, &connector->display_info, mode);
In preparation to add support for the HDMI 2.1 Quad-Pixel TX Controller and minimize code duplication, factor out the hdmi_data_info setup from dw_hdmi_setup() into a common dw_hdmi_prep_data() helper. Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com> --- drivers/gpu/drm/bridge/synopsys/dw-hdmi-common.h | 2 ++ drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 21 ++++++++++++++------- 2 files changed, 16 insertions(+), 7 deletions(-)