From patchwork Fri Dec 19 17:10:39 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 422952 X-Patchwork-Delegate: ijc@hellion.org.uk Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 35918140081 for ; Sat, 20 Dec 2014 04:12:58 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D7D6A4B67F; Fri, 19 Dec 2014 18:12:16 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nxj8TNVw535V; Fri, 19 Dec 2014 18:12:16 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4452F4B664; Fri, 19 Dec 2014 18:12:16 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9DB344B62B for ; Fri, 19 Dec 2014 18:11:04 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zojYlJxcU0Yp for ; Fri, 19 Dec 2014 18:11:04 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by theia.denx.de (Postfix) with ESMTPS id 2ED854B62A for ; Fri, 19 Dec 2014 18:11:01 +0100 (CET) Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sBJHAtbl004330 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 19 Dec 2014 12:10:55 -0500 Received: from shalem.localdomain.com (vpn1-5-140.ams2.redhat.com [10.36.5.140]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id sBJHAfqX022422; Fri, 19 Dec 2014 12:10:54 -0500 From: Hans de Goede To: Anatolij Gustschin , Ian Campbell Date: Fri, 19 Dec 2014 18:10:39 +0100 Message-Id: <1419009041-31057-10-git-send-email-hdegoede@redhat.com> In-Reply-To: <1419009041-31057-1-git-send-email-hdegoede@redhat.com> References: <1419009041-31057-1-git-send-email-hdegoede@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH v2 09/11] sunxi: video: Add support for video-mode environment variable X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.13 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de 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 Acked-by: Ian Campbell Acked-by: Anatolij Gustschin --- drivers/video/sunxi_display.c | 16 +++++++++++++--- include/configs/sunxi-common.h | 2 +- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/drivers/video/sunxi_display.c b/drivers/video/sunxi_display.c index cedb56e..cf81e45 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); diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h index 727f446..77965f7 100644 --- a/include/configs/sunxi-common.h +++ b/include/configs/sunxi-common.h @@ -202,7 +202,7 @@ * 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. */ -#define CONFIG_SUNXI_FB_SIZE (8 << 20) +#define CONFIG_SUNXI_FB_SIZE (9 << 20) /* Do we want to initialize a simple FB? */ #define CONFIG_VIDEO_DT_SIMPLEFB