From: Jani Nikula <jani.nikula@intel.com>
To: Adam Jackson <ajax@redhat.com>,
Lee Shawn C <shawn.c.lee@intel.com>,
intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Cc: Cooper Chiou <cooper.chiou@intel.com>,
Gustavo Padovan <gustavo@padovan.org>
Subject: Re: [PATCH] drm/i915: customize DPCD brightness control for specific panel
Date: Fri, 04 Oct 2019 21:40:22 +0300 [thread overview]
Message-ID: <87d0fce4mh.fsf@intel.com> (raw)
In-Reply-To: <33dcaf669eae3acfc3b716e68b69c0fe76dd2dbc.camel@redhat.com>
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.
>
>> @@ -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.
>
>> +#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?
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.
--
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2019-10-04 18:40 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 [this message]
2019-10-07 4:02 ` Lee, Shawn C
2019-10-07 9:08 ` Jani Nikula
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=87d0fce4mh.fsf@intel.com \
--to=jani.nikula@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 \
--cc=shawn.c.lee@intel.com \
/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).