diff options
author | Jani Nikula <jani.nikula@intel.com> | 2022-05-09 15:03:18 +0300 |
---|---|---|
committer | Jani Nikula <jani.nikula@intel.com> | 2022-05-13 18:54:52 +0300 |
commit | 3176d0925027727ec37e388e9363f124c2c52ae9 (patch) | |
tree | 4254090385489b175cd7349ec18a654927a2b06b /drivers/gpu/drm/drm_edid.c | |
parent | 027034511c6a1e3ea96122f7626b89b6d339ed49 (diff) | |
download | linux-3176d0925027727ec37e388e9363f124c2c52ae9.tar.xz |
drm/edid: add drm_edid helper for drm_detect_hdmi_monitor()
We'll need to propagate drm_edid everywhere.
v2: Handle NULL EDID pointer (Ville, CI)
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/2fbee0d7b544b44ef0866bb154beefac5d260bec.1652097712.git.jani.nikula@intel.com
Diffstat (limited to 'drivers/gpu/drm/drm_edid.c')
-rw-r--r-- | drivers/gpu/drm/drm_edid.c | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index 4e7811c2eb07..ad5e372f046b 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -5113,18 +5113,7 @@ int drm_av_sync_delay(struct drm_connector *connector, } EXPORT_SYMBOL(drm_av_sync_delay); -/** - * drm_detect_hdmi_monitor - detect whether monitor is HDMI - * @edid: monitor EDID information - * - * Parse the CEA extension according to CEA-861-B. - * - * Drivers that have added the modes parsed from EDID to drm_display_info - * should use &drm_display_info.is_hdmi instead of calling this function. - * - * Return: True if the monitor is HDMI, false if not or unknown. - */ -bool drm_detect_hdmi_monitor(const struct edid *edid) +static bool _drm_detect_hdmi_monitor(const struct drm_edid *drm_edid) { const struct cea_db *db; struct cea_db_iter iter; @@ -5134,7 +5123,7 @@ bool drm_detect_hdmi_monitor(const struct edid *edid) * Because HDMI identifier is in Vendor Specific Block, * search it from all data blocks of CEA extension. */ - cea_db_iter_edid_begin(edid, &iter); + cea_db_iter_edid_begin(drm_edid ? drm_edid->edid : NULL, &iter); cea_db_iter_for_each(db, &iter) { if (cea_db_is_hdmi_vsdb(db)) { hdmi = true; @@ -5145,6 +5134,24 @@ bool drm_detect_hdmi_monitor(const struct edid *edid) return hdmi; } + +/** + * drm_detect_hdmi_monitor - detect whether monitor is HDMI + * @edid: monitor EDID information + * + * Parse the CEA extension according to CEA-861-B. + * + * Drivers that have added the modes parsed from EDID to drm_display_info + * should use &drm_display_info.is_hdmi instead of calling this function. + * + * Return: True if the monitor is HDMI, false if not or unknown. + */ +bool drm_detect_hdmi_monitor(const struct edid *edid) +{ + struct drm_edid drm_edid; + + return _drm_detect_hdmi_monitor(drm_edid_legacy_init(&drm_edid, edid)); +} EXPORT_SYMBOL(drm_detect_hdmi_monitor); /** |