diff options
author | Jani Nikula <jani.nikula@intel.com> | 2022-05-09 15:03:20 +0300 |
---|---|---|
committer | Jani Nikula <jani.nikula@intel.com> | 2022-05-13 18:55:00 +0300 |
commit | 5e87b2e5171621ff00ec197c9af15bc3aa405b6b (patch) | |
tree | 2a019ed676f547565e231af80034ae1378b421a3 | |
parent | 0c057877cbdf261efa7874474f48c715cd6401ba (diff) | |
download | linux-5e87b2e5171621ff00ec197c9af15bc3aa405b6b.tar.xz |
drm/edid: convert cea_db_iter_edid_begin() to drm_edid
We'll need to propagate drm_edid everywhere.
v2: Handle NULL drm_edid
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/7d9f060815086e1e4ea037dbfb9fd8ad54d1f25e.1652097712.git.jani.nikula@intel.com
-rw-r--r-- | drivers/gpu/drm/drm_edid.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index f3f31534b78b..16eaf9acf8be 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -4448,12 +4448,13 @@ static bool cea_db_is_vendor(const struct cea_db *db, int vendor_oui) oui(data[2], data[1], data[0]) == vendor_oui; } -static void cea_db_iter_edid_begin(const struct edid *edid, struct cea_db_iter *iter) +static void cea_db_iter_edid_begin(const struct drm_edid *drm_edid, + struct cea_db_iter *iter) { memset(iter, 0, sizeof(*iter)); - drm_edid_iter_begin(edid, &iter->edid_iter); - displayid_iter_edid_begin(edid, &iter->displayid_iter); + drm_edid_iter_begin(drm_edid ? drm_edid->edid : NULL, &iter->edid_iter); + displayid_iter_edid_begin(drm_edid ? drm_edid->edid : NULL, &iter->displayid_iter); } static const struct cea_db * @@ -4675,7 +4676,7 @@ static int add_cea_modes(struct drm_connector *connector, struct cea_db_iter iter; int modes = 0; - cea_db_iter_edid_begin(drm_edid->edid, &iter); + cea_db_iter_edid_begin(drm_edid, &iter); cea_db_iter_for_each(db, &iter) { const u8 *hdmi = NULL, *video = NULL; u8 hdmi_len = 0, video_len = 0; @@ -4926,7 +4927,7 @@ static void drm_edid_to_eld(struct drm_connector *connector, eld[DRM_ELD_PRODUCT_CODE0] = drm_edid->edid->prod_code[0]; eld[DRM_ELD_PRODUCT_CODE1] = drm_edid->edid->prod_code[1]; - cea_db_iter_edid_begin(drm_edid->edid, &iter); + cea_db_iter_edid_begin(drm_edid, &iter); cea_db_iter_for_each(db, &iter) { const u8 *data = cea_db_data(db); int len = cea_db_payload_len(db); @@ -4979,7 +4980,7 @@ static int _drm_edid_to_sad(const struct drm_edid *drm_edid, struct cea_db_iter iter; int count = 0; - cea_db_iter_edid_begin(drm_edid ? drm_edid->edid : NULL, &iter); + cea_db_iter_edid_begin(drm_edid, &iter); cea_db_iter_for_each(db, &iter) { if (cea_db_tag(db) == CTA_DB_AUDIO) { int j; @@ -5032,7 +5033,7 @@ static int _drm_edid_to_speaker_allocation(const struct drm_edid *drm_edid, struct cea_db_iter iter; int count = 0; - cea_db_iter_edid_begin(drm_edid ? drm_edid->edid : NULL, &iter); + cea_db_iter_edid_begin(drm_edid, &iter); cea_db_iter_for_each(db, &iter) { if (cea_db_tag(db) == CTA_DB_SPEAKER && cea_db_payload_len(db) == 3) { @@ -5123,7 +5124,7 @@ static bool _drm_detect_hdmi_monitor(const struct drm_edid *drm_edid) * Because HDMI identifier is in Vendor Specific Block, * search it from all data blocks of CEA extension. */ - cea_db_iter_edid_begin(drm_edid ? drm_edid->edid : NULL, &iter); + cea_db_iter_edid_begin(drm_edid, &iter); cea_db_iter_for_each(db, &iter) { if (cea_db_is_hdmi_vsdb(db)) { hdmi = true; @@ -5177,7 +5178,7 @@ static bool _drm_detect_monitor_audio(const struct drm_edid *drm_edid) goto end; } - cea_db_iter_edid_begin(drm_edid ? drm_edid->edid : NULL, &iter); + cea_db_iter_edid_begin(drm_edid, &iter); cea_db_iter_for_each(db, &iter) { if (cea_db_tag(db) == CTA_DB_AUDIO) { const u8 *data = cea_db_data(db); @@ -5536,7 +5537,7 @@ static void drm_parse_cea_ext(struct drm_connector *connector, } drm_edid_iter_end(&edid_iter); - cea_db_iter_edid_begin(drm_edid->edid, &iter); + cea_db_iter_edid_begin(drm_edid, &iter); cea_db_iter_for_each(db, &iter) { /* FIXME: convert parsers to use struct cea_db */ const u8 *data = (const u8 *)db; |