mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2025-09-19 12:51:23 +02:00
video: Move last_sync to private data
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>
This commit is contained in:
parent
8ada14b4d9
commit
b023948e4f
@ -349,6 +349,7 @@ void video_set_default_colors(struct udevice *dev, bool invert)
|
|||||||
/* Flush video activity to the caches */
|
/* Flush video activity to the caches */
|
||||||
int video_sync(struct udevice *vid, bool force)
|
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);
|
struct video_ops *ops = video_get_ops(vid);
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
@ -364,20 +365,15 @@ int video_sync(struct udevice *vid, bool force)
|
|||||||
* out whether it exists? For now, ARM is safe.
|
* out whether it exists? For now, ARM is safe.
|
||||||
*/
|
*/
|
||||||
#if defined(CONFIG_ARM) && !CONFIG_IS_ENABLED(SYS_DCACHE_OFF)
|
#if defined(CONFIG_ARM) && !CONFIG_IS_ENABLED(SYS_DCACHE_OFF)
|
||||||
struct video_priv *priv = dev_get_uclass_priv(vid);
|
|
||||||
|
|
||||||
if (priv->flush_dcache) {
|
if (priv->flush_dcache) {
|
||||||
flush_dcache_range((ulong)priv->fb,
|
flush_dcache_range((ulong)priv->fb,
|
||||||
ALIGN((ulong)priv->fb + priv->fb_size,
|
ALIGN((ulong)priv->fb + priv->fb_size,
|
||||||
CONFIG_SYS_CACHELINE_SIZE));
|
CONFIG_SYS_CACHELINE_SIZE));
|
||||||
}
|
}
|
||||||
#elif defined(CONFIG_VIDEO_SANDBOX_SDL)
|
#elif defined(CONFIG_VIDEO_SANDBOX_SDL)
|
||||||
struct video_priv *priv = dev_get_uclass_priv(vid);
|
if (force || get_timer(priv->last_sync) > 100) {
|
||||||
static ulong last_sync;
|
|
||||||
|
|
||||||
if (force || get_timer(last_sync) > 100) {
|
|
||||||
sandbox_sdl_sync(priv->fb);
|
sandbox_sdl_sync(priv->fb);
|
||||||
last_sync = get_timer(0);
|
priv->last_sync = get_timer(0);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -97,6 +97,7 @@ enum video_format {
|
|||||||
* the LCD is updated
|
* the LCD is updated
|
||||||
* @fg_col_idx: Foreground color code (bit 3 = bold, bit 0-2 = color)
|
* @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)
|
* @bg_col_idx: Background color code (bit 3 = bold, bit 0-2 = color)
|
||||||
|
* @last_sync: Monotonic time of last video sync
|
||||||
*/
|
*/
|
||||||
struct video_priv {
|
struct video_priv {
|
||||||
/* Things set up by the driver: */
|
/* Things set up by the driver: */
|
||||||
@ -121,6 +122,7 @@ struct video_priv {
|
|||||||
bool flush_dcache;
|
bool flush_dcache;
|
||||||
u8 fg_col_idx;
|
u8 fg_col_idx;
|
||||||
u8 bg_col_idx;
|
u8 bg_col_idx;
|
||||||
|
ulong last_sync;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user