Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp176667rwb; Fri, 4 Aug 2023 10:51:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEIPJETPCfeqo/9xzNcjgUrYtPmhQT65h/wVi0spxfjposdeZbH970DHl2WcH9ORLMYqyLs X-Received: by 2002:a05:6a20:9389:b0:135:110c:c6dd with SMTP id x9-20020a056a20938900b00135110cc6ddmr2670837pzh.53.1691171495851; Fri, 04 Aug 2023 10:51:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691171495; cv=none; d=google.com; s=arc-20160816; b=ZnFGsWoUQNjBm6AKL6l8Ww3NS+EtaM99v53MtORnVRSFZc+tKsG7o4NyhC1fWGxlwc mV+F6+zUeZuGrmEOTsGSnox3LXLiAqojwyULQYCZLGHOd3sNM8bUvMcXg6i+InQ5Q/6k u1GpoNgNf7SYu+KgEP/9cXdDMpsjPThMykpkB9V69yUup+a4wkINQUr1dcLgod8Y/oQb DX4o/bQm4NUqjsvHNLAqy/z1K60AEjP0XwilfTzVimR7GvQI4AQRzcJ6s60v2Z0hiCEc 3UHrAhWARh5wOX+4CTApqu17SH8M9X8QGeZLxcQ7VueZSty1+DoxIeVyMUE1uuK+11oO h2bA== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s76-20020a63774f000000b005646d7e538esi2007568pgc.128.2023.08.04.10.51.22; Fri, 04 Aug 2023 10:51:35 -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 S229736AbjHDPNL (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 Content-Transfer-Encoding: 8bit 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 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 --- 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, -- 2.34.1