From: Doug Anderson <dianders@chromium.org>
To: Andrzej Hajda <a.hajda@samsung.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>,
Thierry Reding <thierry.reding@gmail.com>,
Rob Herring <robh+dt@kernel.org>, Sam Ravnborg <sam@ravnborg.org>,
"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
<devicetree@vger.kernel.org>, Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
Linus W <linus.walleij@linaro.org>,
Daniel Vetter <daniel@ffwll.ch>,
linux-arm-msm <linux-arm-msm@vger.kernel.org>,
Steev Klimaszewski <steev@kali.org>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Bjorn Andersson <bjorn.andersson@linaro.org>,
David Airlie <airlied@linux.ie>,
dri-devel <dri-devel@lists.freedesktop.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v4 04/15] drm/edid: Use new encoded panel id style for quirks matching
Date: Tue, 14 Sep 2021 13:02:20 -0700 [thread overview]
Message-ID: <CAD=FV=XHvFq5+Rtax7WNq2-BieQr-BM4UnmOcma_eTzkX2ZtNA@mail.gmail.com> (raw)
In-Reply-To: <5af6cd50-0ed3-1a70-d7d0-66ca18a83d65@samsung.com>
Hi,
On Tue, Sep 14, 2021 at 12:36 PM Andrzej Hajda <a.hajda@samsung.com> wrote:
>
>
> W dniu 14.09.2021 o 20:59, Jani Nikula pisze:
> > On Tue, 14 Sep 2021, Doug Anderson <dianders@chromium.org> wrote:
> >> Hi,
> >>
> >> On Tue, Sep 14, 2021 at 11:16 AM Jani Nikula
> >> <jani.nikula@linux.intel.com> wrote:
> >>> On Thu, 09 Sep 2021, Douglas Anderson <dianders@chromium.org> wrote:
> >>>> In the patch ("drm/edid: Allow the querying/working with the panel ID
> >>>> from the EDID") we introduced a different way of working with the
> >>>> panel ID stored in the EDID. Let's use this new way for the quirks
> >>>> code.
> >>>>
> >>>> Advantages of the new style:
> >>>> * Smaller data structure size. Saves 4 bytes per panel.
> >>>> * Iterate through quirks structure with just "==" instead of strncmp()
> >>>> * In-kernel storage is more similar to what's stored in the EDID
> >>>> itself making it easier to grok that they are referring to the same
> >>>> value.
> >>>>
> >>>> The quirk table itself is arguably a bit less readable in the new
> >>>> style but not a ton less and it feels like the above advantages make
> >>>> up for it.
> >>> I suppose you could pass vendor as a string to EDID_QUIRK() to retain
> >>> better readability?
> >> I would love to, but I couldn't figure out how to do this and have it
> >> compile! Notably I need the compiler to be able to do math at compile
> >> time to compute the final u32 to store in the init data. I don't think
> >> the compiler can dereference strings (even constant strings) and do
> >> math on the result at compile time.
> > Ah, right.
>
>
> What about:
>
> +#define drm_edid_encode_panel_id(vend, product_id) \
> + ((((u32)((vend)[0]) - '@') & 0x1f) << 26 | \
> + (((u32)((vend)[1]) - '@') & 0x1f) << 21 | \
> + (((u32)((vend)[2]) - '@') & 0x1f) << 16 | \
> + ((product_id) & 0xffff))
Wow, I _swear_ I tried exactly that syntax, but clearly I didn't. It
works great and it looks _sooo_ much nicer now. Thanks! I'll send out
a v5 shortly with this.
-Doug
next prev parent reply other threads:[~2021-09-14 20:02 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-09 21:00 [PATCH v4 00/15] eDP: Support probing eDP panels dynamically instead of hardcoding Douglas Anderson
2021-09-09 21:00 ` [PATCH v4 01/15] dt-bindings: drm/panel-simple-edp: Introduce generic eDP panels Douglas Anderson
2021-09-14 19:11 ` Stephen Boyd
2021-09-14 19:11 ` Stephen Boyd
2021-09-14 20:13 ` Doug Anderson
2021-09-14 20:13 ` Doug Anderson
2021-09-09 21:00 ` [PATCH v4 02/15] drm/edid: Break out reading block 0 of the EDID Douglas Anderson
2021-09-14 18:50 ` Jani Nikula
2021-09-09 21:00 ` [PATCH v4 03/15] drm/edid: Allow querying/working with the panel ID from " Douglas Anderson
2021-09-14 18:53 ` Jani Nikula
2021-09-09 21:00 ` [PATCH v4 04/15] drm/edid: Use new encoded panel id style for quirks matching Douglas Anderson
2021-09-14 18:16 ` Jani Nikula
2021-09-14 18:31 ` Doug Anderson
2021-09-14 18:31 ` Doug Anderson
2021-09-14 18:59 ` Jani Nikula
2021-09-14 18:59 ` Jani Nikula
2021-09-14 19:36 ` Andrzej Hajda
2021-09-14 19:36 ` Andrzej Hajda
2021-09-14 20:02 ` Doug Anderson [this message]
2021-09-14 20:02 ` Doug Anderson
2021-09-14 18:55 ` Jani Nikula
2021-09-09 21:00 ` [PATCH v4 05/15] ARM: configs: Everyone who had PANEL_SIMPLE now gets PANEL_EDP Douglas Anderson
2021-09-09 21:00 ` [PATCH v4 06/15] arm64: defconfig: " Douglas Anderson
2021-09-09 21:00 ` Douglas Anderson
2021-09-09 21:00 ` [PATCH v4 07/15] drm/panel-edp: Split eDP panels out of panel-simple Douglas Anderson
2021-09-09 21:00 ` [PATCH v4 08/15] drm/panel-edp: Move some wayward panels to the eDP driver Douglas Anderson
2021-09-09 21:00 ` [PATCH v4 09/15] drm/panel-simple: Non-eDP panels don't need "HPD" handling Douglas Anderson
2021-09-09 21:00 ` [PATCH v4 10/15] drm/panel-edp: Split the delay structure out Douglas Anderson
2021-09-09 21:00 ` [PATCH v4 11/15] drm/panel-edp: Better describe eDP panel delays Douglas Anderson
2021-09-09 21:00 ` [PATCH v4 12/15] drm/panel-edp: hpd_reliable shouldn't be subtraced from hpd_absent Douglas Anderson
2021-09-09 21:00 ` [PATCH v4 13/15] drm/panel-edp: Fix "prepare_to_enable" if panel doesn't handle HPD Douglas Anderson
2021-09-09 21:00 ` [PATCH v4 14/15] drm/panel-edp: Don't re-read the EDID every time we power off the panel Douglas Anderson
2021-09-09 21:00 ` [PATCH v4 15/15] drm/panel-edp: Implement generic "edp-panel"s probed by EDID Douglas Anderson
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='CAD=FV=XHvFq5+Rtax7WNq2-BieQr-BM4UnmOcma_eTzkX2ZtNA@mail.gmail.com' \
--to=dianders@chromium.org \
--cc=a.hajda@samsung.com \
--cc=airlied@linux.ie \
--cc=bjorn.andersson@linaro.org \
--cc=daniel@ffwll.ch \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=jani.nikula@linux.intel.com \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=robh+dt@kernel.org \
--cc=sam@ravnborg.org \
--cc=steev@kali.org \
--cc=thierry.reding@gmail.com \
--cc=tzimmermann@suse.de \
--subject='Re: [PATCH v4 04/15] drm/edid: Use new encoded panel id style for quirks matching' \
/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
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.