<div dir="ltr"><div><div><div><div><div><div>I kindof assume DP is the default connection these days and with Freesync you use<br></div>DP or course, but this question was specifically for HDMI.<br></div>I guess this patch doesn't affect deep color over DP?<br><br></div>Anyway, only 17 of those monitors have FreeSync but almost all have DP, so perhaps they only support<br></div>10 bpc when connected with DP?<br><br></div>Regards<br></div>//Ernst<br></div><div class="gmail_extra"><br><div class="gmail_quote">2017-01-10 20:54 GMT+01:00 Alex Deucher <span dir="ltr"><<a href="mailto:alexdeucher@gmail.com" target="_blank">alexdeucher@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Tue, Jan 10, 2017 at 12:46 PM, Ville Syrjälä<br>
<<a href="mailto:ville.syrjala@linux.intel.com">ville.syrjala@linux.intel.com</a><wbr>> wrote:<br>
> On Tue, Jan 10, 2017 at 12:27:45PM -0500, Alex Deucher wrote:<br>
>> On Tue, Jan 10, 2017 at 6:33 AM, Ernst Sjöstrand <<a href="mailto:ernstp@gmail.com">ernstp@gmail.com</a>> wrote:<br>
>> > Isn't 10bpc very common among monitors, and 12bpc very rare? Or maybe I'm<br>
>> > confusing the transport layer with the presentation capabilities...?<br>
>> > Here are 201 monitors that claim 10bpc:<br>
>> > <a href="http://pricespy.co.uk/category.php?l=s300859434&o=eg_401#prodlista" rel="noreferrer" target="_blank">http://pricespy.co.uk/<wbr>category.php?l=s300859434&o=<wbr>eg_401#prodlista</a><br>
>> ><br>
>><br>
>> FWIW, I've almost never seen a monitor that supports 12 bpc, but I've<br>
>> see quite a few 10 bpc monitors.<br>
><br>
> I've seen plenty of monitors that do 10bpc over DP, but I've never seen<br>
> anything that does 10bpc over HDMI. 12bpc over HDMI is pretty common<br>
> in "proper" TVs in my experience.<br>
><br>
>> I can talk to our display team to<br>
>> see what other OSes do.<br>
><br>
> Thanks. That should give us some idea if anyone ever tried 10bpc<br>
> over HDMI on these things.<br>
<br>
</span>We apparently see this pretty commonly, especially with freesync<br>
monitors, and we support it. It seems to be pretty prevalent because<br>
you can support a higher refresh rate with a lower bpc.<br>
<span class="HOEnZb"><font color="#888888"><br>
Alex<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
><br>
>><br>
>> Alex<br>
>><br>
>> > Regards<br>
>> > //Ernst<br>
>> ><br>
>> > 2017-01-10 11:52 GMT+01:00 Ville Syrjälä <<a href="mailto:ville.syrjala@linux.intel.com">ville.syrjala@linux.intel.com</a><wbr>>:<br>
>> >><br>
>> >> On Thu, Jan 05, 2017 at 05:45:23PM -0600, Nicholas Sielicki wrote:<br>
>> >> > As per the HDMI 1.3 and 1.4 spec, "deep color modes" are color depths<br>
>> >> > greater than 24 bits per pixel. The spec explicitly states, "All Deep<br>
>> >> > Color modes are optional though if an HDMI Source or Sink supports any<br>
>> >> > Deep Color mode, it shall support 36-bit mode." (6.2.4 Color Depth<br>
>> >> > Requirements).<br>
>> >> ><br>
>> >> > I came across a monitor (Acer X233H) that supplies an illegal EDID where<br>
>> >> > DC_30bit is set and DC_36bit is not set. The end result is badly garbled<br>
>> >> > output because the driver is sending 36BPP when the monitor can't handle<br>
>> >> > it.<br>
>> >> ><br>
>> >> > Much of the intel hardware is incapable of operating at any<br>
>> >> > bit-per-component setting outside of 8 or 12, and the spec seems to<br>
>> >> > imply that if any deep color support is found, then it is a safe<br>
>> >> > assumption to operate at 12.<br>
>> >> ><br>
>> >> > This patch ensures that the EDID is within the spec (specifically, that<br>
>> >> > DC_36bit is set) before committing to going forward with any deep<br>
>> >> > colors. There was already a check for this EDID inconsistency, but it<br>
>> >> > resulted only in a warning and did not fall-back to safer settings.<br>
>> >> ><br>
>> >> > CC: Ville Syrjälä <<a href="mailto:ville.syrjala@linux.intel.com">ville.syrjala@linux.intel.com</a><wbr>><br>
>> >> > Signed-off-by: Nicholas Sielicki <<a href="mailto:nicholas.sielicki@gmail.com">nicholas.sielicki@gmail.com</a>><br>
>> >> > ---<br>
>> >> > drivers/gpu/drm/drm_edid.c | 35 +++++++++++++++++++++++-------<wbr>-----<br>
>> >> > 1 file changed, 23 insertions(+), 12 deletions(-)<br>
>> >> ><br>
>> >> > diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c<br>
>> >> > index 336be31ff3de..42ce3f54d2dc 100644<br>
>> >> > --- a/drivers/gpu/drm/drm_edid.c<br>
>> >> > +++ b/drivers/gpu/drm/drm_edid.c<br>
>> >> > @@ -3772,30 +3772,34 @@ static void<br>
>> >> > drm_parse_hdmi_deep_color_<wbr>info(struct drm_connector *connector,<br>
>> >> > {<br>
>> >> > struct drm_display_info *info = &connector->display_info;<br>
>> >> > unsigned int dc_bpc = 0;<br>
>> >> > + u8 modes = 0;<br>
>> >> ><br>
>> >> > /* HDMI supports at least 8 bpc */<br>
>> >> > info->bpc = 8;<br>
>> >> ><br>
>> >> > + /* Ensure all DC modes are unset if we return early */<br>
>> >> > + info->edid_hdmi_dc_modes = 0;<br>
>> >><br>
>> >> Clearing this in drm_add_display_info() should be sufficient since<br>
>> >> this guy doesn't get called from anywhere else. So this part could<br>
>> >> be droppped.<br>
>> >><br>
>> >> Otherwise this feels like a decent way to handle the problem. We<br>
>> >> could of course try to use the 10bpc (or whatever) deep color modes<br>
>> >> the sink claims to support, but given that the people designing the<br>
>> >> thing didn't bother reading the spec, it seems safer to just disable<br>
>> >> deep color support entirely.<br>
>> >><br>
>> >> Reviewed-by: Ville Syrjälä <<a href="mailto:ville.syrjala@linux.intel.com">ville.syrjala@linux.intel.com</a><wbr>><br>
>> >><br>
>> >> > +<br>
>> >> > if (cea_db_payload_len(hdmi) < 6)<br>
>> >> > return;<br>
>> >> ><br>
>> >> > if (hdmi[6] & DRM_EDID_HDMI_DC_30) {<br>
>> >> > dc_bpc = 10;<br>
>> >> > - info->edid_hdmi_dc_modes |= DRM_EDID_HDMI_DC_30;<br>
>> >> > + modes |= DRM_EDID_HDMI_DC_30;<br>
>> >> > DRM_DEBUG("%s: HDMI sink does deep color 30.\n",<br>
>> >> > connector->name);<br>
>> >> > }<br>
>> >> ><br>
>> >> > if (hdmi[6] & DRM_EDID_HDMI_DC_36) {<br>
>> >> > dc_bpc = 12;<br>
>> >> > - info->edid_hdmi_dc_modes |= DRM_EDID_HDMI_DC_36;<br>
>> >> > + modes |= DRM_EDID_HDMI_DC_36;<br>
>> >> > DRM_DEBUG("%s: HDMI sink does deep color 36.\n",<br>
> >> > connector->name);<br>
>> >> > }<br>
>> >> ><br>
>> >> > if (hdmi[6] & DRM_EDID_HDMI_DC_48) {<br>
>> >> > dc_bpc = 16;<br>
>> >> > - info->edid_hdmi_dc_modes |= DRM_EDID_HDMI_DC_48;<br>
>> >> > + modes |= DRM_EDID_HDMI_DC_48;<br>
>> >> > DRM_DEBUG("%s: HDMI sink does deep color 48.\n",<br>
>> >> > connector->name);<br>
>> >> > }<br>
>> >> > @@ -3806,9 +3810,24 @@ static void drm_parse_hdmi_deep_color_<wbr>info(struct<br>
>> >> > drm_connector *connector,<br>
>> >> > return;<br>
>> >> > }<br>
>> >> ><br>
>> >> > + /*<br>
>> >> > + * All deep color modes are optional, but if a sink supports any<br>
>> >> > deep<br>
>> >> > + * color mode, it must support 36-bit mode. If this is found not<br>
>> >> > + * to be the case, sink is in violation of HDMI 1.3 / 1.4 spec and<br>
>> >> > it<br>
>> >> > + * is prudent to disable all deep color modes. Return here before<br>
>> >> > + * committing bpc and edid_hdmi_dc_modes.<br>
>> >> > + */<br>
>> >> > + if (!(modes & DRM_EDID_HDMI_DC_36)) {<br>
>> >> > + DRM_DEBUG("%s: HDMI sink should do DC_36, but does<br>
>> >> > not!\n",<br>
>> >> > + connector->name);<br>
>> >> > + return;<br>
>> >> > + }<br>
>> >> > +<br>
>> >> > +<br>
>> >> > DRM_DEBUG("%s: Assigning HDMI sink color depth as %d bpc.\n",<br>
>> >> > connector->name, dc_bpc);<br>
>> >> > info->bpc = dc_bpc;<br>
>> >> > + info->edid_hdmi_dc_modes = modes;<br>
>> >> ><br>
>> >> > /*<br>
>> >> > * Deep color support mandates RGB444 support for all video<br>
>> >> > @@ -3823,15 +3842,6 @@ static void drm_parse_hdmi_deep_color_<wbr>info(struct<br>
>> >> > drm_connector *connector,<br>
>> >> > DRM_DEBUG("%s: HDMI sink does YCRCB444 in deep color.\n",<br>
>> >> > connector->name);<br>
>> >> > }<br>
>> >> > -<br>
>> >> > - /*<br>
>> >> > - * Spec says that if any deep color mode is supported at all,<br>
>> >> > - * then deep color 36 bit must be supported.<br>
>> >> > - */<br>
>> >> > - if (!(hdmi[6] & DRM_EDID_HDMI_DC_36)) {<br>
>> >> > - DRM_DEBUG("%s: HDMI sink should do DC_36, but does<br>
>> >> > not!\n",<br>
>> >> > - connector->name);<br>
>> >> > - }<br>
>> >> > }<br>
>> >> ><br>
>> >> > static void<br>
>> >> > @@ -3895,6 +3905,7 @@ static void drm_add_display_info(struct<br>
>> >> > drm_connector *connector,<br>
>> >> > /* driver figures it out in this case */<br>
>> >> > info->bpc = 0;<br>
>> >> > info->color_formats = 0;<br>
>> >> > + info->edid_hdmi_dc_modes = 0;<br>
>> >> > info->cea_rev = 0;<br>
>> >> > info->max_tmds_clock = 0;<br>
>> >> > info->dvi_dual = false;<br>
>> >> > --<br>
>> >> > 2.11.0<br>
>> >><br>
>> >> --<br>
>> >> Ville Syrjälä<br>
>> >> Intel OTC<br>
>> >> ______________________________<wbr>_________________<br>
>> >> dri-devel mailing list<br>
>> >> <a href="mailto:dri-devel@lists.freedesktop.org">dri-devel@lists.freedesktop.<wbr>org</a><br>
>> >> <a href="https://lists.freedesktop.org/mailman/listinfo/dri-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/dri-devel</a><br>
>> ><br>
>> ><br>
>> ><br>
>> > ______________________________<wbr>_________________<br>
>> > dri-devel mailing list<br>
>> > <a href="mailto:dri-devel@lists.freedesktop.org">dri-devel@lists.freedesktop.<wbr>org</a><br>
>> > <a href="https://lists.freedesktop.org/mailman/listinfo/dri-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/dri-devel</a><br>
>> ><br>
><br>
> --<br>
> Ville Syrjälä<br>
> Intel OTC<br>
</div></div></blockquote></div><br></div>