From patchwork Sun Jan 12 19:06:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1221860 X-Patchwork-Delegate: sjg@chromium.org 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=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=Esw11KGi; 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)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47wmYL5MG3z9s29 for ; Mon, 13 Jan 2020 06:11:50 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 23DDE81835; Sun, 12 Jan 2020 20:08:03 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (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=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="Esw11KGi"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4E6DF80246; Sun, 12 Jan 2020 20:07:42 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=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-io1-xd41.google.com (mail-io1-xd41.google.com [IPv6:2607:f8b0:4864:20::d41]) (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 6C3ED81801 for ; Sun, 12 Jan 2020 20:07:39 +0100 (CET) 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-io1-xd41.google.com with SMTP id x1so7256574iop.7 for ; Sun, 12 Jan 2020 11:07:39 -0800 (PST) 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=IU+0y/sZxhYxW476W7zatDte4YFxgC4yKlaPox6DXTA=; b=Esw11KGiAZVynA/lxb9WaSqL9dq6yUP9/hJj+0/kc6vEsniE8PrTourpCgRBuQhltZ cWrBgQXQKcDpTtT0UvAWmclrebctIw0iYOT3Uv0Dt5i5V6IqNCAL8Qv+Cc23uCbdXNM2 Ggp3EA5aAZwYDCBl7R3P9hjojCNTOy/ah9oCE= 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=IU+0y/sZxhYxW476W7zatDte4YFxgC4yKlaPox6DXTA=; b=UdDTo6RQ4i0CHzEafy+hieMYIU/NX/IWkpLay0gPt8gDktPRExc4FHIrzUy+yC92k1 QQmBmM6Ahh+tf0it7pvlsozug+NzosUnjZWhO2z2RhRMLX+mVjpAEh9XAVAnMqTkJ4Nz CKV8oxkkiAwqTusXYw4zw1DnI/GwadAhM0cy+vfYiKC9ic1b0CWbGZ7+rw7AgQ6kej2l eot99ylOTDqdE9YuVzd/HxMhGAoYltfyR5F4JitQiqV/aKOQTxm45gYuSqn2lX8gaa3K 3d8gC+l76y5pbgSZtCeF0hmUDuqQW8Qh8QdgbYxXqX7n4zrHWfVb8WGQUbhiVX+Sx9u4 lneA== X-Gm-Message-State: APjAAAVE2ObI8qxLxI5x34JNqr8mQ1nXKE80YKM0pt+u/Uj6KnUepTRe ywscCdKVrDfTII4SBX6tyftSoDPYidk= X-Google-Smtp-Source: APXvYqxwo4K0MEYXrkUS+VS6eFuvfNV2qJrin18X7aiyrjPK8x/nHEmOt+aCsr7E+8otTIYxXsNlvw== X-Received: by 2002:a02:2a08:: with SMTP id w8mr11469216jaw.86.1578856058244; Sun, 12 Jan 2020 11:07:38 -0800 (PST) Received: from kiwi.bld.corp.google.com ([2620:15c:183:0:8223:87c:a681:66aa]) by smtp.gmail.com with ESMTPSA id r22sm3039219ilb.25.2020.01.12.11.07.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Jan 2020 11:07:37 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Subject: [PATCH 28/33] sandbox: Support changing the LCD colour depth Date: Sun, 12 Jan 2020 12:06:19 -0700 Message-Id: <20200112120216.28.I6e1d242c53cbe76b041651299cf5e971cc7fc7e8@changeid> X-Mailer: git-send-email 2.25.0.rc1.283.g88dfdc4193-goog In-Reply-To: <20200112190624.79077-1-sjg@chromium.org> References: <20200112190624.79077-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.26 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Heinrich Schuchardt Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.101.4 at phobos.denx.de X-Virus-Status: Clean Add a new device-tree property to control the colour depth. At present we support 16bpp and 32bpp. While we are here, update the code to use livetree. Signed-off-by: Simon Glass Reviewed-by: Anatolij Gustschin --- arch/sandbox/dts/sandbox.dtsi | 1 + doc/device-tree-bindings/video/sandbox-fb.txt | 6 +++++- drivers/video/sandbox_sdl.c | 8 +++----- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/arch/sandbox/dts/sandbox.dtsi b/arch/sandbox/dts/sandbox.dtsi index 7bf144f532..7cd56c14f2 100644 --- a/arch/sandbox/dts/sandbox.dtsi +++ b/arch/sandbox/dts/sandbox.dtsi @@ -83,6 +83,7 @@ compatible = "sandbox,lcd-sdl"; xres = <1366>; yres = <768>; + log2-depth = <5>; }; leds { diff --git a/doc/device-tree-bindings/video/sandbox-fb.txt b/doc/device-tree-bindings/video/sandbox-fb.txt index eb91b30e3f..230d25c23b 100644 --- a/doc/device-tree-bindings/video/sandbox-fb.txt +++ b/doc/device-tree-bindings/video/sandbox-fb.txt @@ -2,7 +2,10 @@ Sandbox LCD =========== This uses the displaymode.txt binding except that only xres and yres are -required properties. +required properties. Also an additional optional property is defined: + +log2-depth: Log base 2 of the U-Boot display buffer depth (4=16bpp, 5=32bpp). + If not provided, a value of 4 is used. Example: @@ -10,4 +13,5 @@ Example: compatible = "sandbox,lcd-sdl"; xres = <800>; yres = <600>; + log2-depth = <5>; }; diff --git a/drivers/video/sandbox_sdl.c b/drivers/video/sandbox_sdl.c index d1272d0918..1196e6c671 100644 --- a/drivers/video/sandbox_sdl.c +++ b/drivers/video/sandbox_sdl.c @@ -47,13 +47,11 @@ static int sandbox_sdl_bind(struct udevice *dev) { struct video_uc_platdata *uc_plat = dev_get_uclass_platdata(dev); struct sandbox_sdl_plat *plat = dev_get_platdata(dev); - const void *blob = gd->fdt_blob; - int node = dev_of_offset(dev); int ret = 0; - plat->xres = fdtdec_get_int(blob, node, "xres", LCD_MAX_WIDTH); - plat->yres = fdtdec_get_int(blob, node, "yres", LCD_MAX_HEIGHT); - plat->bpix = VIDEO_BPP16; + plat->xres = dev_read_u32_default(dev, "xres", LCD_MAX_WIDTH); + plat->yres = dev_read_u32_default(dev, "yres", LCD_MAX_HEIGHT); + plat->bpix = dev_read_u32_default(dev, "log2-depth", VIDEO_BPP16); uc_plat->size = plat->xres * plat->yres * (1 << plat->bpix) / 8; debug("%s: Frame buffer size %x\n", __func__, uc_plat->size);