From: Thomas Zimmermann <tzimmermann@suse.de>
To: Javier Martinez Canillas <javierm@redhat.com>,
linux-kernel@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org,
Maxime Ripard <mripard@kernel.org>,
Geert Uytterhoeven <geert@linux-m68k.org>,
Conor Dooley <conor@kernel.org>,
Peter Robinson <pbrobinson@gmail.com>
Subject: Re: [PATCH v2 2/6] drm/ssd130x: Add a per controller family functions table
Date: Thu, 12 Oct 2023 09:39:53 +0200 [thread overview]
Message-ID: <e6593ea5-daa1-466a-9d42-0c1872f41a13@suse.de> (raw)
In-Reply-To: <20231012065822.1007930-3-javierm@redhat.com>
[-- Attachment #1.1: Type: text/plain, Size: 1753 bytes --]
Hi Javier
Am 12.10.23 um 08:58 schrieb Javier Martinez Canillas:
[...]
>
> +struct ssd130x_funcs {
> + int (*init)(struct ssd130x_device *ssd130x);
> + int (*set_buffer_sizes)(struct ssd130x_device *ssd130x);
> + void (*align_rect)(struct ssd130x_device *ssd130x, struct drm_rect *rect);
> + int (*update_rect)(struct ssd130x_device *ssd130x, struct drm_rect *rect,
> + u8 *buf, u8 *data_array);
> + void (*clear_screen)(struct ssd130x_device *ssd130x,
> + u8 *data_array);
> + void (*fmt_convert)(struct iosys_map *dst, const unsigned int *dst_pitch,
> + const struct iosys_map *src, const struct drm_framebuffer *fb,
> + const struct drm_rect *clip);
> +};
> +
You are reinventing DRM's atomic helpers. I strongly advised against
doing that, as it often turns out bad. Maybe see my rant at [1] wrt to
another driver.
It's much better to create a separate mode-setting pipeline for the
ssd132x series and share the common code among pipelines. Your driver
will have a clean and readable implementation for each supported
chipset. Compare an old version of mgag200 [2] with the current driver
to see the difference.
Best regards
Thomas
[1]
https://lore.kernel.org/dri-devel/07cc89a5-5200-72e6-f078-694c5820a99a@suse.de/
[2] https://elixir.bootlin.com/linux/v5.5/source/drivers/gpu/drm/mgag200
> extern const struct ssd130x_deviceinfo ssd130x_variants[];
>
> struct ssd130x_device *ssd130x_probe(struct device *dev, struct regmap *regmap);
--
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 --]
next prev parent reply other threads:[~2023-10-12 7:40 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-12 6:58 [PATCH v2 0/6] drm/solomon: Add support for the SSD132x controller family Javier Martinez Canillas
2023-10-12 6:58 ` [PATCH v2 1/6] drm/ssd130x: Replace .page_height field in device info with a constant Javier Martinez Canillas
2023-10-12 6:58 ` [PATCH v2 2/6] drm/ssd130x: Add a per controller family functions table Javier Martinez Canillas
2023-10-12 7:39 ` Thomas Zimmermann [this message]
2023-10-12 8:02 ` Javier Martinez Canillas
2023-10-12 8:21 ` Thomas Zimmermann
2023-10-12 6:58 ` [PATCH v2 3/6] drm/ssd130x: Rename commands that are shared across chip families Javier Martinez Canillas
2023-10-12 6:58 ` [PATCH v2 4/6] drm/ssd130x: Add support for the SSD132x OLED controller family Javier Martinez Canillas
2023-10-12 7:57 ` Geert Uytterhoeven
2023-10-12 8:05 ` Javier Martinez Canillas
2023-10-12 6:58 ` [PATCH v2 5/6] dt-bindings: display: Split common Solomon properties in their own schema Javier Martinez Canillas
2023-10-12 7:23 ` Rob Herring
2023-10-12 7:59 ` Geert Uytterhoeven
2023-10-12 8:08 ` Javier Martinez Canillas
2023-10-12 11:52 ` Rob Herring
2023-10-12 6:58 ` [PATCH v2 6/6] dt-bindings: display: Add SSD132x OLED controllers Javier Martinez Canillas
2023-10-12 11:53 ` Rob Herring
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=e6593ea5-daa1-466a-9d42-0c1872f41a13@suse.de \
--to=tzimmermann@suse.de \
--cc=conor@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=geert@linux-m68k.org \
--cc=javierm@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mripard@kernel.org \
--cc=pbrobinson@gmail.com \
/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
all inboxes | Powered by JetHome®