summaryrefslogtreecommitdiff
path: root/include/video_console.h
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2024-10-14 16:31:54 -0600
committerSimon Glass <sjg@chromium.org>2024-10-18 14:10:22 -0600
commit18a85cf7b5da3b8fabfed809cc972f0b58279620 (patch)
treee983fa85bf8c938b2556dbd4e051f66d7e69a2b6 /include/video_console.h
parent52c19173dfa162868be792d61a2e48e4bb6e0112 (diff)
video: Avoid starting a new line to close to the bottom
When starting a new text line, an assumption is made that the current vertical position is a multiple of the character height. When this is not true, characters can be written after the end of the framebuffer. This can causes crashes and strange errors from QEMU. Adjust the scrolling check when processing a newline character, to avoid any problems. Add some comments to make things a little clearer. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/video_console.h')
-rw-r--r--include/video_console.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/video_console.h b/include/video_console.h
index 8b5928dc5eb..723d2315606 100644
--- a/include/video_console.h
+++ b/include/video_console.h
@@ -27,6 +27,14 @@ enum {
* Drivers must set up @rows, @cols, @x_charsize, @y_charsize in their probe()
* method. Drivers may set up @xstart_frac if desired.
*
+ * Note that these values relate to the rotated console, so that an 80x25
+ * console which is rotated 90 degrees will have rows=80 and cols=25
+ *
+ * The xcur_frac and ycur values refer to the unrotated coordinates, that is
+ * xcur_frac always advances with each character, even if its limit might be
+ * vid_priv->ysize instead of vid_priv->xsize if the console is rotated 90 or
+ * 270 degrees.
+ *
* @sdev: stdio device, acting as an output sink
* @xcur_frac: Current X position, in fractional units (VID_TO_POS(x))
* @ycur: Current Y position in pixels (0=top)