Re: [U-Boot] [PATCH 32/32] sandbox: Add LCD driver

2013-12-19 Thread Simon Glass
Hi Masahiro,

On 28 November 2013 17:37, Masahiro Yamada  wrote:
> Hello Simon.
>
>
>> Add a simple LCD driver which uses SDL to display the image. We update the
>> image regularly, while still providing for reasonable performance.
>>
>> Adjust the common lcd code to support sandbox.
>>
>> For command-line runs we do not want the LCD to be displayed, so add a
>> --hide_lcd option to disable it.
>>
>> Signed-off-by: Simon Glass 
>> Signed-off-by: Simon Glass 
>
>
> Please be careful to not double Signed-off-by.
>
> I think you used patman to post this series.
> This is a problem of patman.
>
> Patman always adds Signed-off-by
> even when it had been already added to log by hand.

Yes. Commit c737914 went part of the way to this, but it needs an
adjustment. I think I will remove duplicate sign-offs by default.

Regards,
Simon
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 32/32] sandbox: Add LCD driver

2013-11-28 Thread Masahiro Yamada
Hello Simon.


> Add a simple LCD driver which uses SDL to display the image. We update the
> image regularly, while still providing for reasonable performance.
> 
> Adjust the common lcd code to support sandbox.
> 
> For command-line runs we do not want the LCD to be displayed, so add a
> --hide_lcd option to disable it.
> 
> Signed-off-by: Simon Glass 
> Signed-off-by: Simon Glass 


Please be careful to not double Signed-off-by.

I think you used patman to post this series.
This is a problem of patman.

Patman always adds Signed-off-by
even when it had been already added to log by hand.

Best Regards
Masahiro Yamada

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 32/32] sandbox: Add LCD driver

2013-11-10 Thread Simon Glass
Add a simple LCD driver which uses SDL to display the image. We update the
image regularly, while still providing for reasonable performance.

Adjust the common lcd code to support sandbox.

For command-line runs we do not want the LCD to be displayed, so add a
--hide_lcd option to disable it.

Signed-off-by: Simon Glass 
Signed-off-by: Simon Glass 
Tested-by: Che-Liang Chiou 
---
 arch/sandbox/cpu/sdl.c|  4 +-
 arch/sandbox/cpu/start.c  |  9 
 arch/sandbox/include/asm/state.h  |  1 +
 arch/sandbox/include/asm/u-boot-sandbox.h |  3 ++
 board/sandbox/sandbox/sandbox.c   | 19 +++-
 common/lcd.c  | 21 ++--
 doc/device-tree-bindings/video/sandbox-fb.txt | 13 +
 drivers/serial/sandbox.c  |  4 ++
 drivers/video/Makefile|  1 +
 drivers/video/sandbox_sdl.c   | 70 +++
 include/fdtdec.h  |  1 +
 include/lcd.h |  3 ++
 lib/fdtdec.c  |  1 +
 13 files changed, 144 insertions(+), 6 deletions(-)
 create mode 100644 doc/device-tree-bindings/video/sandbox-fb.txt
 create mode 100644 drivers/video/sandbox_sdl.c

diff --git a/arch/sandbox/cpu/sdl.c b/arch/sandbox/cpu/sdl.c
index 909e835..917936f 100644
--- a/arch/sandbox/cpu/sdl.c
+++ b/arch/sandbox/cpu/sdl.c
@@ -55,7 +55,9 @@ static int sandbox_sdl_ensure_init(void)
 
 int sandbox_sdl_init_display(int width, int height, int log2_bpp)
 {
-   if (!width)
+   struct sandbox_state *state = state_get_current();
+
+   if (!width || state->hide_lcd)
return 0;
if (sandbox_sdl_ensure_init())
return -1;
diff --git a/arch/sandbox/cpu/start.c b/arch/sandbox/cpu/start.c
index 2d19fe7..6189ded 100644
--- a/arch/sandbox/cpu/start.c
+++ b/arch/sandbox/cpu/start.c
@@ -175,6 +175,15 @@ static int sandbox_cmdline_cb_ignore_missing(struct 
sandbox_state *state,
 SANDBOX_CMDLINE_OPT_SHORT(ignore_missing, 'n', 0,
  "Ignore missing state on read");
 
+static int sandbox_cmdline_cb_hide_lcd(struct sandbox_state *state,
+  const char *arg)
+{
+   state->hide_lcd = true;
+   return 0;
+}
+SANDBOX_CMDLINE_OPT_SHORT(hide_lcd, 'l', 0,
+ "Don't show the sandbox LCD display");
+
 int main(int argc, char *argv[])
 {
struct sandbox_state *state;
diff --git a/arch/sandbox/include/asm/state.h b/arch/sandbox/include/asm/state.h
index 304104e..9263aca 100644
--- a/arch/sandbox/include/asm/state.h
+++ b/arch/sandbox/include/asm/state.h
@@ -41,6 +41,7 @@ struct sandbox_state {
bool read_state;/* Read sandbox state on startup */
bool write_state;   /* Write sandbox state on exit */
bool ignore_missing_state_on_read;  /* No error if state missing */
+   bool hide_lcd;  /* Hide LCD on start-up */
 
/* Pointer to information for each SPI bus/cs */
struct sandbox_spi_info spi[CONFIG_SANDBOX_SPI_MAX_BUS]
diff --git a/arch/sandbox/include/asm/u-boot-sandbox.h 
b/arch/sandbox/include/asm/u-boot-sandbox.h
index 5707c27..d2f1b65 100644
--- a/arch/sandbox/include/asm/u-boot-sandbox.h
+++ b/arch/sandbox/include/asm/u-boot-sandbox.h
@@ -25,4 +25,7 @@ int sandbox_main_loop_init(void);
 
 int cleanup_before_linux(void);
 
+/* drivers/video/sandbox_sdl.c */
+int sandbox_lcd_sdl_early_init(void);
+
 #endif /* _U_BOOT_SANDBOX_H_ */
diff --git a/board/sandbox/sandbox/sandbox.c b/board/sandbox/sandbox/sandbox.c
index 65dcce8..f3ab575 100644
--- a/board/sandbox/sandbox/sandbox.c
+++ b/board/sandbox/sandbox/sandbox.c
@@ -4,8 +4,8 @@
  */
 
 #include 
-
 #include 
+#include 
 
 /*
  * Pointer to initial global data area
@@ -33,3 +33,20 @@ int dram_init(void)
gd->ram_size = CONFIG_SYS_SDRAM_SIZE;
return 0;
 }
+
+#ifdef CONFIG_BOARD_EARLY_INIT_F
+int board_early_init_f(void)
+{
+#ifdef CONFIG_VIDEO_SANDBOX_SDL
+   int ret;
+
+   ret = sandbox_lcd_sdl_early_init();
+   if (ret) {
+   puts("Could not init sandbox LCD emulation\n");
+   return ret;
+   }
+#endif
+
+   return 0;
+}
+#endif
diff --git a/common/lcd.c b/common/lcd.c
index 5dd7948..bbbede1 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -28,6 +28,8 @@
 #include 
 
 #include 
+#include 
+#include 
 
 #if defined(CONFIG_CPU_PXA25X) || defined(CONFIG_CPU_PXA27X) || \
defined(CONFIG_CPU_MONAHANS)
@@ -63,6 +65,10 @@
 # endif
 #endif
 
+#ifdef CONFIG_SANDBOX
+#include 
+#endif
+
 #ifndef CONFIG_LCD_ALIGNMENT
 #define CONFIG_LCD_ALIGNMENT PAGE_SIZE
 #endif
@@ -144,6 +150,13 @@ void lcd_sync(void)
if (lcd_flush_dcache)
flush_dcache_range((u32)lcd_base,
(u32)(lcd_base + lcd_get_size(&line_length)));
+#elif defined(CONFIG_SANDBOX) && defined(CON