diff options
author | Simon Glass <sjg@chromium.org> | 2016-01-14 18:10:40 -0700 |
---|---|---|
committer | Anatolij Gustschin <agust@denx.de> | 2016-01-30 10:55:27 +0100 |
commit | 58c733a70ff1967490af1fd69aab2ba7bb86eb2c (patch) | |
tree | 54626b91c3c90621542300668a08d89e669efdfd /drivers/video | |
parent | c5b77d01d1eb0943a8241665313577b8b51203ae (diff) | |
download | u-boot-imx-58c733a70ff1967490af1fd69aab2ba7bb86eb2c.zip u-boot-imx-58c733a70ff1967490af1fd69aab2ba7bb86eb2c.tar.gz u-boot-imx-58c733a70ff1967490af1fd69aab2ba7bb86eb2c.tar.bz2 |
video: Provide a signal when a new console line is started
When we start a new line (due to the user pressing return), signal this to
the driver so that it can flush its buffer of character positions.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/vidconsole-uclass.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/video/vidconsole-uclass.c b/drivers/video/vidconsole-uclass.c index 884db01..bea563a 100644 --- a/drivers/video/vidconsole-uclass.c +++ b/drivers/video/vidconsole-uclass.c @@ -47,6 +47,15 @@ int vidconsole_set_row(struct udevice *dev, uint row, int clr) return ops->set_row(dev, row, clr); } +static int vidconsole_entry_start(struct udevice *dev) +{ + struct vidconsole_ops *ops = vidconsole_get_ops(dev); + + if (!ops->entry_start) + return -ENOSYS; + return ops->entry_start(dev); +} + /* Move backwards one space */ static void vidconsole_back(struct udevice *dev) { @@ -82,6 +91,8 @@ static void vidconsole_newline(struct udevice *dev) vid_priv->colour_bg); priv->ycur -= rows * priv->y_charsize; } + priv->last_ch = 0; + video_sync(dev->parent); } @@ -99,6 +110,7 @@ int vidconsole_put_char(struct udevice *dev, char ch) break; case '\n': vidconsole_newline(dev); + vidconsole_entry_start(dev); break; case '\t': /* Tab (8 chars alignment) */ priv->xcur_frac = ((priv->xcur_frac / priv->tab_width_frac) @@ -109,6 +121,7 @@ int vidconsole_put_char(struct udevice *dev, char ch) break; case '\b': vidconsole_back(dev); + priv->last_ch = 0; break; default: /* @@ -125,6 +138,7 @@ int vidconsole_put_char(struct udevice *dev, char ch) if (ret < 0) return ret; priv->xcur_frac += ret; + priv->last_ch = ch; if (priv->xcur_frac >= priv->xsize_frac) vidconsole_newline(dev); break; |