dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* drm/tiny: QUESTION: What to use instead of drm_simple_display_pipe ?
@ 2024-03-18 19:18 Mehdi Djait
  2024-03-19  8:35 ` Thomas Zimmermann
  0 siblings, 1 reply; 4+ messages in thread
From: Mehdi Djait @ 2024-03-18 19:18 UTC (permalink / raw)
  To: tzimmermann, daniel, maarten.lankhorst, dri-devel, linux-kernel

Hello everyone :)

I am implementing a tiny drm driver and I am currently working on the
V2: https://lore.kernel.org/dri-devel/cover.1701267411.git.mehdi.djait@bootlin.com/

I got a review on the v1 telling me not to use the
drm_simple_display_pipe. Can someone please explain this further ? Or
give me an example drm driver that does it the right way ?

--
Kind Regards
Mehdi Djait

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: drm/tiny: QUESTION: What to use instead of drm_simple_display_pipe ?
  2024-03-18 19:18 drm/tiny: QUESTION: What to use instead of drm_simple_display_pipe ? Mehdi Djait
@ 2024-03-19  8:35 ` Thomas Zimmermann
  2024-03-19  8:52   ` Javier Martinez Canillas
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas Zimmermann @ 2024-03-19  8:35 UTC (permalink / raw)
  To: Mehdi Djait, daniel, maarten.lankhorst, dri-devel, linux-kernel

Hi

Am 18.03.24 um 20:18 schrieb Mehdi Djait:
> Hello everyone :)
>
> I am implementing a tiny drm driver and I am currently working on the
> V2: https://lore.kernel.org/dri-devel/cover.1701267411.git.mehdi.djait@bootlin.com/
>
> I got a review on the v1 telling me not to use the
> drm_simple_display_pipe. Can someone please explain this further ? Or
> give me an example drm driver that does it the right way ?

You can copy the code from drm_simple_kms_helper.c into your driver file 
and start inlining everything. For example

  1) Your driver calls drm_simple_display_pipe_init(), so you copy that 
code into your source file
  2) drm_simple_display_pipe_init() uses drm_simple_kms_plane_funcs and 
drm_simple_kms_crtc_funcs, so you copy these into your source file; 
together with the drm_simple_kms_*() helpers that they use for their 
callback pointers.
  3) Mayb do this for other drm_simple_kms_*() code.
  4) Then start inlining: inline your copy of 
drm_simple_display_pipe_iit(). Instead of using 
sharp_ls027b7dh01_pipe_funcs, inline its functions into your copy of the 
callers. And so on.
  5) Rename the resulting code, so that it fits you driver.

With careful changes, you 'll end up with the same functionality as 
before, but without the intermediate layer of the simple-KMS code.

Best regards
Thomas

>
> --
> Kind Regards
> Mehdi Djait

-- 
--
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)


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: drm/tiny: QUESTION: What to use instead of drm_simple_display_pipe ?
  2024-03-19  8:35 ` Thomas Zimmermann
@ 2024-03-19  8:52   ` Javier Martinez Canillas
  2024-03-20 18:59     ` Mehdi Djait
  0 siblings, 1 reply; 4+ messages in thread
From: Javier Martinez Canillas @ 2024-03-19  8:52 UTC (permalink / raw)
  To: Thomas Zimmermann, Mehdi Djait, daniel, maarten.lankhorst,
	dri-devel, linux-kernel

Thomas Zimmermann <tzimmermann@suse.de> writes:

Hello Mehdi,

> Hi
>
> Am 18.03.24 um 20:18 schrieb Mehdi Djait:
>> Hello everyone :)
>>
>> I am implementing a tiny drm driver and I am currently working on the
>> V2: https://lore.kernel.org/dri-devel/cover.1701267411.git.mehdi.djait@bootlin.com/
>>
>> I got a review on the v1 telling me not to use the
>> drm_simple_display_pipe. Can someone please explain this further ? Or
>> give me an example drm driver that does it the right way ?
>
> You can copy the code from drm_simple_kms_helper.c into your driver file 
> and start inlining everything. For example
>
>   1) Your driver calls drm_simple_display_pipe_init(), so you copy that 
> code into your source file
>   2) drm_simple_display_pipe_init() uses drm_simple_kms_plane_funcs and 
> drm_simple_kms_crtc_funcs, so you copy these into your source file; 
> together with the drm_simple_kms_*() helpers that they use for their 
> callback pointers.
>   3) Mayb do this for other drm_simple_kms_*() code.
>   4) Then start inlining: inline your copy of 
> drm_simple_display_pipe_iit(). Instead of using 
> sharp_ls027b7dh01_pipe_funcs, inline its functions into your copy of the 
> callers. And so on.
>   5) Rename the resulting code, so that it fits you driver.
>
> With careful changes, you 'll end up with the same functionality as 
> before, but without the intermediate layer of the simple-KMS code.
>

On top of what Thomas said, you can check 622113b9f11f ("drm/ssd130x:
Replace simple display helpers with the atomic helpers") that did this
change for the drivers/gpu/drm/solomon/ssd130x.c driver.

The driver is also for a monochrome panel controller and it does support
SPI as transport, which means the controller is similar to yours in many
aspects. You could use that driver code as a reference for your driver.

> Best regards
> Thomas
>
>>
>> --
>> Kind Regards
>> Mehdi Djait
>
> -- 
> --
> 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)
>

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: drm/tiny: QUESTION: What to use instead of drm_simple_display_pipe ?
  2024-03-19  8:52   ` Javier Martinez Canillas
@ 2024-03-20 18:59     ` Mehdi Djait
  0 siblings, 0 replies; 4+ messages in thread
From: Mehdi Djait @ 2024-03-20 18:59 UTC (permalink / raw)
  To: Javier Martinez Canillas
  Cc: Thomas Zimmermann, daniel, maarten.lankhorst, dri-devel, linux-kernel

Hello Javier, Hello Thomas,

On Tue, Mar 19, 2024 at 09:52:34AM +0100, Javier Martinez Canillas wrote:
> Thomas Zimmermann <tzimmermann@suse.de> writes:
> 
> Hello Mehdi,
> 
> > Hi
> >
> > Am 18.03.24 um 20:18 schrieb Mehdi Djait:
> >> Hello everyone :)
> >>
> >> I am implementing a tiny drm driver and I am currently working on the
> >> V2: https://lore.kernel.org/dri-devel/cover.1701267411.git.mehdi.djait@bootlin.com/
> >>
> >> I got a review on the v1 telling me not to use the
> >> drm_simple_display_pipe. Can someone please explain this further ? Or
> >> give me an example drm driver that does it the right way ?
> >
> > You can copy the code from drm_simple_kms_helper.c into your driver file 
> > and start inlining everything. For example
> >
> >   1) Your driver calls drm_simple_display_pipe_init(), so you copy that 
> > code into your source file
> >   2) drm_simple_display_pipe_init() uses drm_simple_kms_plane_funcs and 
> > drm_simple_kms_crtc_funcs, so you copy these into your source file; 
> > together with the drm_simple_kms_*() helpers that they use for their 
> > callback pointers.
> >   3) Mayb do this for other drm_simple_kms_*() code.
> >   4) Then start inlining: inline your copy of 
> > drm_simple_display_pipe_iit(). Instead of using 
> > sharp_ls027b7dh01_pipe_funcs, inline its functions into your copy of the 
> > callers. And so on.
> >   5) Rename the resulting code, so that it fits you driver.
> >
> > With careful changes, you 'll end up with the same functionality as 
> > before, but without the intermediate layer of the simple-KMS code.
> >
> 
> On top of what Thomas said, you can check 622113b9f11f ("drm/ssd130x:
> Replace simple display helpers with the atomic helpers") that did this
> change for the drivers/gpu/drm/solomon/ssd130x.c driver.
> 
> The driver is also for a monochrome panel controller and it does support
> SPI as transport, which means the controller is similar to yours in many
> aspects. You could use that driver code as a reference for your driver.

Thank you both very much!

--
Kind Regards
Mehdi Djait

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-03-20 18:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-18 19:18 drm/tiny: QUESTION: What to use instead of drm_simple_display_pipe ? Mehdi Djait
2024-03-19  8:35 ` Thomas Zimmermann
2024-03-19  8:52   ` Javier Martinez Canillas
2024-03-20 18:59     ` Mehdi Djait

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).