[Intel-gfx] [PATCH 2/2] drm/edid: Parse manufacturer id only once per sink

José Roberto de Souza jose.souza at intel.com
Thu Nov 8 00:23:53 UTC 2018


It was parsing the manufacturer id of the sink for each entry in
quirk list.

Signed-off-by: José Roberto de Souza <jose.souza at intel.com>
---
 drivers/gpu/drm/drm_edid.c | 21 ++++-----------------
 1 file changed, 4 insertions(+), 17 deletions(-)

diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 1a0ddf3d326b..69209fcc40f0 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -1770,22 +1770,6 @@ void drm_edid_manufacturer_parse(const struct edid *edid, char manufacturer[3])
 }
 EXPORT_SYMBOL(drm_edid_manufacturer_parse);
 
-/**
- * edid_vendor - match a string against EDID's obfuscated vendor field
- * @edid: EDID to match
- * @vendor: vendor string
- *
- * Returns true if @vendor is in @edid, false otherwise
- */
-static bool edid_vendor(const struct edid *edid, const char *vendor)
-{
-	char edid_vendor[3];
-
-	drm_edid_manufacturer_parse(edid, edid_vendor);
-
-	return !strncmp(edid_vendor, vendor, 3);
-}
-
 /**
  * edid_get_quirks - return quirk flags for a given EDID
  * @edid: EDID to process
@@ -1795,12 +1779,15 @@ static bool edid_vendor(const struct edid *edid, const char *vendor)
 static u32 edid_get_quirks(const struct edid *edid)
 {
 	const struct edid_quirk *quirk;
+	char edid_vendor[3];
 	int i;
 
+	drm_edid_manufacturer_parse(edid, edid_vendor);
+
 	for (i = 0; i < ARRAY_SIZE(edid_quirk_list); i++) {
 		quirk = &edid_quirk_list[i];
 
-		if (edid_vendor(edid, quirk->vendor) &&
+		if (!strncmp(edid_vendor, quirk->vendor, 3) &&
 		    (EDID_PRODUCT_ID(edid) == quirk->product_id))
 			return quirk->quirks;
 	}
-- 
2.19.1



More information about the Intel-gfx mailing list