drm/exynos: fix size check in g2d_check_buf_desc_is_valid()
authorTobias Jakobi <tjakobi@math.uni-bielefeld.de>
Mon, 17 Aug 2015 22:51:24 +0000 (00:51 +0200)
committerInki Dae <daeinki@gmail.com>
Wed, 2 Sep 2015 14:10:28 +0000 (23:10 +0900)
commit179239a7ae805f7695167c62a97eac3efe52d7af
tree5228ad4284d25b58c1bd41a75ce41ab46a24570c
parent879a37d00f1882b1e56a66e626af4194d592d257
drm/exynos: fix size check in g2d_check_buf_desc_is_valid()

The size check was incomplete. It only computed the
size of area of the drawing rectangle and checked if
the size still fit inside the buffer.

The correct check is to compute the position of the
last byte that the G2D engine is going to access and
then check if that position is still contained in the
buffer. In particular we need the stride information
to determine this.

Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
drivers/gpu/drm/exynos/exynos_drm_g2d.c