* [PATCH] drm/ssd130x: Change pixel format used to compute the buffer size
@ 2023-07-13 8:58 Javier Martinez Canillas
2023-07-13 9:56 ` Geert Uytterhoeven
2023-07-13 10:06 ` Thomas Zimmermann
0 siblings, 2 replies; 4+ messages in thread
From: Javier Martinez Canillas @ 2023-07-13 8:58 UTC (permalink / raw)
To: linux-kernel
Cc: Javier Martinez Canillas, Geert Uytterhoeven, Daniel Vetter,
David Airlie, dri-devel
The commit e254b584dbc0 ("drm/ssd130x: Remove hardcoded bits-per-pixel in
ssd130x_buf_alloc()") used a pixel format info instead of a hardcoded bpp
to calculate the size of the buffer allocated to store the native pixels.
But that wrongly used the DRM_FORMAT_C1 fourcc pixel format, which is for
color-indexed frame buffer formats. While the ssd103x controllers don't
support different single-channel colors nor a Color Lookup Table (CLUT).
Both formats use eight pixels/byte, so in practice there is no functional
changes in this patch. But still the correct pixel format should be used.
Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
---
drivers/gpu/drm/solomon/ssd130x.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/solomon/ssd130x.c b/drivers/gpu/drm/solomon/ssd130x.c
index b3dc1ca9dc10..afb08a8aa9fc 100644
--- a/drivers/gpu/drm/solomon/ssd130x.c
+++ b/drivers/gpu/drm/solomon/ssd130x.c
@@ -153,7 +153,7 @@ static int ssd130x_buf_alloc(struct ssd130x_device *ssd130x)
const struct drm_format_info *fi;
unsigned int pitch;
- fi = drm_format_info(DRM_FORMAT_C1);
+ fi = drm_format_info(DRM_FORMAT_R1);
if (!fi)
return -EINVAL;
--
2.41.0
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] drm/ssd130x: Change pixel format used to compute the buffer size
2023-07-13 8:58 [PATCH] drm/ssd130x: Change pixel format used to compute the buffer size Javier Martinez Canillas
@ 2023-07-13 9:56 ` Geert Uytterhoeven
2023-07-13 10:06 ` Thomas Zimmermann
1 sibling, 0 replies; 4+ messages in thread
From: Geert Uytterhoeven @ 2023-07-13 9:56 UTC (permalink / raw)
To: Javier Martinez Canillas
Cc: linux-kernel, Daniel Vetter, David Airlie, dri-devel
On Thu, Jul 13, 2023 at 10:59 AM Javier Martinez Canillas
<javierm@redhat.com> wrote:
> The commit e254b584dbc0 ("drm/ssd130x: Remove hardcoded bits-per-pixel in
> ssd130x_buf_alloc()") used a pixel format info instead of a hardcoded bpp
> to calculate the size of the buffer allocated to store the native pixels.
>
> But that wrongly used the DRM_FORMAT_C1 fourcc pixel format, which is for
> color-indexed frame buffer formats. While the ssd103x controllers don't
> support different single-channel colors nor a Color Lookup Table (CLUT).
>
> Both formats use eight pixels/byte, so in practice there is no functional
> changes in this patch. But still the correct pixel format should be used.
>
> Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org>
> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] drm/ssd130x: Change pixel format used to compute the buffer size
2023-07-13 8:58 [PATCH] drm/ssd130x: Change pixel format used to compute the buffer size Javier Martinez Canillas
2023-07-13 9:56 ` Geert Uytterhoeven
@ 2023-07-13 10:06 ` Thomas Zimmermann
2023-07-13 12:58 ` Javier Martinez Canillas
1 sibling, 1 reply; 4+ messages in thread
From: Thomas Zimmermann @ 2023-07-13 10:06 UTC (permalink / raw)
To: Javier Martinez Canillas, linux-kernel; +Cc: dri-devel, Geert Uytterhoeven
[-- Attachment #1.1: Type: text/plain, Size: 1725 bytes --]
Am 13.07.23 um 10:58 schrieb Javier Martinez Canillas:
> The commit e254b584dbc0 ("drm/ssd130x: Remove hardcoded bits-per-pixel in
> ssd130x_buf_alloc()") used a pixel format info instead of a hardcoded bpp
> to calculate the size of the buffer allocated to store the native pixels.
>
> But that wrongly used the DRM_FORMAT_C1 fourcc pixel format, which is for
> color-indexed frame buffer formats. While the ssd103x controllers don't
> support different single-channel colors nor a Color Lookup Table (CLUT).
Makes sense to me.
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
>
> Both formats use eight pixels/byte, so in practice there is no functional
> changes in this patch. But still the correct pixel format should be used.
>
> Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org>
> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
> ---
>
> drivers/gpu/drm/solomon/ssd130x.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/solomon/ssd130x.c b/drivers/gpu/drm/solomon/ssd130x.c
> index b3dc1ca9dc10..afb08a8aa9fc 100644
> --- a/drivers/gpu/drm/solomon/ssd130x.c
> +++ b/drivers/gpu/drm/solomon/ssd130x.c
> @@ -153,7 +153,7 @@ static int ssd130x_buf_alloc(struct ssd130x_device *ssd130x)
> const struct drm_format_info *fi;
> unsigned int pitch;
>
> - fi = drm_format_info(DRM_FORMAT_C1);
> + fi = drm_format_info(DRM_FORMAT_R1);
> if (!fi)
> return -EINVAL;
>
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] drm/ssd130x: Change pixel format used to compute the buffer size
2023-07-13 10:06 ` Thomas Zimmermann
@ 2023-07-13 12:58 ` Javier Martinez Canillas
0 siblings, 0 replies; 4+ messages in thread
From: Javier Martinez Canillas @ 2023-07-13 12:58 UTC (permalink / raw)
To: Thomas Zimmermann, linux-kernel; +Cc: dri-devel, Geert Uytterhoeven
Thomas Zimmermann <tzimmermann@suse.de> writes:
> Am 13.07.23 um 10:58 schrieb Javier Martinez Canillas:
>> The commit e254b584dbc0 ("drm/ssd130x: Remove hardcoded bits-per-pixel in
>> ssd130x_buf_alloc()") used a pixel format info instead of a hardcoded bpp
>> to calculate the size of the buffer allocated to store the native pixels.
>>
>> But that wrongly used the DRM_FORMAT_C1 fourcc pixel format, which is for
>> color-indexed frame buffer formats. While the ssd103x controllers don't
>> support different single-channel colors nor a Color Lookup Table (CLUT).
>
> Makes sense to me.
>
> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
>
Thanks Geert and Thomas for your review. I've fixed some typos that had in
my commit message and pushed this to drm-misc-next.
--
Best regards,
Javier Martinez Canillas
Core Platforms
Red Hat
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-07-13 12:59 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-13 8:58 [PATCH] drm/ssd130x: Change pixel format used to compute the buffer size Javier Martinez Canillas
2023-07-13 9:56 ` Geert Uytterhoeven
2023-07-13 10:06 ` Thomas Zimmermann
2023-07-13 12:58 ` Javier Martinez Canillas
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®