diff options
author | Donghan Ryu <dryu@nvidia.com> | 2011-04-18 23:59:11 +0900 |
---|---|---|
committer | Varun Colbert <vcolbert@nvidia.com> | 2011-04-19 20:59:40 -0700 |
commit | 1c20ecddb277b3d2798c558b37da07ef8684afd1 (patch) | |
tree | 2a3705f1f4f875c0df2da9329a8ae78ada7ca717 | |
parent | b2dee92789a143ca669954f015615da875f23cf6 (diff) |
video: tegra: dc: removed incorrect cropping code
there was a cropping code which saves from out of FB.However,
the cropping code was wrong and cropping should be done from
usermode driver instead of kernel. a warning is added here
for easy debugging
Bug 792524
Change-Id: Id57243e36f903b14a093dad23a6111032890c01a
Reviewed-on: http://git-master/r/28055
Reviewed-by: Donghan Ryu <dryu@nvidia.com>
Tested-by: Donghan Ryu <dryu@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
-rw-r--r-- | drivers/video/tegra/dc/overlay.c | 15 | ||||
-rw-r--r-- | drivers/video/tegra/fb.c | 15 |
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; |