<div dir="ltr"><div><div><div>Hi everyone,<br><br></div>I can try that patch and see if it fixes the problem.<br></div>Give me a moment so that I can check how it goes.<br><br></div>Luís<br><div><div><div><div><div><br><br></div></div></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Nov 9, 2017 at 9:49 AM, Jani Nikula <span dir="ltr"><<a href="mailto:jani.nikula@linux.intel.com" target="_blank">jani.nikula@linux.intel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Thu, 09 Nov 2017, Russell King - ARM Linux <<a href="mailto:linux@armlinux.org.uk">linux@armlinux.org.uk</a>> wrote:<br>
> On Thu, Nov 09, 2017 at 09:23:18AM +0100, Daniel Vetter wrote:<br>
>> On Tue, Nov 07, 2017 at 11:27:21AM +0000, Russell King wrote:<br>
>> > Parsing the EDID for HDMI and audio information in the get_modes()<br>
>> > callback is incorrect - this only parses the EDID read from the<br>
>> > connector, not any override or firmware provided EDID.<br>
>> ><br>
>> > The correct place to parse the EDID for these parameters is the<br>
>> > fill_modes() callback, after we've called the helper. Move the parsing<br>
>> > there. This caused problems for Luís Mendes.<br>
>> ><br>
>> > Cc: <<a href="mailto:stable@vger.kernel.org">stable@vger.kernel.org</a>><br>
>> > Reported-by: Luís Mendes <<a href="mailto:luis.p.mendes@gmail.com">luis.p.mendes@gmail.com</a>><br>
>> > Tested-by: Luís Mendes <<a href="mailto:luis.p.mendes@gmail.com">luis.p.mendes@gmail.com</a>><br>
>> > Signed-off-by: Russell King <<a href="mailto:rmk%2Bkernel@armlinux.org.uk">rmk+kernel@armlinux.org.uk</a>><br>
>> > ---<br>
>> > drivers/gpu/drm/bridge/<wbr>synopsys/dw-hdmi.c | 28 ++++++++++++++++++++++++----<br>
>> > 1 file changed, 24 insertions(+), 4 deletions(-)<br>
>> ><br>
>> > diff --git a/drivers/gpu/drm/bridge/<wbr>synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/<wbr>synopsys/dw-hdmi.c<br>
>> > index 9fe407f49986..2516a1c18a10 100644<br>
>> > --- a/drivers/gpu/drm/bridge/<wbr>synopsys/dw-hdmi.c<br>
>> > +++ b/drivers/gpu/drm/bridge/<wbr>synopsys/dw-hdmi.c<br>
>> > @@ -1905,10 +1905,7 @@ static int dw_hdmi_connector_get_modes(<wbr>struct drm_connector *connector)<br>
>> > dev_dbg(hdmi->dev, "got edid: width[%d] x height[%d]\n",<br>
>> > edid->width_cm, edid->height_cm);<br>
>> ><br>
>> > - hdmi->sink_is_hdmi = drm_detect_hdmi_monitor(edid);<br>
>> > - hdmi->sink_has_audio = drm_detect_monitor_audio(edid)<wbr>;<br>
>> > drm_mode_connector_update_<wbr>edid_property(connector, edid);<br>
>> > - cec_notifier_set_phys_addr_<wbr>from_edid(hdmi->cec_notifier, edid);<br>
>> > ret = drm_add_edid_modes(connector, edid);<br>
>> > /* Store the ELD */<br>
>> > drm_edid_to_eld(connector, edid);<br>
>> > @@ -1920,6 +1917,29 @@ static int dw_hdmi_connector_get_modes(<wbr>struct drm_connector *connector)<br>
>> > return ret;<br>
>> > }<br>
>> ><br>
>> > +static int dw_hdmi_connector_fill_modes(<wbr>struct drm_connector *connector,<br>
>> > + uint32_t maxX, uint32_t maxY)<br>
>> > +{<br>
>> > + struct dw_hdmi *hdmi = container_of(connector, struct dw_hdmi,<br>
>> > + connector);<br>
>> > + int ret;<br>
>> > +<br>
>> > + ret = drm_helper_probe_single_<wbr>connector_modes(connector, maxX, maxY);<br>
>> > +<br>
>> > + if (connector->edid_blob_ptr) {<br>
>> > + struct edid *edid = (void *)connector->edid_blob_ptr-><wbr>data;<br>
>> > +<br>
>> > + hdmi->sink_is_hdmi = drm_detect_hdmi_monitor(edid);<br>
>> > + hdmi->sink_has_audio = drm_detect_monitor_audio(edid)<wbr>;<br>
>> > + cec_notifier_set_phys_addr_<wbr>from_edid(hdmi->cec_notifier, edid);<br>
>> > + } else {<br>
>> > + hdmi->sink_is_hdmi = false;<br>
>> > + hdmi->sink_has_audio = false;<br>
>> > + }<br>
>> > +<br>
>> > + return ret;<br>
>> > +}<br>
>> > +<br>
>> > static void dw_hdmi_connector_force(struct drm_connector *connector)<br>
>> > {<br>
>> > struct dw_hdmi *hdmi = container_of(connector, struct dw_hdmi,<br>
>> > @@ -1933,7 +1953,7 @@ static void dw_hdmi_connector_force(struct drm_connector *connector)<br>
>> > }<br>
>> ><br>
>> > static const struct drm_connector_funcs dw_hdmi_connector_funcs = {<br>
>> > - .fill_modes = drm_helper_probe_single_<wbr>connector_modes,<br>
>> > + .fill_modes = dw_hdmi_connector_fill_modes,<br>
>><br>
>> Papering over helper functions shouldn't be necessary, except the helper<br>
>> functions not handling the override edid is a known issue. Jani Nikula is<br>
>> working on a proper fix, please coordinate with him.<br>
><br>
> So, what you're basically saying is that fixing real bugs that affect<br>
> users is not something that DRM people want. That's fine, I'll ignore<br>
> people who come to me for help with DRM bugs in future then because<br>
> it's obviously a dead loss.<br>
<br>
</div></div>We may already have fixed the bug in drm-next at the proper<br>
layer. Please see my other mail.<br>
<br>
BR,<br>
Jani.<br>
<div class="HOEnZb"><div class="h5"><br>
--<br>
Jani Nikula, Intel Open Source Technology Center<br>
</div></div></blockquote></div><br></div>