aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLajos Molnar <molnar@ti.com>2010-06-29 04:17:10 -0400
committerPaolo Pisati <paolo.pisati@canonical.com>2012-08-17 04:18:56 -0400
commitbdaecc435e668cc39db7dd9fffe850bf36ce8927 (patch)
tree5b472668bf120062a5c465db1fa38bb931b5cbd8
parent7ee91358245979ad85fdb577c77d0fb2636d0cb0 (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>
-rw-r--r--drivers/media/video/tiler/tiler.c10
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,
309/* (must have mutex) adds a block to an area with certain x coordinates */ 309/* (must have mutex) adds a block to an area with certain x coordinates */
310static inline 310static inline
311struct mem_info *_m_add2area(struct mem_info *mi, struct area_info *ai, 311struct mem_info *_m_add2area(struct mem_info *mi, struct area_info *ai,
312 u16 x0, u16 x1, struct list_head *before) 312 u16 x0, u16 w, struct list_head *before)
313{ 313{
314 mi->parent = ai; 314 mi->parent = ai;
315 mi->area = ai->area; 315 mi->area = ai->area;
316 mi->area.p0.x = x0; 316 mi->area.p0.x = x0;
317 mi->area.p1.x = x1; 317 mi->area.p1.x = x0 + w - 1;
318 list_add_tail(&mi->by_area, before); 318 list_add_tail(&mi->by_area, before);
319 ai->nblocks++; 319 ai->nblocks++;
320 return mi; 320 return mi;
@@ -359,7 +359,7 @@ static struct mem_info *get_2d_area(u16 w, u16 h, u16 align, u16 offs, u16 band,
359 tcm_aheight(ai->area) == h) { 359 tcm_aheight(ai->area) == h) {
360 x = _m_blk_find_fit(w, align, offs, ai, &before); 360 x = _m_blk_find_fit(w, align, offs, ai, &before);
361 if (x) { 361 if (x) {
362 _m_add2area(mi, ai, x - w, x - 1, before); 362 _m_add2area(mi, ai, x - w, w, before);
363 goto done; 363 goto done;
364 } 364 }
365 } 365 }
@@ -370,9 +370,7 @@ static struct mem_info *get_2d_area(u16 w, u16 h, u16 align, u16 offs, u16 band,
370 ai = area_new_m(ALIGN(w + offs, max(band, align)), h, 370 ai = area_new_m(ALIGN(w + offs, max(band, align)), h,
371 max(band, align), tcm, gi); 371 max(band, align), tcm, gi);
372 if (ai) { 372 if (ai) {
373 _m_add2area(mi, ai, ai->area.p0.x + offs, 373 _m_add2area(mi, ai, ai->area.p0.x + offs, w, &ai->blocks);
374 ai->area.p0.x + offs + w - 1,
375 &ai->blocks);
376 } else { 374 } else {
377 /* clean up */ 375 /* clean up */
378 kfree(mi); 376 kfree(mi);