diff options
author | Simon Glass <sjg@chromium.org> | 2017-04-05 16:23:40 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2017-05-09 20:20:39 -0400 |
commit | 2e4170b63bf05afe55a706dfc14c50ff1c6aa305 (patch) | |
tree | 6346d107a18f3836807031cc36c57c80646924c7 /drivers/video/bcm2835.c | |
parent | 25877d4e4c45451c5398aec3de50e0d5befe0e9f (diff) | |
download | u-boot-2e4170b63bf05afe55a706dfc14c50ff1c6aa305.tar.gz u-boot-2e4170b63bf05afe55a706dfc14c50ff1c6aa305.tar.xz u-boot-2e4170b63bf05afe55a706dfc14c50ff1c6aa305.zip |
video: arm: rpi: Move the video query out of the driver
Add a function to get the video size to the msg handler and remove it from
the video driver.
Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Anatolij Gustschin <agust@denx.de>
Diffstat (limited to 'drivers/video/bcm2835.c')
-rw-r--r-- | drivers/video/bcm2835.c | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/drivers/video/bcm2835.c b/drivers/video/bcm2835.c index cc6454f10d..eb137be11c 100644 --- a/drivers/video/bcm2835.c +++ b/drivers/video/bcm2835.c @@ -9,6 +9,7 @@ #include <memalign.h> #include <phys2bus.h> #include <asm/arch/mbox.h> +#include <asm/arch/msg.h> #include <asm/global_data.h> DECLARE_GLOBAL_DATA_PTR; @@ -18,12 +19,6 @@ vidinfo_t panel_info; static u32 bcm2835_pitch; -struct msg_query { - struct bcm2835_mbox_hdr hdr; - struct bcm2835_mbox_tag_physical_w_h physical_w_h; - u32 end_tag; -}; - struct msg_setup { struct bcm2835_mbox_hdr hdr; struct bcm2835_mbox_tag_physical_w_h physical_w_h; @@ -40,27 +35,18 @@ struct msg_setup { void lcd_ctrl_init(void *lcdbase) { - ALLOC_CACHE_ALIGN_BUFFER(struct msg_query, msg_query, 1); ALLOC_CACHE_ALIGN_BUFFER(struct msg_setup, msg_setup, 1); int ret; - u32 w, h; + int w, h; u32 fb_start, fb_end; debug("bcm2835: Query resolution...\n"); - - BCM2835_MBOX_INIT_HDR(msg_query); - BCM2835_MBOX_INIT_TAG_NO_REQ(&msg_query->physical_w_h, - GET_PHYSICAL_W_H); - ret = bcm2835_mbox_call_prop(BCM2835_MBOX_PROP_CHAN, &msg_query->hdr); + ret = bcm2835_get_video_size(&w, &h); if (ret) { - printf("bcm2835: Could not query display resolution\n"); /* FIXME: How to disable the LCD to prevent errors? hang()? */ return; } - w = msg_query->physical_w_h.body.resp.width; - h = msg_query->physical_w_h.body.resp.height; - debug("bcm2835: Setting up display for %d x %d\n", w, h); BCM2835_MBOX_INIT_HDR(msg_setup); |