aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/tiler/tiler-reserve.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/tiler/tiler-reserve.c')
-rw-r--r--drivers/media/video/tiler/tiler-reserve.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/media/video/tiler/tiler-reserve.c b/drivers/media/video/tiler/tiler-reserve.c
index c5a4f9c..1986363 100644
--- a/drivers/media/video/tiler/tiler-reserve.c
+++ b/drivers/media/video/tiler/tiler-reserve.c
@@ -77,16 +77,17 @@ u32 tiler_best2pack(u16 o, u16 a, u16 b, u16 w, u16 *n, u16 *_area)
/* reserve 2d blocks */
static void reserve_blocks(u32 n, enum tiler_fmt fmt, u32 width, u32 height,
- u32 gid,
+ u32 align, u32 offs, u32 gid,
struct security_info *si)
{
u32 bpt, res = 0, i;
- u16 a, band, w, h, n_try;
+ u16 o = offs, a = align, r = 0, band, w, h, n_try;
struct gid_info *gi;
const struct tiler_geom *g;
/* Check input parameters for correctness, and support */
if (!width || !height || !n ||
+ align > PAGE_SIZE || offs >= align ||
fmt < TILFMT_8BIT || fmt > TILFMT_32BIT)
return;
@@ -99,7 +100,7 @@ static void reserve_blocks(u32 n, enum tiler_fmt fmt, u32 width, u32 height,
* sufficient. Also check for basic area info.
*/
if (width * g->bpp * 2 <= PAGE_SIZE ||
- ops->analize(fmt, width, height, &w, &h, &band, &a))
+ ops->analize(fmt, width, height, &w, &h, &band, &a, &o, &r))
return;
/* get group id */
@@ -116,7 +117,7 @@ static void reserve_blocks(u32 n, enum tiler_fmt fmt, u32 width, u32 height,
res = -1;
while (n_try > 1) {
/* adjust res so we fail on 0 return value */
- res = ops->lay_2d(fmt, n_try, w, h, band, a,
+ res = ops->lay_2d(fmt, n_try, w, h, band, a, o,
gi, &gi->reserved) - 1;
if (res >= 0)
break;