<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Mar 20, 2017 at 9:37 AM, Doug Anderson <span dir="ltr"><<a href="mailto:dianders@chromium.org" target="_blank">dianders@chromium.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<span class=""><br>
On Mon, Mar 20, 2017 at 6:59 AM, Thierry Reding<br>
<<a href="mailto:thierry.reding@gmail.com">thierry.reding@gmail.com</a>> wrote:<br>
> On Thu, Mar 09, 2017 at 11:32:16PM -0500, Sean Paul wrote:<br>
>> Change the mode for Sharp lq123p1jx31 panel to something more<br>
>> rockchip-friendly such that we can use the fixed PLLs to<br>
>> generate the pixel clock<br>
>><br>
>> Cc: Chris Zhong <<a href="mailto:zyw@rock-chips.com">zyw@rock-chips.com</a>><br>
>> Cc: Stéphane Marchesin <<a href="mailto:marcheu@chromium.org">marcheu@chromium.org</a>><br>
>> Signed-off-by: Sean Paul <<a href="mailto:seanpaul@chromium.org">seanpaul@chromium.org</a>><br>
>> ---<br>
>>  drivers/gpu/drm/panel/panel-<wbr>simple.c | 7 ++++---<br>
>>  1 file changed, 4 insertions(+), 3 deletions(-)<br>
><br>
> That's really not how you should be doing this. If you want to support<br>
> this panel on more than one type of hardware, especially if they have<br>
> different restrictions on what clocks and timings they can generate,<br>
> the driver should specify the timings using a struct display_timing and<br>
> drivers should use that data to generate a mode that matches their<br>
> requirements but is still within the valid ranges specified in the .min<br>
> and .max values.<br>
><br>
> That said, in this particular case nobody seems to be using the panel<br>
> in the upstream kernel.<br>
<br>
</span>Sean and I had a private conversation about this too.  Roughly summarizing:<br>
<br>
1. We have validated with the panel manufacturer that 266.667 MHz is<br>
valid and within spec.  The panel's datasheet itself says something<br>
like "if you want to try other values you can, but they might not<br>
work", so technically the only values "known" to work are those that<br>
were in the original patch and the values here in Sean's patch.<br></blockquote><div><br></div><div>So why don't you add 2 modes, and let the drivers pick the clock they prefer?</div><div><br></div><div>Stéphane</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
2. In the particular case of rk3399-kevin (which uses this panel), we<br>
actually went through several iterations before we found a mode that<br>
not only worked with the limited PLLs but also that didn't generate<br>
excessive noise on the digitizer (used for stylus input).  The<br>
digitizer is (as I understand) a separate component from the panel<br>
itself, so this restriction isn't really one on the panel but is a<br>
reality of how this panel was used in real hardware.  I have no idea<br>
how one expresses this board-centric view of the world.<br>
<br>
NOTE: Point #2 actually made me check, and Sean's patch is the wrong<br>
iteration of these changes.  Please see <a href="http://crosreview.com/381015" rel="noreferrer" target="_blank">http://crosreview.com/381015</a><br>
<br>
3. In an ideal world, even on rk3399-kevin we'd be able to choose the<br>
252.75 MHz clock if the variable PLL on rk3399 happened to be<br>
available (if there was no external display whose pixel clock needed<br>
the variable PLL).  This would save a bit of power, and I believe the<br>
252.75 MHz also avoids noise on the digitizer.  ...but trying to deal<br>
with all this was very complicated.<br>
<br>
<br>
That all being said: I'd personally be in favor for something like<br>
Sean's patch to land since, as you said, there are no other current<br>
users of the panel.  It's nice to start with something working and<br>
hopefully we can figure out a more advanced / dynamic system sometime<br>
in the future.<br>
<span class=""><br>
<br>
> One minor nit below...<br>
><br>
>><br>
>> diff --git a/drivers/gpu/drm/panel/panel-<wbr>simple.c b/drivers/gpu/drm/panel/panel-<wbr>simple.c<br>
>> index 89eb0422821c..787b4d143220 100644<br>
>> --- a/drivers/gpu/drm/panel/panel-<wbr>simple.c<br>
>> +++ b/drivers/gpu/drm/panel/panel-<wbr>simple.c<br>
>> @@ -1598,17 +1598,18 @@ static const struct panel_desc sharp_lq101k1ly04 = {<br>
>>  };<br>
>><br>
>>  static const struct drm_display_mode sharp_lq123p1jx31_mode = {<br>
>> -     .clock = 252750,<br>
>> +     .clock = 266667,<br>
>>       .hdisplay = 2400,<br>
>>       .hsync_start = 2400 + 48,<br>
>>       .hsync_end = 2400 + 48 + 32,<br>
>> -     .htotal = 2400 + 48 + 32 + 80,<br>
>> +     .htotal = 2400 + 48 + 32 + 139,<br>
<br>
</span>Please fold in <<a href="https://chromium-review.googlesource.com/381015" rel="noreferrer" target="_blank">https://chromium-review.<wbr>googlesource.com/381015</a>> to<br>
get noise-free timings.<br>
<span class=""><br>
<br>
>>       .vdisplay = 1600,<br>
>>       .vsync_start = 1600 + 3,<br>
>>       .vsync_end = 1600 + 3 + 10,<br>
>> -     .vtotal = 1600 + 3 + 10 + 33,<br>
>> +     .vtotal = 1600 + 3 + 10 + 84,<br>
<br>
</span>Here too.<br>
<span class=""><br>
>>       .vrefresh = 60,<br>
>>       .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,<br>
>> +     .type = DRM_MODE_TYPE_PREFERRED | DRM_MODE_TYPE_DRIVER,<br>
<br>
</span>IIRC this was an attempt to deal with the fact that the EDID had a<br>
different mode than we were specifying here, but I could be wrong.<br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
<br>
-Doug<br>
</font></span></blockquote></div><br></div></div>