Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp945238lqs; Wed, 6 Mar 2024 01:19:00 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWMXWFCdaxGCIR+6eR1HMKjyMiDbQMVdHaH77g/IIoi6pdf/5Arzuyw5guvMdVkbUfiOcFzRgnKjAbrKLHTeIS2/blH0wz88u5EjF2HGQ== X-Google-Smtp-Source: AGHT+IFyUKlpkVc5I7egcSEEyz/kbi61q2/mlUv/5viD+FaL1lY+fjrJ9EgXHwhOCSXFcIKD291r X-Received: by 2002:ac8:590b:0:b0:42e:efcb:bff8 with SMTP id 11-20020ac8590b000000b0042eefcbbff8mr1720115qty.9.1709716740631; Wed, 06 Mar 2024 01:19:00 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709716740; cv=pass; d=google.com; s=arc-20160816; b=D1HOXG9KzgGMqopstu08VOoXT5Ty6UpBTmsLbfdtg0Ih0mY7I6ymawOFH9jmOEbmH8 rKU3vEUQXEyq4YfwI4HErPf2ITo+Vwz4Jipsy1Dd0P1Je1zaVvfk8NLZfWglXtCDq4wB RtgpXKprOEua1sdDKkJpICyHfDb5Mh51e/8xgoSmc/Le69BBeb9NtJIZ/PhT6aHrAmuI wyIQeI+FitvzNFo90Fin4O2St70uq4Mb8es/zzAbIDkEmSQm1FeAkWKVB30QyC9PB28Z a9DQ6hNAubCdhKUMy8iCZvaG/lOnKFeVadPnhTPUtQDkLx+abla6+jNMG3SmtcuukZ2d nUrQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:references:organization:in-reply-to:subject:cc:to :from:dkim-signature; bh=BL1DaXeXvHvSBffPDD+2WEKKmjGChgJUzb4RNznwvic=; fh=j8R91R4C7W09DW0hqt3DCC2LgtHqu3BkVbedLMzUihg=; b=z94gunDS/9VPEH6BOQRr3Dzrvn3A/sAgA5lwUFrJgipBtv/rmtb4Pw/Sv2zMyB/RI/ xZFLGz9MA/CzsrrKh0wjLMK7PltolX5Pvi8FRLKRiMvjdjIC3g/GmEmLmJn7qrSU8a1r Eq8w8fEKnDsIQKKfnhyyTnzUbVGGMmYFcDSzt6WGPATpbUlUQlugVQgEvRektWj81S45 yQ/3jn1tch/mg+1kx3jLkgU4b/b4gxEB/A5cdcv0HGGFYPXIyJT82lqV1fxMBWF2sOCY 6MHIKJyTyz8GrAnkAxkTT8ojoHb0IRh1xGY3i+n5s9ndgS/j2VsSLGc4xLrsDiKO5/pf YaZA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=AewuDwmD; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-93614-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-93614-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id y2-20020a05622a004200b0042ec4d6885dsi12797104qtw.226.2024.03.06.01.19.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Mar 2024 01:19:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-93614-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=AewuDwmD; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-93614-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-93614-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 527EC1C2091F for ; Wed, 6 Mar 2024 09:19:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9AD675D91F; Wed, 6 Mar 2024 09:18:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="AewuDwmD" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 34A925C05F for ; Wed, 6 Mar 2024 09:18:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.13 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709716715; cv=none; b=GpEZ4Q1kR+nCpg7owVsfaPvACuZuEA2SexDmVFm7aY2M2vzbxdQOu9HA4zO/L3J9t/dc3lejt0B0ifnYh9LqG/3zu8P5XHEsPZe9FVX+rekZZQOcCbweB3Cudy8K6P3P3RisCNU59jnQepX6fm0t5GxnTfsSc9YQ+epplF1mxYs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709716715; c=relaxed/simple; bh=D34rJ2jpo3Sm8BQKBLjmFR9WHBkOQ9Sy3+mtZWb4xy4=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=BjOLbGASb3zgJvTjZ/GxezoKUrDiSWKAzkslTxFMYBwRunoEjHFY8OZ1NbS13C+mNwf0QvYlDLdHF1QwSD7zjb5F8h2d7h17aqL986ymdUmxsCsrQu+SUq5VVFmD1s3sTB9yMlVrwNwlQV3tRXPejfzg5b+THaH/JZcOBz9Rrrg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=AewuDwmD; arc=none smtp.client-ip=192.198.163.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1709716714; x=1741252714; h=from:to:cc:subject:in-reply-to:references:date: message-id:mime-version; bh=D34rJ2jpo3Sm8BQKBLjmFR9WHBkOQ9Sy3+mtZWb4xy4=; b=AewuDwmDTN8N66Y5R9SfgUesvMF2OWWwrHQD+FcWoKG6zc6cmlxJ7WXV 1fr6bz5XZ3TiQy9sbNbjmKy5kMkodpXAkUiWCclLGrhz7/0FWKcA7UFG8 XBaK9vXAL2f/oDfsBsaACEFv7xS1G7MN03L3VpAY2M2bP8T7MuMaYFSRx EdIFvtwy06QMYllmo6gblY8t41zF3IwQWBBH+PfRvLlck9MFVwfqXwPAc tXa6nZTWcmso0z6dx3ielzu/y3bhVzrB23W1Co2trOYwxag9GqxwkXmSC /oGaoP/avBMjD+h5eXZlGvXNwuISDCjyumLZv8ZsshYO05J2VGjpX4Ftn g==; X-IronPort-AV: E=McAfee;i="6600,9927,11004"; a="7260803" X-IronPort-AV: E=Sophos;i="6.06,207,1705392000"; d="scan'208";a="7260803" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by fmvoesa107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Mar 2024 01:18:33 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,207,1705392000"; d="scan'208";a="40677436" Received: from rjongalo-mobl2.ger.corp.intel.com (HELO localhost) ([10.252.33.211]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Mar 2024 01:18:29 -0800 From: Jani Nikula To: Hsin-Yi Wang , Dmitry Baryshkov , Douglas Anderson Cc: Neil Armstrong , Jessica Zhang , Sam Ravnborg , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 3/5] drm/edid: Match edid quirks with identity In-Reply-To: <20240306004347.974304-4-hsinyi@chromium.org> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo References: <20240306004347.974304-1-hsinyi@chromium.org> <20240306004347.974304-4-hsinyi@chromium.org> Date: Wed, 06 Mar 2024 11:18:26 +0200 Message-ID: <87plw7zpjx.fsf@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain On Tue, 05 Mar 2024, Hsin-Yi Wang wrote: > Currently edid quirks are matched by panel id only. > > Modify it to match with identity so it's easier to be extended > for more complex matching if required. > > Suggested-by: Jani Nikula > Signed-off-by: Hsin-Yi Wang Reviewed-by: Jani Nikula > --- > v4: new > Per discussion https://lore.kernel.org/lkml/87a5nd4tsg.fsf@intel.com/ > --- > drivers/gpu/drm/drm_edid.c | 13 ++++++++----- > 1 file changed, 8 insertions(+), 5 deletions(-) > > diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c > index 5e7e69e0e345..93a49b262dbe 100644 > --- a/drivers/gpu/drm/drm_edid.c > +++ b/drivers/gpu/drm/drm_edid.c > @@ -114,13 +114,15 @@ struct drm_edid_ident_closure { > > #define EDID_QUIRK(vend_chr_0, vend_chr_1, vend_chr_2, product_id, _quirks) \ > { \ > - .panel_id = drm_edid_encode_panel_id(vend_chr_0, vend_chr_1, vend_chr_2, \ > - product_id), \ > + .ident = { \ > + .panel_id = drm_edid_encode_panel_id(vend_chr_0, vend_chr_1, \ > + vend_chr_2, product_id), \ > + }, \ > .quirks = _quirks \ > } > > static const struct edid_quirk { > - u32 panel_id; > + const struct drm_edid_ident ident; > u32 quirks; > } edid_quirk_list[] = { > /* Acer AL1706 */ > @@ -2921,16 +2923,17 @@ EXPORT_SYMBOL(drm_edid_duplicate); > * @drm_edid: EDID to process > * > * This tells subsequent routines what fixes they need to apply. > + * > + * Return: A u32 represents the quirks to apply. > */ > static u32 edid_get_quirks(const struct drm_edid *drm_edid) > { > - u32 panel_id = edid_extract_panel_id(drm_edid->edid); > const struct edid_quirk *quirk; > int i; > > for (i = 0; i < ARRAY_SIZE(edid_quirk_list); i++) { > quirk = &edid_quirk_list[i]; > - if (quirk->panel_id == panel_id) > + if (drm_edid_match_identity(drm_edid, &quirk->ident)) > return quirk->quirks; > } -- Jani Nikula, Intel