intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: "20191004215851.31446-1-shawn.c.lee@intel.com"
	<20191004215851.31446-1-shawn.c.lee@intel.com>,
	Adam Jackson <ajax@redhat.com>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>
Cc: "Chiou, Cooper" <cooper.chiou@intel.com>,
	Gustavo Padovan <gustavo@padovan.org>
Subject: RE: [PATCH] drm/i915: customize DPCD brightness control for specific panel
Date: Mon, 07 Oct 2019 12:08:40 +0300	[thread overview]
Message-ID: <877e5gj52f.fsf@intel.com> (raw)
In-Reply-To: <D42A2A322A1FCA4089E30E9A9BA36AC65D6A9C66@PGSMSX111.gar.corp.intel.com>

On Mon, 07 Oct 2019, "Lee, Shawn C" <shawn.c.lee@intel.com> wrote:
> On Fri, 04 Oct 2019, Jani Nikula <jani.nikula@intel.com> wrote:
>>On Fri, 04 Oct 2019, Adam Jackson <ajax@redhat.com> wrote:
>>> On Sat, 2019-10-05 at 05:58 +0800, Lee Shawn C wrote:
>>>> This panel (manufacturer is SDC, product ID is 0x4141) used 
>>>> manufacturer defined DPCD register to control brightness that not 
>>>> defined in eDP spec so far. This change follow panel vendor's 
>>>> instruction to support brightness adjustment.
>>>
>>> I'm sure this works, but this smells a little funny to me.
>>
>>That was kindly put. ;)
>>
>>>> +	/* Samsung eDP panel */
>>>> +	{ "SDC", 0x4141, EDID_QUIRK_NON_STD_BRIGHTNESS_CONTROL },
>>>
>>> It feels a bit like a layering violation to identify eDP behavior 
>>> changes based on EDID. But I'm not sure there's any obvious way to 
>>> identify this device by its DPCD. The Sink OUI (from the linked
>>> bugzilla) seems to be 0011F8, which doesn't match up to anything in my 
>>> oui.txt...
>>
>>We have the DPCD quirk stuff in drm_dp_helper.c, but IIUC in this case 
>>there's only the OUI, and the device id etc. are all zeros. Otherwise I
>>think that would be the natural thing to do, and all this could be
>>better hidden away in i915.
>>
>
> Below is what we dumped from this panel. Only sink OUI (ba-41-59) in it
> and nothing else. 
> 00000400  ba 41 59 00 00 00 00 00  00 00 00 00 00 00 00 00  |.AY.............|
> 00000410  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................
>
> That's why the patch to identify EDID's manufacturer and product ID
> to make sure this method applied on specific panel.
>
>>>
>>>> @@ -1953,6 +1956,7 @@ static u32 edid_get_quirks(const struct edid 
>>>> *edid)
>>>>  
>>>>  	return 0;
>>>>  }
>>>> +EXPORT_SYMBOL(edid_get_quirks);
>>>
>>> If we're going to export this it should probably get a drm_ prefix.
>
> Yes! It will be better to have drm_ prefix for export funciton.
>
>>>
>>>> +#define DPCD_EDP_GETSET_CTRL_PARAMS		0x344
>>>> +#define DPCD_EDP_CONTENT_LUMINANCE		0x346
>>>> +#define DPCD_EDP_PANEL_LUMINANCE_OVERRIDE	0x34a
>>>> +#define DPCD_EDP_BRIGHTNESS_NITS		0x354
>>>> +#define DPCD_EDP_BRIGHTNESS_OPTIMIZATION	0x358
>>>> +
>>>> +#define EDP_CUSTOMIZE_MAX_BRIGHTNESS_LEVEL	(512)
>>>
>>> This also seems a bit weird, the 0x300-0x3FF registers belong to the 
>>> _source_ DP device. But then later...
>>>
>>>> +	/* write source OUI */
>>>> +	write_val[0] = 0x00;
>>>> +	write_val[1] = 0xaa;
>>>> +	write_val[2] = 0x01;
>>>
>>> Oh hey, you're writing (an) Intel OUI to the Source OUI, so now it 
>>> makes sense that you're writing to registers whose behavior the source 
>>> defines. But this does raise the question: is this just a convention 
>>> between Intel and this particular panel? Would we expect this to work 
>>> with other similar panels? Is there any way to know to expect this 
>>> convention from DPCD instead?
>
> TCON would reply on source OUI to configure its capability. And these
> DPCD registers were defined by vendor and Intel. This change should works
> with similar panels (with same TCON). Seems there is another issue so
> vendor decide to use non standard way to setup brightness.
>
>>For one thing, it's not standard. I honestly don't know, but I'd assume
>>you wouldn't find behaviour with Intel OUI in non-Intel designs... and a
>>quirk of some sort seems like the only way to make this work.
>>
>>I suppose we could start off with a DPCD quirk that only looks at the
>>sink OUI, and then, if needed, limit by DMI matching or by checking for
>>some DPCD registers (what, I am not sure, perhaps write the source OUI
>>and see how it behaves).
>>
>>That would avoid the mildly annoying change in the EDID quirk interface
>>and how it's being used.
>>
>>Thoughts?
>>
>>
>>BR,
>>Jani.
>>
>
> To be honest. Panel vendor did not provide enough sink info in DPCD.
> That's why hard to recognize it and we have to confirm EDID instead of DPCD.
>
> Do you mean just confirm sink OUI only from DPCD quirk? I'm afraid it
> may impact the other panels with the same TCON. Any suggestion?

The problem with the EDID quirks is that exposing the quirks sticks out
like a sore thumb. Thus far all of it has been contained in drm_edid.c
and they affect how the EDID gets parsed, for all drivers. Obviously
this could be changed, but is it the right thing to do?

What I suggested was, check the OUI only, and if it matches, do
more. Perhaps there's something in the 0x300 range of DPCD offsets that
you can read? Or perhaps you need to write the source OUI first, and
then do that.

BR,
Jani.


>
>>
>>--
>>Jani Nikula, Intel Open Source Graphics Center
>>

-- 
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2019-10-07  9:08 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-04 21:58 [PATCH] drm/i915: customize DPCD brightness control for specific panel Lee Shawn C
2019-10-04 15:19 ` Adam Jackson
2019-10-04 18:40   ` Jani Nikula
2019-10-07  4:02     ` Lee, Shawn C
2019-10-07  9:08       ` Jani Nikula [this message]
2019-10-07 17:38         ` Adam Jackson
2019-10-08  9:19           ` Jani Nikula
2019-11-27  0:02             ` [Intel-gfx] " Lyude Paul
2019-11-27  0:02               ` Lyude Paul
2019-11-27 10:38               ` Jani Nikula
2019-11-27 10:38                 ` Jani Nikula
2019-10-04 17:08 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2019-10-04 17:34 ` ✓ Fi.CI.BAT: success " Patchwork
2019-10-05  4:06 ` ✗ Fi.CI.IGT: failure " Patchwork
2019-10-09 12:25 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: customize DPCD brightness control for specific panel (rev2) Patchwork
2019-10-09 12:56 ` ✗ Fi.CI.BAT: failure " Patchwork
2019-10-09 16:13 ` [PATCH v2] drm/i915: customize DPCD brightness control for specific panel Lee Shawn C
2019-11-27  0:25   ` Lyude Paul
2019-11-27  0:25     ` [Intel-gfx] " Lyude Paul
  -- strict thread matches above, loose matches on Subject: below --
2019-10-07  9:39 [PATCH] " Lee, Shawn C
2019-10-09  8:57 Lee, Shawn C

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877e5gj52f.fsf@intel.com \
    --to=jani.nikula@intel.com \
    --cc=20191004215851.31446-1-shawn.c.lee@intel.com \
    --cc=ajax@redhat.com \
    --cc=cooper.chiou@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gustavo@padovan.org \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).