[Letux-kernel] JZ4730/Minibook framebuffer driver updates

H. Nikolaus Schaller hns at goldelico.com
Sat Sep 9 22:21:44 CEST 2017


Hi Paul,

> Am 09.09.2017 um 01:24 schrieb Paul Boddie <paul at boddie.org.uk>:
> 
> Hello,
> 
> I had a look at eliminating board/platform driver initialisation code for the 
> Minibook framebuffer and panel today. This led me through various places where 
> panels are defined, which include this intriguing file:
> 
> drivers/gpu/drm/panel/panel-simple.c
> 
> Here, there are a lot of panels predefined, and I was tempted to add the 
> Minibook panel alongside the other Chunghwa panels. After all, they even have 
> their own device tree bindings! But I was left wondering how to wire the panel 
> up via the DRM interfaces which are rather complicated.
> 
> And so, I took some clues from another place:
> 
> drivers/video/fbdev/omap2/omapfb/displays/panel-dpi.c

Yes, this is more or less a basic decision if we want to use drm or fbdev.

For OMAP we had to switch X11 to omapdrm because fbdev support by X11 became
flaky.

Anyways it is something that can certainly be converted later. It is even
possible to support both in the same kernel tree. Giving some code duplication.

OMAP still can support fbdev but is less tested.

> 
> In this driver, the APIs for extracting timing information are demonstrated, 
> and so it started to make more sense to emulate this in the JZ framebuffer 
> driver. As a result, I now have the following in the device tree:
> 
> panel: claa070vc01 {
>        compatible = "chunghwa,claa070vc01";
> 
>        width = <60>;
>        height = <45>;
>        bpp = <16>;
>        lcd-type = <0>; /* JZ_LCD_TYPE_GENERIC_16_BIT from jz4740_fb.h */
> 
>        panel-timing {
>                clock-frequency = <26400000>;
>                hactive = <800>;
>                vactive = <480>;
>                hfront-porch = <0>;
>                hback-porch = <0>;
>                hsync-len = <80>;
>                vfront-porch = <0>;
>                vback-porch = <0>;
>                vsync-len = <20>;
>                de-active = <1>;
>                pixelclk-active = <0>;
>        };
> };

Looks good.

> 
> And then, the panel is referenced by the framebuffer node. I think this makes 
> sense, but I haven't actually tested it yet.

Yes. Somehow the panel must be connected to the LCD driver (framebuffer).

> This should allow me to eliminate 
> the same details in the board/platform files, I think.

Yes.

> 
> I've attached my patches against the different branches:
> 
> 0001-Allow-JZ-framebuffer-panel-configuration-with-DT.patch applies to 
> work/pboddie/mips/jz4730 against changeset 
> ac98f2a05cead994cb4008a12cc5f046d4e7fef1
> 
> 0001-Configure-panel-via-DT-for-Minibook.patch applies to 
> work/hns/mipsbook400/dt against changeset 
> cae1880dfa30173c79e714d87aeb4558bec83975

Applied fine. I just had a minor issue with merging things together, but have solved as well.

Here:

http://git.goldelico.com/?p=gta04-kernel.git;a=heads

> 
> I hope these are steps in the right direction!

Testing will finally show but IMHO the direction is ok :)

BR and thanks!
Nikolaus



More information about the Letux-kernel mailing list