[rpi] Inherit framebuffer BPP value from the VideoCore firmware
Instead of using hardcoded bpp of 24, obtain current/configured value from VideoCore. This solves certain problems with Xorg/Qt apps that require bpp of 32 to work properly. The mode can be forced by setting framebuffer_depth value in config.txt PR: 235363 Submitted by: Steve Peurifoy <ssw01@mathistry.net>
This commit is contained in:
parent
8c50ee012f
commit
c344416ecd
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=352028
@ -85,7 +85,13 @@ bcm_fb_init(struct bcmsc_softc *sc, struct bcm2835_fb_config *fb)
|
||||
memset(fb, 0, sizeof(*fb));
|
||||
if (bcm2835_mbox_fb_get_w_h(fb) != 0)
|
||||
return (ENXIO);
|
||||
fb->bpp = FB_DEPTH;
|
||||
if (bcm2835_mbox_fb_get_bpp(fb) != 0)
|
||||
return (ENXIO);
|
||||
if (fb->bpp < FB_DEPTH) {
|
||||
device_printf(sc->dev, "changing fb bpp from %d to %d\n", fb->bpp, FB_DEPTH);
|
||||
fb->bpp = FB_DEPTH;
|
||||
} else
|
||||
device_printf(sc->dev, "keeping existing fb bpp of %d\n", fb->bpp);
|
||||
|
||||
fb->vxres = fb->xres;
|
||||
fb->vyres = fb->yres;
|
||||
|
@ -498,6 +498,26 @@ bcm2835_mbox_fb_get_w_h(struct bcm2835_fb_config *fb)
|
||||
return (err);
|
||||
}
|
||||
|
||||
int
|
||||
bcm2835_mbox_fb_get_bpp(struct bcm2835_fb_config *fb)
|
||||
{
|
||||
int err;
|
||||
struct msg_fb_get_bpp msg;
|
||||
|
||||
memset(&msg, 0, sizeof(msg));
|
||||
msg.hdr.buf_size = sizeof(msg);
|
||||
msg.hdr.code = BCM2835_MBOX_CODE_REQ;
|
||||
BCM2835_MBOX_INIT_TAG(&msg.bpp, GET_DEPTH);
|
||||
msg.bpp.tag_hdr.val_len = 0;
|
||||
msg.end_tag = 0;
|
||||
|
||||
err = bcm2835_mbox_property(&msg, sizeof(msg));
|
||||
if (err == 0)
|
||||
fb->bpp = msg.bpp.body.resp.bpp;
|
||||
|
||||
return (err);
|
||||
}
|
||||
|
||||
int
|
||||
bcm2835_mbox_fb_init(struct bcm2835_fb_config *fb)
|
||||
{
|
||||
|
@ -474,6 +474,14 @@ struct msg_fb_get_w_h {
|
||||
|
||||
int bcm2835_mbox_fb_get_w_h(struct bcm2835_fb_config *);
|
||||
|
||||
struct msg_fb_get_bpp {
|
||||
struct bcm2835_mbox_hdr hdr;
|
||||
struct bcm2835_mbox_tag_depth bpp;
|
||||
uint32_t end_tag;
|
||||
};
|
||||
|
||||
int bcm2835_mbox_fb_get_bpp(struct bcm2835_fb_config *);
|
||||
|
||||
struct msg_fb_setup {
|
||||
struct bcm2835_mbox_hdr hdr;
|
||||
struct bcm2835_mbox_tag_fb_w_h physical_w_h;
|
||||
|
Loading…
Reference in New Issue
Block a user