Re: [PATCH 1/3] drm/simpledrm: Bind to OF framebuffers in /chosen

From: Javier Martinez Canillas
Date: Tue Nov 30 2021 - 04:32:06 EST


Hello Thomas,

On Tue, Nov 30, 2021 at 9:31 AM Thomas Zimmermann <tzimmermann@xxxxxxx> wrote:
> Am 30.11.21 um 07:44 schrieb Javier Martinez Canillas:

[snip]

> >
> > I think that instead it could be done in the sysfb_create_simplefb()
> > function [0], which already creates the "simple-framebuffer" device
> > for x86 legacy BIOS and x86/arm64/riscv EFI so it makes sense to do
> > the same for OF. That way the simplefb platform device registration
> > code could also be dropped from the driver and users would just need
> > to enable CONFIG_SYSFB and CONFIG_SYSFB_SIMPLEFB to have the same.
> >
> > I have a couple of boards with a bootloader that populates a
> > "simple-framebuffer" in the /chosen node so I could attempt to write
> > the patches. But probably won't happen until next week.
>
> IMHO it's better to keep the OF-related setup in the OF code. The sysfb
> code is for screen_info. We can try to find common code for OF and sysfb
> that then lives in a shared location.
>

Ok. As long as we don't end with code duplication then that works for me too.

> Using a single global screen_info variable is somewhat awkward these
> days. In the long term, I can think of pushing sysfb code into
> architectures. Each architecture would then setup the platform devices
> that it supports. But that's not really important right now.
>

That makes sense. And provide a set of helpers as you mentioned that could
be shared across the different architectures and firmware interfaces.

Best regards,
Javier