summaryrefslogtreecommitdiffstats
path: root/include/drm
diff options
context:
space:
mode:
authorHsin-Yi Wang <hsinyi@chromium.org>2024-03-07 14:57:42 -0800
committerDouglas Anderson <dianders@chromium.org>2024-03-14 08:22:57 -0700
commit6e3fdedcf0bc03c852d9fdbb5443f1e43103195f (patch)
treec8e64f596612f5cefd9b2a9ca6bf2993d7b1ca9d /include/drm
parenta0b39da11618897e0a2b85ea28e34b8cbcbd3274 (diff)
downloadlinux-6e3fdedcf0bc03c852d9fdbb5443f1e43103195f.tar.gz
linux-6e3fdedcf0bc03c852d9fdbb5443f1e43103195f.tar.bz2
linux-6e3fdedcf0bc03c852d9fdbb5443f1e43103195f.zip
drm/edid: Add a function to match EDID with identity
Create a type drm_edid_ident as the identity of an EDID. Currently it contains panel id and monitor name. Create a function that can match a given EDID and an identity: 1. Reject if the panel id doesn't match. 2. If name is not null in identity, try to match it in the detailed timing blocks. Note that some panel vendors put the monitor name after EDID_DETAIL_MONITOR_STRING. Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org> Reviewed-by: Douglas Anderson <dianders@chromium.org> Reviewed-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Douglas Anderson <dianders@chromium.org> Link: https://patchwork.freedesktop.org/patch/msgid/20240307230653.1807557-3-hsinyi@chromium.org
Diffstat (limited to 'include/drm')
-rw-r--r--include/drm/drm_edid.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
index 9686a7cee6a6..6f65bbf655a1 100644
--- a/include/drm/drm_edid.h
+++ b/include/drm/drm_edid.h
@@ -312,6 +312,13 @@ struct edid {
u8 checksum;
} __packed;
+/* EDID matching */
+struct drm_edid_ident {
+ /* ID encoded by drm_edid_encode_panel_id() */
+ u32 panel_id;
+ const char *name;
+};
+
#define EDID_PRODUCT_ID(e) ((e)->prod_code[0] | ((e)->prod_code[1] << 8))
/* Short Audio Descriptor */
@@ -412,6 +419,8 @@ struct edid *drm_get_edid(struct drm_connector *connector,
struct i2c_adapter *adapter);
const struct drm_edid *drm_edid_read_base_block(struct i2c_adapter *adapter);
u32 drm_edid_get_panel_id(const struct drm_edid *drm_edid);
+bool drm_edid_match(const struct drm_edid *drm_edid,
+ const struct drm_edid_ident *ident);
struct edid *drm_get_edid_switcheroo(struct drm_connector *connector,
struct i2c_adapter *adapter);
struct edid *drm_edid_duplicate(const struct edid *edid);