Jump to content

A way to get a 16 bit framebuffer - RGB565


alexfreed58

Recommended Posts

Hi,

I realize that V3s is not H2 or H3, but I hope the question is generic.  Is it possible to make the FB 16 bit? In mainline Linux? I'm working with a Lichee Pi board. The depth is 18 bits but the fb in Linux is 32 bit. I'd love to get it down to 16 bits to save 1/2 of the video memory and just 2 color bits are a small price to pay. I understand that Linux inherits the FB from u-boot.

Edited by alexfreed58
Link to comment
Share on other sites

7 hours ago, alexfreed58 said:

I understand that Linux inherits the FB from u-boot.

That may or may not be true. Linux has proper V3s display driver for a long time. However, U-Boot may still hand over its FB to Linux. In that case U-Boot FB is used for a very short time and it's replaced with Linux FB during boot. Now, I'm not sure if U-Boot FB memory is actually released or just stays reserved. Best way to check would be to disable display driver in U-Boot (via U-Boot config and rebuild) and compare free memory.

 

I don't know how to force 16-bit buffer. There is probably some kind of kernel parameter for that.

Link to comment
Share on other sites

I have built u-boot with different parameters in the .config file for several LCD panels: 800x480 and 800x600. That becomes the size of the reported uboot screen  and also the Linux kernel inherits the same size. But always 32 bit, even if I put the depth=16 rather than the standard depth=18 into the configuration.

My problem is not with the memory allocated internally for the FB: it's the application in the user space that needs many off the screen windows (pixel buffers, really) that have to match the ARGB FB format. 

 

Anybody?

 

Link to comment
Share on other sites

Ah, you didn't add panel description to DT for Linux. So yes, Linux uses U-Boot FB. 32-bit colours are hardcoded in U-Boot here: https://source.denx.de/u-boot/u-boot/-/blob/master/drivers/video/sunxi/sunxi_de2.c#L255 Fortunately for you, I added handling 16-bit colours (if you change constant), but I can't guarantee it will work. I only tested it in U-Boot for H3 and not in Linux.

 

EDIT: Apparently you have to change also this line: https://source.denx.de/u-boot/u-boot/-/blob/master/drivers/video/sunxi/sunxi_de2.c#L405

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines