~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to drivers/media/video/tiler/tcm.h

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
289
289
#define tcm_aheight(area) __tcm_area_height(&(area))
290
290
#define tcm_is_in(pt, area) __tcm_is_in(&(pt), &(area))
291
291
 
 
292
/* limit a 1D area to the first N pages */
 
293
static inline s32 tcm_1d_limit(struct tcm_area *a, u32 num_pg)
 
294
{
 
295
        if (__tcm_sizeof(a) < num_pg)
 
296
                return -ENOMEM;
 
297
        if (!num_pg)
 
298
                return -EINVAL;
 
299
 
 
300
        a->p1.x = (a->p0.x + num_pg - 1) % a->tcm->width;
 
301
        a->p1.y = a->p0.y + ((a->p0.x + num_pg - 1) / a->tcm->width);
 
302
        return 0;
 
303
}
 
304
 
292
305
/**
293
306
 * Iterate through 2D slices of a valid area. Behaves
294
307
 * syntactically as a for(;;) statement.