<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:PMingLiU;
panose-1:2 1 6 1 0 1 1 1 1 1;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:"\@PMingLiU";
panose-1:2 1 6 1 0 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.EmailStyle18
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.EmailStyle20
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">On Mon, 07 Oct 2019, "Jani Nikula" <<a href="mailto:jani.nikula@intel.com">jani.nikula@intel.com</a>> wrote:<o:p></o:p></p>
<p class="MsoNormal">>On Mon, 07 Oct 2019, "Lee, Shawn C" <<a href="mailto:shawn.c.lee@intel.com">shawn.c.lee@intel.com</a>> wrote:<o:p></o:p></p>
<p class="MsoNormal">>> On Fri, 04 Oct 2019, Jani Nikula <<a href="mailto:jani.nikula@intel.com">jani.nikula@intel.com</a>> wrote:<o:p></o:p></p>
<p class="MsoNormal">>>>On Fri, 04 Oct 2019, Adam Jackson <<a href="mailto:ajax@redhat.com">ajax@redhat.com</a>> wrote:<o:p></o:p></p>
<p class="MsoNormal">>>>> On Sat, 2019-10-05 at 05:58 +0800, Lee Shawn C wrote:<o:p></o:p></p>
<p class="MsoNormal">>>>>> This panel (manufacturer is SDC, product ID is 0x4141) used
<o:p></o:p></p>
<p class="MsoNormal">>>>>> manufacturer defined DPCD register to control brightness that not
<o:p></o:p></p>
<p class="MsoNormal">>>>>> defined in eDP spec so far. This change follow panel vendor's
<o:p></o:p></p>
<p class="MsoNormal">>>>>> instruction to support brightness adjustment.<o:p></o:p></p>
<p class="MsoNormal">>>>><o:p> </o:p></p>
<p class="MsoNormal">>>>> I'm sure this works, but this smells a little funny to me.<o:p></o:p></p>
<p class="MsoNormal">>>><o:p> </o:p></p>
<p class="MsoNormal">>>>That was kindly put. ;)<o:p></o:p></p>
<p class="MsoNormal">>>><o:p> </o:p></p>
<p class="MsoNormal">>>>>> + /* Samsung eDP panel */<o:p></o:p></p>
<p class="MsoNormal">>>>>> + { "SDC", 0x4141, EDID_QUIRK_NON_STD_BRIGHTNESS_CONTROL },<o:p></o:p></p>
<p class="MsoNormal">>>>><o:p> </o:p></p>
<p class="MsoNormal">>>>> It feels a bit like a layering violation to identify eDP behavior
<o:p></o:p></p>
<p class="MsoNormal">>>>> changes based on EDID. But I'm not sure there's any obvious way to
<o:p></o:p></p>
<p class="MsoNormal">>>>> identify this device by its DPCD. The Sink OUI (from the linked<o:p></o:p></p>
<p class="MsoNormal">>>>> bugzilla) seems to be 0011F8, which doesn't match up to anything in my
<o:p></o:p></p>
<p class="MsoNormal">>>>> oui.txt...<o:p></o:p></p>
<p class="MsoNormal">>>><o:p> </o:p></p>
<p class="MsoNormal">>>>We have the DPCD quirk stuff in drm_dp_helper.c, but IIUC in this case
<o:p></o:p></p>
<p class="MsoNormal">>>>there's only the OUI, and the device id etc. are all zeros. Otherwise I<o:p></o:p></p>
<p class="MsoNormal">>>>think that would be the natural thing to do, and all this could be<o:p></o:p></p>
<p class="MsoNormal">>>>better hidden away in i915.<o:p></o:p></p>
<p class="MsoNormal">>>><o:p> </o:p></p>
<p class="MsoNormal">>><o:p> </o:p></p>
<p class="MsoNormal">>> Below is what we dumped from this panel. Only sink OUI (ba-41-59) in it<o:p></o:p></p>
<p class="MsoNormal">>> and nothing else. <o:p></o:p></p>
<p class="MsoNormal">>> 00000400 ba 41 59 00 00 00 00 00 00 00 00 00 00 00 00 00 |.AY.............|<o:p></o:p></p>
<p class="MsoNormal">>> 00000410 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................<o:p></o:p></p>
<p class="MsoNormal">>><o:p> </o:p></p>
<p class="MsoNormal">>> That's why the patch to identify EDID's manufacturer and product ID<o:p></o:p></p>
<p class="MsoNormal">>> to make sure this method applied on specific panel.<o:p></o:p></p>
<p class="MsoNormal">>><o:p> </o:p></p>
<p class="MsoNormal">>>>><o:p> </o:p></p>
<p class="MsoNormal">>>>>> @@ -1953,6 +1956,7 @@ static u32 edid_get_quirks(const struct edid
<o:p></o:p></p>
<p class="MsoNormal">>>>>> *edid)<o:p></o:p></p>
<p class="MsoNormal">>>>>> <o:p></o:p></p>
<p class="MsoNormal">>>>>> return 0;<o:p></o:p></p>
<p class="MsoNormal">>>>>> }<o:p></o:p></p>
<p class="MsoNormal">>>>>> +EXPORT_SYMBOL(edid_get_quirks);<o:p></o:p></p>
<p class="MsoNormal">>>>><o:p> </o:p></p>
<p class="MsoNormal">>>>> If we're going to export this it should probably get a drm_ prefix.<o:p></o:p></p>
<p class="MsoNormal">>><o:p> </o:p></p>
<p class="MsoNormal">>> Yes! It will be better to have drm_ prefix for export funciton.<o:p></o:p></p>
<p class="MsoNormal">>><o:p> </o:p></p>
<p class="MsoNormal">>>>><o:p> </o:p></p>
<p class="MsoNormal">>>>>> +#define DPCD_EDP_GETSET_CTRL_PARAMS 0x344<o:p></o:p></p>
<p class="MsoNormal">>>>>> +#define DPCD_EDP_CONTENT_LUMINANCE 0x346<o:p></o:p></p>
<p class="MsoNormal">>>>>> +#define DPCD_EDP_PANEL_LUMINANCE_OVERRIDE 0x34a<o:p></o:p></p>
<p class="MsoNormal">>>>>> +#define DPCD_EDP_BRIGHTNESS_NITS 0x354<o:p></o:p></p>
<p class="MsoNormal">>>>>> +#define DPCD_EDP_BRIGHTNESS_OPTIMIZATION 0x358<o:p></o:p></p>
<p class="MsoNormal">>>>>> +<o:p></o:p></p>
<p class="MsoNormal">>>>>> +#define EDP_CUSTOMIZE_MAX_BRIGHTNESS_LEVEL (512)<o:p></o:p></p>
<p class="MsoNormal">>>>><o:p> </o:p></p>
<p class="MsoNormal">>>>> This also seems a bit weird, the 0x300-0x3FF registers belong to the
<o:p></o:p></p>
<p class="MsoNormal">>>>> _source_ DP device. But then later...<o:p></o:p></p>
<p class="MsoNormal">>>>><o:p> </o:p></p>
<p class="MsoNormal">>>>>> + /* write source OUI */<o:p></o:p></p>
<p class="MsoNormal">>>>>> + write_val[0] = 0x00;<o:p></o:p></p>
<p class="MsoNormal">>>>>> + write_val[1] = 0xaa;<o:p></o:p></p>
<p class="MsoNormal">>>>>> + write_val[2] = 0x01;<o:p></o:p></p>
<p class="MsoNormal">>>>><o:p> </o:p></p>
<p class="MsoNormal">>>>> Oh hey, you're writing (an) Intel OUI to the Source OUI, so now it
<o:p></o:p></p>
<p class="MsoNormal">>>>> makes sense that you're writing to registers whose behavior the source
<o:p></o:p></p>
<p class="MsoNormal">>>>> defines. But this does raise the question: is this just a convention
<o:p></o:p></p>
<p class="MsoNormal">>>>> between Intel and this particular panel? Would we expect this to work
<o:p></o:p></p>
<p class="MsoNormal">>>>> with other similar panels? Is there any way to know to expect this
<o:p></o:p></p>
<p class="MsoNormal">>>>> convention from DPCD instead?<o:p></o:p></p>
<p class="MsoNormal">>><o:p> </o:p></p>
<p class="MsoNormal">>> TCON would reply on source OUI to configure its capability. And these<o:p></o:p></p>
<p class="MsoNormal">>> DPCD registers were defined by vendor and Intel. This change should works<o:p></o:p></p>
<p class="MsoNormal">>> with similar panels (with same TCON). Seems there is another issue so<o:p></o:p></p>
<p class="MsoNormal">>> vendor decide to use non standard way to setup brightness.<o:p></o:p></p>
<p class="MsoNormal">>><o:p> </o:p></p>
<p class="MsoNormal">>>>For one thing, it's not standard. I honestly don't know, but I'd assume<o:p></o:p></p>
<p class="MsoNormal">>>>you wouldn't find behaviour with Intel OUI in non-Intel designs... and a<o:p></o:p></p>
<p class="MsoNormal">>>>quirk of some sort seems like the only way to make this work.<o:p></o:p></p>
<p class="MsoNormal">>>><o:p> </o:p></p>
<p class="MsoNormal">>>>I suppose we could start off with a DPCD quirk that only looks at the<o:p></o:p></p>
<p class="MsoNormal">>>>sink OUI, and then, if needed, limit by DMI matching or by checking for<o:p></o:p></p>
<p class="MsoNormal">>>>some DPCD registers (what, I am not sure, perhaps write the source OUI<o:p></o:p></p>
<p class="MsoNormal">>>>and see how it behaves).<o:p></o:p></p>
<p class="MsoNormal">>>><o:p> </o:p></p>
<p class="MsoNormal">>>>That would avoid the mildly annoying change in the EDID quirk interface<o:p></o:p></p>
<p class="MsoNormal">>>>and how it's being used.<o:p></o:p></p>
<p class="MsoNormal">>>><o:p> </o:p></p>
<p class="MsoNormal">>>>Thoughts?<o:p></o:p></p>
<p class="MsoNormal">>>><o:p> </o:p></p>
<p class="MsoNormal">>>><o:p> </o:p></p>
<p class="MsoNormal">>>>BR,<o:p></o:p></p>
<p class="MsoNormal">>>>Jani.<o:p></o:p></p>
<p class="MsoNormal">>>><o:p> </o:p></p>
<p class="MsoNormal">>><o:p> </o:p></p>
<p class="MsoNormal">>> To be honest. Panel vendor did not provide enough sink info in DPCD.<o:p></o:p></p>
<p class="MsoNormal">>> That's why hard to recognize it and we have to confirm EDID instead of DPCD.<o:p></o:p></p>
<p class="MsoNormal">>><o:p> </o:p></p>
<p class="MsoNormal">>> Do you mean just confirm sink OUI only from DPCD quirk? I'm afraid it<o:p></o:p></p>
<p class="MsoNormal">>> may impact the other panels with the same TCON. Any suggestion?<o:p></o:p></p>
<p class="MsoNormal">><o:p> </o:p></p>
<p class="MsoNormal">>The problem with the EDID quirks is that exposing the quirks sticks out<o:p></o:p></p>
<p class="MsoNormal">>like a sore thumb. Thus far all of it has been contained in drm_edid.c<o:p></o:p></p>
<p class="MsoNormal">>and they affect how the EDID gets parsed, for all drivers. Obviously<o:p></o:p></p>
<p class="MsoNormal">>this could be changed, but is it the right thing to do?<o:p></o:p></p>
<p class="MsoNormal">><o:p> </o:p></p>
<p class="MsoNormal">>What I suggested was, check the OUI only, and if it matches, do<o:p></o:p></p>
<p class="MsoNormal">>more. Perhaps there's something in the 0x300 range of DPCD offsets that<o:p></o:p></p>
<p class="MsoNormal">>you can read? Or perhaps you need to write the source OUI first, and<o:p></o:p></p>
<p class="MsoNormal">>then do that.<o:p></o:p></p>
<p class="MsoNormal">><o:p> </o:p></p>
<p class="MsoNormal">>BR,<o:p></o:p></p>
<p class="MsoNormal">>Jani.<o:p></o:p></p>
<p class="MsoNormal">><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">These bytes are RO. Seems we can used it to identify this panel<o:p></o:p></p>
<p class="MsoNormal">as well. I will use DPCD quirk and renew this patch again.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">><o:p> </o:p></p>
<p class="MsoNormal">>><o:p> </o:p></p>
<p class="MsoNormal">>>><o:p> </o:p></p>
<p class="MsoNormal">>>>--<o:p></o:p></p>
<p class="MsoNormal">>>>Jani Nikula, Intel Open Source Graphics Center<o:p></o:p></p>
<p class="MsoNormal">>>><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>