summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/video/tegra/dc/overlay.c15
-rw-r--r--drivers/video/tegra/fb.c15
2 files changed, 19 insertions, 11 deletions
diff --git a/drivers/video/tegra/dc/overlay.c b/drivers/video/tegra/dc/overlay.c
index c915c2d78b63..47a6f498938f 100644
--- a/drivers/video/tegra/dc/overlay.c
+++ b/drivers/video/tegra/dc/overlay.c
@@ -159,11 +159,16 @@ static int tegra_overlay_set_windowattr(struct tegra_overlay_info *overlay,
win->out_w = flip_win->attr.out_w;
win->out_h = flip_win->attr.out_h;
- if (((win->out_x + win->out_w) > xres) && (win->out_x < xres))
- win->out_w = xres - win->out_x;
-
- if (((win->out_y + win->out_h) > yres) && (win->out_y < yres))
- win->out_h = yres - win->out_y;
+ if ((((win->out_x + win->out_w) > xres) && (win->out_x < xres)) ||
+ (((win->out_y + win->out_h) > yres) && (win->out_y < yres))) {
+ pr_warning("outside of FB: "
+ "FB=(%d,%d,%d,%d) "
+ "src=(%d,%d,%d,%d) ",
+ "dst=(%d,%d,%d,%d)",
+ 0, 0, xres, yres,
+ win->x, win->y, win->w, win->h,
+ win->out_x, win->out_y, win->out_w, win->out_h);
+ }
win->z = flip_win->attr.z;
win->cur_handle = flip_win->handle;
diff --git a/drivers/video/tegra/fb.c b/drivers/video/tegra/fb.c
index e64039a7743c..3d22f8fc8c98 100644
--- a/drivers/video/tegra/fb.c
+++ b/drivers/video/tegra/fb.c
@@ -417,12 +417,15 @@ static int tegra_fb_set_windowattr(struct tegra_fb_info *tegra_fb,
win->out_w = flip_win->attr.out_w;
win->out_h = flip_win->attr.out_h;
- if (((win->out_x + win->out_w) > xres) && (win->out_x < xres)) {
- win->out_w = xres - win->out_x;
- }
-
- if (((win->out_y + win->out_h) > yres) && (win->out_y < yres)) {
- win->out_h = yres - win->out_y;
+ if ((((win->out_x + win->out_w) > xres) && (win->out_x < xres)) ||
+ (((win->out_y + win->out_h) > yres) && (win->out_y < yres))) {
+ pr_warning("outside of FB: "
+ "FB=(%d,%d,%d,%d) "
+ "src=(%d,%d,%d,%d) ",
+ "dst=(%d,%d,%d,%d)",
+ 0, 0, xres, yres,
+ win->x, win->y, win->w, win->h,
+ win->out_x, win->out_y, win->out_w, win->out_h);
}
win->z = flip_win->attr.z;