Merge tag ‘drm-misc-fixes-2019-04-25’ of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes [Linux 5.1]

Merge tag ‘drm-misc-fixes-2019-04-25’ of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes [Linux 5.1]

This Linux kernel change "Merge tag ‘drm-misc-fixes-2019-04-25’ of git://anongit.freedesktop.org/drm/drm-misc 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:29:07 2019 +1000. The commit for this change in Linux stable tree is 528ffbf (patch). Other info about this change: Merge: f21492d c4cba44

Merge tag 'drm-misc-fixes-2019-04-25' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes

- sun4i: Fix module loading / unloading
- vc4: Fix a compilation error and memory leak
- dw-hdmi: Fix an overflow on Rockchip and SCDC configuration

Signed-off-by: Dave Airlie <[email protected]>

From: Maxime Ripard <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]

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 *