aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakumi Sueda2022-09-13 18:32:42 +0900
committerAnatolij Gustschin2022-10-30 08:28:40 +0100
commitdb2c8ed3a5850e64fcf612d099ce7b22c480a752 (patch)
treeb45def559c4da2f2c6dd16845dc6af2a0e825fde
parent720927249788826e0e72c3c6ee3b696a0188ed4d (diff)
video: simplefb: add rotation support
It introduces the way to rotate the screen for boards with rotated screen. Signed-off-by: Takumi Sueda <puhitaku@gmail.com>
-rw-r--r--drivers/video/simplefb.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/video/simplefb.c b/drivers/video/simplefb.c
index 2b0d8835e38..235ec761f70 100644
--- a/drivers/video/simplefb.c
+++ b/drivers/video/simplefb.c
@@ -43,7 +43,11 @@ static int simple_video_probe(struct udevice *dev)
uc_priv->xsize = fdtdec_get_uint(blob, node, "width", 0);
uc_priv->ysize = fdtdec_get_uint(blob, node, "height", 0);
- uc_priv->rot = 0;
+ uc_priv->rot = fdtdec_get_uint(blob, node, "rot", 0);
+ if (uc_priv->rot > 3) {
+ log_debug("%s: invalid rot\n", __func__);
+ return log_msg_ret("rot", -EINVAL);
+ }
format = fdt_getprop(blob, node, "format", NULL);
debug("%s: %dx%d@%s\n", __func__, uc_priv->xsize, uc_priv->ysize, format);