video: Improve syncing performance with cyclic
v2 cover 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 workarounds 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 growth 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
Changes in v2:
- Add an SPL_CYCLIC symbol
- Add a lot more explanation about the header files
- Expand help for CONFIG_VIDEO
- Fix 'groth' and 'work-around' typos in cover letter
Simon Glass (5):
cyclic: Add a symbol for SPL
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 | 9 ++++++ common/Makefile | 2 +- drivers/serial/sandbox.c | 2 -- drivers/video/Kconfig | 35 +++++++++++++++++++++ drivers/video/video-uclass.c | 52 +++++++++++++++++++++++++------ drivers/watchdog/Kconfig | 1 + include/asm-generic/global_data.h | 2 +- include/cyclic.h | 6 ++-- include/video.h | 2 ++ 9 files changed, 96 insertions(+), 15 deletions(-)
Signature · 1 line
2.43.0.rc2.451.g8631bc7472-goog
PATCH v2 1/5 cyclic: Add a symbol for SPL
The cyclic subsystem is currently enabled either in all build phases or none. For tools this should not be enabled, but since lib/shc256.c and other files include watchdog.h in the host build, we must make sure that it is not enabled there.
Add an SPL symbol so that there is more control of this.
Add an include into cyclic.h so that tools can include this file.
Also add the kconfig.h header so that CONFIG_IS_ENABLED() works. We could avoid this for now by moving the location of the watchdog.h inclusion to outside the USE_HOSTCC area. But at some point the #ifdefs from these files will likely be removed, so there is no benefit in going that way.
---
Changes in v2:
- Add an SPL_CYCLIC symbol
- Add a lot more explanation about the header files
common/Kconfig | 8 ++++++++ common/Makefile | 2 +- drivers/watchdog/Kconfig | 1 + include/asm-generic/global_data.h | 2 +- include/cyclic.h | 6 ++++-- 5 files changed, 15 insertions(+), 4 deletions(-)
common/Kconfig +8 -0
@@ -626,6 +626,14 @@ config CYCLIC if CYCLIC +config SPL_CYCLIC + bool "General-purpose cyclic execution mechanism (SPL)" + help + This enables a general-purpose cyclic execution infrastructure in SPL, + to allow "small" (run-time wise) functions to be executed at + a specified frequency. Things like LED blinking or watchdog + triggering are examples for such tasks. + config CYCLIC_MAX_CPU_TIME_US int "Sets the max allowed time for a cyclic function in us" default 1000
common/Makefile +1 -1
@@ -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
drivers/watchdog/Kconfig +1 -0
@@ -395,6 +395,7 @@ config WDT_ARM_SMC config SPL_WDT bool "Enable driver model for watchdog timer drivers in SPL" depends on SPL_DM + select SPL_CYCLIC if CYCLIC help Enable driver model for watchdog timer in SPL. This is similar to CONFIG_WDT in U-Boot.
include/asm-generic/global_data.h +1 -1
@@ -485,7 +485,7 @@ struct global_data {*/ struct event_state event_state;#endif -#ifdef CONFIG_CYCLIC +#if CONFIG_IS_ENABLED (CYCLIC )/** * @cyclic_list: list of registered cyclic functions */
include/cyclic.h +4 -2
@@ -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
Signature · 1 line
2.43.0.rc2.451.g8631bc7472-goog
Re: [PATCH v2 1/5] cyclic: Add a symbol for SPL
Quoted 9 lines · Simon Glass
The cyclic subsystem is currently enabled either in all build phases or none. For tools this should not be enabled, but since
lib/shc256.cand other files includewatchdog.hin the host build, we must make sure that it is not enabled there.Add an SPL symbol so that there is more control of this.
Add an include into
cyclic.hso that tools can include this file.
Quoted 7 lines
Also add the
kconfig.hheader so thatCONFIG_IS_ENABLED()works. We could avoid this for now by moving the location of thewatchdog.hinclusion to outside theUSE_HOSTCCarea. But at some point the #ifdefs from these files will likely be removed, so there is no benefit in going that way.Signed-off-by Simon Glass <[email protected]>
Thanks,
Stefan
Quoted 93 lines
---
Changes in v2:
- Add anSPL_CYCLICsymbol
- Add a lot more explanation about the header filescommon/Kconfig | 8 ++++++++ common/Makefile | 2 +- drivers/watchdog/Kconfig | 1 + include/asm-generic/global_data.h | 2 +- include/cyclic.h | 6 ++++-- 5 files changed, 15 insertions(+), 4 deletions(-)common/Kconfig +8
-0@@ -626,6 +626,14 @@ config CYCLIC if CYCLIC +config SPL_CYCLIC + bool "General-purpose cyclic execution mechanism (SPL)" + help + This enables a general-purpose cyclic execution infrastructure in SPL, + to allow "small" (run-time wise) functions to be executed at + a specified frequency. Things like LED blinking or watchdog + triggering are examples for such tasks. + config CYCLIC_MAX_CPU_TIME_US int "Sets the max allowed time for a cyclic function in us" default 1000common/Makefile +1
-1@@ -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.odrivers/watchdog/Kconfig +1
-0@@ -395,6 +395,7 @@ config WDT_ARM_SMC config SPL_WDT bool "Enable driver model for watchdog timer drivers in SPL" depends on SPL_DM + select SPL_CYCLIC if CYCLIC help Enable driver model for watchdog timer in SPL. This is similar to CONFIG_WDT in U-Boot.include/asm-generic/global_data.h +1
-1@@ -485,7 +485,7 @@ struct global_data {*/ struct event_state event_state;#endif -#ifdef CONFIG_CYCLIC +#if CONFIG_IS_ENABLED (CYCLIC )/** * @cyclic_list: list of registered cyclic functions */ include/cyclic.h +3
-1@@ -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 *
include/cyclic.h static inline int cyclic_unregister_all(void) · line 129
Quoted 7 lines
include/cyclic.h +1
-1@@ -122,6 +124,6 @@ static inline int cyclic_unregister_all(void) {return 0 ; } -#endif +#endif /* CYCLIC */ #endif
Viele Grüße,
Stefan Roese
Signature · 3 lines
DENX Software Engineering GmbH, Managing Director: Erika Unter HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]
Re: [PATCH v2 1/5] cyclic: Add a symbol for SPL
In reply to Simon GlassHi Simon,
Quoted 9 lines · Simon Glass
The cyclic subsystem is currently enabled either in all build phases or none. For tools this should not be enabled, but since
lib/shc256.cand other files includewatchdog.hin the host build, we must make sure that it is not enabled there.Add an SPL symbol so that there is more control of this.
Add an include into
cyclic.hso that tools can include this file.
Quoted 7 lines
Also add the
kconfig.hheader so thatCONFIG_IS_ENABLED()works. We could avoid this for now by moving the location of thewatchdog.hinclusion to outside theUSE_HOSTCCarea. But at some point the #ifdefs from these files will likely be removed, so there is no benefit in going that way.Signed-off-by Simon Glass <[email protected]>
Regards
Devarsh
Quoted 100 lines
---
Changes in v2:
- Add anSPL_CYCLICsymbol
- Add a lot more explanation about the header filescommon/Kconfig | 8 ++++++++ common/Makefile | 2 +- drivers/watchdog/Kconfig | 1 + include/asm-generic/global_data.h | 2 +- include/cyclic.h | 6 ++++-- 5 files changed, 15 insertions(+), 4 deletions(-)common/Kconfig +8
-0@@ -626,6 +626,14 @@ config CYCLIC if CYCLIC +config SPL_CYCLIC + bool "General-purpose cyclic execution mechanism (SPL)" + help + This enables a general-purpose cyclic execution infrastructure in SPL, + to allow "small" (run-time wise) functions to be executed at + a specified frequency. Things like LED blinking or watchdog + triggering are examples for such tasks. + config CYCLIC_MAX_CPU_TIME_US int "Sets the max allowed time for a cyclic function in us" default 1000common/Makefile +1
-1@@ -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.odrivers/watchdog/Kconfig +1
-0@@ -395,6 +395,7 @@ config WDT_ARM_SMC config SPL_WDT bool "Enable driver model for watchdog timer drivers in SPL" depends on SPL_DM + select SPL_CYCLIC if CYCLIC help Enable driver model for watchdog timer in SPL. This is similar to CONFIG_WDT in U-Boot.include/asm-generic/global_data.h +1
-1@@ -485,7 +485,7 @@ struct global_data {*/ struct event_state event_state;#endif -#ifdef CONFIG_CYCLIC +#if CONFIG_IS_ENABLED (CYCLIC )/** * @cyclic_list: list of registered cyclic functions */ include/cyclic.h +4
-2@@ -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
Re: [PATCH v2 1/5] cyclic: Add a symbol for SPL
In reply to Simon GlassQuoted 4 lines · Simon Glass
The cyclic subsystem is currently enabled either in all build phases or none. For tools this should not be enabled, but since
lib/shc256.cand other files includewatchdog.hin the host build, we must make sure that it is not enabled there.
This part is what I see as the Wrong Direction. There's some code we really need to share with our user space tools, in order to not copy/paste the same code. In turn, this code must be as user-space friendly as possible. Maybe even we re-factor things a little more, if needed, so that we _just_ have the library functions in common files, and u-boot or user space only files have the make use of logic. I don't feel bad about tools/ needing:
void sha256_csum_wd(const unsigned char *input, unsigned int ilen,
unsigned char *output, unsigned int chunk_sz)
{
sha256_context ctx;
sha256_starts(&ctx);
sha256_update(&ctx, input, ilen);
sha256_finish(&ctx, output);
}(and so on for other algos) as a duplicate bit of code. Much less so than I do about adding <linux/kconfig.h> to a direct include list (since we should never be doing that) so that later on we can if (IS_ENABLED(..)) the existing code.
Signature · 1 line
Tom
Re: [PATCH v2 1/5] cyclic: Add a symbol for SPL
Hi Tom,
Quoted 24 lines · Tom Rini
Quoted 4 lines · Simon Glass
The cyclic subsystem is currently enabled either in all build phases or none. For tools this should not be enabled, but since
lib/shc256.cand other files includewatchdog.hin the host build, we must make sure that it is not enabled there.This part is what I see as the Wrong Direction. There's some code we really need to share with our user space tools, in order to not copy/paste the same code. In turn, this code must be as user-space friendly as possible. Maybe even we re-factor things a little more, if needed, so that we _just_ have the library functions in common files, and u-boot or user space only files have the make use of logic. I don't feel bad about
tools/needing:
void sha256_csum_wd(const unsigned char *input, unsigned int ilen,
unsigned char *output, unsigned intchunk_sz){ sha256_context ctx; sha256_starts(&ctx); sha256_update(&ctx, input, ilen); sha256_finish(&ctx, output); }
Quoted 4 lines
(and so on for other algos) as a duplicate bit of code. Much less so than I do about adding <
linux/kconfig.h> to a direct include list (since we should never be doing that) so that later on we can if (IS_ENABLED(..)) the existing code.
Bear in mind that we have the CONFIG_TOOLS_... options entirely to deal with the need for tools to enable features in common code. This SHA thing is a very small part of the code, compared to common code in boot/ for example.
So is this really a win?
Regards,
Simon
Re: [PATCH v2 1/5] cyclic: Add a symbol for SPL
Quoted 32 lines · Simon Glass
Hi Tom,
Quoted 24 lines · Tom Rini
Quoted 4 lines · Simon Glass
The cyclic subsystem is currently enabled either in all build phases or none. For tools this should not be enabled, but since
lib/shc256.cand other files includewatchdog.hin the host build, we must make sure that it is not enabled there.This part is what I see as the Wrong Direction. There's some code we really need to share with our user space tools, in order to not copy/paste the same code. In turn, this code must be as user-space friendly as possible. Maybe even we re-factor things a little more, if needed, so that we _just_ have the library functions in common files, and u-boot or user space only files have the make use of logic. I don't feel bad about
tools/needing:
void sha256_csum_wd(const unsigned char *input, unsigned int ilen,
unsigned char *output, unsigned intchunk_sz){ sha256_context ctx; sha256_starts(&ctx); sha256_update(&ctx, input, ilen); sha256_finish(&ctx, output); }Quoted 4 lines
(and so on for other algos) as a duplicate bit of code. Much less so than I do about adding <
linux/kconfig.h> to a direct include list (since we should never be doing that) so that later on we can if (IS_ENABLED(..)) the existing code.
Quoted 6 lines
Bear in mind that we have the
CONFIG_TOOLS_... options entirely to deal with the need for tools to enable features in common code. This SHA thing is a very small part of the code, compared to common code in boot/ for example.So is this really a win?
I don't follow you here, sorry. We share lib/sha*.c with host tools for generic mkimage functionality. I'm fine with continuing to use USE_HOSTCC as the guard for U-Boot / userspace here. And I don't think switching these files from:
#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG) to:
if (IS_ENABLED(CONFIG_HW_WATCHDOG) || IS_ENABLED(CONFIG_WATCHDOG)) {improves readability of the code.
Signature · 1 line
Tom
Re: [PATCH v2 1/5] cyclic: Add a symbol for SPL
Hi Tom,
Quoted 34 lines · Tom Rini
Quoted 32 lines · Simon Glass
Hi Tom,
Quoted 28 lines · Tom Rini
Quoted 4 lines · Simon Glass
The cyclic subsystem is currently enabled either in all build phases or none. For tools this should not be enabled, but since
lib/shc256.cand other files includewatchdog.hin the host build, we must make sure that it is not enabled there.This part is what I see as the Wrong Direction. There's some code we really need to share with our user space tools, in order to not copy/paste the same code. In turn, this code must be as user-space friendly as possible. Maybe even we re-factor things a little more, if needed, so that we _just_ have the library functions in common files, and u-boot or user space only files have the make use of logic. I don't feel bad about
tools/needing:
void sha256_csum_wd(const unsigned char *input, unsigned int ilen,
unsigned char *output, unsigned intchunk_sz){ sha256_context ctx; sha256_starts(&ctx); sha256_update(&ctx, input, ilen); sha256_finish(&ctx, output); }(and so on for other algos) as a duplicate bit of code. Much less so than I do about adding <
linux/kconfig.h> to a direct include list (since we should never be doing that) so that later on we can if (IS_ENABLED(..)) the existing code.
Quoted 8 lines
Quoted 6 lines
Bear in mind that we have the
CONFIG_TOOLS_... options entirely to deal with the need for tools to enable features in common code. This SHA thing is a very small part of the code, compared to common code in boot/ for example.So is this really a win?
I don't follow you here, sorry.
I mean that we share a lot of code already, code which contains CONFIG options. So does it matter avoiding adding one more?
Quoted 8 lines
We share
lib/sha*.cwith host tools for
generic mkimage functionality. I'm fine with continuing to useUSE_HOSTCCas the guard for U-Boot / userspace here. And I don't think switching these files from:
#ifdefined(CONFIG_HW_WATCHDOG)||defined(CONFIG_WATCHDOG)to:if (IS_ENABLED(CONFIG_HW_WATCHDOG) || IS_ENABLED(CONFIG_WATCHDOG)) {improves readability of the code.
Perhaps I am being too hard on the #ifdefs.
BTW we have a tools_build() function now.
Regards,
Simon
Re: [PATCH v2 1/5] cyclic: Add a symbol for SPL
Quoted 42 lines · Simon Glass
Hi Tom,
Quoted 39 lines · Tom Rini
Quoted 37 lines · Simon Glass
Hi Tom,
Quoted 24 lines · Tom Rini
Quoted 4 lines · Simon Glass
The cyclic subsystem is currently enabled either in all build phases or none. For tools this should not be enabled, but since
lib/shc256.cand other files includewatchdog.hin the host build, we must make sure that it is not enabled there.This part is what I see as the Wrong Direction. There's some code we really need to share with our user space tools, in order to not copy/paste the same code. In turn, this code must be as user-space friendly as possible. Maybe even we re-factor things a little more, if needed, so that we _just_ have the library functions in common files, and u-boot or user space only files have the make use of logic. I don't feel bad about
tools/needing:
void sha256_csum_wd(const unsigned char *input, unsigned int ilen,
unsigned char *output, unsigned intchunk_sz){ sha256_context ctx; sha256_starts(&ctx); sha256_update(&ctx, input, ilen); sha256_finish(&ctx, output); }Quoted 4 lines
(and so on for other algos) as a duplicate bit of code. Much less so than I do about adding <
linux/kconfig.h> to a direct include list (since we should never be doing that) so that later on we can if (IS_ENABLED(..)) the existing code.Bear in mind that we have the
CONFIG_TOOLS_... options entirely to deal with the need for tools to enable features in common code. This SHA thing is a very small part of the code, compared to common code in boot/ for example.
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
So is this really a win?
I don't follow you here, sorry.
I mean that we share a lot of code already, code which contains CONFIG options. So does it matter avoiding adding one more?
It's adding <linux/kconfig.h> to files, we must not do that. And we don't need to if we don't have <watchdog.h> (and that in turn, cyclic.h) included outside of USE_HOSTCC :)
Signature · 1 line
Tom
Re: [PATCH v2 1/5] cyclic: Add a symbol for SPL
Hi Tom,
Quoted 46 lines · Tom Rini
Quoted 44 lines · Simon Glass
Hi Tom,
Quoted 41 lines · Tom Rini
Quoted 38 lines · Simon Glass
Hi Tom,
Quoted 24 lines · Tom Rini
Quoted 4 lines · Simon Glass
The cyclic subsystem is currently enabled either in all build phases or none. For tools this should not be enabled, but since
lib/shc256.cand other files includewatchdog.hin the host build, we must make sure that it is not enabled there.This part is what I see as the Wrong Direction. There's some code we really need to share with our user space tools, in order to not copy/paste the same code. In turn, this code must be as user-space friendly as possible. Maybe even we re-factor things a little more, if needed, so that we _just_ have the library functions in common files, and u-boot or user space only files have the make use of logic. I don't feel bad about
tools/needing:
void sha256_csum_wd(const unsigned char *input, unsigned int ilen,
unsigned char *output, unsigned intchunk_sz){ sha256_context ctx; sha256_starts(&ctx); sha256_update(&ctx, input, ilen); sha256_finish(&ctx, output); }Quoted 4 lines
(and so on for other algos) as a duplicate bit of code. Much less so than I do about adding <
linux/kconfig.h> to a direct include list (since we should never be doing that) so that later on we can if (IS_ENABLED(..)) the existing code.Bear in mind that we have the
CONFIG_TOOLS_... options entirely to deal with the need for tools to enable features in common code. This SHA thing is a very small part of the code, compared to common code in boot/ for example.So is this really a win?
Quoted 8 lines
Quoted 4 lines
Quoted 1 line
I don't follow you here, sorry.
I mean that we share a lot of code already, code which contains CONFIG options. So does it matter avoiding adding one more?
It's adding <
linux/kconfig.h> to files, we must not do that. And we don't need to if we don't have <watchdog.h> (and that in turn,cyclic.h) included outside ofUSE_HOSTCC:)
$ git grep kconfig.h .azure-pipelines.yml: :^include/linux/kconfig.h :^tools/ && exit 1 || exit 0 .gitlab-ci.yml: :^include/linux/kconfig.h :^tools/ && exit 1 || exit 0 Makefile: -include $(srctree)/include/linux/kconfig.h Makefile: -include linux/kconfig.h -include include/config.h \ arch/arm/include/asm/arch-fsl-layerscape/config.h:#include <linux/kconfig.h> arch/arm/mach-rockchip/tpl.c:#include <linux/kconfig.h> arch/arm/mach-sunxi/dram_sun50i_h6.c:#include <linux/kconfig.h> arch/arm/mach-sunxi/dram_sun50i_h616.c:#include <linux/kconfig.h> arch/arm/mach-sunxi/dram_sunxi_dw.c:#include <linux/kconfig.h> boot/image-fit.c:#include <linux/kconfig.h> boot/image.c:#include <linux/kconfig.h>
These are the sorts of ones which are a real pain to remove.
common/hash.c:#include <linux/kconfig.h> drivers/timer/dw-apb-timer.c:#include <linux/kconfig.h> env/embedded.c:#include <linux/kconfig.h> include/bootstage.h:#include <linux/kconfig.h> include/configs/at91-sama5_common.h:#include <linux/kconfig.h> include/configs/tqma6.h:#include <linux/kconfig.h> include/env_internal.h:#include <linux/kconfig.h> include/hash.h:#include <linux/kconfig.h> include/image.h:#include <linux/kconfig.h> include/u-boot/ecdsa.h:#include <linux/kconfig.h> lib/rsa/rsa-verify.c:#include <linux/kconfig.h>scripts/Makefile.autoconf: -include
$(srctree)/include/linux/kconfig.h
scripts/Makefile.autoconf: echo \#include \<linux/kconfig.h\>;
\test/dm/scmi.c:#include <linux/kconfig.h> test/lib/kconfig.c: * Test of linux/kconfig.h macros test/lib/kconfig_spl.c: * Test of linux/kconfig.h macros for SPL tools/binman/test/blob_syms.c:#include <linux/kconfig.h> tools/binman/test/u_boot_binman_syms.c:#include <linux/kconfig.h> tools/binman/test/u_boot_binman_syms_size.c:#include <linux/kconfig.h> tools/env/fw_env_private.h:#include <linux/kconfig.h> tools/envcrc.c:#include <linux/kconfig.h> tools/mkeficapsule.c:#include <linux/kconfig.h> tools/printinitialenv.c:#include <linux/kconfig.h>
I don't really mind what we do with sha, and it seems I am a bit too rabid on the anti-#ifdef thing compared to others.
Regards,
Simon
PATCH v2 2/5 video: Move last_sync to private data
In reply to Simon GlassRather 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.
---
(no changes since v1)
drivers/video/video-uclass.c | 10 +++------- include/video.h | 2 ++ 2 files changed, 5 insertions(+), 7 deletions(-)
drivers/video/video-uclass.c +3 -7
@@ -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 ;
include/video.h +2 -0
@@ -97,6 +97,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: */
@@ -121,6 +122,7 @@ struct video_priv {bool flush_dcache;u8 fg_col_idx;u8 bg_col_idx; +ulong last_sync; };/**
Signature · 1 line
2.43.0.rc2.451.g8631bc7472-goog
PATCH v2 3/5 video: Use cyclic to handle video sync
In reply to Simon GlassAt 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.
---
Changes in v2:
- Expand help for CONFIG_VIDEO
drivers/video/Kconfig | 35 +++++++++++++++++++++++++++ drivers/video/video-uclass.c | 46 ++++++++++++++++++++++++++++++++---- 2 files changed, 77 insertions(+), 4 deletions(-)
drivers/video/Kconfig +35 -0
@@ -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
@@ -14,6 +15,11 @@ config VIDEO option compiles in the video uclass and routes all LCD/video access through this. + If CYCLIC is enabled (which it is by default), the cyclic subsystem + is used to flush pending output to the display periodically, rather + than this happening with every chunk of output. This allows for more + efficient operation and faster display output. + if VIDEO config VIDEO_FONT_4X6
@@ -231,6 +237,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
drivers/video/video-uclass.c +42 -4
106 lines not on this page · raw message
Signature · 1 line
2.43.0.rc2.451.g8631bc7472-goog
PATCH v2 4/5 sandbox: Increase cyclic CPU-time limit
In reply to Simon GlassNow 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.
---
(no changes since v1)
common/Kconfig | 1 + 1 file changed, 1 insertion(+)
common/Kconfig +1 -0
@@ -636,6 +636,7 @@ config SPL_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
Signature · 1 line
2.43.0.rc2.451.g8631bc7472-goog
PATCH v2 5/5 sandbox: Drop video-sync in serial driver
In reply to Simon GlassWith 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.
---
Changes in v2:
- Fix 'groth' and 'work-around' typos in cover letter
drivers/serial/sandbox.c | 2 -- 1 file changed, 2 deletions(-)
drivers/serial/sandbox.c +0 -2
@@ -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 */
Signature · 1 line
2.43.0.rc2.451.g8631bc7472-goog