summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDirk Eibach <dirk.eibach@gdsys.cc>2016-06-02 07:05:40 (GMT)
committerTom Rini <trini@konsulko.com>2016-06-06 17:39:13 (GMT)
commitdf3223f9f78a2d841c10fe5037f11bd28c03b6a5 (patch)
treecea316392c139f5387b6f77b5fe6d39f28d9fd05
parent52b13f275e0c1c2e1fb1e367a01614137baf64ce (diff)
downloadu-boot-df3223f9f78a2d841c10fe5037f11bd28c03b6a5.tar.xz
gdsys: osd: Allow osdsize on valid screens only
Limit "osdsize"-command to access valid screens only. Signed-off-by: Dirk Eibach <dirk.eibach@gdsys.cc> Reviewed-by: Tom Rini <trini@konsulko.com>
-rw-r--r--board/gdsys/common/osd.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/board/gdsys/common/osd.c b/board/gdsys/common/osd.c
index 4e292f5..add9574 100644
--- a/board/gdsys/common/osd.c
+++ b/board/gdsys/common/osd.c
@@ -469,6 +469,9 @@ int osd_size(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
}
for (screen = 0; screen < MAX_OSD_SCREEN; ++screen) {
+ if (!(osd_screen_mask & (1 << screen)))
+ continue;
+
OSD_SET_REG(screen, xy_size, ((x - 1) << 8) | (y - 1));
OSD_SET_REG(screen, x_pos, 32767 * (640 - 12 * x) / 65535);
OSD_SET_REG(screen, y_pos, 32767 * (480 - 18 * y) / 65535);