From: "Shankar, Uma" <uma.shankar@intel.com>
To: "Nikula, Jani" <jani.nikula@intel.com>,
"intel-gfx@lists.freedesktop.org"
<intel-gfx@lists.freedesktop.org>
Cc: "dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>,
"ville.syrjala@linux.intel.com" <ville.syrjala@linux.intel.com>,
"Nikula, Jani" <jani.nikula@intel.com>
Subject: Re: [Intel-gfx] [PATCH v2 3/6] drm/edid: abstract OUI conversion to 24-bit int
Date: Mon, 13 Sep 2021 05:35:10 +0000 [thread overview]
Message-ID: <e1c4d6369d8a4f7cb94bca5e03e6a6a3@intel.com> (raw)
In-Reply-To: <2f43032d5f001510c7eed059321ceeb76d07a606.1630419362.git.jani.nikula@intel.com>
> -----Original Message-----
> From: dri-devel <dri-devel-bounces@lists.freedesktop.org> On Behalf Of Jani Nikula
> Sent: Tuesday, August 31, 2021 7:48 PM
> To: intel-gfx@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org; ville.syrjala@linux.intel.com; Nikula, Jani
> <jani.nikula@intel.com>
> Subject: [PATCH v2 3/6] drm/edid: abstract OUI conversion to 24-bit int
>
> Replace the open coded OUI conversion from three bytes to a 24-bit int, as we'll be
> adding one more user shortly. No functional changes.
>
> Side note: CTA-861 format has the OUI bytes in reverse order.
Looks ok to me.
Reviewed-by: Uma Shankar <uma.shankar@intel.com>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
> drivers/gpu/drm/drm_edid.c | 17 +++++++----------
> 1 file changed, 7 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index
> 6325877c5fd6..92974b1478bc 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -49,6 +49,11 @@
> (((edid)->version > (maj)) || \
> ((edid)->version == (maj) && (edid)->revision > (min)))
>
> +static int oui(u8 first, u8 second, u8 third) {
> + return (first << 16) | (second << 8) | third; }
> +
> #define EDID_EST_TIMINGS 16
> #define EDID_STD_TIMINGS 8
> #define EDID_DETAILED_TIMINGS 4
> @@ -4113,32 +4118,24 @@ cea_db_offsets(const u8 *cea, int *start, int *end)
>
> static bool cea_db_is_hdmi_vsdb(const u8 *db) {
> - int hdmi_id;
> -
> if (cea_db_tag(db) != VENDOR_BLOCK)
> return false;
>
> if (cea_db_payload_len(db) < 5)
> return false;
>
> - hdmi_id = db[1] | (db[2] << 8) | (db[3] << 16);
> -
> - return hdmi_id == HDMI_IEEE_OUI;
> + return oui(db[3], db[2], db[1]) == HDMI_IEEE_OUI;
> }
>
> static bool cea_db_is_hdmi_forum_vsdb(const u8 *db) {
> - unsigned int oui;
> -
> if (cea_db_tag(db) != VENDOR_BLOCK)
> return false;
>
> if (cea_db_payload_len(db) < 7)
> return false;
>
> - oui = db[3] << 16 | db[2] << 8 | db[1];
> -
> - return oui == HDMI_FORUM_IEEE_OUI;
> + return oui(db[3], db[2], db[1]) == HDMI_FORUM_IEEE_OUI;
> }
>
> static bool cea_db_is_vcdb(const u8 *db)
> --
> 2.30.2
next prev parent reply other threads:[~2021-09-13 5:35 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-31 14:17 [Intel-gfx] [PATCH v2 0/6] drm/displayid: VESA vendor block and drm/i915 MSO use of it Jani Nikula
2021-08-31 14:17 ` [Intel-gfx] [PATCH v2 1/6] drm/displayid: re-align data block macros Jani Nikula
2021-09-13 5:31 ` Shankar, Uma
2021-08-31 14:17 ` [Intel-gfx] [PATCH v2 2/6] drm/displayid: add DisplayID v2.0 data blocks and primary use cases Jani Nikula
2021-09-13 5:33 ` Shankar, Uma
2021-08-31 14:17 ` [Intel-gfx] [PATCH v2 3/6] drm/edid: abstract OUI conversion to 24-bit int Jani Nikula
2021-09-13 5:35 ` Shankar, Uma [this message]
2021-08-31 14:17 ` [Intel-gfx] [PATCH v2 4/6] drm/edid: parse the DisplayID v2.0 VESA vendor block for MSO Jani Nikula
2021-09-13 6:23 ` Shankar, Uma
2021-09-13 9:30 ` Jani Nikula
2021-09-13 11:21 ` Shankar, Uma
2021-08-31 14:17 ` [Intel-gfx] [PATCH v2 5/6] drm/i915/edp: postpone MSO init until after EDID read Jani Nikula
2021-09-13 6:24 ` Shankar, Uma
2021-08-31 14:17 ` [Intel-gfx] [PATCH v2 6/6] drm/i915/edp: use MSO pixel overlap from DisplayID data Jani Nikula
2021-09-13 6:26 ` Shankar, Uma
2021-08-31 15:31 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for drm/displayid: VESA vendor block and drm/i915 MSO use of it (rev2) Patchwork
2021-08-31 15:59 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2021-08-31 19:36 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2021-09-13 16:45 ` [Intel-gfx] [PATCH v2 0/6] drm/displayid: VESA vendor block and drm/i915 MSO use of it Jani Nikula
2021-09-14 8:29 ` Maxime Ripard
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=e1c4d6369d8a4f7cb94bca5e03e6a6a3@intel.com \
--to=uma.shankar@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jani.nikula@intel.com \
--cc=ville.syrjala@linux.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