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 8CAA3C05027 for ; Mon, 20 Feb 2023 09:56:31 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9C09185870; Mon, 20 Feb 2023 10:55:41 +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="dXtq+3D1"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5ACF885936; Mon, 20 Feb 2023 10:54:58 +0100 (CET) Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) (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 07CB385841 for ; Mon, 20 Feb 2023 10:54:51 +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-ed1-x530.google.com with SMTP id ck15so3535341edb.0 for ; Mon, 20 Feb 2023 01:54:51 -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=obyjDcr9A3Oaf0RrYu/YOThFwd4pAD/XNiq0Bcv/2RY=; b=dXtq+3D1MwR58g4yzNhiL+fd3/2MFoWWvPOhurakr+sXcCEZUKWMZRoaMe+7GeXrmD 9UQgUO7fXSV2AIRnlYsSNJk4AFPkyFPHQn90ZeBY0eCu1F8qg8btRDsxOcWRvWj1jcCb DBuQA+lDSzNwVm1m0e51lQD3YypAwXAfinRhO9CKGgX+pmcYKkLRtrBzl7A2VlYxK7v8 RPokX2FBNuc21dEITopH1p9pS9YkyAbs5RQLTUsEZ3+/IqEle/nsY/HvVHZwNOET6Vn4 bZrZ1j64LAzQvh0fRqWuoYu4qV4iAynivd3tiB7TrAo8OGDXnLKJ5NyJfdSWriP4++B3 Jt4w== 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=obyjDcr9A3Oaf0RrYu/YOThFwd4pAD/XNiq0Bcv/2RY=; b=p4pjmimocgm9t9EL1+rFm2koiekQBUpq/1drmDOOD11bi6M94tvMooQpo2pxT6QKYg 82xHoK5iIHehQGhTTbyr8MpdhFbScOZrFezn3jnWMzl7ZX2d1Vp68UvCS6kOIAGjs5mu DensriKFYI6mTqB8Ig5dzat/TQFOeZ1LlID/qnm0fUps/X0uJpJXeAGpgeXVGz6j3fP6 1fMzOOuR/slpbee+cTQCMyUM2zgyPw0/05M4NmeNf/sgdAP1HSPz/r7wIRXi+0+NQW2S y23Xjq932fOKHMLkcCCETs8jMbmvGRIdopBhWubfSbuRn5LwsbsPZ2CUYdwBswLoMu7h d09A== X-Gm-Message-State: AO0yUKXu6ga4jt1nt6/lmO74pxnuytjR8lR/M35f4BwsDcpN81IPwNoR D1t+e3xjCABqp+2yXO5R59s= X-Google-Smtp-Source: AK7set+ipC6QHZ88CTGlBLaF6hREZmWg53Wx7cGDWuvAo1syt7YQSZUBT5s5hroXC/c+WNaw/qP3yA== X-Received: by 2002:a17:906:7488:b0:8b1:7a86:b06f with SMTP id e8-20020a170906748800b008b17a86b06fmr11114239ejl.63.1676886890668; Mon, 20 Feb 2023 01:54:50 -0800 (PST) Received: from xeon.. ([188.163.112.76]) by smtp.gmail.com with ESMTPSA id bk7-20020a170906b0c700b008cd37aff603sm1636536ejb.164.2023.02.20.01.54.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Feb 2023 01:54:50 -0800 (PST) From: Svyatoslav Ryhel To: Tom Warren , Anatolij Gustschin , Simon Glass , Svyatoslav Ryhel , Marcel Ziswiler , Thierry Reding , Maxim Schwalm , Dmitry Osipenko Cc: u-boot@lists.denx.de Subject: [PATCH v1 04/11] video: tegra-dc: request timings from panel driver first Date: Mon, 20 Feb 2023 11:54:18 +0200 Message-Id: <20230220095425.6198-5-clamor95@gmail.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20230220095425.6198-1-clamor95@gmail.com> References: <20230220095425.6198-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: 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