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 phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 803CCC6FA8E for ; Sun, 26 Feb 2023 18:21:33 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C6E7B859FD; Sun, 26 Feb 2023 19:20:47 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="h86nTNa3"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 36D448559B; Sun, 26 Feb 2023 19:20:38 +0100 (CET) Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 26F248591C for ; Sun, 26 Feb 2023 19:20:34 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=clamor95@gmail.com Received: by mail-lf1-x132.google.com with SMTP id f18so5721367lfa.3 for ; Sun, 26 Feb 2023 10:20:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=kV+yJ67Nc+7wuKT9HTKvHL1aH15SVL2JnlcqcQ3Wg/8=; b=h86nTNa3fwzozBepQzeui2VPO33LZYAPAX8MbXnLvrw9pfN2I2fbkJUzxS8JzYUq4t saPapEuUq7QGCirYr8fRjswY8L6yCrEfLT4vm6Ol5nrbBxTe4XaNKr0/xT0n5zSbv1Pg Wp5euqg0xvLBRTooTxL5rOhXkyiHeGhvw8kxfbcT9L1I0xu/BqgwrvZXBsVSVhUXN5CA FtQ0EV9iqOr7eg4av+a8DqzN97DcoX4p1WIX7jzxGx5DuICMOt0N2facfJZ+pN8dXEaJ yvs1GcqpGXffbyzOowNFx0wzI+gWPoT4J4LPpte+UOGHJFVBh40CXR8X5MXyz4KgZi5a 64aA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=kV+yJ67Nc+7wuKT9HTKvHL1aH15SVL2JnlcqcQ3Wg/8=; b=peoQpkeAtgRYb4jEPQhQafR86ZzN7J4QFO1df+zZCAfZM3Que8wILtYwlcO2f8ZYuM f51IONZ9upYMe8weCt9Oowdu86gTKnj+bVyum9BEOoqMrFdjNYeYOCuHdevw6/Izqy8f sR+vWr8+7vWMkt8IaIZd5jIAGiUbB8q7kyrvHaFT0RdVFAEudDeoRomSd/etCVYGn6Xe VLVVGbpXGLmyi2ly+Lbb5V9f7vho4VTbf7+jz72I/Cx3Of3/VeWJC/wdwrgSMKbmflNz XIIUUsiJ6x8NBDaFNdfPAfu8nAIEpEEswV3LtSVk6g/ndm4/vRCB+aEOh+Ya5WACo5YK CrIA== X-Gm-Message-State: AO0yUKXhXpivVM+B0EooLR8J7qyMC9nLfxyyCf3RR8msyoYGX74G0xSX VmVlXtjxMUYA2wYPnD2GG7E= X-Google-Smtp-Source: AK7set+HhTyqtpdy6cxINvBqBAIELi4L6wsPzOUQ/VEVI7EAg8ZkyccdpkgVuJknzO9Ep7BzHkDN2A== X-Received: by 2002:ac2:4435:0:b0:4b5:61e8:8934 with SMTP id w21-20020ac24435000000b004b561e88934mr7514740lfl.64.1677435633422; Sun, 26 Feb 2023 10:20:33 -0800 (PST) Received: from xeon.. ([188.163.112.76]) by smtp.gmail.com with ESMTPSA id x25-20020ac259d9000000b004dc4d984911sm619421lfn.271.2023.02.26.10.20.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 10:20:33 -0800 (PST) From: Svyatoslav Ryhel To: Tom Warren , Anatolij Gustschin , Simon Glass , Svyatoslav Ryhel , Marcel Ziswiler , Thierry Reding , Maxim Schwalm , Dmitry Osipenko , Nicolas Chauvet Cc: u-boot@lists.denx.de Subject: [PATCH v2 04/11] video: tegra-dc: request timings from panel driver first Date: Sun, 26 Feb 2023 20:19:58 +0200 Message-Id: <20230226182005.27291-5-clamor95@gmail.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20230226182005.27291-1-clamor95@gmail.com> References: <20230226182005.27291-1-clamor95@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean Check if panel driver has display timings and get those. If panel driver does not pass timing, try to find timing under rgb node for backwards compatibility. Tested-by: Robert Eckelmann # ASUS TF101 T20 Tested-by: Nicolas Chauvet # Paz00 Tested-by: Andreas Westman Dorcsak # ASUS TF T30 Tested-by: Svyatoslav Ryhel # LG P895 T30 Signed-off-by: Svyatoslav Ryhel --- drivers/video/tegra20/tegra-dc.c | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/drivers/video/tegra20/tegra-dc.c b/drivers/video/tegra20/tegra-dc.c index ff67cc8989..91298b7b7f 100644 --- a/drivers/video/tegra20/tegra-dc.c +++ b/drivers/video/tegra20/tegra-dc.c @@ -380,18 +380,6 @@ static int tegra_lcd_of_to_plat(struct udevice *dev) return -EINVAL; } - ret = fdtdec_decode_display_timing(blob, rgb, 0, &priv->timing); - if (ret) { - debug("%s: Cannot read display timing for '%s' (ret=%d)\n", - __func__, dev->name, ret); - return -EINVAL; - } - timing = &priv->timing; - priv->width = timing->hactive.typ; - priv->height = timing->vactive.typ; - priv->pixel_clock = timing->pixelclock.typ; - priv->log2_bpp = VIDEO_BPP16; - /* * Sadly the panel phandle is in an rgb subnode so we cannot use * uclass_get_device_by_phandle(). @@ -401,6 +389,7 @@ static int tegra_lcd_of_to_plat(struct udevice *dev) debug("%s: Cannot find panel information\n", __func__); return -EINVAL; } + ret = uclass_get_device_by_of_offset(UCLASS_PANEL, panel_node, &priv->panel); if (ret) { @@ -409,6 +398,22 @@ static int tegra_lcd_of_to_plat(struct udevice *dev) return ret; } + ret = panel_get_display_timing(priv->panel, &priv->timing); + if (ret) { + ret = fdtdec_decode_display_timing(blob, rgb, 0, &priv->timing); + if (ret) { + debug("%s: Cannot read display timing for '%s' (ret=%d)\n", + __func__, dev->name, ret); + return -EINVAL; + } + } + + timing = &priv->timing; + priv->width = timing->hactive.typ; + priv->height = timing->vactive.typ; + priv->pixel_clock = timing->pixelclock.typ; + priv->log2_bpp = VIDEO_BPP16; + return 0; } -- 2.37.2