video: tegra: Update line length to match resolution
Subsystems (2)
PATCH 1/3 video: tegra: Update line length to match resolution
Instead of storing the computed line length in a local variable, store it in the global lcd_line_length variable to make sure the LCD subsystem can properly draw content for the display resolution.
This probably wasn't noticed yet because the only board where LCD support is currently enabled is Seaboard, which runs at a 1366x768 resolution. As it happens this is the maximum resolution supported and also the default that is used to initialize the framebuffer before the configuration from DT is available.
--- drivers/video/tegra.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/video/tegra.c +2 -2
@@ -145,8 +145,8 @@ static void update_panel_size(struct fdt_disp_config *config)void lcd_ctrl_init (void *lcdbase) { -int line_length, size;int type =DCACHE_OFF ; +int size;assert (disp_config);
@@ -160,7 +160,7 @@ void lcd_ctrl_init(void *lcdbase) && disp_config->height <= LCD_MAX_HEIGHT && disp_config->log2_bpp <= LCD_MAX_LOG2_BPP)update_panel_size (disp_config); - size =lcd_get_size (&line_length); + size =lcd_get_size (&lcd_line_length);/* Set up the LCD caching as requested */ if (config.cache_type &FDT_LCD_CACHE_WRITE_THROUGH )
Signature · 1 line
1.8.0
PATCH 2/3 tegra: Enable LCD on Medcom-Wide
The Medcom-Wide has a 15" LCD panel with a resolution of 1366x768 pixels. Add a corresponding panel description to the device tree and enable LCD support in the configuration.
--- board/avionic-design/dts/tegra20-medcom-wide.dts | 32 ++++++++++++++++++++++++ include/configs/medcom-wide.h | 14 +++++++++++ 2 files changed, 46 insertions(+)
board/avionic-design/dts/tegra20-medcom-wide.dts +32 -0
@@ -24,6 +24,19 @@ }; }; + host1x { + status = "okay"; + + dc at 54200000 { + status = "okay"; + + rgb { + nvidia,panel = <&lcd_panel>; + status = "okay"; + }; + }; + }; + clock at 60006000 { clocks = <&clk_32k &osc>; };
@@ -55,4 +68,23 @@ usb at c5004000 { status = "disabled"; }; + + lcd_panel: panel { + clock = <61715000>; + xres = <1366>; + yres = <768>; + left-margin = <2>; + right-margin = <47>; + hsync-len = <136>; + lower-margin = <21>; + upper-margin = <11>; + vsync-len = <4>; + + nvidia,bits-per-pixel = <16>; + nvidia,pwm = <&pwm 0 500000>; + nvidia,backlight-enable-gpios = <&gpio 13 0>; /* PB5 */ + nvidia,backlight-vdd-gpios = <&gpio 176 0>; /* PW0 */ + nvidia,lvds-shutdown-gpios = <&gpio 10 0>; /* PB2 */ + nvidia,panel-timings = <0 0 0 0>; + }; };
include/configs/medcom-wide.h +14 -0
@@ -42,6 +42,7 @@#define CONFIG_SYS_NS16550_COM1 NV_PA_APB_UARTD_BASE#define CONFIG_BOARD_EARLY_INIT_F +#define CONFIG_BOARD_LATE_INIT #define CONFIG_ENV_IS_NOWHERE
@@ -77,6 +78,19 @@"ext2load mmc 0 0x17000000 /boot/uImage;" \ "bootm" +#undef TEGRA_DEVICE_SETTINGS +#define TEGRA_DEVICE_SETTINGS \ + "stdin=serial\0" \ + "stdout=serial,lcd\0" \ + "stderr=serial,lcd\0" + +/* LCD support */ +#define CONFIG_LCD +#define CONFIG_PWM_TEGRA +#define CONFIG_VIDEO_TEGRA +#define LCD_BPP LCD_COLOR16 +#define CONFIG_SYS_WHITE_ON_BLACK +#include "tegra-common-post.h" #endif /* __CONFIG_H */
Signature · 1 line
1.8.0
PATCH 2/3 tegra: Enable LCD on Medcom-Wide
Quoted 5 lines · Thierry Reding
The Medcom-Wide has a 15" LCD panel with a resolution of 1366x768 pixels. Add a corresponding panel description to the device tree and enable LCD support in the configuration.
Signed-off-by Thierry Reding <[email protected]>
PATCH 3/3 tegra: Enable LCD on TEC
In reply to Thierry RedingThe TEC ships with a 7" LCD panel that provides a resolution of 800x480 pixels. Add a corresponding panel description to the device tree and enable LCD support in the configuration.
--- board/avionic-design/dts/tegra20-tec.dts | 32 ++++++++++++++++++++++++++++++++ include/configs/tec.h | 15 ++++++++++++++- 2 files changed, 46 insertions(+), 1 deletion(-)
board/avionic-design/dts/tegra20-tec.dts +32 -0
@@ -24,6 +24,19 @@ }; }; + host1x { + status = "okay"; + + dc at 54200000 { + status = "okay"; + + rgb { + nvidia,panel = <&lcd_panel>; + status = "okay"; + }; + }; + }; + clock at 60006000 { clocks = <&clk_32k &osc>; };
@@ -66,4 +79,23 @@ compatible = "hynix,hy27uf4g2b", "nand-flash"; }; }; + + lcd_panel: panel { + clock = <33260000>; + xres = <800>; + yres = <480>; + left-margin = <120>; + right-margin = <120>; + hsync-len = <16>; + lower-margin = <15>; + upper-margin = <15>; + vsync-len = <15>; + + nvidia,bits-per-pixel = <16>; + nvidia,pwm = <&pwm 0 500000>; + nvidia,backlight-enable-gpios = <&gpio 13 0>; /* PB5 */ + nvidia,backlight-vdd-gpios = <&gpio 176 0>; /* PW0 */ + nvidia,lvds-shutdown-gpios = <&gpio 10 0>; /* PB2 */ + nvidia,panel-timings = <0 0 0 0>; + }; };
include/configs/tec.h +14 -1
@@ -36,13 +36,13 @@/* High-level configuration options */ #define V_PROMPT "Tegra20 (TEC) # "#define CONFIG_TEGRA_BOARD_STRING "Avionic Design Tamonten Evaluation Carrier" -#define CONFIG_SYS_BOARD_ODMDATA 0x2b0d8011/* Board-specific serial config */ #define CONFIG_TEGRA_ENABLE_UARTD /* UARTD: debug UART */ #define CONFIG_SYS_NS16550_COM1 NV_PA_APB_UARTD_BASE#define CONFIG_BOARD_EARLY_INIT_F +#define CONFIG_BOARD_LATE_INIT /* SD/MMC */ #define CONFIG_MMC
@@ -85,6 +85,19 @@"ext2load mmc 0 0x17000000 /boot/uImage;" \ "bootm" +#undef TEGRA_DEVICE_SETTINGS +#define TEGRA_DEVICE_SETTINGS \ + "stdin=serial\0" \ + "stdout=serial,lcd\0" \ + "stderr=serial,lcd\0" + +/* LCD support */ +#define CONFIG_LCD +#define CONFIG_PWM_TEGRA +#define CONFIG_VIDEO_TEGRA +#define LCD_BPP LCD_COLOR16 +#define CONFIG_SYS_WHITE_ON_BLACK +#include "tegra-common-post.h" #endif /* __CONFIG_H */
Signature · 1 line
1.8.0
PATCH 3/3 tegra: Enable LCD on TEC
Hi Thierry,
Quoted 63 lines · Thierry Reding
The TEC ships with a 7" LCD panel that provides a resolution of 800x480 pixels. Add a corresponding panel description to the device tree and enable LCD support in the configuration.
Signed-off-by Thierry Reding <[email protected]>--- board/avionic-design/dts/tegra20-tec.dts | 32 ++++++++++++++++++++++++++++++++ include/configs/tec.h | 15 ++++++++++++++- 2 files changed, 46 insertions(+), 1 deletion(-)board/avionic-design/dts/tegra20-tec.dts +32
-0@@ -24,6 +24,19 @@ }; }; + host1x { + status = "okay"; + + dc at 54200000 { + status = "okay"; + + rgb { + nvidia,panel = <&lcd_panel>; + status = "okay"; + }; + }; + }; + clock at 60006000 { clocks = <&clk_32k &osc>; };@@ -66,4 +79,23 @@ compatible = "hynix,hy27uf4g2b", "nand-flash"; }; }; + + lcd_panel: panel { + clock = <33260000>; + xres = <800>; + yres = <480>; + left-margin = <120>; + right-margin = <120>; + hsync-len = <16>; + lower-margin = <15>; + upper-margin = <15>; + vsync-len = <15>; + + nvidia,bits-per-pixel = <16>; + nvidia,pwm = <&pwm 0 500000>; + nvidia,backlight-enable-gpios = <&gpio 13 0>; /* PB5 */ + nvidia,backlight-vdd-gpios = <&gpio 176 0>; /* PW0 */ + nvidia,lvds-shutdown-gpios = <&gpio 10 0>; /* PB2 */ + nvidia,panel-timings = <0 0 0 0>; + }; };include/configs/tec.h +0
-0
include/configs/tec.h line 39
Quoted 4 lines
include/configs/tec.h +0
-1@@ -36,13 +36,13 @@/* High-level configuration options */ #define V_PROMPT "Tegra20 (TEC) # "#define CONFIG_TEGRA_BOARD_STRING "Avionic Design Tamonten Evaluation Carrier" -#define CONFIG_SYS_BOARD_ODMDATA 0x2b0d8011
This has an unrelated patch, but I guess that doesn't matter.
Quoted 31 lines
include/configs/tec.h +14
-1/* Board-specific serial config */ #define CONFIG_TEGRA_ENABLE_UARTD /* UARTD: debug UART */ #define CONFIG_SYS_NS16550_COM1 NV_PA_APB_UARTD_BASE#define CONFIG_BOARD_EARLY_INIT_F +#define CONFIG_BOARD_LATE_INIT /* SD/MMC */ #define CONFIG_MMC @@ -85,6 +85,19 @@"ext2load mmc 0 0x17000000 /boot/uImage;" \ "bootm" +#undef TEGRA_DEVICE_SETTINGS +#define TEGRA_DEVICE_SETTINGS \ + "stdin=serial\0" \ + "stdout=serial,lcd\0" \ + "stderr=serial,lcd\0" + +/* LCD support */ +#define CONFIG_LCD +#define CONFIG_PWM_TEGRA +#define CONFIG_VIDEO_TEGRA +#define LCD_BPP LCD_COLOR16 +#define CONFIG_SYS_WHITE_ON_BLACK +#include "tegra-common-post.h" #endif /* __CONFIG_H */ --
Quoted 2 lines
1.8.0
Regards,
Simon
PATCH 1/3 video: tegra: Update line length to match resolution
In reply to Thierry RedingQuoted 11 lines · Thierry Reding
Instead of storing the computed line length in a local variable, store it in the global
lcd_line_lengthvariable to make sure the LCD subsystem can properly draw content for the display resolution.This probably wasn't noticed yet because the only board where LCD support is currently enabled is Seaboard, which runs at a 1366x768 resolution. As it happens this is the maximum resolution supported and also the default that is used to initialize the framebuffer before the configuration from DT is available.
Signed-off-by Thierry Reding <[email protected]>
Thanks!