Lines Matching defs:pool
7 #include "ipu3-css-pool.h"
25 void imgu_css_pool_cleanup(struct imgu_device *imgu, struct imgu_css_pool *pool)
30 imgu_dmamap_free(imgu, &pool->entry[i].param);
33 int imgu_css_pool_init(struct imgu_device *imgu, struct imgu_css_pool *pool,
39 pool->entry[i].valid = false;
41 pool->entry[i].param.vaddr = NULL;
45 if (!imgu_dmamap_alloc(imgu, &pool->entry[i].param, size))
49 pool->last = IPU3_CSS_POOL_SIZE;
54 imgu_css_pool_cleanup(imgu, pool);
59 * Allocate a new parameter via recycling the oldest entry in the pool.
61 void imgu_css_pool_get(struct imgu_css_pool *pool)
64 u32 n = (pool->last + 1) % IPU3_CSS_POOL_SIZE;
66 pool->entry[n].valid = true;
67 pool->last = n;
73 void imgu_css_pool_put(struct imgu_css_pool *pool)
75 pool->entry[pool->last].valid = false;
76 pool->last = (pool->last + IPU3_CSS_POOL_SIZE - 1) % IPU3_CSS_POOL_SIZE;
80 * imgu_css_pool_last - Retrieve the nth pool entry from last
82 * @pool: a pointer to &struct imgu_css_pool.
89 imgu_css_pool_last(struct imgu_css_pool *pool, unsigned int n)
92 int i = (pool->last + IPU3_CSS_POOL_SIZE - n) % IPU3_CSS_POOL_SIZE;
96 if (!pool->entry[i].valid)
99 return &pool->entry[i].param;