Skip to content
Snippets Groups Projects
Commit 5f33993b authored by Hans de Goede's avatar Hans de Goede
Browse files

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: default avatarHans de Goede <hdegoede@redhat.com>
Acked-by: default avatarIan Campbell <ijc@hellion.org.uk>
Acked-by: default avatarAnatolij Gustschin <agust@denx.de>
parent be8ec633
No related branches found
No related tags found
No related merge requests found
...@@ -358,7 +358,9 @@ retry: ...@@ -358,7 +358,9 @@ retry:
void *video_hw_init(void) void *video_hw_init(void)
{ {
static GraphicDevice *graphic_device = &sunxi_display.graphic_device; 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; int ret;
memset(&sunxi_display, 0, sizeof(struct sunxi_display)); memset(&sunxi_display, 0, sizeof(struct sunxi_display));
...@@ -367,14 +369,22 @@ void *video_hw_init(void) ...@@ -367,14 +369,22 @@ void *video_hw_init(void)
CONFIG_SUNXI_FB_SIZE >> 10); CONFIG_SUNXI_FB_SIZE >> 10);
gd->fb_base = gd->ram_top; gd->fb_base = gd->ram_top;
video_get_ctfb_res_modes(RES_MODE_1024x768, 24, &mode, &depth, &options);
ret = sunxi_hdmi_hpd_detect(); ret = sunxi_hdmi_hpd_detect();
if (!ret) if (!ret)
return NULL; return NULL;
printf("HDMI connected.\n"); 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_engines_init();
sunxi_mode_set(mode, gd->fb_base - CONFIG_SYS_SDRAM_BASE); sunxi_mode_set(mode, gd->fb_base - CONFIG_SYS_SDRAM_BASE);
......
...@@ -205,7 +205,7 @@ ...@@ -205,7 +205,7 @@
* The amount of RAM that is reserved for the FB. This will not show up as * The amount of RAM that is reserved for the FB. This will not show up as
* RAM to the kernel, but will be reclaimed by a KMS driver in future. * RAM to the kernel, but will be reclaimed by a KMS driver in future.
*/ */
#define CONFIG_SUNXI_FB_SIZE (8 << 20) #define CONFIG_SUNXI_FB_SIZE (9 << 20)
/* Do we want to initialize a simple FB? */ /* Do we want to initialize a simple FB? */
#define CONFIG_VIDEO_DT_SIMPLEFB #define CONFIG_VIDEO_DT_SIMPLEFB
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment