[PATCH 0/5] video: Improve syncing performance with cyclic

Now that U-Boot has a background-processing feature, it is possible to reduce the amount of 'foreground' syncing of the display. At present this happens quite often.
Foreground syncing blocks all other processing, sometimes for 10ms or more. When pasting commands into U-Boot over the UART, this typically result in characters being dropped. For example, on rpi_4 it isn't possible to paste in more than 35 characters before things fail. This makes updating the environment or entering long commands very painful over the console, since text must be pasted in chunks, or the vidconsole device must be dropped from stdout.
This series introduces background syncing, enabled by default for boards which use video. The sync rates for foreground and background are configurable.
With this series it is possible to paste in any amount of text to the command line. Some sandbox-specific work-arounds can now be removed and sandbox video (./u-boot -Dl) is significantly more responsive.
This obviously increases code size, since it enables a subsystem not normally used by default. However it only applies to boards which have VIDEO enabled, which are presumably less worried about memory space since the video code is fairly large.
Also it is possible to disable CMD_CYCLIC and reduce the groth to:
aarch64: (for 1/1 boards) all +1081.0 rodata +65.0 text +1016.0 arm: (for 1/1 boards) all +945.0 rodata +65.0 text +880.0
Without that, the increase doubles.
It is of course possible to disable CYCLIC and still use VIDEO but this reverts to the current behaviour
Simon Glass (5): cyclic: Disable in SPL builds video: Move last_sync to private data video: Use cyclic to handle video sync sandbox: Increase cyclic CPU-time limit sandbox: Drop video-sync in serial driver
common/Kconfig | 1 + common/Makefile | 2 +- drivers/serial/sandbox.c | 2 -- drivers/video/Kconfig | 30 +++++++++++++++++++++ drivers/video/video-uclass.c | 52 +++++++++++++++++++++++++++++------- include/cyclic.h | 6 +++-- include/video.h | 2 ++ 7 files changed, 81 insertions(+), 14 deletions(-)

The cyclic subsystem is currently enabled in all build phases or none. So far it doesn't have any purpose within SPL builds, so adjust the rules to prevent it being built in that case.
Signed-off-by: Simon Glass sjg@chromium.org ---
common/Makefile | 2 +- include/cyclic.h | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/common/Makefile b/common/Makefile index 1495436d5d45..27443863bf9b 100644 --- a/common/Makefile +++ b/common/Makefile @@ -77,7 +77,7 @@ obj-$(CONFIG_CROS_EC) += cros_ec.o obj-y += dlmalloc.o obj-$(CONFIG_$(SPL_TPL_)SYS_MALLOC_F) += malloc_simple.o
-obj-$(CONFIG_CYCLIC) += cyclic.o +obj-$(CONFIG_$(SPL_TPL_)CYCLIC) += cyclic.o obj-$(CONFIG_$(SPL_TPL_)EVENT) += event.o
obj-$(CONFIG_$(SPL_TPL_)HASH) += hash.o diff --git a/include/cyclic.h b/include/cyclic.h index 44ad3cb6b803..d3b368dd90df 100644 --- a/include/cyclic.h +++ b/include/cyclic.h @@ -11,6 +11,7 @@ #ifndef __cyclic_h #define __cyclic_h
+#include <linux/kconfig.h> #include <linux/list.h> #include <asm/types.h>
@@ -44,7 +45,8 @@ struct cyclic_info { /** Function type for cyclic functions */ typedef void (*cyclic_func_t)(void *ctx);
-#if defined(CONFIG_CYCLIC) +#if CONFIG_IS_ENABLED(CYCLIC) + /** * cyclic_register - Register a new cyclic function * @@ -122,6 +124,6 @@ static inline int cyclic_unregister_all(void) { return 0; } -#endif +#endif /* CYCLIC */
#endif

On Sun, Nov 19, 2023 at 07:46:39AM -0700, Simon Glass wrote:
The cyclic subsystem is currently enabled in all build phases or none. So far it doesn't have any purpose within SPL builds, so adjust the rules to prevent it being built in that case.
Signed-off-by: Simon Glass sjg@chromium.org
common/Makefile | 2 +- include/cyclic.h | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/common/Makefile b/common/Makefile index 1495436d5d45..27443863bf9b 100644 --- a/common/Makefile +++ b/common/Makefile @@ -77,7 +77,7 @@ obj-$(CONFIG_CROS_EC) += cros_ec.o obj-y += dlmalloc.o obj-$(CONFIG_$(SPL_TPL_)SYS_MALLOC_F) += malloc_simple.o
-obj-$(CONFIG_CYCLIC) += cyclic.o +obj-$(CONFIG_$(SPL_TPL_)CYCLIC) += cyclic.o obj-$(CONFIG_$(SPL_TPL_)EVENT) += event.o
obj-$(CONFIG_$(SPL_TPL_)HASH) += hash.o
This is fine, but I suspect we're missing SPL_CYCLIC as a symbol and SPL_WDT should be select'ing that, same as "WDT".
diff --git a/include/cyclic.h b/include/cyclic.h index 44ad3cb6b803..d3b368dd90df 100644 --- a/include/cyclic.h +++ b/include/cyclic.h @@ -11,6 +11,7 @@ #ifndef __cyclic_h #define __cyclic_h
+#include <linux/kconfig.h> #include <linux/list.h> #include <asm/types.h>
Is this really needed? What's blowing up since we should have -include .../linux/kconfig.h cover this.

Hi Tom,
On Sun, 19 Nov 2023 at 08:59, Tom Rini trini@konsulko.com wrote:
On Sun, Nov 19, 2023 at 07:46:39AM -0700, Simon Glass wrote:
The cyclic subsystem is currently enabled in all build phases or none. So far it doesn't have any purpose within SPL builds, so adjust the rules to prevent it being built in that case.
Signed-off-by: Simon Glass sjg@chromium.org
common/Makefile | 2 +- include/cyclic.h | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/common/Makefile b/common/Makefile index 1495436d5d45..27443863bf9b 100644 --- a/common/Makefile +++ b/common/Makefile @@ -77,7 +77,7 @@ obj-$(CONFIG_CROS_EC) += cros_ec.o obj-y += dlmalloc.o obj-$(CONFIG_$(SPL_TPL_)SYS_MALLOC_F) += malloc_simple.o
-obj-$(CONFIG_CYCLIC) += cyclic.o +obj-$(CONFIG_$(SPL_TPL_)CYCLIC) += cyclic.o obj-$(CONFIG_$(SPL_TPL_)EVENT) += event.o
obj-$(CONFIG_$(SPL_TPL_)HASH) += hash.o
This is fine, but I suspect we're missing SPL_CYCLIC as a symbol and SPL_WDT should be select'ing that, same as "WDT".
Ooops I had assumed that it wasn't used in SPL but of course watchdog is completely migrated to it now...I will add a symbol.
BTW the watchdog Kconfig seems a little confusiing. There is only one board using WATCHDOG without WDT and only 3 using HW_WATCHDOG
Setfan, I wonder if some more clean-up could be done?
diff --git a/include/cyclic.h b/include/cyclic.h index 44ad3cb6b803..d3b368dd90df 100644 --- a/include/cyclic.h +++ b/include/cyclic.h @@ -11,6 +11,7 @@ #ifndef __cyclic_h #define __cyclic_h
+#include <linux/kconfig.h> #include <linux/list.h> #include <asm/types.h>
Is this really needed? What's blowing up since we should have -include .../linux/kconfig.h cover this.
It is the CONFIG_IS_ENABLED() when building. We have kconfig.h in a few other places (used by tools) too.
In file included from include/watchdog.h:13, from tools/../lib/sha1.c:25, from tools/generated/lib/sha1.c:1: include/cyclic.h:47:22: error: missing binary operator before token "(" 47 | #if CONFIG_IS_ENABLED(CYCLIC) | ^
Regards, Simon

On Sun, Nov 19, 2023 at 11:23:41AM -0700, Simon Glass wrote:
Hi Tom,
On Sun, 19 Nov 2023 at 08:59, Tom Rini trini@konsulko.com wrote:
On Sun, Nov 19, 2023 at 07:46:39AM -0700, Simon Glass wrote:
[snip]
diff --git a/include/cyclic.h b/include/cyclic.h index 44ad3cb6b803..d3b368dd90df 100644 --- a/include/cyclic.h +++ b/include/cyclic.h @@ -11,6 +11,7 @@ #ifndef __cyclic_h #define __cyclic_h
+#include <linux/kconfig.h> #include <linux/list.h> #include <asm/types.h>
Is this really needed? What's blowing up since we should have -include .../linux/kconfig.h cover this.
It is the CONFIG_IS_ENABLED() when building. We have kconfig.h in a few other places (used by tools) too.
In file included from include/watchdog.h:13, from tools/../lib/sha1.c:25, from tools/generated/lib/sha1.c:1: include/cyclic.h:47:22: error: missing binary operator before token "(" 47 | #if CONFIG_IS_ENABLED(CYCLIC) | ^
OK, for this we need to cleanup lib/sha*.c include directives. I'm tackling that now.

Hi Simon,
On 11/19/23 19:23, Simon Glass wrote:
Hi Tom,
On Sun, 19 Nov 2023 at 08:59, Tom Rini trini@konsulko.com wrote:
On Sun, Nov 19, 2023 at 07:46:39AM -0700, Simon Glass wrote:
The cyclic subsystem is currently enabled in all build phases or none. So far it doesn't have any purpose within SPL builds, so adjust the rules to prevent it being built in that case.
Signed-off-by: Simon Glass sjg@chromium.org
common/Makefile | 2 +- include/cyclic.h | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/common/Makefile b/common/Makefile index 1495436d5d45..27443863bf9b 100644 --- a/common/Makefile +++ b/common/Makefile @@ -77,7 +77,7 @@ obj-$(CONFIG_CROS_EC) += cros_ec.o obj-y += dlmalloc.o obj-$(CONFIG_$(SPL_TPL_)SYS_MALLOC_F) += malloc_simple.o
-obj-$(CONFIG_CYCLIC) += cyclic.o +obj-$(CONFIG_$(SPL_TPL_)CYCLIC) += cyclic.o obj-$(CONFIG_$(SPL_TPL_)EVENT) += event.o
obj-$(CONFIG_$(SPL_TPL_)HASH) += hash.o
This is fine, but I suspect we're missing SPL_CYCLIC as a symbol and SPL_WDT should be select'ing that, same as "WDT".
Ooops I had assumed that it wasn't used in SPL but of course watchdog is completely migrated to it now...I will add a symbol.
BTW the watchdog Kconfig seems a little confusiing. There is only one board using WATCHDOG without WDT and only 3 using HW_WATCHDOG
Setfan, I wonder if some more clean-up could be done?
I fully agree that the watchdog Kconfig options are confusing. Perhaps I can find some time in the Holidays to try to clean this up and finally get rid of this HW_WATCHDOG stuff completely.
Thanks, Stefan
diff --git a/include/cyclic.h b/include/cyclic.h index 44ad3cb6b803..d3b368dd90df 100644 --- a/include/cyclic.h +++ b/include/cyclic.h @@ -11,6 +11,7 @@ #ifndef __cyclic_h #define __cyclic_h
+#include <linux/kconfig.h> #include <linux/list.h> #include <asm/types.h>
Is this really needed? What's blowing up since we should have -include .../linux/kconfig.h cover this.
It is the CONFIG_IS_ENABLED() when building. We have kconfig.h in a few other places (used by tools) too.
In file included from include/watchdog.h:13, from tools/../lib/sha1.c:25, from tools/generated/lib/sha1.c:1: include/cyclic.h:47:22: error: missing binary operator before token "(" 47 | #if CONFIG_IS_ENABLED(CYCLIC) | ^
Regards, Simon
Viele Grüße, Stefan Roese

Rather than using a static variable, use the video device's private data to remember when the last video sync was completed. This allows each display to have its own sync and avoids using static data in SPL.
Signed-off-by: Simon Glass sjg@chromium.org ---
drivers/video/video-uclass.c | 10 +++------- include/video.h | 2 ++ 2 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c index f743ed74c818..600e12b802d1 100644 --- a/drivers/video/video-uclass.c +++ b/drivers/video/video-uclass.c @@ -354,6 +354,7 @@ void video_set_default_colors(struct udevice *dev, bool invert) /* Flush video activity to the caches */ int video_sync(struct udevice *vid, bool force) { + struct video_priv *priv = dev_get_uclass_priv(vid); struct video_ops *ops = video_get_ops(vid); int ret;
@@ -369,20 +370,15 @@ int video_sync(struct udevice *vid, bool force) * out whether it exists? For now, ARM is safe. */ #if defined(CONFIG_ARM) && !CONFIG_IS_ENABLED(SYS_DCACHE_OFF) - struct video_priv *priv = dev_get_uclass_priv(vid); - if (priv->flush_dcache) { flush_dcache_range((ulong)priv->fb, ALIGN((ulong)priv->fb + priv->fb_size, CONFIG_SYS_CACHELINE_SIZE)); } #elif defined(CONFIG_VIDEO_SANDBOX_SDL) - struct video_priv *priv = dev_get_uclass_priv(vid); - static ulong last_sync; - - if (force || get_timer(last_sync) > 100) { + if (force || get_timer(priv->last_sync) > 100) { sandbox_sdl_sync(priv->fb); - last_sync = get_timer(0); + priv->last_sync = get_timer(0); } #endif return 0; diff --git a/include/video.h b/include/video.h index 5048116a3d57..b9b8dc0f8f99 100644 --- a/include/video.h +++ b/include/video.h @@ -94,6 +94,7 @@ enum video_format { * the LCD is updated * @fg_col_idx: Foreground color code (bit 3 = bold, bit 0-2 = color) * @bg_col_idx: Background color code (bit 3 = bold, bit 0-2 = color) + * @last_sync: Monotonic time of last video sync */ struct video_priv { /* Things set up by the driver: */ @@ -118,6 +119,7 @@ struct video_priv { bool flush_dcache; u8 fg_col_idx; u8 bg_col_idx; + ulong last_sync; };
/**

At present U-Boot flushes the cache after every character written to ths display. This makes the command-line slower, to the point that pasting in long strings can fail.
Add a cyclic function to sync the display every 10ms. Enable this by default.
Allow much longer times for sandbox, since the SDL display is quite slow.
Avoid size growth if the feature is disabled by making the new init and destroy functions dependent on CYCLIC being enabled.
Signed-off-by: Simon Glass sjg@chromium.org ---
drivers/video/Kconfig | 30 +++++++++++++++++++++++ drivers/video/video-uclass.c | 46 ++++++++++++++++++++++++++++++++---- 2 files changed, 72 insertions(+), 4 deletions(-)
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig index 6f319ba0d544..1742e342f466 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig @@ -7,6 +7,7 @@ menu "Graphics support" config VIDEO bool "Enable driver model support for LCD/video" depends on DM + imply CYCLIC help This enables driver model for LCD and video devices. These support a bitmap display of various sizes and depths which can be drawn on @@ -231,6 +232,35 @@ config NO_FB_CLEAR loads takes over the screen. This, for example, can be used to keep splash image on screen until grub graphical boot menu starts.
+config VIDEO_SYNC_MS + int "Video-sync period in milliseconds for foreground processing" + default 300 if SANDBOX + default 100 + help + This sets the requested, maximum time before a video sync will take + place, in milliseconds. Note that the time between video syncs + may be longer than this, since syncs only happen when the video system + is used, e.g. by outputting a character to the console. + + It may also be shorter, since the video uclass will automatically + force a sync in certain situations. + + Many video-output systems require a sync operation before any output + is visible. This may flush the CPU cache or perhaps copy the + display contents to a hardware framebuffer. Without this, change to + the video may never be displayed. + +config VIDEO_SYNC_CYCLIC_MS + int "Video-sync period in milliseconds for cyclic processing" + depends on CYCLIC + default 100 if SANDBOX + default 10 + help + This sets the frequency of cyclic video syncs. The cyclic system is + used to ensure that when U-Boot is idle, it syncs the video. This + improves the responsiveness of the command line to new characters + being entered. + config PANEL bool "Enable panel uclass support" default y diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c index 600e12b802d1..fbed4ce861b4 100644 --- a/drivers/video/video-uclass.c +++ b/drivers/video/video-uclass.c @@ -9,6 +9,7 @@ #include <bloblist.h> #include <console.h> #include <cpu_func.h> +#include <cyclic.h> #include <dm.h> #include <log.h> #include <malloc.h> @@ -53,6 +54,8 @@ */ DECLARE_GLOBAL_DATA_PTR;
+struct cyclic_info; + /** * struct video_uc_priv - Information for the video uclass * @@ -61,9 +64,11 @@ DECLARE_GLOBAL_DATA_PTR; * available address to use for a device's framebuffer. It starts at * gd->video_top and works downwards, running out of space when it hits * gd->video_bottom. + * @cyc: handle for cyclic-execution function, or NULL if none */ struct video_uc_priv { ulong video_ptr; + struct cyclic_info *cyc; };
/** struct vid_rgb - Describes a video colour */ @@ -364,6 +369,10 @@ int video_sync(struct udevice *vid, bool force) return ret; }
+ if (CONFIG_IS_ENABLED(CYCLIC) && !force && + get_timer(priv->last_sync) < CONFIG_VIDEO_SYNC_MS) + return 0; + /* * flush_dcache_range() is declared in common.h but it seems that some * architectures do not actually implement it. Is there a way to find @@ -376,11 +385,10 @@ int video_sync(struct udevice *vid, bool force) CONFIG_SYS_CACHELINE_SIZE)); } #elif defined(CONFIG_VIDEO_SANDBOX_SDL) - if (force || get_timer(priv->last_sync) > 100) { - sandbox_sdl_sync(priv->fb); - priv->last_sync = get_timer(0); - } + sandbox_sdl_sync(priv->fb); #endif + priv->last_sync = get_timer(0); + return 0; }
@@ -525,10 +533,16 @@ int video_default_font_height(struct udevice *dev) return vc_priv->y_charsize; }
+static void video_idle(void *ctx) +{ + video_sync_all(); +} + /* Set up the display ready for use */ static int video_post_probe(struct udevice *dev) { struct video_uc_plat *plat = dev_get_uclass_plat(dev); + struct video_uc_priv *uc_priv = uclass_get_priv(dev->uclass); struct video_priv *priv = dev_get_uclass_priv(dev); char name[30], drv[15], *str; const char *drv_name = drv; @@ -599,6 +613,17 @@ static int video_post_probe(struct udevice *dev) } }
+ /* register cyclic as soon as the first video device is probed */ + if (CONFIG_IS_ENABLED(CYCLIC) && (gd->flags && GD_FLG_RELOC) && + !uc_priv->cyc) { + uint ms = CONFIG_IF_ENABLED_INT(CYCLIC, VIDEO_SYNC_CYCLIC_MS); + + uc_priv->cyc = cyclic_register(video_idle, ms * 1000, + "video_init", NULL); + if (!uc_priv->cyc) + return log_msg_ret("cyc", -ENOMEM); + } + return 0; };
@@ -638,6 +663,18 @@ static int video_post_bind(struct udevice *dev) return 0; }
+__maybe_unused static int video_destroy(struct uclass *uc) +{ + struct video_uc_priv *uc_priv = uclass_get_priv(uc); + + if (uc_priv->cyc) { + cyclic_unregister(uc_priv->cyc); + uc_priv->cyc = NULL; + } + + return 0; +} + UCLASS_DRIVER(video) = { .id = UCLASS_VIDEO, .name = "video", @@ -647,4 +684,5 @@ UCLASS_DRIVER(video) = { .priv_auto = sizeof(struct video_uc_priv), .per_device_auto = sizeof(struct video_priv), .per_device_plat_auto = sizeof(struct video_uc_plat), + CONFIG_IS_ENABLED(CYCLIC, (.destroy = video_destroy, )) };

On Sun, Nov 19, 2023 at 07:46:41AM -0700, Simon Glass wrote:
At present U-Boot flushes the cache after every character written to ths display. This makes the command-line slower, to the point that pasting in long strings can fail.
Add a cyclic function to sync the display every 10ms. Enable this by default.
Allow much longer times for sandbox, since the SDL display is quite slow.
Avoid size growth if the feature is disabled by making the new init and destroy functions dependent on CYCLIC being enabled.
Signed-off-by: Simon Glass sjg@chromium.org
drivers/video/Kconfig | 30 +++++++++++++++++++++++ drivers/video/video-uclass.c | 46 ++++++++++++++++++++++++++++++++---- 2 files changed, 72 insertions(+), 4 deletions(-)
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig index 6f319ba0d544..1742e342f466 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig @@ -7,6 +7,7 @@ menu "Graphics support" config VIDEO bool "Enable driver model support for LCD/video" depends on DM
- imply CYCLIC help This enables driver model for LCD and video devices. These support a bitmap display of various sizes and depths which can be drawn on
We should at least expand the help message to say that if you enable cyclic you get some other behavior. In hind sight, cyclic shouldn't be prompted and it should be selected as used. But that's not an issue for this patch set.

Hi Tom,
On Sun, 19 Nov 2023 at 08:59, Tom Rini trini@konsulko.com wrote:
On Sun, Nov 19, 2023 at 07:46:41AM -0700, Simon Glass wrote:
At present U-Boot flushes the cache after every character written to ths display. This makes the command-line slower, to the point that pasting in long strings can fail.
Add a cyclic function to sync the display every 10ms. Enable this by default.
Allow much longer times for sandbox, since the SDL display is quite slow.
Avoid size growth if the feature is disabled by making the new init and destroy functions dependent on CYCLIC being enabled.
Signed-off-by: Simon Glass sjg@chromium.org
drivers/video/Kconfig | 30 +++++++++++++++++++++++ drivers/video/video-uclass.c | 46 ++++++++++++++++++++++++++++++++---- 2 files changed, 72 insertions(+), 4 deletions(-)
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig index 6f319ba0d544..1742e342f466 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig @@ -7,6 +7,7 @@ menu "Graphics support" config VIDEO bool "Enable driver model support for LCD/video" depends on DM
imply CYCLIC help This enables driver model for LCD and video devices. These support a bitmap display of various sizes and depths which can be drawn on
We should at least expand the help message to say that if you enable cyclic you get some other behavior. In hind sight, cyclic shouldn't be prompted and it should be selected as used. But that's not an issue for this patch set.
Yes it is similar to EVENT I think. But note that some boards do use it for other purposes.
I assume you mean to expand the help for VIDEO
Regards, Simon

On Sun, Nov 19, 2023 at 11:23:59AM -0700, Simon Glass wrote:
Hi Tom,
On Sun, 19 Nov 2023 at 08:59, Tom Rini trini@konsulko.com wrote:
On Sun, Nov 19, 2023 at 07:46:41AM -0700, Simon Glass wrote:
At present U-Boot flushes the cache after every character written to ths display. This makes the command-line slower, to the point that pasting in long strings can fail.
Add a cyclic function to sync the display every 10ms. Enable this by default.
Allow much longer times for sandbox, since the SDL display is quite slow.
Avoid size growth if the feature is disabled by making the new init and destroy functions dependent on CYCLIC being enabled.
Signed-off-by: Simon Glass sjg@chromium.org
drivers/video/Kconfig | 30 +++++++++++++++++++++++ drivers/video/video-uclass.c | 46 ++++++++++++++++++++++++++++++++---- 2 files changed, 72 insertions(+), 4 deletions(-)
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig index 6f319ba0d544..1742e342f466 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig @@ -7,6 +7,7 @@ menu "Graphics support" config VIDEO bool "Enable driver model support for LCD/video" depends on DM
imply CYCLIC help This enables driver model for LCD and video devices. These support a bitmap display of various sizes and depths which can be drawn on
We should at least expand the help message to say that if you enable cyclic you get some other behavior. In hind sight, cyclic shouldn't be prompted and it should be selected as used. But that's not an issue for this patch set.
Yes it is similar to EVENT I think. But note that some boards do use it for other purposes.
I assume you mean to expand the help for VIDEO
Yes, please expand the help in VIDEO.

Now that sandbox is using cyclic for video, it trips the 1us time limit. Updating the sandbox display often takes 20ms or more.
Increase the limit to 100ms to avoid a warning.
Signed-off-by: Simon Glass sjg@chromium.org ---
common/Kconfig | 1 + 1 file changed, 1 insertion(+)
diff --git a/common/Kconfig b/common/Kconfig index 0283701f1d05..07fe53dba687 100644 --- a/common/Kconfig +++ b/common/Kconfig @@ -628,6 +628,7 @@ if CYCLIC
config CYCLIC_MAX_CPU_TIME_US int "Sets the max allowed time for a cyclic function in us" + default 100000 if SANDBOX # sandbox video is quite slow default 1000 help The max allowed time for a cyclic function in us. If a functions

With sandbox, when U-Boot is waiting for input it syncs the video display, since presumably the user has finished typing.
Now that cyclic is used for video syncing, we can drop this. Cyclic will automatically call the video_idle() function when idle.
Signed-off-by: Simon Glass sjg@chromium.org ---
drivers/serial/sandbox.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/drivers/serial/sandbox.c b/drivers/serial/sandbox.c index f6ac3d228526..be72fd2c65f7 100644 --- a/drivers/serial/sandbox.c +++ b/drivers/serial/sandbox.c @@ -139,8 +139,6 @@ static int sandbox_serial_pending(struct udevice *dev, bool input) return 0;
os_usleep(100); - if (IS_ENABLED(CONFIG_VIDEO) && !IS_ENABLED(CONFIG_SPL_BUILD)) - video_sync_all(); avail = membuff_putraw(&priv->buf, 100, false, &data); if (!avail) return 1; /* buffer full */
participants (3)
-
Simon Glass
-
Stefan Roese
-
Tom Rini