diff options
author | Lajos Molnar <molnar@ti.com> | 2011-04-07 08:41:10 +0100 |
---|---|---|
committer | Andy Green <andy.green@linaro.org> | 2011-04-07 08:41:10 +0100 |
commit | d8342be7676acf3d4be1a178f1685f80b06f33bd (patch) | |
tree | d917ce5fa9334febc4969dfa782b88b46b5b3e98 /drivers/media/video/tiler | |
parent | 6f8b2b3f0afb4d753ba64dab894817839fc32da4 (diff) |
TILER: Simplify _m_add2area parameters.
Change x1 (end-x-coord) parameter to width. This simplifies the
use of this method with complex starting-x-coordinates.
Signed-off-by: Lajos Molnar <molnar@ti.com>
Diffstat (limited to 'drivers/media/video/tiler')
-rw-r--r-- | drivers/media/video/tiler/tiler.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/media/video/tiler/tiler.c b/drivers/media/video/tiler/tiler.c index 36db4486bb6..6fdd409fc2e 100644 --- a/drivers/media/video/tiler/tiler.c +++ b/drivers/media/video/tiler/tiler.c @@ -309,12 +309,12 @@ static u16 _m_blk_find_fit(u16 w, u16 align, u16 offs, /* (must have mutex) adds a block to an area with certain x coordinates */ static inline struct mem_info *_m_add2area(struct mem_info *mi, struct area_info *ai, - u16 x0, u16 x1, struct list_head *before) + u16 x0, u16 w, struct list_head *before) { mi->parent = ai; mi->area = ai->area; mi->area.p0.x = x0; - mi->area.p1.x = x1; + mi->area.p1.x = x0 + w - 1; list_add_tail(&mi->by_area, before); ai->nblocks++; return mi; @@ -359,7 +359,7 @@ static struct mem_info *get_2d_area(u16 w, u16 h, u16 align, u16 offs, u16 band, tcm_aheight(ai->area) == h) { x = _m_blk_find_fit(w, align, offs, ai, &before); if (x) { - _m_add2area(mi, ai, x - w, x - 1, before); + _m_add2area(mi, ai, x - w, w, before); goto done; } } @@ -370,9 +370,7 @@ static struct mem_info *get_2d_area(u16 w, u16 h, u16 align, u16 offs, u16 band, ai = area_new_m(ALIGN(w + offs, max(band, align)), h, max(band, align), tcm, gi); if (ai) { - _m_add2area(mi, ai, ai->area.p0.x + offs, - ai->area.p0.x + offs + w - 1, - &ai->blocks); + _m_add2area(mi, ai, ai->area.p0.x + offs, w, &ai->blocks); } else { /* clean up */ kfree(mi); |