devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marcus Folkesson <marcus.folkesson@gmail.com>
To: Javier Martinez Canillas <javierm@redhat.com>
Cc: David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Thomas Zimmermann <tzimmrmann@suse.de>
Subject: Re: [PATCH v3 2/3] drm/st7571-i2c: add support for Sitronix ST7571 LCD controller
Date: Wed, 9 Apr 2025 08:41:47 +0200	[thread overview]
Message-ID: <Z_YWq4ry6Y-Jgvjq@gmail.com> (raw)
In-Reply-To: <87ecy1g8z8.fsf@minerva.mail-host-address-is-not-set>

[-- Attachment #1: Type: text/plain, Size: 2045 bytes --]

Hello Javier,

On Wed, Apr 09, 2025 at 08:11:23AM +0200, Javier Martinez Canillas wrote:

[...]
> >> > +static int st7571_set_pixel_format(struct st7571_device *st7571,
> >> > +				   u32 pixel_format)
> >> > +{
> >> > +	switch (pixel_format) {
> >> > +	case DRM_FORMAT_C1:
> >> > +		return st7571_set_color_mode(st7571, ST7571_COLOR_MODE_BLACKWHITE);
> >> > +	case DRM_FORMAT_C2:
> >> > +		return st7571_set_color_mode(st7571, ST7571_COLOR_MODE_GRAY);
> >> > +	default:
> >> > +		return -EINVAL;
> >> > +	}
> >> 
> >> These should be DRM_FORMAT_R1 and DRM_FORMAT_R2 and not C{1,2}. The former
> >> is for displays have a single color (i.e: grey) while the latter is when a
> >> pixel can have different color, whose values are defined by a CLUT table.
> >> 
> >
> > I see.
> > Does fbdev only works with CLUT formats? I get this error when I switch
> > to DRM_FORMAT_R{1,2}:
> >
> > [drm] Initialized st7571 1.0.0 for 0-003f on minor 0
> > st7571 0-003f: [drm] format C1   little-endian (0x20203143) not supported
> > st7571 0-003f: [drm] No compatible format found
> > st7571 0-003f: [drm] *ERROR* fbdev: Failed to setup emulation (ret=-22)
> >
> >
> 
> That's a god question, I don't really know...
> 
> But fbdev does support XRGB8888, which may be another good reason to add
> it and make it the default format. Yes, it will cause an unnecessary pixel
> format conversion but the I2C transport is so slow anyways that compute is
> not the bottleneck when using these small displays.

Hrm, I now realised that I have another issue.
Not all LCDs that will be attached to the ST7571 controller will be
grayscale.
The display I've attached to the ST7571 is a monochrome LCD for example.

Maybe the right way to do it is to only support XRGB8888 and specify 
if the display is monochrome or grayscale in the device tree.

Or do you have any good suggestions?

[...]
> 
> -- 
> Best regards,
> 
> Javier Martinez Canillas
> Core Platforms
> Red Hat
> 

Best regards,
Marcus Folkesson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2025-04-09  6:41 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-08  7:04 [PATCH v3 0/3] Add support for Sitronix ST7571 LCD controller Marcus Folkesson
2025-04-08  7:04 ` [PATCH v3 1/3] dt-bindings: display: Add Sitronix ST7571 LCD Controller Marcus Folkesson
2025-04-08 16:16   ` Conor Dooley
2025-04-08  7:04 ` [PATCH v3 2/3] drm/st7571-i2c: add support for Sitronix ST7571 LCD controller Marcus Folkesson
2025-04-08 10:44   ` Javier Martinez Canillas
2025-04-08 11:01     ` Thomas Zimmermann
2025-04-08 11:34       ` Javier Martinez Canillas
2025-04-08 13:20     ` Marcus Folkesson
2025-04-08 13:57       ` Thomas Zimmermann
2025-04-08 14:58         ` Marcus Folkesson
2025-04-09  7:22           ` Thomas Zimmermann
2025-04-09  6:11       ` Javier Martinez Canillas
2025-04-09  6:41         ` Marcus Folkesson [this message]
2025-04-09  9:43           ` Javier Martinez Canillas
2025-04-09 13:25             ` Marcus Folkesson
2025-04-09 14:15               ` Javier Martinez Canillas
2025-04-11  6:47                 ` Geert Uytterhoeven
2025-04-11  6:03             ` Marcus Folkesson
2025-04-11  8:26               ` Javier Martinez Canillas
2025-04-12  6:56                 ` Marcus Folkesson
2025-04-14  7:55                   ` Javier Martinez Canillas
2025-04-24  6:36     ` Marcus Folkesson
2025-04-24  6:45       ` Javier Martinez Canillas
2025-04-08  7:04 ` [PATCH v3 3/3] MAINTAINERS: add entry for Sitronix ST7571 LCD Controller Marcus Folkesson

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=Z_YWq4ry6Y-Jgvjq@gmail.com \
    --to=marcus.folkesson@gmail.com \
    --cc=airlied@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=javierm@redhat.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=robh@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=tzimmermann@suse.de \
    --cc=tzimmrmann@suse.de \
    /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;
as well as URLs for NNTP newsgroup(s).