Merge tag ‘imx-drm-fixes-2019-04-25’ of git://git.pengutronix.de/pza/linux into drm-fixes [Linux 5.1]

Merge tag ‘imx-drm-fixes-2019-04-25’ of git://git.pengutronix.de/pza/linux into drm-fixes [Linux 5.1]

This Linux kernel change "Merge tag ‘imx-drm-fixes-2019-04-25’ of git://git.pengutronix.de/pza/linux into drm-fixes" is included in the Linux 5.1 release. This change is authored by Dave Airlie <airlied [at] redhat.com> on Fri Apr 26 10:32:57 2019 +1000. The commit for this change in Linux stable tree is 6db71be (patch). Other info about this change: Merge: a35d9d6 7bcde27

Merge tag 'imx-drm-fixes-2019-04-25' of git://git.pengutronix.de/pza/linux into drm-fixes

drm/imx: fix DP CSC handling

- Fix the DP color space conversion matrix setup to avoid bugs where
  disabling the overlay plane while both primary and overlay plane are
  routed via the CSC unit would not reconfigure the CSC routing
  properly, leaving the display in a nonworking state, or the CSC
  setting from a previously set mode would be left behind, causing
  wrong colors when reenabling the display in certain configurations.

Signed-off-by: Dave Airlie <airlied@redhat.com>

From: Philipp Zabel <p.zabel@pengutronix.de>
Link: https://patchwork.freedesktop.org/patch/msgid/1556183136.2271.3.camel@pengutronix.de

There is no are 0 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

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

diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
index b74ccb6..ab7968c 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
@@ -1046,6 +1046,10 @@ static bool dw_hdmi_support_scdc(struct dw_hdmi *hdmi)
    if (hdmi->version < 0x200a)
        return false;

+   /* Disable if no DDC bus */
+   if (!hdmi->ddc)
+       return false;
+
    /* Disable if SCDC is not supported, or if an HF-VSDB block is absent */
    if (!display->hdmi.scdc.supported ||
        !display->hdmi.scdc.scrambling.supported)
@@ -1684,13 +1688,13 @@ static void hdmi_av_composer(struct dw_hdmi *hdmi,
             * Source Devices compliant shall set the
             * Source Version = 1.
             */
-           drm_scdc_readb(&hdmi->i2c->adap, SCDC_SINK_VERSION,
+           drm_scdc_readb(hdmi->ddc, SCDC_SINK_VERSION,
                       &bytes);
-           drm_scdc_writeb(&hdmi->i2c->adap, SCDC_SOURCE_VERSION,
+           drm_scdc_writeb(hdmi->ddc, SCDC_SOURCE_VERSION,
                min_t(u8, bytes, SCDC_MIN_SOURCE_VERSION));

            /* Enabled Scrambling in the Sink */
-           drm_scdc_set_scrambling(&hdmi->i2c->adap, 1);
+           drm_scdc_set_scrambling(hdmi->ddc, 1);

            /*
             * To activate the scrambler feature, you must ensure
@@ -1706,7 +1710,7 @@ static void hdmi_av_composer(struct dw_hdmi *hdmi,
            hdmi_writeb(hdmi, 0, HDMI_FC_SCRAMBLER_CTRL);
            hdmi_writeb(hdmi, (u8)~HDMI_MC_SWRSTZ_TMDSSWRST_REQ,
                    HDMI_MC_SWRSTZ);
-           drm_scdc_set_scrambling(&hdmi->i2c->adap, 0);
+           drm_scdc_set_scrambling(hdmi->ddc, 0);
        }
    }

Leave a Reply

Your email address will not be published. Required fields are marked *