From nobody Sun Feb 8 13:10:46 2026 Received: from mail-pg1-f171.google.com (mail-pg1-f171.google.com [209.85.215.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 65B9F143C63 for ; Fri, 23 Feb 2024 22:40:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708728007; cv=none; b=M6hWLNFmjp9uZGz8D+jF9gDpCFxy2YxOUG0H43rzKNs/MskD4sBmvlUUv7OrQAWVFgUx+ewyS5UcSuzo2zxPYBLUxAnVknsXz4wMr95vTxFtlwfkX0Eee1+jg0M0nj0/hS7AAxzWuI+LuzzAPbdbziu4r3bHEL39wSOreXs9q0M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708728007; c=relaxed/simple; bh=ZGM0H9OX6IuYQLFMOB8tArMAbsmHZckmY8VWfmMOH+0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=G3ZpgZSiHmoa1WwUTb+Su2vw1+0glKsCblDJn91cPpMMrUU0DU9Bg9SPhyWdXarjXVwD2yxx4tXrJl56TU+S/bLz+MSbX2ENEybRzq4e5YdGj2RbnpoNqIcc7D+y0WqfFOphLgw8yAZkYPEuEEDENBS24ArUJyAztqABnsHb9Ac= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=cpu4ndIt; arc=none smtp.client-ip=209.85.215.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="cpu4ndIt" Received: by mail-pg1-f171.google.com with SMTP id 41be03b00d2f7-5cedfc32250so1277353a12.0 for ; Fri, 23 Feb 2024 14:40:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1708728003; x=1709332803; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=j2NLOgJvFk9/xpCgoWWX0mwY7XC1SqoEPJetQl38NRg=; b=cpu4ndIt16D5/QrGZ6s67ePQzuC2xQc8W2t8TcoIXfeQpxWN+nVbhXIB4re+qdjKte thBi8YZdynxnmZ6eECAuP1F3WAjYlrFPCicTS9WFUyv7o3+IuEbqVqCYPquNp/bPwVO4 HqNRRLO9/iGBgOreXYOhJMYmqFKAF0S2vYAaw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708728003; x=1709332803; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=j2NLOgJvFk9/xpCgoWWX0mwY7XC1SqoEPJetQl38NRg=; b=FEQahFM731n67qDc0tV99lvj6dP+KErCWjvPDEH97NXdrvQL6tjXIb23fu/0DB8aWZ kKQX+1U3Uhjf9rGUKiQvtgTMZyM5aVkxItVXVoORRfCLp6YJTHbIGB4lJBx0QbK+ZfDF /TiB+aG3+yU5DhSYA+rJ6ggZINCELrYPN4NNEwMkJcLh2na7uYEENwg4JKLWVQti6go+ l746vw3dD/r94IeaVb7ruOvUPgdxzgujltumwhdPmgHWJb9NQFVl+D518Bas357RJePK v2BKBJEFFtQQg1S+F94gZHr6gVR/1/mRsvsoRsdLftrnGlZ/BbFL6mx+LdQBIrZVWlGI UUxQ== X-Forwarded-Encrypted: i=1; AJvYcCUA+kj9ysENdUqPkuZrEBkwvBoNW6KR7C2yQDevIeeQR77QdW4Va5z75mid52YTCSTRTB0QVtagf/a3gsa84QSr/QhEl2Z+beIEuMd8 X-Gm-Message-State: AOJu0Yy6Ramdjp/laUDXD1pKPKisQPoBWhjjQGEeZiPFyPutLhieHTdf AldKyrdEbRSN9/urcsulv/4+cUbQEGCe3MlESP0zlrYXWZkOj6pZkyzvIi2rUA== X-Google-Smtp-Source: AGHT+IEqAmzztLLv9pUMQIH60NYC+Jh68DPyMwr8SAMILCs8UUd15S395jHWIMuyyILxwr0lYYsk4g== X-Received: by 2002:a17:90b:380d:b0:299:2da5:a843 with SMTP id mq13-20020a17090b380d00b002992da5a843mr1194908pjb.14.1708728003603; Fri, 23 Feb 2024 14:40:03 -0800 (PST) Received: from hsinyi.sjc.corp.google.com ([2620:15c:9d:2:8ff9:a089:c05c:9af]) by smtp.gmail.com with ESMTPSA id cz4-20020a17090ad44400b002966a13f2e9sm2032873pjb.37.2024.02.23.14.40.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 14:40:03 -0800 (PST) From: Hsin-Yi Wang To: 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: [PATCH 1/2] drm_edid: Add a function to get EDID base block Date: Fri, 23 Feb 2024 14:29:17 -0800 Message-ID: <20240223223958.3887423-2-hsinyi@chromium.org> X-Mailer: git-send-email 2.44.0.rc0.258.g7320e95886-goog In-Reply-To: <20240223223958.3887423-1-hsinyi@chromium.org> References: <20240223223958.3887423-1-hsinyi@chromium.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" It's found that some panels have variants that they share the same panel id although their EDID and names are different. Besides panel id, now we need the hash of entire EDID base block to distinguish these panel variants. Add drm_edid_get_base_block to returns the EDID base block, so caller can further use it to get panel id and/or the hash. Signed-off-by: Hsin-Yi Wang Reviewed-by: Douglas Anderson --- drivers/gpu/drm/drm_edid.c | 55 +++++++++++++++++-------------- drivers/gpu/drm/panel/panel-edp.c | 8 +++-- include/drm/drm_edid.h | 3 +- 3 files changed, 38 insertions(+), 28 deletions(-) diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index 923c4423151c..55598ca4a5d1 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -2770,58 +2770,63 @@ static u32 edid_extract_panel_id(const struct edid = *edid) } =20 /** - * drm_edid_get_panel_id - Get a panel's ID through DDC - * @adapter: I2C adapter to use for DDC + * drm_edid_get_panel_id - Get a panel's ID from EDID base block + * @base_bock: EDID base block that contains panel ID. * - * This function reads the first block of the EDID of a panel and (assuming + * This function uses the first block of the EDID of a panel and (assuming * that the EDID is valid) extracts the ID out of it. The ID is a 32-bit v= alue * (16 bits of manufacturer ID and 16 bits of per-manufacturer ID) that's * supposed to be different for each different modem of panel. * + * Return: A 32-bit ID that should be different for each make/model of pan= el. + * See the functions drm_edid_encode_panel_id() and + * drm_edid_decode_panel_id() for some details on the structure of= this + * ID. + */ +u32 drm_edid_get_panel_id(void *base_block) +{ + return edid_extract_panel_id(base_block); +} +EXPORT_SYMBOL(drm_edid_get_panel_id); + +/** + * drm_edid_get_base_block - Get a panel's EDID base block + * @adapter: I2C adapter to use for DDC + * + * This function returns the first block of the EDID of a panel. + * * This function is intended to be used during early probing on devices wh= ere * more than one panel might be present. Because of its intended use it mu= st - * assume that the EDID of the panel is correct, at least as far as the ID - * is concerned (in other words, we don't process any overrides here). + * assume that the EDID of the panel is correct, at least as far as the ba= se + * block is concerned (in other words, we don't process any overrides here= ). * * NOTE: it's expected that this function and drm_do_get_edid() will both * be read the EDID, but there is no caching between them. Since we're only * reading the first block, hopefully this extra overhead won't be too big. * - * Return: A 32-bit ID that should be different for each make/model of pan= el. - * See the functions drm_edid_encode_panel_id() and - * drm_edid_decode_panel_id() for some details on the structure of= this - * ID. + * Caller should free the base block after use. */ - -u32 drm_edid_get_panel_id(struct i2c_adapter *adapter) +void *drm_edid_get_base_block(struct i2c_adapter *adapter) { enum edid_block_status status; void *base_block; - u32 panel_id =3D 0; - - /* - * There are no manufacturer IDs of 0, so if there is a problem reading - * the EDID then we'll just return 0. - */ =20 base_block =3D kzalloc(EDID_LENGTH, GFP_KERNEL); if (!base_block) - return 0; + return NULL; =20 status =3D edid_block_read(base_block, 0, drm_do_probe_ddc_edid, adapter); =20 edid_block_status_print(status, base_block, 0); =20 - if (edid_block_status_valid(status, edid_block_tag(base_block))) - panel_id =3D edid_extract_panel_id(base_block); - else + if (!edid_block_status_valid(status, edid_block_tag(base_block))) { edid_block_dump(KERN_NOTICE, base_block, 0); + return NULL; + } =20 - kfree(base_block); - - return panel_id; + return base_block; } -EXPORT_SYMBOL(drm_edid_get_panel_id); +EXPORT_SYMBOL(drm_edid_get_base_block); =20 /** * drm_get_edid_switcheroo - get EDID data for a vga_switcheroo output diff --git a/drivers/gpu/drm/panel/panel-edp.c b/drivers/gpu/drm/panel/pane= l-edp.c index bd71d239272a..f6ddbaa103b5 100644 --- a/drivers/gpu/drm/panel/panel-edp.c +++ b/drivers/gpu/drm/panel/panel-edp.c @@ -763,6 +763,7 @@ static const struct edp_panel_entry *find_edp_panel(u32= panel_id); static int generic_edp_panel_probe(struct device *dev, struct panel_edp *p= anel) { struct panel_desc *desc; + void *base_block; u32 panel_id; char vend[4]; u16 product_id; @@ -792,8 +793,11 @@ static int generic_edp_panel_probe(struct device *dev,= struct panel_edp *panel) goto exit; } =20 - panel_id =3D drm_edid_get_panel_id(panel->ddc); - if (!panel_id) { + base_block =3D drm_edid_get_base_block(panel->ddc); + if (base_block) { + panel_id =3D drm_edid_get_panel_id(base_block); + kfree(base_block); + } else { dev_err(dev, "Couldn't identify panel via EDID\n"); ret =3D -EIO; goto exit; diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h index 7923bc00dc7a..56b60f9204d3 100644 --- a/include/drm/drm_edid.h +++ b/include/drm/drm_edid.h @@ -410,7 +410,8 @@ struct edid *drm_do_get_edid(struct drm_connector *conn= ector, void *data); struct edid *drm_get_edid(struct drm_connector *connector, struct i2c_adapter *adapter); -u32 drm_edid_get_panel_id(struct i2c_adapter *adapter); +void *drm_edid_get_base_block(struct i2c_adapter *adapter); +u32 drm_edid_get_panel_id(void *base_block); struct edid *drm_get_edid_switcheroo(struct drm_connector *connector, struct i2c_adapter *adapter); struct edid *drm_edid_duplicate(const struct edid *edid); --=20 2.44.0.rc0.258.g7320e95886-goog From nobody Sun Feb 8 13:10:46 2026 Received: from mail-pj1-f54.google.com (mail-pj1-f54.google.com [209.85.216.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 499B5145B1B for ; Fri, 23 Feb 2024 22:40:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708728006; cv=none; b=JmbGrA0/9cNKL24f2b1NYETVWboQRekYoPzNTWnAFrZBWQcSN/uuyFNQJ2RT5q7TGt4OOa2kkMZRozLe3SngWaA3n4/4E+FEH29vxnj9hJEyrAONi4Dvx6O3iKpXlXhFAyvLJowUNl+EBwo1WGzd0WEkojYe3PSFVDkdXltU1p8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708728006; c=relaxed/simple; bh=Pjl8ko0DWDowcGUxGWXv4KdIPeEjmRIMNi+B2vSNeiQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=K8miZBrT9GI1pVZv5oURBHRE8YfVTf0XfLkO1s8lv6EQ0P2e3fNB5SN/GNq+8aPfgNFcgubCGjbEeQc6tR/sl6qwwpRgEKEtkrlAymaNerKup7u46rFX7RcEFEeunO6AOrJRhIVq4FjjT4ZF/8U1dfrwN6onRE+xzkRcO12g8Sc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=MriA/p38; arc=none smtp.client-ip=209.85.216.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="MriA/p38" Received: by mail-pj1-f54.google.com with SMTP id 98e67ed59e1d1-29a2d0f69a6so1016132a91.3 for ; Fri, 23 Feb 2024 14:40:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1708728004; x=1709332804; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=OtJto2Kd/SieW6LbOckqb66w6924YRC023lFGaAJu7I=; b=MriA/p38et10AfvSKffP3yy21UKPkzln1pQrU+V9qBRGzuXuMiFIAyVhAMSOMmrO4T 6ZSM09OJi5OBR9MHGa+Gjsb3SpaGyTE7yIj8YqCH4kXw8jUQVNiUyO2lM0Te4A7V0/nU dcHizdcjjM9pGYEY3RQa4+/+jUEe058lapUHw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708728004; x=1709332804; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OtJto2Kd/SieW6LbOckqb66w6924YRC023lFGaAJu7I=; b=iBwv005lqSTNrGWK31/sIjUej+g5U8OsvQuQe2f7e/L856IijQS2sA4ikl6teABdRB NKvw2ED5RBL6EkQmwpcD125uNCFWNY19VR5iNq2AsbQH1hWKXmyHY4KLLYPdKC4lcib+ aDpv6kFUiY2CCiI6x/T4pv93pab14cEGjpYpLH6EcHb4fEMoYaWcCqADcO3SKYKAS215 HIm/vfWImUkTw/vNVPm5AcLpqqZabFBoAWi2rwh3nJYKp/8g3/diTM2xu/YtD53rYdum k+n5w3Rw7VzcZyXkyn+NAngPARFzyfi+CSd+HV9ENRN54JTzJMXxsEaMuHF7z6cATGYu uAcg== X-Forwarded-Encrypted: i=1; AJvYcCUKlHUltXpWBUlvYT+4eD4HA+qliNbiEvfx9m7PAar7uf5OjIVaKKI7QLPpV3xQaZXcduo/P21cBZR34g6rxPJA9p/hXYynZMF1/tOQ X-Gm-Message-State: AOJu0YyBZsin1cw9hsJ/OYe1EuSHvM4P1FScAUKJK8Cfk/fm6Cnueh87 r/9KcLsAeuEGr8T7A8RNybsPYEHXkDqFW5l6G9k53HqiqvRuGldXfYu6unUhfA== X-Google-Smtp-Source: AGHT+IEVPk3T/BcnGztFSXqnNC//o637SLCFJjp4OfpRUNvGShjjo4L/qCoxs5rN+qfxLlvAOkyQ8A== X-Received: by 2002:a17:90b:4f4a:b0:299:96fe:1135 with SMTP id pj10-20020a17090b4f4a00b0029996fe1135mr997780pjb.44.1708728004586; Fri, 23 Feb 2024 14:40:04 -0800 (PST) Received: from hsinyi.sjc.corp.google.com ([2620:15c:9d:2:8ff9:a089:c05c:9af]) by smtp.gmail.com with ESMTPSA id cz4-20020a17090ad44400b002966a13f2e9sm2032873pjb.37.2024.02.23.14.40.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 14:40:04 -0800 (PST) From: Hsin-Yi Wang To: 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: [PATCH 2/2] drm/panel: panel-edp: Match with panel hash for overridden modes Date: Fri, 23 Feb 2024 14:29:18 -0800 Message-ID: <20240223223958.3887423-3-hsinyi@chromium.org> X-Mailer: git-send-email 2.44.0.rc0.258.g7320e95886-goog In-Reply-To: <20240223223958.3887423-1-hsinyi@chromium.org> References: <20240223223958.3887423-1-hsinyi@chromium.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" It's found that some panels have variants that they share the same panel id although their EDID and names are different. One of the variants requires using overridden modes to resolve glitching issue as described in commit 70e0d5550f5c ("drm/panel-edp: Add auo_b116xa3_mode"). Other variants should use the modes parsed from EDID. For example, AUO 0x405c B116XAK01.0, it has at least 2 different variants that EDID and panel name are different, but using the same panel id. One of the variants require using overridden mode. Same case for AUO 0x615c B116XAN06.1. Add such entries and use the hash of the EDID to match the panel needs the overridden modes. Signed-off-by: Hsin-Yi Wang --- drivers/gpu/drm/panel/panel-edp.c | 52 +++++++++++++++++++++++++++---- 1 file changed, 46 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-edp.c b/drivers/gpu/drm/panel/pane= l-edp.c index f6ddbaa103b5..42c430036846 100644 --- a/drivers/gpu/drm/panel/panel-edp.c +++ b/drivers/gpu/drm/panel/panel-edp.c @@ -21,6 +21,7 @@ * DEALINGS IN THE SOFTWARE. */ =20 +#include #include #include #include @@ -213,6 +214,9 @@ struct edp_panel_entry { /** @panel_id: 32-bit ID for panel, encoded with drm_edid_encode_panel_id= (). */ u32 panel_id; =20 + /** @panel_hash: the CRC32 hash of the EDID base block. */ + u32 panel_hash; + /** @delay: The power sequencing delays needed for this panel. */ const struct panel_delay *delay; =20 @@ -758,13 +762,13 @@ static void panel_edp_parse_panel_timing_node(struct = device *dev, dev_err(dev, "Reject override mode: No display_timing found\n"); } =20 -static const struct edp_panel_entry *find_edp_panel(u32 panel_id); +static const struct edp_panel_entry *find_edp_panel(u32 panel_id, u32 pane= l_hash); =20 static int generic_edp_panel_probe(struct device *dev, struct panel_edp *p= anel) { struct panel_desc *desc; void *base_block; - u32 panel_id; + u32 panel_id, panel_hash; char vend[4]; u16 product_id; u32 reliable_ms =3D 0; @@ -796,15 +800,17 @@ static int generic_edp_panel_probe(struct device *dev= , struct panel_edp *panel) base_block =3D drm_edid_get_base_block(panel->ddc); if (base_block) { panel_id =3D drm_edid_get_panel_id(base_block); + panel_hash =3D crc32_le(~0, base_block, EDID_LENGTH) ^ 0xffffffff; kfree(base_block); } else { dev_err(dev, "Couldn't identify panel via EDID\n"); ret =3D -EIO; goto exit; } + drm_edid_decode_panel_id(panel_id, vend, &product_id); =20 - panel->detected_panel =3D find_edp_panel(panel_id); + panel->detected_panel =3D find_edp_panel(panel_id, panel_hash); =20 /* * We're using non-optimized timings and want it really obvious that @@ -1006,6 +1012,19 @@ static const struct panel_desc auo_b101ean01 =3D { }, }; =20 +static const struct drm_display_mode auo_b116xa3_mode =3D { + .clock =3D 70589, + .hdisplay =3D 1366, + .hsync_start =3D 1366 + 40, + .hsync_end =3D 1366 + 40 + 40, + .htotal =3D 1366 + 40 + 40 + 32, + .vdisplay =3D 768, + .vsync_start =3D 768 + 10, + .vsync_end =3D 768 + 10 + 12, + .vtotal =3D 768 + 10 + 12 + 6, + .flags =3D DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC, +}; + static const struct drm_display_mode auo_b116xak01_mode =3D { .clock =3D 69300, .hdisplay =3D 1366, @@ -1926,11 +1945,13 @@ static const struct panel_delay delay_200_500_e50_p= o2e200 =3D { .delay =3D _delay \ } =20 -#define EDP_PANEL_ENTRY2(vend_chr_0, vend_chr_1, vend_chr_2, product_id, _= delay, _name, _mode) \ +#define EDP_PANEL_ENTRY2(vend_chr_0, vend_chr_1, vend_chr_2, product_id, \ + _hash, _delay, _name, _mode) \ { \ .name =3D _name, \ .panel_id =3D drm_edid_encode_panel_id(vend_chr_0, vend_chr_1, vend_chr_2= , \ product_id), \ + .panel_hash =3D _hash, \ .delay =3D _delay, \ .override_edid_mode =3D _mode \ } @@ -2077,13 +2098,32 @@ static const struct edp_panel_entry edp_panels[] = =3D { { /* sentinal */ } }; =20 -static const struct edp_panel_entry *find_edp_panel(u32 panel_id) +/* + * Similar to edp_panels, this table lists panel variants that require usi= ng + * overridden modes but have the same panel id as one of the entries in ed= p_panels. + * + * Sort first by vendor, then by product ID. + */ +static const struct edp_panel_entry edp_panels_variants[] =3D { + EDP_PANEL_ENTRY2('A', 'U', 'O', 0x405c, 0xa9951478, &auo_b116xak01.delay, + "B116XAK01.0", &auo_b116xa3_mode), + EDP_PANEL_ENTRY2('A', 'U', 'O', 0x615c, 0x109b75b3, &delay_200_500_e50, + "B116XAN06.1", &auo_b116xa3_mode), + + { /* sentinal */ } +}; + +static const struct edp_panel_entry *find_edp_panel(u32 panel_id, u32 pane= l_hash) { const struct edp_panel_entry *panel; =20 - if (!panel_id) + if (!panel_id || !panel_hash) return NULL; =20 + for (panel =3D edp_panels_variants; panel->panel_id; panel++) + if (panel->panel_id =3D=3D panel_id && panel->panel_hash =3D=3D panel_ha= sh) + return panel; + for (panel =3D edp_panels; panel->panel_id; panel++) if (panel->panel_id =3D=3D panel_id) return panel; --=20 2.44.0.rc0.258.g7320e95886-goog