<div dir="ltr"><div dir="ltr">On Mon, Jan 25, 2021 at 1:09 PM Ville Syrjälä <<a href="mailto:ville.syrjala@linux.intel.com">ville.syrjala@linux.intel.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Sun, Jan 24, 2021 at 10:04:54PM +0100, Mario Kleiner wrote:<br>
> On Sun, Jan 24, 2021 at 9:24 PM Simon Ser <<a href="mailto:contact@emersion.fr" target="_blank">contact@emersion.fr</a>> wrote:<br>
> <br>
> > On Sunday, January 24th, 2021 at 9:10 PM, Mario Kleiner <<br>
> > <a href="mailto:mario.kleiner.de@gmail.com" target="_blank">mario.kleiner.de@gmail.com</a>> wrote:<br>
> ><br>
> > > But it still needs to be fixed if we want working HDR. I thought<br>
> > > libdrm copies the definitions from the kernel periodically, so the<br>
> > > fix should propagate?<br>
> ><br>
> > There will always be user-space that sends 1 instead of 0. This<br>
> > shouldn't fail on more recent kernels or it will be a regression.<br>
> ><br>
> <br>
> Yes, i know, regressing user-space is bad, but in this very specific case a<br>
> "good" one, if ever. At the moment, it wouldn't regress userspace simply<br>
> because the kernel doesn't actually check for the correct value in its HDR<br>
> metadata handling. But the value itself is sent as HDMI HDR metadata to the<br>
> attached HDR display monitor, so if the monitors firmware checks, it will<br>
> classify the wrong value of 1 as invalid and disable HDR mode on the<br>
> display, which is certainly not what a HDR client application wants. And<br>
> future HDR standards which will actually allocate the value 1 to a<br>
> different mode of HDR operation will switch to the wrong mode /<br>
> misinterpret the sent HDR metadata with hillarious results, which is also<br>
> not in the interest of a HDR client application, or a HDR capable<br>
> compositor.<br>
> <br>
> Iow. if clients continue to use the wrong value 1 then HDR display will<br>
> break in various ways on correctly implemented HDR displays, but in a<br>
> mystifying and hard to debug way. The kernel rejecting a wrong setting<br>
> explicitly and forcing a bug fix in the client would be a blessing in this<br>
> case.<br>
> <br>
> I spent weeks last year, going in circles and hunting ghost bugs related to<br>
> HDR because much of the HDR stuff, both drivers and monitor firmware seems<br>
> to be in not a great shape. "Less wrong" would be a big step forward.<br>
> Especially with the cheaper HDR monitors it is difficult to see when things<br>
> go wrong, because we don't have good expectations on how proper HDR should<br>
> look and the lower end HDR displays don't help.<br>
<br>
This is not an uapi defintion anyway so fixing should be fine.<br>
I don't think we even check any of the client provided values, or do we?<br>
EOTF I think we do check, but IMO that check should probably just be<br>
nuked as well if we don't bother checking anything else.<br>
<br></blockquote><div> </div><div>I think we check only EOTF atm. That check does make sense though, as userspace getting that wrong will definitely knock out even low-end HDR monitors. My tests with a - supposed to be pretty good according to tests - DisplayHDR-600 monitor suggest that that's pretty much the only thing the monitor actually uses, apart from CRC checking the data packet.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
I was in fact going to suggest nuking this entire hdr_sink_metadata<br>
parsing as unused, but looks like amdgpu has started to use it for<br>
some backlight stuff of all things.<br></blockquote><div><br></div><div>My gut feeling says we will need this info in the kernel in the future, independent of current users. Probably especially if one wants to do interesting things which combine HDR with VRR/DP-Adaptive sync, or future HDR standards (dynamic HDR metadata?), those infos in the kernel may become quite useful.</div><div> In some way it would even be nice to have all that info exposed in parsed form as a connector property or such, so all clients can use the same parsed data instead of reinventing the wheel. So I'd vote against nuking it.</div><div><br></div><div>Thanks,</div><div>-mario<br></div><br></div></div>