From patchwork Thu Nov 2 21:47:47 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: 161129 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp673488vqu; Thu, 2 Nov 2023 15:13:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEMJsYbGjWpsWrPBbJNPLYVtzQjqhk1udaa+/XCTGh+s0t8zzNR5syN24uMLK2ZOkT8JGFR X-Received: by 2002:a05:6358:7e07:b0:169:845b:3414 with SMTP id o7-20020a0563587e0700b00169845b3414mr11348214rwm.20.1698963210166; Thu, 02 Nov 2023 15:13:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698963210; cv=none; d=google.com; s=arc-20160816; b=olFpo7zkxPqWZYCgKmFIyK1R4XWp9sY4uBqDmT+/oqlQxrUG3lnXskJilL4m28aVOK g9KYd6faBPLPwN22ilVdMBbOBEBIGQvqUcHdQQ2JT9gQqiomXeczqNfKza2HBhZvp56S 5xzW4O5tQzHxN7JARnGYEcVaDWCbCqt3QbnmtU40xov68AS90rsDrUs0uHy6KzBScLLB U6EfGGogdVvzWkN6vnS5Ys97FdegDusU8avaeH571UilvlEFTODOnGJRrq8ux9qUE9Gg 37YFe9cnDsAqvttFtyAM2Q0ZR+Zy52XXFLRuvoh5TujqLkRghKzhno6t+jLqEnDxmb3Q G1Vg== 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=Zk0tSzTqOt000Sz6gC+Uw1YKPByQMtx0crh+RvsA3Hs=; fh=xm4V3i9y7SNKSixHUbMvMEPgDl0W8xdNniziEWdXVkQ=; b=YeI/UrAr5YUxOilgPFowrUw3HC7MXaJ5ixl8LEJ23l2E+px6+ctnTNF7xb5ymtmzBB gWrDmeXh0MP7ZpYUsGYWkK+gMzahb2qTsUXAAn6Kzg6LHQogZf6NXx6uIcIf8YUohVmy dQggc5tqH9/+vNqCbLr/sMzCMy37IiV3fumso1ybgUfulOPREY57KEL1mYzzrGL5Oj5U c27uIwxJNukCM66g6Nhsx7W218nInygVLrUgA8U7RfxwFJF1OZ6ofPlaUcSZxcj+5eU1 LJkE5QVwM7Z7YuiCcbv+rYPLjj/ugRrnBFRJe6HZF9Pm1gctMJ/LA3LhYJ1fYZ0dgUNg 4HkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=LO9y6jgR; 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 n3-20020a632703000000b00577f4d85fdbsi363311pgn.548.2023.11.02.15.13.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 15:13:30 -0700 (PDT) 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=LO9y6jgR; 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 487F782F05F8; Thu, 2 Nov 2023 15:13:29 -0700 (PDT) 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 S233730AbjKBWN0 (ORCPT + 37 others); Thu, 2 Nov 2023 18:13:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45608 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229448AbjKBWNW (ORCPT ); Thu, 2 Nov 2023 18:13:22 -0400 Received: from mail-oo1-xc36.google.com (mail-oo1-xc36.google.com [IPv6:2607:f8b0:4864:20::c36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0747FA6 for ; Thu, 2 Nov 2023 15:13:16 -0700 (PDT) Received: by mail-oo1-xc36.google.com with SMTP id 006d021491bc7-5845213c583so711111eaf.0 for ; Thu, 02 Nov 2023 15:13:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1698963195; x=1699567995; 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=Zk0tSzTqOt000Sz6gC+Uw1YKPByQMtx0crh+RvsA3Hs=; b=LO9y6jgRZTBaubmltJhBviJxlQ6uZrdb8mdqLaqDjcJtRpkvvVkodnbFrF3KuGXlJF ZNSzOSq36G4cddjPH+ByUdlleS7+RT6qxDbE1CuC8dhdREwbZKGC7uyN4NXl/yNHvdHJ SpCy0wpGeD+mi3ukTQkWIRgHVEoHZa/rjEVKc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698963195; x=1699567995; 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=Zk0tSzTqOt000Sz6gC+Uw1YKPByQMtx0crh+RvsA3Hs=; b=hRBveulEHJWqzSnlxAX5E1mzg7Eai0szp94MNnVd7LqNmAHsGImNJAHffs/1rlFJV+ ip8VMII5XbrZY2WbeCZI/baiNQYIXqXDyHnB/aFE0j20uIvC7xbZJeQizbVji2cW2OHy auNFujwWG19iYp4ETExvdcXwV8/Mnlm+0WUezo3pIIrvCX03FMRmDkdW1NO/NHXuJaCY mVRB/9918JicTvXKdhGTo05tnjzfuAjRdQY6Zwle7jjO+nOhsejXYC/mqeu1oLDECEMV e0jsLlRcvy/KVf6N8dGGdLOghllV2ZFsM/a6vvflHoc34uMWR7Es5+1yo/jJm8euWdgH zuHA== X-Gm-Message-State: AOJu0Ywk0EhFdUq7xPZhDrj+pZPHGJ2MGAbjNQnOIHIyCSHZXivpT+w9 w4LO5fWrLHhy7uqKJ6Ez/HFZqA== X-Received: by 2002:a05:6358:904c:b0:168:dbac:b94e with SMTP id f12-20020a056358904c00b00168dbacb94emr24862561rwf.32.1698963195256; Thu, 02 Nov 2023 15:13:15 -0700 (PDT) Received: from hsinyi.sjc.corp.google.com ([2620:15c:9d:2:6ec1:79de:6e50:d6fa]) by smtp.gmail.com with ESMTPSA id y6-20020a63ce06000000b00565e96d9874sm196057pgf.89.2023.11.02.15.13.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 15:13:14 -0700 (PDT) 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/4] drm/panel-edp: Add several AUO/BOE panels Date: Thu, 2 Nov 2023 14:47:47 -0700 Message-ID: <20231102221309.1971910-2-hsinyi@chromium.org> X-Mailer: git-send-email 2.42.0.869.gea05f2083d-goog In-Reply-To: <20231102221309.1971910-1-hsinyi@chromium.org> References: <20231102221309.1971910-1-hsinyi@chromium.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.5 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, URIBL_BLOCKED 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]); Thu, 02 Nov 2023 15:13:29 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781492046673419985 X-GMAIL-MSGID: 1781492046673419985 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 --- v1->v2: Address comments: update delay for auo_b116xak01, sort entries. --- 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 Thu Nov 2 21:47:48 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: 161131 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp673531vqu; Thu, 2 Nov 2023 15:13:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHx6sqyNJVCVcdrUxrDdnvN3f2xoiD7uTtZifAQ831X0//D4WzHNyD4zNj5B3jNKXleyonU X-Received: by 2002:a05:6a20:a11e:b0:153:39d9:56fe with SMTP id q30-20020a056a20a11e00b0015339d956femr18659101pzk.47.1698963217988; Thu, 02 Nov 2023 15:13:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698963217; cv=none; d=google.com; s=arc-20160816; b=WMCA1+rLD0mQwWer1Lm7P+BAkc2nX5YggzYhXn/sZ+gq9MBSy7keENVANHpMx4omy8 wQBokg+r5b41P2i4Wn9rgO5A1XIQ7YVwoTCGr4sthyQpAUoK7jJUrJZ6GyavPlum2d43 UXHcNFj9Oe7EB3bQpySdf5RseDCvP8NimAi86//X9GbZBUzUuPlFLaoWuIXgJCQmQ0iM Xr9ODgkOb+53Rb7oLleUZw9B+B0q9xsgi/TujFcUqkVZIPihIUOgq+79Wjf4jPmwHsMU Thpf+iBeyVyMNIM/RT7Yw13vyWVa2n0lSeOPT6HHJ4bevODbvtwtWAHFOlZt2Tdm+5lQ BsxA== 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=QorWcfM+G5ADWypzN9KpHRHW7tbG66Yho+IlCrrLtv4=; fh=xm4V3i9y7SNKSixHUbMvMEPgDl0W8xdNniziEWdXVkQ=; b=dDrXQ8pK7zkQHb2kruF4CZwkZ3TxKATc4t1FSZJh1UCSteEWlIlD/t84H0c/0pfSnn jsEBWQHB6yZ9sB7yHbKLoIVkFl6cAMvwRUBJr7dIsjXn3o01RKPKfheMJL7LHTndHf6P 3oc/HCtv/RsSaVfLSBfjsDPV9B8atAz5KIIVd1rG+CwTT2kZRFevCLT+O3Q/6U+Co6H1 SHEdDjwFfrBXxmxoDcVvOA/lt6OP2h4frmw7QONu7fA2ujbCrEXN/+jp5DldiUC80Eo9 /yDTNKt3TIb0yWJkGw7ETAJEK1mitmDbPy+/BuVUGtr2emKGYZ3qG5femRmrtNaN//rv LmoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="UjpK2O/2"; 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 ot13-20020a17090b3b4d00b0028007dadafbsi515879pjb.58.2023.11.02.15.13.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 15:13:37 -0700 (PDT) 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="UjpK2O/2"; 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 C141C82F27DF; Thu, 2 Nov 2023 15:13:36 -0700 (PDT) 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 S1377469AbjKBWNa (ORCPT + 37 others); Thu, 2 Nov 2023 18:13:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234346AbjKBWNX (ORCPT ); Thu, 2 Nov 2023 18:13:23 -0400 Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A34B919E for ; Thu, 2 Nov 2023 15:13:17 -0700 (PDT) Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-692c02adeefso1487124b3a.3 for ; Thu, 02 Nov 2023 15:13:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1698963197; x=1699567997; 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=QorWcfM+G5ADWypzN9KpHRHW7tbG66Yho+IlCrrLtv4=; b=UjpK2O/20UxRHAnF+mAiRr2TlU6w+oKdCBITl5a6jyOajucsSpo45YYMENMNAOGMGX 8f5Bt6TKXE8VFCzw0SEzCdz/HitfIDakp7Y/s21ofmNKrjebk+nairx4af2C5rHt1Qe4 7z2DBFYxKAv5yToS3W3MnOHTLMraTA2+RFdCQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698963197; x=1699567997; 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=QorWcfM+G5ADWypzN9KpHRHW7tbG66Yho+IlCrrLtv4=; b=Lx783JXmkqZwIr0IkSwAZa10IYm4HfAmeotq6Xno7y0hGOQxS2QFlXEecc7vHAKMWt ICDbDN2C9N23IqbQmJLE5m1sadi31TSnF3KUDzG/M/GTDhB+R0QnrxDny+zYw4VZfZy0 XA4ffv1XryKNeBVXhO+ADV7Tx/+rqMDILE4cbjMhM6BBEAA9QFhQZV1tB3QC2yJj0nDD 861HEoX/lF5Px6MYil3CN6P64kPj2vYVj3xGToQYLi15lfPKMCtyUEb8pLmfdAF+1gVZ pmMYS9XzMyBGeu4+geOCjfWLfnpVzYLASmo4kTGYWrtXCboYxO5d9+xUhAUHjsBKeycS AeRA== X-Gm-Message-State: AOJu0YyIdc1ksz/3lm67ZfZKDpG0GPdO5go3bxrneUBAcW+Lq/PIWGFN xTSXL2HjIAXG+fLVMwTdMwx43g== X-Received: by 2002:a05:6a00:1152:b0:6be:2bfa:6290 with SMTP id b18-20020a056a00115200b006be2bfa6290mr18056636pfm.8.1698963197065; Thu, 02 Nov 2023 15:13:17 -0700 (PDT) Received: from hsinyi.sjc.corp.google.com ([2620:15c:9d:2:6ec1:79de:6e50:d6fa]) by smtp.gmail.com with ESMTPSA id y6-20020a63ce06000000b00565e96d9874sm196057pgf.89.2023.11.02.15.13.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 15:13:16 -0700 (PDT) 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/4] drm/panel-edp: Add override_edid_mode quirk for generic edp Date: Thu, 2 Nov 2023 14:47:48 -0700 Message-ID: <20231102221309.1971910-3-hsinyi@chromium.org> X-Mailer: git-send-email 2.42.0.869.gea05f2083d-goog In-Reply-To: <20231102221309.1971910-1-hsinyi@chromium.org> References: <20231102221309.1971910-1-hsinyi@chromium.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.5 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, URIBL_BLOCKED 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]); Thu, 02 Nov 2023 15:13:36 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781492055275800513 X-GMAIL-MSGID: 1781492055275800513 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 --- v1->v2: 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 Thu Nov 2 21:47:49 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: 161130 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp673496vqu; Thu, 2 Nov 2023 15:13:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFA8uYTaH88dPXLMmWKrJDII2VaUdsITEOzgYlXzFkjxveOUd5uwDLfrRkNAWtANeeXvX2M X-Received: by 2002:a05:6a20:9184:b0:181:594b:fb77 with SMTP id v4-20020a056a20918400b00181594bfb77mr1235005pzd.29.1698963212125; Thu, 02 Nov 2023 15:13:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698963212; cv=none; d=google.com; s=arc-20160816; b=C4o4u+BLWeJezlyMKPbBPM4Twao5yjh2hidweqyG+ur+zOkXI+inXZWXE73Pe3RfEK PdyFvjUNaI+r0pcRPEWbXa0CqykKaJUehtPXjNkFvLwIfzUjLsX2C647EtpV4Pxe6NGt klvu+Lx08QZAYC5arxJuMu3JPoEGT47NlZ0W64b6iyPb+dmHc2qfbjZjQCn9BgkJBd/N 3u6y/+K2pxbzD88CpJyBk/mQuQSEnnAC31r486kwSWcePWvz4/+P1XqP86cGE8Fcn4Ws CVpI9UeE7vpxILVAg8iXPZoOGxdWKurSkY6udITNMCN1dEWiD2luKNoaqsf6qkhtQCl6 ZiSQ== 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=y06i8Y7ERebYf/tho68vkzbllD+e/f8ccnIKfy6txBE=; fh=xm4V3i9y7SNKSixHUbMvMEPgDl0W8xdNniziEWdXVkQ=; b=obZpzKQfnyQ71Lg6rdFjlqo2yLkCYBNzIwi1CPg3WsmP4BEONg8jQjEoZlTwOQemKs 4uaO9mSIJzcrgt6dJ6rCmev9JC5N/aA2kjT9qxl2WN/OfGP1wD1cpTMVT3uCW19slnP9 ZkO8lQGP6MFxA2FnwembdYCyswBWsO1dN2g2iSm5StgR9J0QFvSK0+LdDy+VJG9MOV61 gDbS41rWCP1d7Nb+2fWGIGRSrN8HRWN0seGraBNsWz58TEHtVzBDcxbwti11UOwruGfq mdX1JYcFkquZ6tK1VBN3sH6FXGldE7QJCgwdfHyOznYoFvz5pbMYv2cdQc6W274O3rqf VrNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="Kk/E6RU9"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id fa36-20020a056a002d2400b006c128a7f813si364061pfb.177.2023.11.02.15.13.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 15:13:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="Kk/E6RU9"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 5BAF882F05EA; Thu, 2 Nov 2023 15:13:31 -0700 (PDT) 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 S1377465AbjKBWN2 (ORCPT + 37 others); Thu, 2 Nov 2023 18:13:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230187AbjKBWNY (ORCPT ); Thu, 2 Nov 2023 18:13:24 -0400 Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D91A9138 for ; Thu, 2 Nov 2023 15:13:18 -0700 (PDT) Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-1cc53d0030fso12058365ad.0 for ; Thu, 02 Nov 2023 15:13:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1698963198; x=1699567998; 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=y06i8Y7ERebYf/tho68vkzbllD+e/f8ccnIKfy6txBE=; b=Kk/E6RU9Ao0Fd5cORJG34sAFudLpkSB5HJKfNVioSDwluCr4Al57WsBQPX+iI8+AUl CSToW8Fs+mkke6j9aTpTc4u/hYu597q6EMHK7hnHBYA776DfsANFZID1Y/iCfiMmRi6G ewlft7Smn8jojhDIUkKn58OBlaUSv6vodklQw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698963198; x=1699567998; 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=y06i8Y7ERebYf/tho68vkzbllD+e/f8ccnIKfy6txBE=; b=cgkcgyvrRuB6KKvbiaw5uPADqYTJbNZxUMa2wJW0T/L1CC00ax8S2UbukOiBNdBC6e XRq04AuWx012Hv7BsrLhVQ85AsBy2Jjfqs7869mz2OI7iVF9KEQcEGPxN1sVsYZ9cBt9 6aSmqBXSYFl3AvOdoeqUvXZfXUsYmpeiqOXgjH+fr5efDDNpoa3MlM7eqD8PP2cZ4oht VBoHhw+EJTM6DDgx/Nohoeco0pW31vkKqjfjNa+hOxrSgCMhuMPOPo+jyPF0UoHlojSO dZTXUCVfwD7GhIZTd3fF5U8HfvTG3mLi/gc/NqOsMt4DwXkDMDKkipSVGkQ86SNZL2M3 b82g== X-Gm-Message-State: AOJu0YzG4ClVtscTAMVPVNWfhgQoLedSRCMXZxfNdmw7jsYe95RUMjif Z0ira/9cpqm4AC94J3kQf8YyzNU3fxRE2QK5pVE= X-Received: by 2002:a17:903:41c6:b0:1cc:55d4:a715 with SMTP id u6-20020a17090341c600b001cc55d4a715mr1007326ple.3.1698963198271; Thu, 02 Nov 2023 15:13:18 -0700 (PDT) Received: from hsinyi.sjc.corp.google.com ([2620:15c:9d:2:6ec1:79de:6e50:d6fa]) by smtp.gmail.com with ESMTPSA id y6-20020a63ce06000000b00565e96d9874sm196057pgf.89.2023.11.02.15.13.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 15:13:17 -0700 (PDT) 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/4] drm/modes: Add a function to clear preferred modes Date: Thu, 2 Nov 2023 14:47:49 -0700 Message-ID: <20231102221309.1971910-4-hsinyi@chromium.org> X-Mailer: git-send-email 2.42.0.869.gea05f2083d-goog In-Reply-To: <20231102221309.1971910-1-hsinyi@chromium.org> References: <20231102221309.1971910-1-hsinyi@chromium.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.5 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, URIBL_BLOCKED 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]); Thu, 02 Nov 2023 15:13:31 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781492048821863889 X-GMAIL-MSGID: 1781492048821863889 Add a function to clear the preferred bit of a connector's existing modes. This is useful for edp panel to unset the preferred modes read from edid if the panel has hard-coded modes. Signed-off-by: Hsin-Yi Wang Reviewed-by: Douglas Anderson --- v1->v2: - fix doc string (reported by kernel test robot). - split mode and panel patches. --- drivers/gpu/drm/drm_modes.c | 16 ++++++++++++++++ include/drm/drm_modes.h | 1 + 2 files changed, 17 insertions(+) diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c index ac9a406250c5..be3e9e931219 100644 --- a/drivers/gpu/drm/drm_modes.c +++ b/drivers/gpu/drm/drm_modes.c @@ -1933,6 +1933,22 @@ void drm_connector_list_update(struct drm_connector *connector) } EXPORT_SYMBOL(drm_connector_list_update); +/** + * drm_mode_unset_preferred_modes - clear the preferred bit on existing modes. + * @connector: the connector to update + * + * Walk the mode list for connector, clearing the preferred status on existing + * modes. + */ +void drm_mode_unset_preferred_modes(struct drm_connector *connector) +{ + struct drm_display_mode *cur_mode; + + list_for_each_entry(cur_mode, &connector->probed_modes, head) + cur_mode->type &= ~DRM_MODE_TYPE_PREFERRED; +} +EXPORT_SYMBOL_GPL(drm_mode_unset_preferred_modes); + static int drm_mode_parse_cmdline_bpp(const char *str, char **end_ptr, struct drm_cmdline_mode *mode) { diff --git a/include/drm/drm_modes.h b/include/drm/drm_modes.h index c613f0abe9dc..301817e00a15 100644 --- a/include/drm/drm_modes.h +++ b/include/drm/drm_modes.h @@ -560,6 +560,7 @@ void drm_mode_prune_invalid(struct drm_device *dev, struct list_head *mode_list, bool verbose); void drm_mode_sort(struct list_head *mode_list); void drm_connector_list_update(struct drm_connector *connector); +void drm_mode_unset_preferred_modes(struct drm_connector *connector); /* parsing cmdline modes */ bool From patchwork Thu Nov 2 21:47: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: 161132 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp673567vqu; Thu, 2 Nov 2023 15:13:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHQY25bsmyyrsawD8KwBMe5ev1Z2A5pqnKuvss5zuO2I1mJqZCaMGqWlPc4XPTAoM+1BvRW X-Received: by 2002:a17:90b:3597:b0:263:f630:228f with SMTP id mm23-20020a17090b359700b00263f630228fmr20681282pjb.23.1698963221561; Thu, 02 Nov 2023 15:13:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698963221; cv=none; d=google.com; s=arc-20160816; b=bw5fjvKc4B0K0dP6yOwP6ZV89bcRXeDricATw2DVvUv1CEAndu76VTJWTVXNgJnE0R PJQKS63lVxgCNVSt5TfoNjDN7aazhU9WsgBb0YHt5OQiYfUpQiU5bBQxR9HdhBDh7EF0 MkZ35rerPE9fzgxk7Y8nKQtB8FQDTFVqH6IN+LPfn+agC+qS5F+BChU3vgPahZH9IaQs +a0Gair6FL3M6+eYm/SRqKbjNTAzzEUhNWtFqMOsyhzci4a2XIf/lSto1FysVpDRXIHt ScFgN+JoXJeZ1EbzCdTwtlO8Rzi+UyDJDHtJ/PkJHke2s5hlQyW8BlhGpsuw3U/X6NOu emTw== 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=6k2Y92G/jCAECpt6DbXki9hGcN+8cUNHTMZGe3U3vro=; fh=xm4V3i9y7SNKSixHUbMvMEPgDl0W8xdNniziEWdXVkQ=; b=ZjCVmgE9R1sNI07v4meJfEC0dH2TYrymbbdUVTLTvcYkymgF+01J4OE01Q9cmADjTc ZeQ/2LsTurYBMlIVJS0eIUxDhLw7eQfC+o3uxLdO6L0FljjUydNXn69OMqvfX6V8mzjH GYoF7BBNZAy+osVmxCltPhgdMXAmHn64SXUZywTLlO8nAZ5xbrZRJ2uBMG4UFhSUagsB DVJROSKG3oD+c6k7oOVi41qvKKem7Us8n+Nydoxh28vKE4bExGT44lYbFNvpabbbKwXA SRRwAs7RTHqooWdj2HJ850J34/kBN+iCNJ7EvjxTnnuqmBWMHprx07Dyp5R+FJqF9/Mc SVaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=aKqUivh5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id kp16-20020a170903281000b001ae40e07fb0si335799plb.216.2023.11.02.15.13.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 15:13:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=aKqUivh5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 11C1282F27C7; Thu, 2 Nov 2023 15:13:40 -0700 (PDT) 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 S1377476AbjKBWNe (ORCPT + 37 others); Thu, 2 Nov 2023 18:13:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377461AbjKBWNZ (ORCPT ); Thu, 2 Nov 2023 18:13:25 -0400 Received: from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com [IPv6:2607:f8b0:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0EEBB192 for ; Thu, 2 Nov 2023 15:13:20 -0700 (PDT) Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-6be1bc5aa1cso1544760b3a.3 for ; Thu, 02 Nov 2023 15:13:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1698963199; x=1699567999; 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=6k2Y92G/jCAECpt6DbXki9hGcN+8cUNHTMZGe3U3vro=; b=aKqUivh5S/VJZ0lA80BpArfupAJsYeS2Fa6R3yY+TXp363R2zVQpE6njvepBQftM51 TCmgtiskthuaiThXiMd0YoCenLOCMOgADx/t/WM5bqxLrV6xMoBPgvXO34WscwSsaan6 UO4OJoQd1dFRuWNdlcERfM8UZg73Jv0p51ID0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698963199; x=1699567999; 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=6k2Y92G/jCAECpt6DbXki9hGcN+8cUNHTMZGe3U3vro=; b=vlF3VhWtZizOY2iYphY1SPw39YTP3UGEqjDaMIs7pmK7P/WopDAP4YVhRZ0FqPn4Xs wxspjE/lw/3IqTdukKZGTAgQmD8IwjM2+SwUs+uDBVoFcz6Zh/mwuFuJuNf6xqn4bBCF pzOOsONhGBtCJiU/Ua9E1CpcHpJUALqci7voYQpcu7aHvvoza7Lq0VSgzXIFCRue14uC kSpLXRYdcQ3O5TnwLpwPiAW4boDzVNcnWqOV/gx4GUiEUaIbWIEBFNLdN7+U8msILcpw nEKjgPmipTz9XcRT7FphTBxvPRcsZbDOmyoW4iy4CMsh3biB7gm4DWQ76gQtTMXSQ1Jj v+Hg== X-Gm-Message-State: AOJu0YwfLWcCPMAqifUo4ZzR+ZwOGkk1jSKjTtxwJwJum07HYbxMj7yd Dr9u9CD6OZJJrz1eDkKVhtaN2w== X-Received: by 2002:a05:6a00:2d09:b0:6b6:5ed4:dd42 with SMTP id fa9-20020a056a002d0900b006b65ed4dd42mr23406858pfb.31.1698963199539; Thu, 02 Nov 2023 15:13:19 -0700 (PDT) Received: from hsinyi.sjc.corp.google.com ([2620:15c:9d:2:6ec1:79de:6e50:d6fa]) by smtp.gmail.com with ESMTPSA id y6-20020a63ce06000000b00565e96d9874sm196057pgf.89.2023.11.02.15.13.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 15:13:19 -0700 (PDT) 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 4/4] drm/panel-edp: Choose correct preferred mode Date: Thu, 2 Nov 2023 14:47:50 -0700 Message-ID: <20231102221309.1971910-5-hsinyi@chromium.org> X-Mailer: git-send-email 2.42.0.869.gea05f2083d-goog In-Reply-To: <20231102221309.1971910-1-hsinyi@chromium.org> References: <20231102221309.1971910-1-hsinyi@chromium.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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]); Thu, 02 Nov 2023 15:13:40 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781492059255263306 X-GMAIL-MSGID: 1781492059255263306 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 a hard-coded mode is present, unset the preferred bit of the modes read from edid. Signed-off-by: Hsin-Yi Wang Reviewed-by: Douglas Anderson --- v1->v2: split patches from drm_modes. --- drivers/gpu/drm/panel/panel-edp.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-edp.c b/drivers/gpu/drm/panel/panel-edp.c index 0fb439b5efb1..021322ff9f65 100644 --- a/drivers/gpu/drm/panel/panel-edp.c +++ b/drivers/gpu/drm/panel/panel-edp.c @@ -622,10 +622,13 @@ 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 (p->desc->num_timings || p->desc->num_modes) { + /* hard-coded modes present, unset preferred modes from edid. */ + drm_mode_unset_preferred_modes(connector); num += panel_edp_get_non_edid_modes(p, connector); - else if (!num) + } else if (!num) { dev_warn(p->base.dev, "No display modes\n"); + } /* * TODO: Remove once all drm drivers call