From: Ramalingam C <ramalingam.c@intel.com>
To: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
Cc: simon.ser@intel.com, daniel.vetter@ffwll.ch,
intel-gfx@lists.freedesktop.org, martin.peres@intel.com,
dri-devel@lists.freedesktop.org, paul.kocialkowski@bootlin.com,
jani.saarinen@intel.com
Subject: Re: [PATCH v2 1/3] drm: Add helper to compare edids.
Date: Fri, 28 Jun 2019 09:43:13 +0530 [thread overview]
Message-ID: <20190628041313.GB24852@intel.com> (raw)
In-Reply-To: <20190628082454.16345-2-stanislav.lisovskiy@intel.com>
On 2019-06-28 at 11:24:52 +0300, Stanislav Lisovskiy wrote:
> Many drivers would benefit from using
> drm helper to compare edid, rather
> than bothering with own implementation.
>
> v2: Added documentation for this function.
>
> Signed-off-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
> ---
> drivers/gpu/drm/drm_edid.c | 33 +++++++++++++++++++++++++++++++++
> include/drm/drm_edid.h | 9 +++++++++
> 2 files changed, 42 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index 9d8f2b952004..eaad5155fbdd 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -1361,6 +1361,39 @@ static bool drm_edid_is_zero(const u8 *in_edid, int length)
> return true;
> }
>
> +/**
> + * drm_edid_are_equal - compare two edid blobs.
> + * @edid1: pointer to first blob
> + * @edid2: pointer to second blob
extra line here is preferred.
> + * This helper can be used during probing to determine if
> + * edid had changed.
bool is implicit. if you want you can explain the return value.
> + */
> +bool drm_edid_are_equal(struct edid *edid1, struct edid *edid2)
> +{
> + int edid1_len, edid2_len;
> + bool edid1_present = edid1 != NULL;
> + bool edid2_present = edid2 != NULL;
> +
> + if (edid1_present != edid2_present)
> + return false;
> +
> + if (edid1) {
> +
> + edid1_len = EDID_LENGTH * (1 + edid1->extensions);
> + edid2_len = EDID_LENGTH * (1 + edid2->extensions);
> +
> + if (edid1_len != edid2_len)
> + return false;
> +
> + if (memcmp(edid1, edid2, edid1_len))
> + return false;
> + }
> +
> + return true;
> +}
> +EXPORT_SYMBOL(drm_edid_are_equal);
> +
> +
> /**
> * drm_edid_block_valid - Sanity check the EDID block (base or extension)
> * @raw_edid: pointer to raw EDID block
> diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
> index b9719418c3d2..716964f63312 100644
> --- a/include/drm/drm_edid.h
> +++ b/include/drm/drm_edid.h
> @@ -354,6 +354,15 @@ drm_load_edid_firmware(struct drm_connector *connector)
> }
> #endif
>
> +/**
> + * drm_edid_are_equal - compare two edid blobs.
> + * @edid1: pointer to first blob
> + * @edid2: pointer to second blob
> + * This helper can be used during probing to determine if
> + * edid had changed.
> + */
Do we need kdoc for function declaration too!? Should be sufficient for
definition alone.
-Ram
> +bool drm_edid_are_equal(struct edid *edid1, struct edid *edid2);
> +
> int
> drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame,
> struct drm_connector *connector,
> --
> 2.17.1
>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2019-06-28 4:13 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-28 8:24 [PATCH v2 0/3] Send a hotplug when edid changes Stanislav Lisovskiy
2019-06-28 8:24 ` [PATCH v2 1/3] drm: Add helper to compare edids Stanislav Lisovskiy
2019-06-28 4:13 ` Ramalingam C [this message]
2019-07-01 19:52 ` Lyude Paul
2019-06-28 8:24 ` [PATCH v2 2/3] drm: Introduce change counter to drm_connector Stanislav Lisovskiy
2019-06-28 4:16 ` Ramalingam C
2019-06-28 8:24 ` [PATCH v2 3/3] drm/i915: Send hotplug event if edid had changed Stanislav Lisovskiy
2019-06-28 4:24 ` Ramalingam C
2019-06-28 11:36 ` Lisovskiy, Stanislav
2019-06-28 4:50 ` Ramalingam C
2019-06-28 8:48 ` ✗ Fi.CI.CHECKPATCH: warning for Send a hotplug when edid changes (rev2) Patchwork
2019-06-28 15:49 ` ✓ Fi.CI.BAT: success " Patchwork
2019-06-28 23:11 ` ✗ Fi.CI.IGT: failure " Patchwork
2019-07-22 11:25 ` ✗ Fi.CI.BAT: failure for Send a hotplug when edid changes (rev3) Patchwork
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=20190628041313.GB24852@intel.com \
--to=ramalingam.c@intel.com \
--cc=daniel.vetter@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jani.saarinen@intel.com \
--cc=martin.peres@intel.com \
--cc=paul.kocialkowski@bootlin.com \
--cc=simon.ser@intel.com \
--cc=stanislav.lisovskiy@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