From mboxrd@z Thu Jan 1 00:00:00 1970 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BCACCC433F5 for ; Sat, 25 Sep 2021 13:41:19 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id DDF7061250 for ; Sat, 25 Sep 2021 13:41:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org DDF7061250 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EA7218350D; Sat, 25 Sep 2021 15:41:16 +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="EzV6hWob"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 88E218350D; Sat, 25 Sep 2021 15:41:14 +0200 (CEST) Received: from mail-ua1-x92b.google.com (mail-ua1-x92b.google.com [IPv6:2607:f8b0:4864:20::92b]) (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 8A702832AD for ; Sat, 25 Sep 2021 15:41:10 +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@google.com Received: by mail-ua1-x92b.google.com with SMTP id b15so2986819uaj.5 for ; Sat, 25 Sep 2021 06:41:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=WyZ9ZnIQDUM3RAXIsMZZTnZcPQVjiUBbsntbzKE4xZM=; b=EzV6hWobqVQZvzBKUOUNfC+Qw1VULgpUa+xP6tLB6tdgy/13wE6rSXQUWECK7f2duT u/aKE9gE00MxxeYlcky7SedZZa6np4QVpjeNkrxMJk/2IUpItIOxV0Uwy/PN60u51GFn y7lsx8/jL6aLU1jfGW6lBiZ87PA4p9lAkDUdw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=WyZ9ZnIQDUM3RAXIsMZZTnZcPQVjiUBbsntbzKE4xZM=; b=JTWnya0ls82Q54f4SYQxaOYoc59PX3cfdO2WwjJdGIddIKHb+8P3yIW7BniWRC+XM1 RCJ1E9X2zx/wjMPOay+5A5hXBuyvhgdl7hCZt7l8tuFSt88/yBgDPcnlSrvq1DW2v6S8 b79OX+i8lCHph1HqkJNOU5f52GtRODH+gfmmaA5eD9iAGciXpLCq0eDZvD04mZlQ8kqa rqWmZRzC9MiPJodFqu68pv7U8gbhrOhiCEYQcVR20vdb0kJX/fi5XYb1b34yMwByJ8D2 yuutK72LlnbqXSt3Mf104WkAA5Ye35handWXdCTI1Qs8o4CGmoGtPr9fGt/n/hf8QUwE orBA== X-Gm-Message-State: AOAM5334HMKJm1rxzIZp7j5JcKUMZBGfnrctHU/UWRhLzhv3Ol/5T60E JWaC/NucFSzesstJs2DOuJJO2e5VmfqIrjiXOFtTjw== X-Google-Smtp-Source: ABdhPJxlUd56LIPYKNUPDar4OD4us8EOk5C9Ccz752Qqcg1ohSmvHnDcBL0qmcl57Z6rrH5IMrYEv8J0Vycu7lQ87E0= X-Received: by 2002:ab0:4a19:: with SMTP id q25mr7123329uae.143.1632577265240; Sat, 25 Sep 2021 06:41:05 -0700 (PDT) MIME-Version: 1.0 References: <20210916130117.20894-1-kettenis@openbsd.org> <20210916130117.20894-2-kettenis@openbsd.org> In-Reply-To: <20210916130117.20894-2-kettenis@openbsd.org> From: Simon Glass Date: Sat, 25 Sep 2021 07:40:54 -0600 Message-ID: Subject: Re: [PATCH 1/3] video: Add 30bpp support To: Mark Kettenis Cc: U-Boot Mailing List , Anatolij Gustschin , Heinrich Schuchardt , Alexander Graf Content-Type: text/plain; charset="UTF-8" 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.103.2 at phobos.denx.de X-Virus-Status: Clean On Thu, 16 Sept 2021 at 07:01, Mark Kettenis wrote: > > Add support for 30bpp mode where pixels are picked in 32-bit > integers but use 10 bits instead of 8 bits for each component. > > Signed-off-by: Mark Kettenis > --- > drivers/video/console_normal.c | 2 ++ > drivers/video/console_rotate.c | 6 ++++++ > drivers/video/console_truetype.c | 3 +++ > drivers/video/vidconsole-uclass.c | 7 +++++++ > drivers/video/video-uclass.c | 1 + > include/video.h | 1 + > 6 files changed, 20 insertions(+) > > diff --git a/drivers/video/console_normal.c b/drivers/video/console_normal.c > index 04f022491e..e0b89cbb93 100644 > --- a/drivers/video/console_normal.c > +++ b/drivers/video/console_normal.c > @@ -41,6 +41,7 @@ static int console_normal_set_row(struct udevice *dev, uint row, int clr) > end = dst; > break; > } > + case VIDEO_BPP30: > case VIDEO_BPP32: > if (IS_ENABLED(CONFIG_VIDEO_BPP32)) { > uint32_t *dst = line; > @@ -126,6 +127,7 @@ static int console_normal_putc_xy(struct udevice *dev, uint x_frac, uint y, > } > break; > } > + case VIDEO_BPP30: > case VIDEO_BPP32: > if (IS_ENABLED(CONFIG_VIDEO_BPP32)) { > uint32_t *dst = line; > diff --git a/drivers/video/console_rotate.c b/drivers/video/console_rotate.c > index 36c8d0609d..bf81b80a39 100644 > --- a/drivers/video/console_rotate.c > +++ b/drivers/video/console_rotate.c > @@ -40,6 +40,7 @@ static int console_set_row_1(struct udevice *dev, uint row, int clr) > *dst++ = clr; > break; > } > + case VIDEO_BPP30: > case VIDEO_BPP32: > if (IS_ENABLED(CONFIG_VIDEO_BPP32)) { > uint32_t *dst = line; > @@ -128,6 +129,7 @@ static int console_putc_xy_1(struct udevice *dev, uint x_frac, uint y, char ch) > } > break; > } > + case VIDEO_BPP30: > case VIDEO_BPP32: > if (IS_ENABLED(CONFIG_VIDEO_BPP32)) { > uint32_t *dst = line; > @@ -183,6 +185,7 @@ static int console_set_row_2(struct udevice *dev, uint row, int clr) > end = dst; > break; > } > + case VIDEO_BPP30: > case VIDEO_BPP32: > if (IS_ENABLED(CONFIG_VIDEO_BPP32)) { > uint32_t *dst = line; > @@ -266,6 +269,7 @@ static int console_putc_xy_2(struct udevice *dev, uint x_frac, uint y, char ch) > } > break; > } > + case VIDEO_BPP30: > case VIDEO_BPP32: > if (IS_ENABLED(CONFIG_VIDEO_BPP32)) { > uint32_t *dst = line; > @@ -318,6 +322,7 @@ static int console_set_row_3(struct udevice *dev, uint row, int clr) > *dst++ = clr; > break; > } > + case VIDEO_BPP30: > case VIDEO_BPP32: > if (IS_ENABLED(CONFIG_VIDEO_BPP32)) { > uint32_t *dst = line; > @@ -402,6 +407,7 @@ static int console_putc_xy_3(struct udevice *dev, uint x_frac, uint y, char ch) > } > break; > } > + case VIDEO_BPP30: > case VIDEO_BPP32: > if (IS_ENABLED(CONFIG_VIDEO_BPP32)) { > uint32_t *dst = line; > diff --git a/drivers/video/console_truetype.c b/drivers/video/console_truetype.c > index 98427f4c61..0195d996de 100644 > --- a/drivers/video/console_truetype.c > +++ b/drivers/video/console_truetype.c > @@ -153,6 +153,7 @@ static int console_truetype_set_row(struct udevice *dev, uint row, int clr) > } > #endif > #ifdef CONFIG_VIDEO_BPP32 > + case VIDEO_BPP30: > case VIDEO_BPP32: { > u32 *dst = line; > > @@ -299,6 +300,7 @@ static int console_truetype_putc_xy(struct udevice *dev, uint x, uint y, > } > #endif > #ifdef CONFIG_VIDEO_BPP32 > + case VIDEO_BPP30: > case VIDEO_BPP32: { > u32 *dst = (u32 *)line + xoff; > int i; > @@ -381,6 +383,7 @@ static int console_truetype_erase(struct udevice *dev, int xstart, int ystart, > } > #endif > #ifdef CONFIG_VIDEO_BPP32 > + case VIDEO_BPP30: > case VIDEO_BPP32: { > uint32_t *dst = line; > > diff --git a/drivers/video/vidconsole-uclass.c b/drivers/video/vidconsole-uclass.c > index 8132efa55a..cc274b45fe 100644 > --- a/drivers/video/vidconsole-uclass.c > +++ b/drivers/video/vidconsole-uclass.c > @@ -153,6 +153,13 @@ u32 vid_console_color(struct video_priv *priv, unsigned int idx) > ((colors[idx].b >> 3) << 0); > } > break; > + case VIDEO_BPP30: > + if (CONFIG_IS_ENABLED(VIDEO_BPP32)) { > + return (colors[idx].r << 22) | > + (colors[idx].g << 12) | > + (colors[idx].b << 2); > + } > + break; > case VIDEO_BPP32: > if (CONFIG_IS_ENABLED(VIDEO_BPP32)) { > return (colors[idx].r << 16) | > diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c > index 9f8cf6ef2a..28bf701f41 100644 > --- a/drivers/video/video-uclass.c > +++ b/drivers/video/video-uclass.c > @@ -129,6 +129,7 @@ int video_clear(struct udevice *dev) > *ppix++ = priv->colour_bg; > break; > } > + case VIDEO_BPP30: > case VIDEO_BPP32: > if (IS_ENABLED(CONFIG_VIDEO_BPP32)) { > u32 *ppix = priv->fb; > diff --git a/include/video.h b/include/video.h > index 827733305e..04c636b317 100644 > --- a/include/video.h > +++ b/include/video. > @@ -53,6 +53,7 @@ enum video_log2_bpp { > VIDEO_BPP4, > VIDEO_BPP8, > VIDEO_BPP16, > + VIDEO_BPP30, > VIDEO_BPP32, > }; This breaks the enuam here. See the comment above: /* * Bits per pixel selector. Each value n is such that the bits-per-pixel is * 2 ^ n */ Quite a few things rely on this, so there will need to be some changes. See for example VBNBYTE() immediately below. Also don't you need a CONFIG_VIDEO_BPP30 ? Tested on: Macbook Air M1 Tested-by: Simon Glass Fails on sandbox (display turns blue) Regards, Simon