From patchwork Wed Sep 23 03:16:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1369568 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=2a01:238:438b:c500:173d:9f52:ddab:ee01; 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=nx7QK1j1; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Bx3JD0Kbjz9sSn for ; Wed, 23 Sep 2020 13:17:15 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EFBB4825C2; Wed, 23 Sep 2020 05:16:58 +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="nx7QK1j1"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id EA327825AC; Wed, 23 Sep 2020 05:16:56 +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-oi1-x242.google.com (mail-oi1-x242.google.com [IPv6:2607:f8b0:4864:20::242]) (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 DD81882581 for ; Wed, 23 Sep 2020 05:16:53 +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-oi1-x242.google.com with SMTP id c13so23475911oiy.6 for ; Tue, 22 Sep 2020 20:16:53 -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=Q54O2A4dYpCX5R/Kt9G9C/hHr+Td92tCg6w9s1af6Fo=; b=nx7QK1j1w355jF/125IZfQERU4rVPfVcHFoXQmlLW/zm1BfKXzYlhDsOMBm0sd2Pcn TbOr0oqfzcQaKwp3hH3peiBKyrg+BK7yXIY2wYzt941EY8Y3gTVlVI5HyUZRVpmNGC98 Fqnf9buYm1mwqk4tD1qAod88vEur76yGD551c= 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=Q54O2A4dYpCX5R/Kt9G9C/hHr+Td92tCg6w9s1af6Fo=; b=WIf6pWNIjxKcJkJgMu66LoMwgZF0on1/Wo2HBzqdMXlUhWXdSgNiOL1qDfkHX1zGi7 Mpl9eTSzBACBIYfsgonhwNKZvEvjYQ6G8/ZaW8gP8leyeHAvMZcTwZD5sxFd1eHScLtz oM62VTC3brU8kOGnnExJFQmPxw3ARr9dz0Phfo8iVfD2PmVBCdJPtieRg1bkeJWRq7nl okA8D9XXpi+v9YnCvHyNTS1UYnbPYW8dmy9rcMJaNvbrSQmLom6wWK3m6OX2HNtOFGho RhIJE+ToXf617gQV7oPROl4F9ZjIAFPo9mS9drzbkc467bfXrjx2HCepCv3JB70D4sI9 VJ9g== X-Gm-Message-State: AOAM531iDA/gLdhutfgD/SleRhRYsPG68iUK4kAJKjAZiqpzbr9AjtZI 0mAn6qByz2kZs1gFqTl8zcBbGIcQ2Bb7GLWt X-Google-Smtp-Source: ABdhPJxdY4/4xUUackEcnobRH6Yln7qLAiDSe9MqjgV0Jw4MK5dndIdhJPtr6hPVsRWAJwxg7jIZiw== X-Received: by 2002:a05:6808:1da:: with SMTP id x26mr4482936oic.161.1600831012494; Tue, 22 Sep 2020 20:16:52 -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 l3sm9180595oom.18.2020.09.22.20.16.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Sep 2020 20:16:51 -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 Subject: [PATCH v3 5/5] x86: video: Show information about each video device Date: Tue, 22 Sep 2020 21:16:40 -0600 Message-Id: <20200922211636.v3.5.I27387a60499ae66446ae94ada3060dce1bc21817@changeid> X-Mailer: git-send-email 2.28.0.681.g6f77f65b4e-goog In-Reply-To: <20200923031640.3055955-1-sjg@chromium.org> References: <20200923031640.3055955-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 --- Changes in v3: - Update header file to avoid build error with !DM_VIDEO cmd/bdinfo.c | 26 +++++++++++++++++++++++++- include/video.h | 6 ++---- 2 files changed, 27 insertions(+), 5 deletions(-) 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) diff --git a/include/video.h b/include/video.h index 1a0ffd80379..9d09d2409af 100644 --- a/include/video.h +++ b/include/video.h @@ -13,8 +13,6 @@ #ifndef _VIDEO_H_ #define _VIDEO_H_ -#ifdef CONFIG_DM_VIDEO - #include struct udevice; @@ -140,6 +138,7 @@ struct video_ops { */ int video_reserve(ulong *addrp); +#ifdef CONFIG_DM_VIDEO /** * video_clear() - Clear a device's frame buffer to background color. * @@ -147,6 +146,7 @@ int video_reserve(ulong *addrp); * @return 0 */ int video_clear(struct udevice *dev); +#endif /* CONFIG_DM_VIDEO */ /** * video_sync() - Sync a device's frame buffer with its hardware @@ -243,8 +243,6 @@ static inline int video_sync_copy(struct udevice *dev, void *from, void *to) } #endif -#endif /* CONFIG_DM_VIDEO */ - #ifndef CONFIG_DM_VIDEO /* Video functions */