aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorHans de Goede2014-12-19 14:03:40 +0100
committerHans de Goede2015-01-14 14:56:38 +0100
commit5f33993b7e9a3a3bfc6887780d4101e684b11359 (patch)
treec5653bf631e77aad1b04d9f4f51a8c6215e4a48b /drivers
parentbe8ec6330627c8413e5bd15ccf6c32a98677e704 (diff)
sunxi: video: Add support for video-mode environment variable
Add support for the standard video-mode environment variable using the videomodes.c video_get_ctfb_res_modes() helper function. This will allow users to specify the resolution e.g. : setenv video-mode sunxi:video-mode=1280x1024-24@60 saveenv Also make the reserved fb mem slightly larger to allow 1920x1200 to work. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Ian Campbell <ijc@hellion.org.uk> Acked-by: Anatolij Gustschin <agust@denx.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/sunxi_display.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/video/sunxi_display.c b/drivers/video/sunxi_display.c
index cedb56ecb99..cf81e452c7a 100644
--- a/drivers/video/sunxi_display.c
+++ b/drivers/video/sunxi_display.c
@@ -358,7 +358,9 @@ retry:
void *video_hw_init(void)
{
static GraphicDevice *graphic_device = &sunxi_display.graphic_device;
- const struct ctfb_res_modes *mode = &res_mode_init[RES_MODE_1024x768];
+ const struct ctfb_res_modes *mode;
+ const char *options;
+ unsigned int depth;
int ret;
memset(&sunxi_display, 0, sizeof(struct sunxi_display));
@@ -367,14 +369,22 @@ void *video_hw_init(void)
CONFIG_SUNXI_FB_SIZE >> 10);
gd->fb_base = gd->ram_top;
+ video_get_ctfb_res_modes(RES_MODE_1024x768, 24, &mode, &depth, &options);
+
ret = sunxi_hdmi_hpd_detect();
if (!ret)
return NULL;
printf("HDMI connected.\n");
- sunxi_display.enabled = true;
- printf("Setting up a %dx%d console.\n", mode->xres, mode->yres);
+ if (mode->vmode != FB_VMODE_NONINTERLACED) {
+ printf("Only non-interlaced modes supported, falling back to 1024x768\n");
+ mode = &res_mode_init[RES_MODE_1024x768];
+ } else {
+ printf("Setting up a %dx%d console\n", mode->xres, mode->yres);
+ }
+
+ sunxi_display.enabled = true;
sunxi_engines_init();
sunxi_mode_set(mode, gd->fb_base - CONFIG_SYS_SDRAM_BASE);