svn commit: r298383 - head/sys/arm/broadcom/bcm2835
Oleksandr Tymoshenko
gonzo at FreeBSD.org
Wed Apr 20 22:38:02 UTC 2016
Author: gonzo
Date: Wed Apr 20 22:38:00 2016
New Revision: 298383
URL: https://svnweb.freebsd.org/changeset/base/298383
Log:
Force framebuffer virtual viewport to be the same as physical
VideoCore reports garbage in viewport geometry fields unless
viewport was set previously by earlier stage boot loader. So
when booting FreeBSD kernel directly from VideoCore's start.elf
framebuffer intialization fails due to invalid vxres, vyres
values. Make sure we request viewport to be equal to physical
resolution
Submitted by: Sylvain Garrigues <sylvain at sylvaingarrigues.com>
Modified:
head/sys/arm/broadcom/bcm2835/bcm2835_fb.c
head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c
head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c
head/sys/arm/broadcom/bcm2835/bcm2835_mbox_prop.h
Modified: head/sys/arm/broadcom/bcm2835/bcm2835_fb.c
==============================================================================
--- head/sys/arm/broadcom/bcm2835/bcm2835_fb.c Wed Apr 20 21:37:32 2016 (r298382)
+++ head/sys/arm/broadcom/bcm2835/bcm2835_fb.c Wed Apr 20 22:38:00 2016 (r298383)
@@ -149,6 +149,9 @@ bcm_fb_attach(device_t dev)
if (bcm2835_mbox_fb_get_w_h(&fb) != 0)
return (ENXIO);
fb.bpp = FB_DEPTH;
+ fb.vxres = fb.xres;
+ fb.vyres = fb.yres;
+ fb.xoffset = fb.yoffset = 0;
if (bcm2835_mbox_fb_init(&fb) != 0)
return (ENXIO);
Modified: head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c
==============================================================================
--- head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c Wed Apr 20 21:37:32 2016 (r298382)
+++ head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c Wed Apr 20 22:38:00 2016 (r298383)
@@ -80,6 +80,10 @@ bcm_fb_init(struct bcmsc_softc *sc, stru
return (ENXIO);
fb->bpp = FB_DEPTH;
+ fb->vxres = fb->xres;
+ fb->vyres = fb->yres;
+ fb->xoffset = fb->yoffset = 0;
+
if ((err = bcm2835_mbox_fb_init(fb)) != 0) {
device_printf(sc->dev, "bcm2835_mbox_fb_init failed, err=%d\n", err);
return (ENXIO);
Modified: head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c
==============================================================================
--- head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c Wed Apr 20 21:37:32 2016 (r298382)
+++ head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c Wed Apr 20 22:38:00 2016 (r298383)
@@ -475,20 +475,12 @@ bcm2835_mbox_fb_get_w_h(struct bcm2835_f
msg.hdr.code = BCM2835_MBOX_CODE_REQ;
BCM2835_MBOX_INIT_TAG(&msg.physical_w_h, GET_PHYSICAL_W_H);
msg.physical_w_h.tag_hdr.val_len = 0;
- BCM2835_MBOX_INIT_TAG(&msg.virtual_w_h, GET_VIRTUAL_W_H);
- msg.virtual_w_h.tag_hdr.val_len = 0;
- BCM2835_MBOX_INIT_TAG(&msg.offset, GET_VIRTUAL_OFFSET);
- msg.offset.tag_hdr.val_len = 0;
msg.end_tag = 0;
err = bcm2835_mbox_property(&msg, sizeof(msg));
if (err == 0) {
fb->xres = msg.physical_w_h.body.resp.width;
fb->yres = msg.physical_w_h.body.resp.height;
- fb->vxres = msg.virtual_w_h.body.resp.width;
- fb->vyres = msg.virtual_w_h.body.resp.height;
- fb->xoffset = msg.offset.body.resp.x;
- fb->yoffset = msg.offset.body.resp.y;
}
return (err);
Modified: head/sys/arm/broadcom/bcm2835/bcm2835_mbox_prop.h
==============================================================================
--- head/sys/arm/broadcom/bcm2835/bcm2835_mbox_prop.h Wed Apr 20 21:37:32 2016 (r298382)
+++ head/sys/arm/broadcom/bcm2835/bcm2835_mbox_prop.h Wed Apr 20 22:38:00 2016 (r298383)
@@ -469,8 +469,6 @@ struct bcm2835_fb_config {
struct msg_fb_get_w_h {
struct bcm2835_mbox_hdr hdr;
struct bcm2835_mbox_tag_fb_w_h physical_w_h;
- struct bcm2835_mbox_tag_fb_w_h virtual_w_h;
- struct bcm2835_mbox_tag_virtual_offset offset;
uint32_t end_tag;
};
More information about the svn-src-head
mailing list