From patchwork Mon Nov 6 21:00:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hsin-Yi Wang X-Patchwork-Id: 162184 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp2926008vqu; Mon, 6 Nov 2023 13:04:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IFzvwfT2gdWprdiymNhW5sasDUEyT3mcRpCSCjgHZYH9ZvqInXbnV+GYG/AOqf9Th4Kq4Pw X-Received: by 2002:a17:902:f28b:b0:1ca:8169:e853 with SMTP id k11-20020a170902f28b00b001ca8169e853mr21326999plc.4.1699304656676; Mon, 06 Nov 2023 13:04:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699304656; cv=none; d=google.com; s=arc-20160816; b=zvK+ZfXCgvP4HygGMiGQ170zA6/gccKSr2PB04g9e6xKq2YeLXgJXvGf4CtRzCo0RI 52pxL98+vYevGbcIVXuHzb/vNHmgQlxusGOWUA1ioRyFZznFGkiKajfqAWfqM1A8ch3S F7IFRblYgxfIJgeOU0hPPf0zyAqHYKnX5M0LWrYjJ7F7L9xdty6A224Vgv/KZ83JnJaq qLlScvdgU1rbhoDndrQskWPGBHI4ORkYiHPIZTPhUvhEcCmcU5Up/pkXQLlbsraBeSaW VHVd6WUBB5Qzj3plVKCx0DXNVtgEZSW3uS/JaKV2x3Ms1UtAIK8XaPlPo8CeSQbR2wWN 2obg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=eKtI99VxeOyhPoDjugXpaj86NuLenomQwROgP1e0y7o=; fh=xm4V3i9y7SNKSixHUbMvMEPgDl0W8xdNniziEWdXVkQ=; b=LrZpMI8qK65omKuBpW6vC01ar14/t/l1aaN9IGBz5R8qHF0N1nMNCfLYD1UOx/ru0P JlddfvWpLKYJC409oGv+Gi/NxqH8rm4ZiMrXdisrUoS6s6z8xOX4bV2Lxww9vAQpgLca +vwETrWm1u4N9wnaSswR6Lf5w4f4ecpINd7pvgSA+FUDiu31quCKwWn/HuBcb9UnI4RR udmbPCrLSRHCPba17UxwlO9iMAAkacpKUXcJXUfUtKP3SKSeNMmF+SdMclb+hzmgIPn+ IqXyVc5l084H1BoaM4NkUnc6fejUvhcxmfsEtBih2u+YSp+6gKbyvxZADL8+saA8OHA7 LMmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=JAn29ap+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id e9-20020a170902744900b001b82a4d3ea7si8585427plt.249.2023.11.06.13.04.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 13:04:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=JAn29ap+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 9B0F780320E0; Mon, 6 Nov 2023 13:04:09 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233079AbjKFVDq (ORCPT + 34 others); Mon, 6 Nov 2023 16:03:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57176 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231975AbjKFVDp (ORCPT ); Mon, 6 Nov 2023 16:03:45 -0500 Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 382AFA3 for ; Mon, 6 Nov 2023 13:03:42 -0800 (PST) Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-1ccbb7f79cdso12726835ad.3 for ; Mon, 06 Nov 2023 13:03:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1699304622; x=1699909422; 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=eKtI99VxeOyhPoDjugXpaj86NuLenomQwROgP1e0y7o=; b=JAn29ap+X6Zp6Cktdqoi1EGOQxSnr2znMljTUfjfYSNAsOXyjuy0wZG7J+r9H+FVNP +wv/U6RdJ84frybvvBUlmFGN04gAuUSId+oAUnkzEPBuCbNw5LyVm2b3Pxa3EQwYtHvq zT8W6lKeqe+63KRhKFYrUCi0M3l/LpoDaDr7s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699304622; x=1699909422; 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=eKtI99VxeOyhPoDjugXpaj86NuLenomQwROgP1e0y7o=; b=Ylv0hUjcN40m7vM5g39QNAoPmwiODYVgxTj/PcIH7UzT4b/Ijl7ooK5/qwF/qLhUYW W2cQK3P42Up3NyJ/yMvkEVhDMecO3QC87gV7YtWjmMrIvgqPi8pUxNb3+J+TxTIqvsA4 8vLjiFJWZ0i93Og7FrItS3sj7zyvz1wotG1wFcqZOOi+TkonIfkkv8w8PfJwQvB2Ofxa z/0+q0eW7RA/rvWuJ40AgvInAOwteuTqlj2mqEB03b09/v88CT9qwXNKgCCHcRQmFnla QL73ub08sTK38nLI9yppACowitVBfixGD4crvSR405AgntMXWwXmC+r03KD6UYCHjfml gnEQ== X-Gm-Message-State: AOJu0YwSmAB17o3Y4L/AAD75Qlu6+RBcVCX4irh7ssh3a04vX+1dFm0A XqzuZ9HOb69Ma+fMiJnn8HYsTg== X-Received: by 2002:a17:902:bcca:b0:1cc:41e1:ba38 with SMTP id o10-20020a170902bcca00b001cc41e1ba38mr18038316pls.66.1699304621684; Mon, 06 Nov 2023 13:03:41 -0800 (PST) Received: from hsinyi.sjc.corp.google.com ([2620:15c:9d:2:3374:ff6c:474e:a78]) by smtp.gmail.com with ESMTPSA id 11-20020a170902c14b00b001c75a07f62esm6291220plj.34.2023.11.06.13.03.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 13:03:41 -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 v4 1/3] drm/panel-edp: drm/panel-edp: Add several generic edp panels Date: Mon, 6 Nov 2023 13:00:50 -0800 Message-ID: <20231106210337.2900034-2-hsinyi@chromium.org> X-Mailer: git-send-email 2.42.0.869.gea05f2083d-goog In-Reply-To: <20231106210337.2900034-1-hsinyi@chromium.org> References: <20231106210337.2900034-1-hsinyi@chromium.org> MIME-Version: 1.0 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Mon, 06 Nov 2023 13:04:09 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781850079773148049 X-GMAIL-MSGID: 1781850079773148049 Add a few generic edp panels used by mt8186 chromebooks. Besides, modify the following panel: - AUO 0x235c B116XTN02 renamed to B116XTN02.3. - AUO 0x405c B116XAK01 adjust the timing of auo_b116xak01. According to the datasheet: T3=200, T12=500, T7_max = 50. Signed-off-by: Hsin-Yi Wang Reviewed-by: Douglas Anderson --- v3->v4: no change --- drivers/gpu/drm/panel/panel-edp.c | 57 +++++++++++++++++++++++++++++-- 1 file changed, 55 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-edp.c b/drivers/gpu/drm/panel/panel-edp.c index 9dce4c702414..599a949d74d1 100644 --- a/drivers/gpu/drm/panel/panel-edp.c +++ b/drivers/gpu/drm/panel/panel-edp.c @@ -973,6 +973,8 @@ static const struct panel_desc auo_b116xak01 = { }, .delay = { .hpd_absent = 200, + .unprepare = 500, + .enable = 50, }, }; @@ -1830,6 +1832,12 @@ static const struct panel_delay delay_200_500_e50 = { .enable = 50, }; +static const struct panel_delay delay_200_500_e80 = { + .hpd_absent = 200, + .unprepare = 500, + .enable = 80, +}; + static const struct panel_delay delay_200_500_e80_d50 = { .hpd_absent = 200, .unprepare = 500, @@ -1849,6 +1857,19 @@ static const struct panel_delay delay_200_500_e200 = { .enable = 200, }; +static const struct panel_delay delay_200_500_e200_d10 = { + .hpd_absent = 200, + .unprepare = 500, + .enable = 200, + .disable = 10, +}; + +static const struct panel_delay delay_200_150_e200 = { + .hpd_absent = 200, + .unprepare = 150, + .enable = 200, +}; + #define EDP_PANEL_ENTRY(vend_chr_0, vend_chr_1, vend_chr_2, product_id, _delay, _name) \ { \ .name = _name, \ @@ -1869,37 +1890,69 @@ static const struct edp_panel_entry edp_panels[] = { EDP_PANEL_ENTRY('A', 'U', 'O', 0x145c, &delay_200_500_e50, "B116XAB01.4"), EDP_PANEL_ENTRY('A', 'U', 'O', 0x1e9b, &delay_200_500_e50, "B133UAN02.1"), EDP_PANEL_ENTRY('A', 'U', 'O', 0x1ea5, &delay_200_500_e50, "B116XAK01.6"), - EDP_PANEL_ENTRY('A', 'U', 'O', 0x235c, &delay_200_500_e50, "B116XTN02"), - EDP_PANEL_ENTRY('A', 'U', 'O', 0x405c, &auo_b116xak01.delay, "B116XAK01"), + EDP_PANEL_ENTRY('A', 'U', 'O', 0x208d, &delay_200_500_e50, "B140HTN02.1"), + EDP_PANEL_ENTRY('A', 'U', 'O', 0x235c, &delay_200_500_e50, "B116XTN02.3"), + 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', 0x582d, &delay_200_500_e50, "B133UAN01.0"), EDP_PANEL_ENTRY('A', 'U', 'O', 0x615c, &delay_200_500_e50, "B116XAN06.1"), + EDP_PANEL_ENTRY('A', 'U', 'O', 0x635c, &delay_200_500_e50, "B116XAN06.3"), + EDP_PANEL_ENTRY('A', 'U', 'O', 0x639c, &delay_200_500_e50, "B140HAK02.7"), EDP_PANEL_ENTRY('A', 'U', 'O', 0x8594, &delay_200_500_e50, "B133UAN01.0"), + EDP_PANEL_ENTRY('A', 'U', 'O', 0xf390, &delay_200_500_e50, "B140XTN07.7"), + EDP_PANEL_ENTRY('B', 'O', 'E', 0x0715, &delay_200_150_e200, "NT116WHM-N21"), + EDP_PANEL_ENTRY('B', 'O', 'E', 0x0731, &delay_200_500_e80, "NT116WHM-N42"), + EDP_PANEL_ENTRY('B', 'O', 'E', 0x0741, &delay_200_500_e200, "NT116WHM-N44"), EDP_PANEL_ENTRY('B', 'O', 'E', 0x0786, &delay_200_500_p2e80, "NV116WHM-T01"), EDP_PANEL_ENTRY('B', 'O', 'E', 0x07d1, &boe_nv133fhm_n61.delay, "NV133FHM-N61"), + EDP_PANEL_ENTRY('B', 'O', 'E', 0x07f6, &delay_200_500_e200, "NT140FHM-N44"), EDP_PANEL_ENTRY('B', 'O', 'E', 0x082d, &boe_nv133fhm_n61.delay, "NV133FHM-N62"), + EDP_PANEL_ENTRY('B', 'O', 'E', 0x08b2, &delay_200_500_e200, "NT140WHM-N49"), EDP_PANEL_ENTRY('B', 'O', 'E', 0x09c3, &delay_200_500_e50, "NT116WHM-N21,836X2"), EDP_PANEL_ENTRY('B', 'O', 'E', 0x094b, &delay_200_500_e50, "NT116WHM-N21"), + EDP_PANEL_ENTRY('B', 'O', 'E', 0x0951, &delay_200_500_e80, "NV116WHM-N47"), EDP_PANEL_ENTRY('B', 'O', 'E', 0x095f, &delay_200_500_e50, "NE135FBM-N41 v8.1"), EDP_PANEL_ENTRY('B', 'O', 'E', 0x0979, &delay_200_500_e50, "NV116WHM-N49 V8.0"), EDP_PANEL_ENTRY('B', 'O', 'E', 0x098d, &boe_nv110wtm_n61.delay, "NV110WTM-N61"), + EDP_PANEL_ENTRY('B', 'O', 'E', 0x09ae, &delay_200_500_e200, "NT140FHM-N45"), EDP_PANEL_ENTRY('B', 'O', 'E', 0x09dd, &delay_200_500_e50, "NT116WHM-N21"), EDP_PANEL_ENTRY('B', 'O', 'E', 0x0a5d, &delay_200_500_e50, "NV116WHM-N45"), EDP_PANEL_ENTRY('B', 'O', 'E', 0x0ac5, &delay_200_500_e50, "NV116WHM-N4C"), + EDP_PANEL_ENTRY('B', 'O', 'E', 0x0b43, &delay_200_500_e200, "NV140FHM-T09"), + EDP_PANEL_ENTRY('B', 'O', 'E', 0x0b56, &delay_200_500_e80, "NT140FHM-N47"), + EDP_PANEL_ENTRY('B', 'O', 'E', 0x0c20, &delay_200_500_e80, "NT140FHM-N47"), + EDP_PANEL_ENTRY('C', 'M', 'N', 0x1132, &delay_200_500_e80_d50, "N116BGE-EA2"), + EDP_PANEL_ENTRY('C', 'M', 'N', 0x1138, &innolux_n116bca_ea1.delay, "N116BCA-EA1-RC4"), EDP_PANEL_ENTRY('C', 'M', 'N', 0x1139, &delay_200_500_e80_d50, "N116BGE-EA2"), + EDP_PANEL_ENTRY('C', 'M', 'N', 0x1145, &delay_200_500_e80_d50, "N116BCN-EB1"), EDP_PANEL_ENTRY('C', 'M', 'N', 0x114c, &innolux_n116bca_ea1.delay, "N116BCA-EA1"), EDP_PANEL_ENTRY('C', 'M', 'N', 0x1152, &delay_200_500_e80_d50, "N116BCN-EA1"), EDP_PANEL_ENTRY('C', 'M', 'N', 0x1153, &delay_200_500_e80_d50, "N116BGE-EA2"), EDP_PANEL_ENTRY('C', 'M', 'N', 0x1154, &delay_200_500_e80_d50, "N116BCA-EA2"), + EDP_PANEL_ENTRY('C', 'M', 'N', 0x1157, &delay_200_500_e80_d50, "N116BGE-EA2"), + EDP_PANEL_ENTRY('C', 'M', 'N', 0x115b, &delay_200_500_e80_d50, "N116BCN-EB1"), EDP_PANEL_ENTRY('C', 'M', 'N', 0x1247, &delay_200_500_e80_d50, "N120ACA-EA1"), + EDP_PANEL_ENTRY('C', 'M', 'N', 0x142b, &delay_200_500_e80_d50, "N140HCA-EAC"), + EDP_PANEL_ENTRY('C', 'M', 'N', 0x144f, &delay_200_500_e80_d50, "N140HGA-EA1"), + EDP_PANEL_ENTRY('C', 'M', 'N', 0x1468, &delay_200_500_e80, "N140HGA-EA1"), + EDP_PANEL_ENTRY('C', 'M', 'N', 0x14e5, &delay_200_500_e80_d50, "N140HGA-EA1"), EDP_PANEL_ENTRY('C', 'M', 'N', 0x14d4, &delay_200_500_e80_d50, "N140HCA-EAC"), + EDP_PANEL_ENTRY('C', 'M', 'N', 0x14d6, &delay_200_500_e80_d50, "N140BGA-EA4"), + + EDP_PANEL_ENTRY('H', 'K', 'C', 0x2d5c, &delay_200_500_e200, "MB116AN01-2"), + EDP_PANEL_ENTRY('I', 'V', 'O', 0x048e, &delay_200_500_e200_d10, "M116NWR6 R5"), EDP_PANEL_ENTRY('I', 'V', 'O', 0x057d, &delay_200_500_e200, "R140NWF5 RH"), EDP_PANEL_ENTRY('I', 'V', 'O', 0x854a, &delay_200_500_p2e100, "M133NW4J"), EDP_PANEL_ENTRY('I', 'V', 'O', 0x854b, &delay_200_500_p2e100, "R133NW4K-R0"), + EDP_PANEL_ENTRY('I', 'V', 'O', 0x8c4d, &delay_200_150_e200, "R140NWFM R1"), EDP_PANEL_ENTRY('K', 'D', 'B', 0x0624, &kingdisplay_kd116n21_30nv_a010.delay, "116N21-30NV-A010"), + EDP_PANEL_ENTRY('K', 'D', 'C', 0x0809, &delay_200_500_e50, "KD116N2930A15"), EDP_PANEL_ENTRY('K', 'D', 'B', 0x1120, &delay_200_500_e80_d50, "116N29-30NK-C007"), EDP_PANEL_ENTRY('S', 'H', 'P', 0x1511, &delay_200_500_e50, "LQ140M1JW48"), From patchwork Mon Nov 6 21:00:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hsin-Yi Wang X-Patchwork-Id: 162182 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp2925799vqu; Mon, 6 Nov 2023 13:03:58 -0800 (PST) X-Google-Smtp-Source: AGHT+IEHf6eLVuUwJ6/balnVqdEbKiMnZN+HIEMx3Y5dvhFy13eUD3Rh9YwbhZ3pXxDnF+BeVYye X-Received: by 2002:a05:6e02:1846:b0:357:677e:50e7 with SMTP id b6-20020a056e02184600b00357677e50e7mr1010949ilv.27.1699304637758; Mon, 06 Nov 2023 13:03:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699304637; cv=none; d=google.com; s=arc-20160816; b=ZDEavj6ywJP+3nvJYJddZ5o5oTueGKhnRNPxUIxjK2C7X4u4TOpLh0GOpodq7Q0jiQ sK3UfO1mq6DIbJR6NJ+CM65/TGB28sbYFfxQaaJQYplXKXqLhGQpeLho8b8+S8rPLvFR LGQYBVr+WBR61MrZ/CN50ruEgHF/lk/1Pb2a2msx3/wk2M+XpO10zvtPlsn82NgCNfmj V36EeyTmxSEOUivFeiTzk7e4woEWE6JSeL4W+btAzdQ4zIUkmC3aOCtYhbdiyYfVffiL YN1o/4aQd03pmC6Teg4fLBN4OV3HGGWIATGq6gVxKoVb4R6m5rVxKEG90Ijh3NJKAb5d VRCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=0wWL7J6soKXZc65uu5mj0Qq7sACwpTaan+kzwOlzpWc=; fh=xm4V3i9y7SNKSixHUbMvMEPgDl0W8xdNniziEWdXVkQ=; b=isn7fHoHsYp90Q6gm+JTfyoQBLtMLo9RGVspA512UR1U2Nyihuglu5V6VUvCv0RJSz 0ty2A7xABb/t9wuW7R9QKD7QYWJzqJiQcohKEDX+xL9ZdDa3Ld/AQaUOiQsRHc4aMbmJ Y1HgvHmRE7dk0XXgsRgOevrPDVis4NcR3gihrS/tGrcI8FQXaY+kHHh3c/GoK+R4LrVC ajp6yRYyXVK1CH9tBMcWpK72ck6nDxELplMPQZlGK9MZ4eeeTMKscqcxH+QzEZkgH7dg Jof8ys/BbZwqlP3qgg+AMAajdtd/7a7h5ad+dLiejfpb7tpwG46hIGsikDo8a40QCmHc 0P8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=VI0sYYNS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id k64-20020a638443000000b005b7f3f3ecc5si489870pgd.735.2023.11.06.13.03.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 13:03:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=VI0sYYNS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 96BE3801B425; Mon, 6 Nov 2023 13:03:55 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233088AbjKFVDt (ORCPT + 34 others); Mon, 6 Nov 2023 16:03:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233065AbjKFVDq (ORCPT ); Mon, 6 Nov 2023 16:03:46 -0500 Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F436103 for ; Mon, 6 Nov 2023 13:03:43 -0800 (PST) Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-6b20a48522fso4197108b3a.1 for ; Mon, 06 Nov 2023 13:03:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1699304623; x=1699909423; 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=0wWL7J6soKXZc65uu5mj0Qq7sACwpTaan+kzwOlzpWc=; b=VI0sYYNSk0tKdSQHnfobUL3t72QrxPESqP8dl1JovWqzz3L//Sww4dVaOKEpAMcNba pX3pKpG1+05q4VJ1g7+xxldYZ7Y/GY9XWR2gzcDnHnrpT5sKB/herBcBCwjQyxv9r5a1 xoSytHDQCaduuNmluF6aO639qLCCkVsl7mk5U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699304623; x=1699909423; 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=0wWL7J6soKXZc65uu5mj0Qq7sACwpTaan+kzwOlzpWc=; b=hi7G8UWqeAju1rXuh0kfYWuMTXgIbGGqL7yGLVcq5KzoLHZOc8zUlylchXUNOofDai uPCcIVFah2r9DgnDVCgvv6CuM+gyFS8rQVAh7L1CdJ3o8f0xuCIMQSf1Jfhpei5MQTj+ gZ7QoKiH7iQxGBAVVcHMLYt9eCbqB+uDJmASMQDVr+6UTJ96FUVTRV0UNjMndWjXPTBf wM6Lbwwa9/IsJObQxLiHtEHFWksW6nqfBR/b4rmnBOtvaV+ahfSAER0Y3AJy1qR5pjXy agpYwDU3FKLK/wcEbN61Sqq6ei7Xej9InQNMRutUysDqNa297o8Wre4M3FxEZkdL6prj Bupw== X-Gm-Message-State: AOJu0YwR0OHyLZ7cI9euudf9upxadR6vWBU0ZLCMADd5JYj/TYEl6Pm1 suBqCpLDg11qvEDNoMCThuaCPg== X-Received: by 2002:a05:6a20:7d9e:b0:180:e2b8:3b05 with SMTP id v30-20020a056a207d9e00b00180e2b83b05mr19953860pzj.52.1699304622719; Mon, 06 Nov 2023 13:03:42 -0800 (PST) Received: from hsinyi.sjc.corp.google.com ([2620:15c:9d:2:3374:ff6c:474e:a78]) by smtp.gmail.com with ESMTPSA id 11-20020a170902c14b00b001c75a07f62esm6291220plj.34.2023.11.06.13.03.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 13:03:42 -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 v4 2/3] drm/panel-edp: Add override_edid_mode quirk for generic edp Date: Mon, 6 Nov 2023 13:00:51 -0800 Message-ID: <20231106210337.2900034-3-hsinyi@chromium.org> X-Mailer: git-send-email 2.42.0.869.gea05f2083d-goog In-Reply-To: <20231106210337.2900034-1-hsinyi@chromium.org> References: <20231106210337.2900034-1-hsinyi@chromium.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 06 Nov 2023 13:03:55 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781850059675418247 X-GMAIL-MSGID: 1781850059675418247 Generic edp gets mode from edid. However, some panels report incorrect mode in this way, resulting in glitches on panel. Introduce a new quirk additional_mode to the generic edid to pick a correct hardcoded mode. Signed-off-by: Hsin-Yi Wang Reviewed-by: Douglas Anderson --- v3->v4: no change --- drivers/gpu/drm/panel/panel-edp.c | 68 ++++++++++++++++++++++++++++--- 1 file changed, 63 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-edp.c b/drivers/gpu/drm/panel/panel-edp.c index 599a949d74d1..0fb439b5efb1 100644 --- a/drivers/gpu/drm/panel/panel-edp.c +++ b/drivers/gpu/drm/panel/panel-edp.c @@ -203,6 +203,9 @@ struct edp_panel_entry { /** @name: Name of this panel (for printing to logs). */ const char *name; + + /** @override_edid_mode: Override the mode obtained by edid. */ + const struct drm_display_mode *override_edid_mode; }; struct panel_edp { @@ -301,6 +304,25 @@ static unsigned int panel_edp_get_display_modes(struct panel_edp *panel, return num; } +static int panel_edp_override_edid_mode(struct panel_edp *panel, + struct drm_connector *connector, + const struct drm_display_mode *override_mode) +{ + struct drm_display_mode *mode; + + mode = drm_mode_duplicate(connector->dev, override_mode); + if (mode) { + mode->type |= DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; + drm_mode_set_name(mode); + drm_mode_probed_add(connector, mode); + return 1; + } + + dev_err(panel->base.dev, "failed to add additional mode\n"); + + return 0; +} + static int panel_edp_get_non_edid_modes(struct panel_edp *panel, struct drm_connector *connector) { @@ -568,6 +590,9 @@ static int panel_edp_get_modes(struct drm_panel *panel, { struct panel_edp *p = to_panel_edp(panel); int num = 0; + bool has_override_edid_mode = p->detected_panel && + p->detected_panel != ERR_PTR(-EINVAL) && + p->detected_panel->override_edid_mode; /* probe EDID if a DDC bus is available */ if (p->ddc) { @@ -575,9 +600,18 @@ static int panel_edp_get_modes(struct drm_panel *panel, if (!p->edid) p->edid = drm_get_edid(connector, p->ddc); - - if (p->edid) - num += drm_add_edid_modes(connector, p->edid); + if (p->edid) { + if (has_override_edid_mode) { + /* + * override_edid_mode is specified. Use + * override_edid_mode instead of from edid. + */ + num += panel_edp_override_edid_mode(p, connector, + p->detected_panel->override_edid_mode); + } else { + num += drm_add_edid_modes(connector, p->edid); + } + } pm_runtime_mark_last_busy(panel->dev); pm_runtime_put_autosuspend(panel->dev); @@ -950,6 +984,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, @@ -1878,6 +1925,15 @@ static const struct panel_delay delay_200_150_e200 = { .delay = _delay \ } +#define EDP_PANEL_ENTRY2(vend_chr_0, vend_chr_1, vend_chr_2, product_id, _delay, _name, _mode) \ +{ \ + .name = _name, \ + .panel_id = drm_edid_encode_panel_id(vend_chr_0, vend_chr_1, vend_chr_2, \ + product_id), \ + .delay = _delay, \ + .override_edid_mode = _mode \ +} + /* * This table is used to figure out power sequencing delays for panels that * are detected by EDID. Entries here may point to entries in the @@ -1895,9 +1951,11 @@ 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_ENTRY2('A', 'U', 'O', 0x405c, &auo_b116xak01.delay, "B116XAK01.0", + &auo_b116xa3_mode), 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"), + EDP_PANEL_ENTRY2('A', 'U', 'O', 0x615c, &delay_200_500_e50, "B116XAN06.1", + &auo_b116xa3_mode), EDP_PANEL_ENTRY('A', 'U', 'O', 0x635c, &delay_200_500_e50, "B116XAN06.3"), EDP_PANEL_ENTRY('A', 'U', 'O', 0x639c, &delay_200_500_e50, "B140HAK02.7"), EDP_PANEL_ENTRY('A', 'U', 'O', 0x8594, &delay_200_500_e50, "B133UAN01.0"), From patchwork Mon Nov 6 21:00:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hsin-Yi Wang X-Patchwork-Id: 162183 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp2925812vqu; Mon, 6 Nov 2023 13:03:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IHgNdF3/aRf/3ciJSvqK4ouCBVCXoxaxTzRwqkP4CvQQIuchJWP+8DB6oCAjhYv9T5jLnPe X-Received: by 2002:a05:6e02:1523:b0:359:398d:7c31 with SMTP id i3-20020a056e02152300b00359398d7c31mr933439ilu.4.1699304638805; Mon, 06 Nov 2023 13:03:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699304638; cv=none; d=google.com; s=arc-20160816; b=RZq+nAyV0UGCFe7BiDuJPAV4FM6OOrNpHlKyCkWtCtMwVDzcFWbF1ul2sXATCqO+n4 cMiIuyO/9MLVFpN0+EwcUZayOeVdmJhCiBOYG0Q3X5CIFNlPVOiwIt3Kf6hSonvUWiS7 vkqyjJzKvmHdtkQNVcIQD1DV8hUK2kONOEarv2EFrYI48jSYkmQ4r9l2T5oKD7biaHne Q2zAjFNSfjeO2IaxRczFGUMc7YF+WZaAJXsZ1AD/e8xP1XYPGTD6g0aCY27GQICB5brh ujNnGMP6xibX/k3bkhw68sK+83n+alnyWDcc7Cc9ut7Uq6UkXO+xMdzwVg6exBIewGdS xADg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=7kMz5bDbNmGy2pUD82uFFbL5daLBA/vsaP69IFKgup4=; fh=xm4V3i9y7SNKSixHUbMvMEPgDl0W8xdNniziEWdXVkQ=; b=C2DplE9OvzwZv6J2Ib+1YnQgvEDPTiVi6ghQ6HGytnZyWk0PSvpJYaBBGwbkLyTBxE qo1Zc5qxRsw6kpn/+oDOUJ4+BPYUTA/2Mm3bUAbgw4oqlMUXjfVlrymEOcm5L3x36oUn rnRKgWYkZjhLG3Mc8XwTMGf/zbILrIa/r41cKKmM6Zlmvq57G2bzpQGvnU+PAdDRPc28 8FXOcAK9iRgRGQnk5FHyACyKfBNTpYfYfYCPDxvE8xPM7UqicMSiXNh7FU7N5ngNxfwL iSjD9DwZuL3fH4zt6excv+46o4AiIhoVO1qWewGUQZ3arI3uXq9W4P5sepaNLtrz1nAK /jJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=AaHMfj+B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id 14-20020a63194e000000b005b8a295f016si508863pgz.64.2023.11.06.13.03.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 13:03:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=AaHMfj+B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id C6919801B41A; Mon, 6 Nov 2023 13:03:57 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233092AbjKFVDv (ORCPT + 34 others); Mon, 6 Nov 2023 16:03:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233080AbjKFVDq (ORCPT ); Mon, 6 Nov 2023 16:03:46 -0500 Received: from mail-pg1-x532.google.com (mail-pg1-x532.google.com [IPv6:2607:f8b0:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 53D33A3 for ; Mon, 6 Nov 2023 13:03:44 -0800 (PST) Received: by mail-pg1-x532.google.com with SMTP id 41be03b00d2f7-5bd6ac9833fso1074634a12.0 for ; Mon, 06 Nov 2023 13:03:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1699304624; x=1699909424; 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=7kMz5bDbNmGy2pUD82uFFbL5daLBA/vsaP69IFKgup4=; b=AaHMfj+BWvqcdReQPy/WjbaWZvLbFCJkY45D4gnNR5PuDePP6Szlw3lZ/EAdz46L1I brRUdp5ZJFo99OndPLmhZdIyEyRIiaBXYNZiRbPl6NUPuC13OKZ8/emwrAC1MdaDSIa2 6pe8yChjPHr0FF0DCQ3fqypuUHoL9JyHSeP1c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699304624; x=1699909424; 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=7kMz5bDbNmGy2pUD82uFFbL5daLBA/vsaP69IFKgup4=; b=wUb1DrD/SncaSCpHpBPwur2FR2UiukND5SKvmvQf1GTlsu12Y9LF3AKpST1zSEudIz /U9pANYxIRmkbq8nrs+H0QWwikWnxznujZmtNyTXDZ7maOghTziEBa/1FwnDuwMEEMFS YY/T9rODy7sehDlFnTnpQcrdrRehuiN8TCajpR23mZvHT/P6OAosMfDPVwqlwYKy2iVl GoePRVScpN8WE1ZPLEigJLwdG2CjF0PxlgToALgotr6t4ty6XGRsoA+77h/GmNZ1UcnD jUUSNcOjD21qLh6FhYnOCKTKRvM5wez4T+kzM1BcvjPO5pBIoYCOLAMRe6MsthclLKOm bMcQ== X-Gm-Message-State: AOJu0YwNokRsfZHGEY8/5EdWgERhjed6vWaqSII7Ia5ui+/ghEZsCQfG AbeccwslBmXwao38vtvPZSPvVg== X-Received: by 2002:a17:90a:1a03:b0:280:f4a:86b4 with SMTP id 3-20020a17090a1a0300b002800f4a86b4mr23561724pjk.17.1699304623756; Mon, 06 Nov 2023 13:03:43 -0800 (PST) Received: from hsinyi.sjc.corp.google.com ([2620:15c:9d:2:3374:ff6c:474e:a78]) by smtp.gmail.com with ESMTPSA id 11-20020a170902c14b00b001c75a07f62esm6291220plj.34.2023.11.06.13.03.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 13:03:43 -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 v4 3/3] drm/panel-edp: Avoid adding multiple preferred modes Date: Mon, 6 Nov 2023 13:00:52 -0800 Message-ID: <20231106210337.2900034-4-hsinyi@chromium.org> X-Mailer: git-send-email 2.42.0.869.gea05f2083d-goog In-Reply-To: <20231106210337.2900034-1-hsinyi@chromium.org> References: <20231106210337.2900034-1-hsinyi@chromium.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 06 Nov 2023 13:03:57 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781850060742936711 X-GMAIL-MSGID: 1781850060742936711 If a non generic edp-panel is under aux-bus, the mode read from edid would still be selected as preferred and results in multiple preferred modes, which is ambiguous. If both hard-coded mode and edid exists, only add mode from hard-coded. Signed-off-by: Hsin-Yi Wang --- v3->v4: don't skip read edid. only skip add modes. --- drivers/gpu/drm/panel/panel-edp.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-edp.c b/drivers/gpu/drm/panel/panel-edp.c index 0fb439b5efb1..c8bb4baf1d45 100644 --- a/drivers/gpu/drm/panel/panel-edp.c +++ b/drivers/gpu/drm/panel/panel-edp.c @@ -590,6 +590,7 @@ static int panel_edp_get_modes(struct drm_panel *panel, { struct panel_edp *p = to_panel_edp(panel); int num = 0; + bool has_hard_coded_modes = p->desc->num_timings || p->desc->num_modes; bool has_override_edid_mode = p->detected_panel && p->detected_panel != ERR_PTR(-EINVAL) && p->detected_panel->override_edid_mode; @@ -600,7 +601,11 @@ static int panel_edp_get_modes(struct drm_panel *panel, if (!p->edid) p->edid = drm_get_edid(connector, p->ddc); - if (p->edid) { + /* + * If both edid and hard-coded modes exists, skip edid modes to + * avoid multiple preferred modes. + */ + if (p->edid && !has_hard_coded_modes) { if (has_override_edid_mode) { /* * override_edid_mode is specified. Use @@ -622,7 +627,7 @@ static int panel_edp_get_modes(struct drm_panel *panel, * and no modes (the generic edp-panel case) because it will clobber * the display_info that was already set by drm_add_edid_modes(). */ - if (p->desc->num_timings || p->desc->num_modes) + if (has_hard_coded_modes) num += panel_edp_get_non_edid_modes(p, connector); else if (!num) dev_warn(p->base.dev, "No display modes\n");