Linux Framebuffer Layer development
 help / color / mirror / Atom feed
From: Thomas Zimmermann <tzimmermann@suse.de>
To: Sebastian Raase <basti@sraa.de>
Cc: Sebastian Raase <linux@sraa.de>, Hans de Goede <hansg@kernel.org>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	Helge Deller <deller@gmx.de>
Subject: Re: [PATCH 2/2] dt-bindings: display: simple-framebuffer: Document mono format
Date: Mon, 16 Nov 2026 09:21:13 +0100	[thread overview]
Message-ID: <57ae6b8a-0a34-4093-bf63-e40a0bc2c904@suse.de> (raw)
In-Reply-To: <20261116030028.32753ba3@ryzen>

Hi

Am 15.11.26 um 20:00 schrieb Sebastian Raase:
> Hi,
>
> On Thu, 12 Nov 2026 08:35:59 +0100
> Thomas Zimmermann <tzimmermann@suse.de> wrote:
>
>> Hi
>>
>> Am 04.11.26 um 03:34 schrieb Sebastian Raase:
>>> This is a 1 bit-per-pixel monochrome format, with 8 pixels/byte.
>>>
>>> Signed-off-by: Sebastian Raase <linux@sraa.de>
>>> ---
>>>    .../devicetree/bindings/display/simple-framebuffer.yaml         |
>>> 2 ++ 1 file changed, 2 insertions(+)
>>>
>>> diff --git
>>> a/Documentation/devicetree/bindings/display/simple-framebuffer.yaml
>>> b/Documentation/devicetree/bindings/display/simple-framebuffer.yaml
>>> index 45ffdebc9d86..c627ec088434 100644 ---
>>> a/Documentation/devicetree/bindings/display/simple-framebuffer.yaml
>>> +++
>>> b/Documentation/devicetree/bindings/display/simple-framebuffer.yaml
>>> @@ -94,6 +94,7 @@ properties: format: description: > Format of the
>>> framebuffer:
>>> +        * `mono` - 1-bit packed pixels, 8 pixels/byte
>> I don't object the change, but I really object the naming.
> I fully agree, but could not think of a better name at the time.
>
> As Sashiko pointed out, "mono" neither describes the endianness nor the
> polarity.
>
>> Mono is not a good name because it doesn't describe the format's
>> pixel layout. For example, RGB with only 2 colors is also mono in
>> some sense.
> A two-color RGB format sounds like a contradiction, although bi-color
> LEDs are very common.
>
>> The common names used in the Linux kernel for this type of color
>> format are C1 and R1. More generally speaking,
>>
>>    - Cn describes an n-bit format with a palette. The pixel bits index
>> into the palette.  Pixels are packed.
>>    - Rn describes an n-bit format with a single color channel. The
>> channel has linear color gradient. Pixels are packed.
>>
>> In your case, you'd define 'r1'. While at it, we can also define r2,
>> r4, and r8.  The terminal supports up to 16 colors, so implementing
>> r4 might be of interest to some simple hardware.
> Sounds like a good idea; I can test those for simplefb (not simpledrm).
> Do you have a suggestion on endianness and polarity in the name?

See [1] for what we use in DRM.

  - Cn: Index into color LUT
  - Rn: Linear gradient, 0 means dark
  - Dn: Linear gradient, 0 means full brightness

For what you want to do, 'r1' seams like the right choice, as I outlined 
before.

[1] 
https://elixir.bootlin.com/linux/v7.3.1/source/include/uapi/drm/drm_fourcc.h#L95



>
> Today, we have grayscale/color in mind, so the obvious polarity is
> 0=dark and 1=bright. But the other approach uses 0=paper (white) and

That's Rn

> 1=ink (black), which leads to reverse video hardware. It's uncommon, so
> we can probably ignore this.

That's Dn.  I'm not aware of any hardware that would implement this and 
use simple-framebuffer. No need to add this for now.


>
> Endianness is basically the same difference as RGBA vs. ABGR in 32-bit
> color formats.

Our conversion logic from 8-bit grayscale to 1-bit mono is at [2]. It 
encodes from LSB to MSB.  AFIAK, that's the usual convention.

[2] 
https://elixir.bootlin.com/linux/v7.3.1/source/drivers/gpu/drm/drm_format_helper.c#L1187

>
> So far, I have only tried stride values which were multiples of 8, to
> align them with byte boundaries. Any restriction would apply to r1, r2
> and r4 formats.

Stride and display resolution needs to be aligned to byte boundaries. 
It's usually not a problem in practice.

>
> If I send a v2 patch, should that be a follow-up of this email thread,
> or a completely new thread?

A new thread please.

Best regards
Thomas

>
>> Best regards
>> Thomas
>>
>>
>>>            * `a1r5g5b5` - 16-bit pixels, d[15]=a, d[14:10]=r,
>>> d[9:5]=g, d[4:0]=b
>>>            * `a2r10g10b10` - 32-bit pixels, d[31:30]=a, d[29:20]=r,
>>> d[19:10]=g, d[9:0]=b
>>>            * `a8b8g8r8` - 32-bit pixels, d[31:24]=a, d[23:16]=b,
>>> d[15:8]=g, d[7:0]=r @@ -106,6 +107,7 @@ properties:
>>>            * `x8r8g8b8` - 32-bit pixels, d[23:16]=r, d[15:8]=g,
>>> d[7:0]=b
>>>            * `x8b8g8r8` - 32-bit pixels, d[23:16]=b, d[15:8]=g,
>>> d[7:0]=r enum:
>>> +      - mono
>>>          - a1r5g5b5
>>>          - a2r10g10b10
>>>          - a8b8g8r8
> Best Regards,
> Sebastian

-- 
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com
GF: Stefan Gaiser, Jochen Jaser, Abhinav Puri, (HRB 36809, AG Nürnberg)



  reply	other threads:[~2026-11-16  8:21 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-04  2:34 [PATCH 0/2] Add monochrome framebuffer support to simple-framebuffer Sebastian Raase
2026-11-04  2:34 ` [PATCH 1/2] fbdev: simplefb: Add mono framebuffer format Sebastian Raase
2026-11-10 23:25   ` Helge Deller
2026-11-11 15:27     ` Thomas Zimmermann
2026-11-11 17:52       ` Helge Deller
2026-11-12  7:23         ` Thomas Zimmermann
2026-11-04  2:34 ` [PATCH 2/2] dt-bindings: display: simple-framebuffer: Document mono format Sebastian Raase
2026-11-12  7:35   ` Thomas Zimmermann
2026-11-15 19:00     ` Sebastian Raase
2026-11-16  8:21       ` Thomas Zimmermann [this message]
2026-11-11 11:15 ` [PATCH 0/2] Add monochrome framebuffer support to simple-framebuffer Hans de Goede
2026-11-11 15:32   ` Thomas Zimmermann
2026-11-15 19:10   ` Sebastian Raase

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=57ae6b8a-0a34-4093-bf63-e40a0bc2c904@suse.de \
    --to=tzimmermann@suse.de \
    --cc=airlied@gmail.com \
    --cc=basti@sraa.de \
    --cc=conor+dt@kernel.org \
    --cc=deller@gmx.de \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hansg@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@sraa.de \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=robh@kernel.org \
    --cc=simona@ffwll.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox