From patchwork Tue Sep 22 20:54:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1369260 X-Patchwork-Delegate: bmeng.cn@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=Hvbof6Mj; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Bwtqv6BkFz9sS8 for ; Wed, 23 Sep 2020 06:55:39 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 852AB825DE; Tue, 22 Sep 2020 22:55:15 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="Hvbof6Mj"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5047F825DE; Tue, 22 Sep 2020 22:55:08 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ot1-x343.google.com (mail-ot1-x343.google.com [IPv6:2607:f8b0:4864:20::343]) (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 6AB5882242 for ; Tue, 22 Sep 2020 22:55:04 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-ot1-x343.google.com with SMTP id o8so16930642otl.4 for ; Tue, 22 Sep 2020 13:55:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=C1U71C8NAEUzQEGcNgqv9PpMm4BPXqB9RAckHzFpoYI=; b=Hvbof6MjDkgRS+iW/pd1h3uAkVSI9zsYrC7YDF1baCRLtOh0Ku7y/WEDqPqZzIKqfQ P8LqXQsiWokm5SuN4JqAg4VxJWedVFKOxw2UIUUeUzBagsce4+h+X/R9pMIba0l9DQN1 xef7q04hoPogORS0bY/SgZiR4lrYiT07S2wgU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=C1U71C8NAEUzQEGcNgqv9PpMm4BPXqB9RAckHzFpoYI=; b=Uy76WldpcgKkQv1WfO1m6p3Q5r3yzRAK/icVbUS9zGK7vdyl7beCWigR3KdO+2Ei4D Tp9MRKKpvuHTYF2XkzmmRcaJSX7sRNC37dfZMfO2HiDIYw9gpI8IB5fZDblFYIV7F/0g NIWbmfBCQXWJ186Na7CcuaCn13T3HKOf4ZVP8OrdSPGGBAd5a2ozi/Z/l8ww0tvqp7z6 nv6wNCcLiL+GV576OWshpOaR6SAxTPYWTCaSwVMtceDUwcGrbRzPkizRsCKJhAyWCVJy iud2OiYJ3jQM9aZLPSWf8XzBv1XHmMetO4gPEzyg30f0oDjWVPJDoTLg2WHX3x0lzUNn HXHA== X-Gm-Message-State: AOAM532TAUqDwsehJ6v5O6GmCz+mRZvYv+Fe3GEz/RZqEguA2YdSzklh GBi3rCJZ7a7d77JePkDSLwupTl1RlZYNl6Ku X-Google-Smtp-Source: ABdhPJyDjAIlfevfbBh+pcgWaEgx6BdFp3rVLFPJhVNqOGsrEr9W9Lb1t5j6d81VNV8Uab/qsKZpOg== X-Received: by 2002:a9d:491:: with SMTP id 17mr4157182otm.338.1600808103046; Tue, 22 Sep 2020 13:55:03 -0700 (PDT) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id r5sm7205541otk.74.2020.09.22.13.55.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Sep 2020 13:55:02 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Andy Shevchenko , Heinrich Schuchardt , Bernhard Messerklinger , Wolfgang Wallner , Walter Lozano , Simon Glass , Bin Meng , Anatolij Gustschin , Stefan Roese Subject: [PATCH v2 5/5] x86: video: Show information about each video device Date: Tue, 22 Sep 2020 14:54:52 -0600 Message-Id: <20200922145447.v2.5.I27387a60499ae66446ae94ada3060dce1bc21817@changeid> X-Mailer: git-send-email 2.28.0.681.g6f77f65b4e-goog In-Reply-To: <20200922205452.2955712-1-sjg@chromium.org> References: <20200922205452.2955712-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.102.3 at phobos.denx.de X-Virus-Status: Clean At present the 'bdinfo' command shows the framebuffer address, but not the address of the copy framebuffer, if present. Add support for this. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- (no changes since v1) cmd/bdinfo.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/cmd/bdinfo.c b/cmd/bdinfo.c index 9593b345a3d..2d88eb18ba7 100644 --- a/cmd/bdinfo.c +++ b/cmd/bdinfo.c @@ -8,9 +8,11 @@ #include #include +#include #include #include #include +#include #include #include @@ -66,6 +68,26 @@ __weak void arch_print_bdinfo(void) { } +static void show_video_info(void) +{ + const struct udevice *dev; + struct uclass *uc; + + uclass_id_foreach_dev(UCLASS_VIDEO, dev, uc) { + printf("%-12s= %s %sactive\n", "Video", dev->name, + device_active(dev) ? "" : "in"); + if (device_active(dev)) { + struct video_priv *upriv = dev_get_uclass_priv(dev); + + print_phys_addr("FB base", (ulong)upriv->fb); + if (upriv->copy_fb) + print_phys_addr("FB copy", (ulong)upriv->copy_fb); + printf("%-12s= %dx%dx%d\n", "FB size", upriv->xsize, + upriv->ysize, 1 << upriv->bpix); + } + } +} + int do_bdinfo(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { struct bd_info *bd = gd->bd; @@ -96,7 +118,9 @@ int do_bdinfo(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) bdinfo_print_num("fdt_blob", (ulong)gd->fdt_blob); bdinfo_print_num("new_fdt", (ulong)gd->new_fdt); bdinfo_print_num("fdt_size", (ulong)gd->fdt_size); -#if defined(CONFIG_LCD) || defined(CONFIG_VIDEO) || defined(CONFIG_DM_VIDEO) + if (IS_ENABLED(CONFIG_DM_VIDEO)) + show_video_info(); +#if defined(CONFIG_LCD) || defined(CONFIG_VIDEO) bdinfo_print_num("FB base ", gd->fb_base); #endif #if CONFIG_IS_ENABLED(MULTI_DTB_FIT)