From patchwork Wed Feb 28 01:05:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hsin-Yi Wang X-Patchwork-Id: 13574636 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C125CC5478C for ; Wed, 28 Feb 2024 01:11:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F168D10E556; Wed, 28 Feb 2024 01:11:44 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="lYXtO1Ok"; dkim-atps=neutral Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) by gabe.freedesktop.org (Postfix) with ESMTPS id 88A3F10E4FC for ; Wed, 28 Feb 2024 01:11:39 +0000 (UTC) Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-1d7232dcb3eso35753015ad.2 for ; Tue, 27 Feb 2024 17:11:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1709082699; x=1709687499; darn=lists.freedesktop.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=iXmDMoR5fxDfWHfx9hk2z/Xni/CCYvEBdkiUT3ERlc4=; b=lYXtO1OkN8vca18LmPia6UWhHxjt3Ewq6q15IHs7DKw5jqPOFuQxo7X76eoQRKS5/5 2Iyp9W/54rjMavPrp7Pr/EGICLl49LJjX7VyDmyGG4eDUQVJtVVXekd1ZufaRWg1nqga qmHdW+jFvmu5BhCoJ7K6GurLF/TVEc9F1fRGQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709082699; x=1709687499; 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=iXmDMoR5fxDfWHfx9hk2z/Xni/CCYvEBdkiUT3ERlc4=; b=ISNccW53jx3JKQodBAkfZOEyTCau3e8KhtOc6EY11SVQGwGZh9mpPI6vsDarrnXHQj Yy2mGoVGKux47UZoWsDv6crFKL99BGmNkW9W+BO5WlczIfDD8QNVkL/XRFmrpxyNmIId M5+iclSfZ93k9Sxm9zW+Bl102tvzrOINII8qMCBOCWFnpFSIYOhtrOrpjJzvMkGazw8x EwHrUMZTHXvsa9NvBZSKzzChtc02fKte3UKY564l4dfmXryFzul+3qYjUZB1zoAL/1Tk wCq6Ak4dKj+QLTsG+hc4/uzE5OoCBeaXr9x1l+ht+whmLeZbkRR/0tWX6Jt+7nmeYSds Za3g== X-Forwarded-Encrypted: i=1; AJvYcCWEMSP1df6aB192XaZjNChEgs7I0NBOLt0YF/bHdx2iwzJYtXm9nAjSUEInIW0nLooa5LWizQkkMcQHqdxhOVBGkGuvuoWJGdhgDcnvPDvM X-Gm-Message-State: AOJu0YyQHxeeE9eXF4hytoOcvZ5oN3SFpkEl6OVZD6SbboG7iOY/GOO0 nal6hmKJV+wRIOaPKaXbF5nrTXG1qLUJw/PDPTCdm1uv4VWFkGfhRnxCfsTp1A== X-Google-Smtp-Source: AGHT+IFZU274TcXtjwUJ4KumuJnFvswQ8pqcET9/pvdjkcdY+FVA+6GXBMXUpT3bKpLlEHZ2fby6QQ== X-Received: by 2002:a17:902:8303:b0:1dc:5e8a:93b with SMTP id bd3-20020a170902830300b001dc5e8a093bmr9108581plb.8.1709082698923; Tue, 27 Feb 2024 17:11:38 -0800 (PST) Received: from hsinyi.sjc.corp.google.com ([2620:15c:9d:2:87d1:e95d:b670:4783]) by smtp.gmail.com with ESMTPSA id kl14-20020a170903074e00b001db4b3769f6sm2131529plb.280.2024.02.27.17.11.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 17:11:38 -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 v2 1/3] drm_edid: Support getting EDID through ddc without connector Date: Tue, 27 Feb 2024 17:05:58 -0800 Message-ID: <20240228011133.1238439-2-hsinyi@chromium.org> X-Mailer: git-send-email 2.44.0.rc1.240.g4c46232300-goog In-Reply-To: <20240228011133.1238439-1-hsinyi@chromium.org> References: <20240228011133.1238439-1-hsinyi@chromium.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Some panels are interested in the EDID during early probe when connector is still unknown. Add a function drm_get_edid_no_connector() to get edid without connector. No functional change for existing usage. Signed-off-by: Hsin-Yi Wang --- v1->v2: add a function to return the entire edid without updating connector. --- drivers/gpu/drm/drm_edid.c | 45 ++++++++++++++++++++++++++++---------- include/drm/drm_edid.h | 1 + 2 files changed, 34 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index 1ad94473e400..15b97c8ed993 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -2364,7 +2364,7 @@ static struct edid *_drm_do_get_edid(struct drm_connector *connector, struct edid *edid, *new; size_t alloc_size = EDID_LENGTH; - override = drm_edid_override_get(connector); + override = connector ? drm_edid_override_get(connector) : false; if (override) { alloc_size = override->size; edid = kmemdup(override->edid, alloc_size, GFP_KERNEL); @@ -2385,18 +2385,20 @@ static struct edid *_drm_do_get_edid(struct drm_connector *connector, if (status == EDID_BLOCK_READ_FAIL) goto fail; - /* FIXME: Clarify what a corrupt EDID actually means. */ - if (status == EDID_BLOCK_OK || status == EDID_BLOCK_VERSION) - connector->edid_corrupt = false; - else - connector->edid_corrupt = true; + if (connector) { + /* FIXME: Clarify what a corrupt EDID actually means. */ + if (status == EDID_BLOCK_OK || status == EDID_BLOCK_VERSION) + connector->edid_corrupt = false; + else + connector->edid_corrupt = true; - if (!edid_block_status_valid(status, edid_block_tag(edid))) { - if (status == EDID_BLOCK_ZERO) - connector->null_edid_counter++; + if (!edid_block_status_valid(status, edid_block_tag(edid))) { + if (status == EDID_BLOCK_ZERO) + connector->null_edid_counter++; - connector_bad_edid(connector, edid, 1); - goto fail; + connector_bad_edid(connector, edid, 1); + goto fail; + } } if (!edid_extension_block_count(edid)) @@ -2444,7 +2446,8 @@ static struct edid *_drm_do_get_edid(struct drm_connector *connector, } if (invalid_blocks) { - connector_bad_edid(connector, edid, num_blocks); + if (connector) + connector_bad_edid(connector, edid, num_blocks); edid = edid_filter_invalid_blocks(edid, &alloc_size); } @@ -2637,6 +2640,24 @@ struct edid *drm_get_edid(struct drm_connector *connector, } EXPORT_SYMBOL(drm_get_edid); +/** + * drm_get_edid_no_connector - get EDID data without updating connector status + * @adapter: I2C adapter to use for DDC + * + * Similar to drm_edid_read_ddc(), but not checking any connector status. Use + * this function to get EDID when connector is still unknown. + * + * Return: Pointer to valid EDID or NULL if we couldn't find any. + */ +struct edid *drm_get_edid_no_connector(struct i2c_adapter *adapter) +{ + if (!drm_probe_ddc(adapter)) + return NULL; + + return _drm_do_get_edid(NULL, drm_do_probe_ddc_edid, adapter, NULL); +} +EXPORT_SYMBOL(drm_get_edid_no_connector); + /** * drm_edid_read_custom - Read EDID data using given EDID block read function * @connector: Connector to use diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h index 70ae6c290bdc..80c9e32ff80e 100644 --- a/include/drm/drm_edid.h +++ b/include/drm/drm_edid.h @@ -565,6 +565,7 @@ struct edid *drm_do_get_edid(struct drm_connector *connector, void *data); struct edid *drm_get_edid(struct drm_connector *connector, struct i2c_adapter *adapter); +struct edid *drm_get_edid_no_connector(struct i2c_adapter *adapter); u32 drm_edid_get_panel_id(struct i2c_adapter *adapter); struct edid *drm_get_edid_switcheroo(struct drm_connector *connector, struct i2c_adapter *adapter); From patchwork Wed Feb 28 01:05:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hsin-Yi Wang X-Patchwork-Id: 13574635 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 85B1EC54E49 for ; Wed, 28 Feb 2024 01:11:47 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A9AB010E526; Wed, 28 Feb 2024 01:11:44 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="IypTE3xq"; dkim-atps=neutral Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7D2A510E4FC for ; Wed, 28 Feb 2024 01:11:40 +0000 (UTC) Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-1dc5d0162bcso41956515ad.0 for ; Tue, 27 Feb 2024 17:11:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1709082700; x=1709687500; darn=lists.freedesktop.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=sqVPOgao3nUBQcfuJjPRQ/Z77KczM3H/soIyvGzsAUo=; b=IypTE3xqoXWkr1ICJN1qbwcdtmZy+Y5GiJZ8pRYww32C6Gv0icLjP30bNtq1/bAuf/ TwE3a77z2d+zxLIyJ2U0Pq+3Cv7PjlKbU81NmTItoHYb5iJ47RHnKxY7Fl5yBTZGF8PJ enfbcUaxI4WApZlUqHXNDrFfLLUJjxvMwHqE8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709082700; x=1709687500; 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=sqVPOgao3nUBQcfuJjPRQ/Z77KczM3H/soIyvGzsAUo=; b=ilz9x/27WIcC8B0A8zgaHsmMJjjLAjGmR56vnxkzZftQci2xlgw16cL+Ki2juhUX0L qDNVtXZtQHs1rAug3uxwllG+3+xeqnLIcsrui3CE6Gm7gUtYtiUCCzghzSoaWl4VnTYV Ya4BIaFj3OBw8G8S+ZFMv5V1dgXiYxIYo1IuDqZUaI/HCLV9SM+jOsDatiKXQ0urxkcb V1KpRNrmEUlNokF8GzmglKNjNplk4nidqRFevVJO5EZbD7jpOLex93fCCAKRHMDcvK3C bCeg8TYU93FfTwycI/Rl9QI1ALi13G0TcEQIjPTjJHjzbS1dry8gnPwQVHqGWhMfNeqE 9eRg== X-Forwarded-Encrypted: i=1; AJvYcCWUPjOuZXgUn3lKrxHdVr5uyJc6rIlEbgZpae0ft4kz9LIIqrTAFubxuzWb/ScZ+x+nyx64Bvuz7qffgk5l1md5elFWfSaNiqrzKgmWZqwO X-Gm-Message-State: AOJu0YwTmKVPh08UzzYwUXTgw/HvGQo8jOEXmVAY/qYP9sObHaerHXYD roKAZth5A4IsRYhRDOUJ3O2qlhjsE6WHMCWVDg17G45RdPYBdsinFWPiStL00g== X-Google-Smtp-Source: AGHT+IEanBcdy/4EmkJInHO9eSzsmi9IHlJxuOJZ78Yq00y6wV5YFHQmlw+GKcpe6EBwL9YtY+2iHA== X-Received: by 2002:a17:902:d4c6:b0:1dc:af71:4d46 with SMTP id o6-20020a170902d4c600b001dcaf714d46mr6771119plg.13.1709082699902; Tue, 27 Feb 2024 17:11:39 -0800 (PST) Received: from hsinyi.sjc.corp.google.com ([2620:15c:9d:2:87d1:e95d:b670:4783]) by smtp.gmail.com with ESMTPSA id kl14-20020a170903074e00b001db4b3769f6sm2131529plb.280.2024.02.27.17.11.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 17:11:39 -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 v2 2/3] drm/panel: panel-edp: Match edp_panels with panel name Date: Tue, 27 Feb 2024 17:05:59 -0800 Message-ID: <20240228011133.1238439-3-hsinyi@chromium.org> X-Mailer: git-send-email 2.44.0.rc1.240.g4c46232300-goog In-Reply-To: <20240228011133.1238439-1-hsinyi@chromium.org> References: <20240228011133.1238439-1-hsinyi@chromium.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" It's found that some panels have variants that they share the same panel id although their EDID and names are different. When matching generic edp panels, we should first match with both panel id and panel name by checking if edid contains the name string. If not found, match with panel id only. Signed-off-by: Hsin-Yi Wang --- v1->v2: match with panel name instead of crc hash. Note that we can't directly use drm_edid_get_monitor_name(), because some panel store the name after EDID_DETAIL_MONITOR_STRING instead of EDID_DETAIL_MONITOR_NAME. --- drivers/gpu/drm/drm_edid.c | 69 +++++++------------------------ drivers/gpu/drm/panel/panel-edp.c | 44 +++++++++++++++++--- include/drm/drm_edid.h | 2 +- 3 files changed, 54 insertions(+), 61 deletions(-) diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index 15b97c8ed993..c4126475ff0a 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -2764,7 +2764,19 @@ const struct drm_edid *drm_edid_read(struct drm_connector *connector) } EXPORT_SYMBOL(drm_edid_read); -static u32 edid_extract_panel_id(const struct edid *edid) +/** + * edid_extract_panel_id - Extract a panel's ID from EDID + * @edid: EDID used to extract the panel's ID. + * + * Extract panel ID from EDID. + * + * Return: A 32-bit ID that should be different for each make/model of panel. + * See the functions drm_edid_encode_panel_id() and + * drm_edid_decode_panel_id() for some details on the structure of this + * ID. + */ + +u32 edid_extract_panel_id(const struct edid *edid) { /* * We represent the ID as a 32-bit number so it can easily be compared @@ -2783,60 +2795,7 @@ static u32 edid_extract_panel_id(const struct edid *edid) (u32)edid->mfg_id[1] << 16 | (u32)EDID_PRODUCT_ID(edid); } - -/** - * drm_edid_get_panel_id - Get a panel's ID through DDC - * @adapter: I2C adapter to use for DDC - * - * This function reads 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 value - * (16 bits of manufacturer ID and 16 bits of per-manufacturer ID) that's - * supposed to be different for each different modem of panel. - * - * This function is intended to be used during early probing on devices where - * more than one panel might be present. Because of its intended use it must - * 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). - * - * 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 panel. - * 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(struct i2c_adapter *adapter) -{ - enum edid_block_status status; - void *base_block; - u32 panel_id = 0; - - /* - * There are no manufacturer IDs of 0, so if there is a problem reading - * the EDID then we'll just return 0. - */ - - base_block = kzalloc(EDID_LENGTH, GFP_KERNEL); - if (!base_block) - return 0; - - status = edid_block_read(base_block, 0, drm_do_probe_ddc_edid, adapter); - - edid_block_status_print(status, base_block, 0); - - if (edid_block_status_valid(status, edid_block_tag(base_block))) - panel_id = edid_extract_panel_id(base_block); - else - edid_block_dump(KERN_NOTICE, base_block, 0); - - kfree(base_block); - - return panel_id; -} -EXPORT_SYMBOL(drm_edid_get_panel_id); +EXPORT_SYMBOL(edid_extract_panel_id); /** * 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/panel-edp.c index 3fb5fcd326a4..72ad552bff24 100644 --- a/drivers/gpu/drm/panel/panel-edp.c +++ b/drivers/gpu/drm/panel/panel-edp.c @@ -761,11 +761,13 @@ static void panel_edp_parse_panel_timing_node(struct device *dev, dev_err(dev, "Reject override mode: No display_timing found\n"); } -static const struct edp_panel_entry *find_edp_panel(u32 panel_id); +static bool edid_has_name(struct edid *edid, const char *panel_name); +static const struct edp_panel_entry *find_edp_panel(u32 panel_id, struct edid *edid); static int generic_edp_panel_probe(struct device *dev, struct panel_edp *panel) { struct panel_desc *desc; + struct edid *edid; u32 panel_id; char vend[4]; u16 product_id; @@ -795,15 +797,19 @@ static int generic_edp_panel_probe(struct device *dev, struct panel_edp *panel) goto exit; } - panel_id = drm_edid_get_panel_id(panel->ddc); - if (!panel_id) { + edid = drm_get_edid_no_connector(panel->ddc); + if (!edid) { dev_err(dev, "Couldn't identify panel via EDID\n"); ret = -EIO; goto exit; } + panel_id = edid_extract_panel_id(edid); drm_edid_decode_panel_id(panel_id, vend, &product_id); - panel->detected_panel = find_edp_panel(panel_id); + panel->detected_panel = find_edp_panel(panel_id, edid); + + /* Read EDID again in panel_edp_get_modes() when connector is known. */ + kfree(edid); /* * We're using non-optimized timings and want it really obvious that @@ -2107,13 +2113,41 @@ static const struct edp_panel_entry edp_panels[] = { { /* sentinal */ } }; -static const struct edp_panel_entry *find_edp_panel(u32 panel_id) +static bool edid_has_name(struct edid *edid, const char *panel_name) +{ + int i, j; + char buf[13]; + + for (i = 0; i < 4; i++) { + strncpy(buf, edid->detailed_timings[i].data.other_data.data.str.str, + sizeof(buf)); + for (j = 0; j < 13; j++) { + if (buf[j] == 0x0a) { + buf[j] = '\0'; + break; + } + } + buf[12] = '\0'; + if (strncmp(panel_name, buf, strlen(panel_name)) == 0) + return true; + } + + return false; +} + +static const struct edp_panel_entry *find_edp_panel(u32 panel_id, struct edid *edid) { const struct edp_panel_entry *panel; if (!panel_id) return NULL; + /* Match with both panel_id and name. Find if EDID contains name. */ + for (panel = edp_panels; panel->panel_id; panel++) + if (panel->panel_id == panel_id && edid_has_name(edid, panel->name)) + return panel; + + /* Match with only panel_id */ for (panel = edp_panels; panel->panel_id; panel++) if (panel->panel_id == panel_id) return panel; diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h index 80c9e32ff80e..4cefff357789 100644 --- a/include/drm/drm_edid.h +++ b/include/drm/drm_edid.h @@ -566,7 +566,7 @@ struct edid *drm_do_get_edid(struct drm_connector *connector, struct edid *drm_get_edid(struct drm_connector *connector, struct i2c_adapter *adapter); struct edid *drm_get_edid_no_connector(struct i2c_adapter *adapter); -u32 drm_edid_get_panel_id(struct i2c_adapter *adapter); +u32 edid_extract_panel_id(const struct edid *edid); struct edid *drm_get_edid_switcheroo(struct drm_connector *connector, struct i2c_adapter *adapter); struct edid *drm_edid_duplicate(const struct edid *edid); From patchwork Wed Feb 28 01:06:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hsin-Yi Wang X-Patchwork-Id: 13574634 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A9787C54798 for ; Wed, 28 Feb 2024 01:11:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A495710E4FC; Wed, 28 Feb 2024 01:11:44 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="lMT3k01O"; dkim-atps=neutral Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3A9F210E4FC for ; Wed, 28 Feb 2024 01:11:41 +0000 (UTC) Received: by mail-pl1-f176.google.com with SMTP id d9443c01a7336-1d911c2103aso29477265ad.0 for ; Tue, 27 Feb 2024 17:11:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1709082701; x=1709687501; darn=lists.freedesktop.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=JUDXeYcrvidwDBcA1WOXXMMQ4eSI9QRabZdiDLCy8AY=; b=lMT3k01OYTrkmftH/RP2VU9k5yE3h/8HMd1HHabR8NQgBhjr8Z1alCxn+1+UhfhSN5 RRNDnjEmT0PHsGcvTYHuDRYJcgVA4tN+/F0CbuCJ0i3z2PGBV9wYeU8slyGUfac27tvS u1kf2aYQmIyd6eFGPVYiR3QVkEbxL5tM9YSM0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709082701; x=1709687501; 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=JUDXeYcrvidwDBcA1WOXXMMQ4eSI9QRabZdiDLCy8AY=; b=fivDN1XdpGEIttrCdSyKs4Q9F7neLsqQISNoPrQwuO2u+CV9y65u3Vf8KV1cyNog3C ORSn54UD/6a/LhQrux93hlxX3WPyEVI4goXAYYo1dC/9atUuDWEVQcoD+whdy1yCUtUC Wx0QC9U0xzi5tMKjiemVlf17pdxui9KzdhfNuPNaDymh5r/TCnKkfl/zYlYTtQ6PY89Z 4N6UfgyLHst4OQ3wP8r3rUfMditdQpdOMo0/3IFJLADRdJS+IgTt4gKS/SPS/JGX9/WC GXKfxLi9rliVYxZ85JMmf/pDx0ZUnvn6UMiJ3IzYMEm9LC/vfK+7Y7zJNlBUOByOuGmB GVPA== X-Forwarded-Encrypted: i=1; AJvYcCWr80KkYnJbjPUlVGNcGcq1oIUtQdSipRl4xMUpkEv15A1wWKj3r4NcKJALnyzPP4u62NzABHvyVG5K3jhcbx7Ime6jWBsdA2bkoBvvQtmk X-Gm-Message-State: AOJu0YydIF8uzYmx7SbqErIEmfJ4NHXeHn8yAVyMtoZSYdHjLIgaMzwE H4jvewd00VI57RqwyAW0IZMh0ieB3He33CoVczo2vk3/WwpfDwKvwf3sMRHMnA== X-Google-Smtp-Source: AGHT+IE0Z6fIVeriFN1uMUOqrW9/ukSipbQ+YPExtZ1nyKsCKZYK1PuQscgD1Vwgs+5BAfFvhvuBsg== X-Received: by 2002:a17:903:985:b0:1db:c6ff:6648 with SMTP id mb5-20020a170903098500b001dbc6ff6648mr13245620plb.10.1709082700718; Tue, 27 Feb 2024 17:11:40 -0800 (PST) Received: from hsinyi.sjc.corp.google.com ([2620:15c:9d:2:87d1:e95d:b670:4783]) by smtp.gmail.com with ESMTPSA id kl14-20020a170903074e00b001db4b3769f6sm2131529plb.280.2024.02.27.17.11.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 17:11:40 -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 v2 3/3] drm/panel: panel-edp: Fix AUO 0x405c panel naming and add a variant Date: Tue, 27 Feb 2024 17:06:00 -0800 Message-ID: <20240228011133.1238439-4-hsinyi@chromium.org> X-Mailer: git-send-email 2.44.0.rc1.240.g4c46232300-goog In-Reply-To: <20240228011133.1238439-1-hsinyi@chromium.org> References: <20240228011133.1238439-1-hsinyi@chromium.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" There are 2 different AUO panels using the same panel id. 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. Signed-off-by: Hsin-Yi Wang --- v2: new --- drivers/gpu/drm/panel/panel-edp.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/panel/panel-edp.c b/drivers/gpu/drm/panel/panel-edp.c index 72ad552bff24..e39af92342e8 100644 --- a/drivers/gpu/drm/panel/panel-edp.c +++ b/drivers/gpu/drm/panel/panel-edp.c @@ -1013,6 +1013,19 @@ static const struct panel_desc auo_b101ean01 = { }, }; +static const struct drm_display_mode auo_b116xa3_mode = { + .clock = 70589, + .hdisplay = 1366, + .hsync_start = 1366 + 40, + .hsync_end = 1366 + 40 + 40, + .htotal = 1366 + 40 + 40 + 32, + .vdisplay = 768, + .vsync_start = 768 + 10, + .vsync_end = 768 + 10 + 12, + .vtotal = 768 + 10 + 12 + 6, + .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC, +}; + static const struct drm_display_mode auo_b116xak01_mode = { .clock = 69300, .hdisplay = 1366, @@ -1990,7 +2003,9 @@ static const struct edp_panel_entry edp_panels[] = { EDP_PANEL_ENTRY('A', 'U', 'O', 0x239b, &delay_200_500_e50, "B116XAN06.1"), EDP_PANEL_ENTRY('A', 'U', 'O', 0x255c, &delay_200_500_e50, "B116XTN02.5"), EDP_PANEL_ENTRY('A', 'U', 'O', 0x403d, &delay_200_500_e50, "B140HAN04.0"), - EDP_PANEL_ENTRY('A', 'U', 'O', 0x405c, &auo_b116xak01.delay, "B116XAK01.0"), + EDP_PANEL_ENTRY('A', 'U', 'O', 0x405c, &auo_b116xak01.delay, "B116XAN04.0 "), + EDP_PANEL_ENTRY2('A', 'U', 'O', 0x405c, &auo_b116xak01.delay, "B116XAK01.0 ", + &auo_b116xa3_mode), EDP_PANEL_ENTRY('A', 'U', 'O', 0x435c, &delay_200_500_e50, "Unknown"), EDP_PANEL_ENTRY('A', 'U', 'O', 0x582d, &delay_200_500_e50, "B133UAN01.0"), EDP_PANEL_ENTRY('A', 'U', 'O', 0x615c, &delay_200_500_e50, "B116XAN06.1"),