From patchwork Fri Aug 4 15:12:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Ceresoli X-Patchwork-Id: 131244 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:44a:b0:3f2:4152:657d with SMTP id ez10csp378513vqb; Fri, 4 Aug 2023 09:28:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH33CWdpLcfvip3AElW/5pOUbI3jKhpHddR7Y7OmuMF9hUVgMtBc92n7x2qZAMEpVrSsK1B X-Received: by 2002:a05:6a20:1612:b0:13e:14f9:294d with SMTP id l18-20020a056a20161200b0013e14f9294dmr2404970pzj.58.1691166494563; Fri, 04 Aug 2023 09:28:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691166494; cv=none; d=google.com; s=arc-20160816; b=lOyPNrsvf8wFIHv00dIHZr1+2Com9mCM5FKuE+PkH8I+aTky5zio9Bf+xMrwRqnjnQ fSxE02SvHi/yufYGxqlZ7Q9k3uGxvPb9YsTiuppRq6NZ8dwMAlwYRatI6RncGWAkquPl e3/Q+PKpXdSatQqxBmjlF5VhpYfmEi1X/heomp+DI74rL8i4FXW6jbJ/ZxdpeGzT2iTu lSCDinU3qAuZLXaqq5C1l1SI24O4PV7U7f20jo7/OlTDBCPUefSYk31dk1wsFBr0/jA4 1XgaBiNug3GBlvuu+0yM4+3tvXOG5ibI2Ia8kh+LavQMBsBhDL6IKG1U5kab15OOu7Xv 6aFQ== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=sVsvPzcZLc04k8Mm6Fe387YJusgHKs7kp3zgszuHqAA=; fh=APhHyHy8GNSZ3F2toSIaRb/kBRLJdeGgpohVaPcsaic=; b=bLz3+Ox3sIc0fMHLlKRN7HanN64WCxzTl61sgJ/UVcGGvm+ZjlCwjlUvtxdsoMhzH/ infPJmFaSd34VnRjyNuZqnUR6mjIMS2rO3guwTp5Sb2CdPFYA/ei1yHUbiXdRQfI6ZAy b+XtCQp009W0VL8e5ak0xBX6xASE5v6reJLEaGHo+Khnlq5iWv0obvkCd+AJSGq9w5Wb HhrPB7+Bn9yOs++ptxWB6KAn9ZQXe6gFRVPPIH+VSqwoauTqwmwcncx4ykrlh1sEEKBl lcpI98GNSf3ZEQhxmfASB33YFq+g+uIsv3pAUu+uuAecSgFxVjYIJUwv5rMlpugxqIzX mnkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=NbD5KjwD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r130-20020a632b88000000b00563e0ec8fa4si1896957pgr.730.2023.08.04.09.27.30; Fri, 04 Aug 2023 09:28:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=NbD5KjwD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229983AbjHDPNL (ORCPT + 99 others); Fri, 4 Aug 2023 11:13:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229726AbjHDPMs (ORCPT ); Fri, 4 Aug 2023 11:12:48 -0400 Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7622649C1 for ; Fri, 4 Aug 2023 08:12:47 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPA id 7E16BFF802; Fri, 4 Aug 2023 15:12:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1691161964; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=sVsvPzcZLc04k8Mm6Fe387YJusgHKs7kp3zgszuHqAA=; b=NbD5KjwDufaLxvHe0Ciehi2+EPqgpLicnDnl+PEqYwkZ6XBVbaVp9ZLRTdigY558uPrrvx acS4fzr5z/gxjW0qIJz0fvPvkzGwnAfelgL8MMGkchwUut+Xm9N0VDoIB/u20fRg42Jtq8 KgwzwP839x6UWNrDxn0hmRqEXvylgVUPkqmTHYtLsQn8iekoF5DSMqpXHKRGCXD3+hYJGx GxUMPrIkZdFR3fFsk8QDxqS7vvNRzuOBxskNpaIF50kZQ+4tTZNTKcaJfupAlMvjoJR+M/ ZkDTcSA8+F3fZtk2rvUfHY27sKG5Iu5frwKfgZFxbItqMAR9PY22ruck3+BfXg== From: Luca Ceresoli To: dri-devel@lists.freedesktop.org Cc: Luca Ceresoli , Neil Armstrong , Sam Ravnborg , David Airlie , Daniel Vetter , Sebastian Reichel , linux-kernel@vger.kernel.org, Thomas Petazzoni , Paul Kocialkowski Subject: [PATCH] drm/panel: simple: Fix AUO G121EAN01 panel timings according to the docs Date: Fri, 4 Aug 2023 17:12:39 +0200 Message-Id: <20230804151239.835216-1-luca.ceresoli@bootlin.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-GND-Sasl: luca.ceresoli@bootlin.com X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,SPF_PASS,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-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773316598279331319 X-GMAIL-MSGID: 1773316598279331319 Commit 03e909acd95a ("drm/panel: simple: Add support for AUO G121EAN01.4 panel") added support for this panel model, but the timings it implements are very different from what the datasheet describes. I checked both the G121EAN01.0 datasheet from [0] and the G121EAN01.4 one from [1] and they all have the same timings: for example the LVDS clock typical value is 74.4 MHz, not 66.7 MHz as implemented. Replace the timings with the ones from the documentation. These timings have been tested and the clock frequencies verified with an oscilloscope to ensure they are correct. Also use struct display_timing instead of struct drm_display_mode in order to also specify the minimum and maximum values. [0] https://embedded.avnet.com/product/g121ean01-0/ [1] https://embedded.avnet.com/product/g121ean01-4/ Fixes: 03e909acd95a ("drm/panel: simple: Add support for AUO G121EAN01.4 panel") Signed-off-by: Luca Ceresoli Reviewed-by: Neil Armstrong --- drivers/gpu/drm/panel/panel-simple.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c index 701013b3ad13..56854f78441e 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -999,21 +999,21 @@ static const struct panel_desc auo_g104sn02 = { .connector_type = DRM_MODE_CONNECTOR_LVDS, }; -static const struct drm_display_mode auo_g121ean01_mode = { - .clock = 66700, - .hdisplay = 1280, - .hsync_start = 1280 + 58, - .hsync_end = 1280 + 58 + 8, - .htotal = 1280 + 58 + 8 + 70, - .vdisplay = 800, - .vsync_start = 800 + 6, - .vsync_end = 800 + 6 + 4, - .vtotal = 800 + 6 + 4 + 10, +static const struct display_timing auo_g121ean01_timing = { + .pixelclock = { 60000000, 74400000, 90000000 }, + .hactive = { 1280, 1280, 1280 }, + .hfront_porch = { 20, 50, 100 }, + .hback_porch = { 20, 50, 100 }, + .hsync_len = { 30, 100, 200 }, + .vactive = { 800, 800, 800 }, + .vfront_porch = { 2, 10, 25 }, + .vback_porch = { 2, 10, 25 }, + .vsync_len = { 4, 18, 50 }, }; static const struct panel_desc auo_g121ean01 = { - .modes = &auo_g121ean01_mode, - .num_modes = 1, + .timings = &auo_g121ean01_timing, + .num_timings = 1, .bpc = 8, .size = { .width = 261,