From: Mitul Golani <mitulkumar.ajitkumar.golani@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: jani.nikula@intel.com
Subject: [Intel-gfx] [PATCH 2/3] drm: Add Wrapper Functions for ELD SAD Extraction
Date: Mon, 21 Aug 2023 21:30:03 +0530 [thread overview]
Message-ID: <20230821160004.2821445-3-mitulkumar.ajitkumar.golani@intel.com> (raw)
In-Reply-To: <20230821160004.2821445-1-mitulkumar.ajitkumar.golani@intel.com>
Add wrapper functions to facilitate extracting Short Audio
Descriptor (SAD) information from EDID-Like Data (ELD) pointers
with different constness requirements.
1. `drm_eld_sad`: This function returns a constant `uint8_t`
pointer and wraps the main extraction function, allowing access
to SAD information while maintaining const correctness.
2. `drm_extract_sad_from_eld`: This function returns a mutable
`uint8_t` pointer and implements the core logic for extracting
SAD from the provided ELD pointer. It performs version and
maximum channel checks to ensure proper extraction.
These wrapper functions provide flexibility to the codebase,
allowing users to access SAD information while adhering to
const correctness when needed and modifying the pointer when
required.
Signed-off-by: Mitul Golani <mitulkumar.ajitkumar.golani@intel.com>
---
include/drm/drm_edid.h | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
index 48e93f909ef6..626bc0d542eb 100644
--- a/include/drm/drm_edid.h
+++ b/include/drm/drm_edid.h
@@ -418,11 +418,7 @@ static inline int drm_eld_mnl(const uint8_t *eld)
return (eld[DRM_ELD_CEA_EDID_VER_MNL] & DRM_ELD_MNL_MASK) >> DRM_ELD_MNL_SHIFT;
}
-/**
- * drm_eld_sad - Get ELD SAD structures.
- * @eld: pointer to an eld memory structure with sad_count set
- */
-static inline const uint8_t *drm_eld_sad(const uint8_t *eld)
+static uint8_t *drm_extract_sad_from_eld(uint8_t *eld)
{
unsigned int ver, mnl;
@@ -437,6 +433,15 @@ static inline const uint8_t *drm_eld_sad(const uint8_t *eld)
return eld + DRM_ELD_CEA_SAD(mnl, 0);
}
+/**
+ * drm_eld_sad - Get ELD SAD structures.
+ * @eld: pointer to an eld memory structure with sad_count set
+ */
+static inline const uint8_t *drm_eld_sad(const uint8_t *eld)
+{
+ return drm_extract_sad_from_eld((uint8_t *)eld);
+}
+
/**
* drm_eld_sad_count - Get ELD SAD count.
* @eld: pointer to an eld memory structure with sad_count set
--
2.25.1
next prev parent reply other threads:[~2023-08-21 16:04 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-21 16:00 [Intel-gfx] [PATCH 0/3] Get optimal audio frequency and channels Mitul Golani
2023-08-21 16:00 ` [Intel-gfx] [PATCH 1/3] drm/i915: Add has_audio to separate audio parameter in crtc_state Mitul Golani
2023-08-21 16:00 ` Mitul Golani [this message]
2023-09-05 6:26 ` [Intel-gfx] [PATCH 2/3] drm: Add Wrapper Functions for ELD SAD Extraction Kandpal, Suraj
2023-09-07 9:35 ` Jani Nikula
2023-08-21 16:00 ` [Intel-gfx] [PATCH 3/3] drm/i915/display: Configure and initialize HDMI audio capabilities Mitul Golani
2023-09-05 9:17 ` Kandpal, Suraj
2023-09-06 16:17 ` Golani, Mitulkumar Ajitkumar
2023-09-08 8:17 ` Kandpal, Suraj
2023-08-21 21:58 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for Get optimal audio frequency and channels (rev10) Patchwork
2023-08-21 21:58 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2023-08-21 22:13 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-08-22 1:05 ` [Intel-gfx] ✓ Fi.CI.IGT: " 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=20230821160004.2821445-3-mitulkumar.ajitkumar.golani@intel.com \
--to=mitulkumar.ajitkumar.golani@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jani.nikula@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