• Home
  • Raw
  • Download

Lines Matching refs:ic

164 static inline u32 ipu_ic_read(struct ipu_ic *ic, unsigned offset)  in ipu_ic_read()  argument
166 return readl(ic->priv->base + offset); in ipu_ic_read()
169 static inline void ipu_ic_write(struct ipu_ic *ic, u32 value, unsigned offset) in ipu_ic_write() argument
171 writel(value, ic->priv->base + offset); in ipu_ic_write()
174 static int init_csc(struct ipu_ic *ic, in init_csc() argument
178 struct ipu_ic_priv *priv = ic->priv; in init_csc()
185 (priv->tpmem_base + ic->reg->tpmem_csc[csc_index]); in init_csc()
216 static int calc_resize_coeffs(struct ipu_ic *ic, in calc_resize_coeffs() argument
221 struct ipu_ic_priv *priv = ic->priv; in calc_resize_coeffs()
268 void ipu_ic_task_enable(struct ipu_ic *ic) in ipu_ic_task_enable() argument
270 struct ipu_ic_priv *priv = ic->priv; in ipu_ic_task_enable()
276 ic_conf = ipu_ic_read(ic, IC_CONF); in ipu_ic_task_enable()
278 ic_conf |= ic->bit->ic_conf_en; in ipu_ic_task_enable()
280 if (ic->rotation) in ipu_ic_task_enable()
281 ic_conf |= ic->bit->ic_conf_rot_en; in ipu_ic_task_enable()
283 if (ic->in_cs.cs != ic->out_cs.cs) in ipu_ic_task_enable()
284 ic_conf |= ic->bit->ic_conf_csc1_en; in ipu_ic_task_enable()
286 if (ic->graphics) { in ipu_ic_task_enable()
287 ic_conf |= ic->bit->ic_conf_cmb_en; in ipu_ic_task_enable()
288 ic_conf |= ic->bit->ic_conf_csc1_en; in ipu_ic_task_enable()
290 if (ic->g_in_cs.cs != ic->out_cs.cs) in ipu_ic_task_enable()
291 ic_conf |= ic->bit->ic_conf_csc2_en; in ipu_ic_task_enable()
294 ipu_ic_write(ic, ic_conf, IC_CONF); in ipu_ic_task_enable()
300 void ipu_ic_task_disable(struct ipu_ic *ic) in ipu_ic_task_disable() argument
302 struct ipu_ic_priv *priv = ic->priv; in ipu_ic_task_disable()
308 ic_conf = ipu_ic_read(ic, IC_CONF); in ipu_ic_task_disable()
310 ic_conf &= ~(ic->bit->ic_conf_en | in ipu_ic_task_disable()
311 ic->bit->ic_conf_csc1_en | in ipu_ic_task_disable()
312 ic->bit->ic_conf_rot_en); in ipu_ic_task_disable()
313 if (ic->bit->ic_conf_csc2_en) in ipu_ic_task_disable()
314 ic_conf &= ~ic->bit->ic_conf_csc2_en; in ipu_ic_task_disable()
315 if (ic->bit->ic_conf_cmb_en) in ipu_ic_task_disable()
316 ic_conf &= ~ic->bit->ic_conf_cmb_en; in ipu_ic_task_disable()
318 ipu_ic_write(ic, ic_conf, IC_CONF); in ipu_ic_task_disable()
324 int ipu_ic_task_graphics_init(struct ipu_ic *ic, in ipu_ic_task_graphics_init() argument
329 struct ipu_ic_priv *priv = ic->priv; in ipu_ic_task_graphics_init()
335 if (ic->task == IC_TASK_ENCODER) in ipu_ic_task_graphics_init()
340 ic_conf = ipu_ic_read(ic, IC_CONF); in ipu_ic_task_graphics_init()
342 if (!(ic_conf & ic->bit->ic_conf_csc1_en)) { in ipu_ic_task_graphics_init()
356 ret = init_csc(ic, &csc1, 0); in ipu_ic_task_graphics_init()
361 ic->g_in_cs = *g_in_cs; in ipu_ic_task_graphics_init()
362 csc2.in_cs = ic->g_in_cs; in ipu_ic_task_graphics_init()
363 csc2.out_cs = ic->out_cs; in ipu_ic_task_graphics_init()
369 ret = init_csc(ic, &csc2, 1); in ipu_ic_task_graphics_init()
375 reg = ipu_ic_read(ic, IC_CMBP_1); in ipu_ic_task_graphics_init()
376 reg &= ~(0xff << ic->bit->ic_cmb_galpha_bit); in ipu_ic_task_graphics_init()
377 reg |= (galpha << ic->bit->ic_cmb_galpha_bit); in ipu_ic_task_graphics_init()
378 ipu_ic_write(ic, reg, IC_CMBP_1); in ipu_ic_task_graphics_init()
384 ipu_ic_write(ic, colorkey, IC_CMBP_2); in ipu_ic_task_graphics_init()
388 ipu_ic_write(ic, ic_conf, IC_CONF); in ipu_ic_task_graphics_init()
390 ic->graphics = true; in ipu_ic_task_graphics_init()
397 int ipu_ic_task_init_rsc(struct ipu_ic *ic, in ipu_ic_task_init_rsc() argument
403 struct ipu_ic_priv *priv = ic->priv; in ipu_ic_task_init_rsc()
411 ret = calc_resize_coeffs(ic, in_height, out_height, in ipu_ic_task_init_rsc()
419 ret = calc_resize_coeffs(ic, in_width, out_width, in ipu_ic_task_init_rsc()
429 ipu_ic_write(ic, rsc, ic->reg->rsc); in ipu_ic_task_init_rsc()
432 ic->in_cs = csc->in_cs; in ipu_ic_task_init_rsc()
433 ic->out_cs = csc->out_cs; in ipu_ic_task_init_rsc()
435 ret = init_csc(ic, csc, 0); in ipu_ic_task_init_rsc()
441 int ipu_ic_task_init(struct ipu_ic *ic, in ipu_ic_task_init() argument
446 return ipu_ic_task_init_rsc(ic, csc, in ipu_ic_task_init()
452 int ipu_ic_task_idma_init(struct ipu_ic *ic, struct ipuv3_channel *channel, in ipu_ic_task_idma_init() argument
456 struct ipu_ic_priv *priv = ic->priv; in ipu_ic_task_idma_init()
477 ic_idmac_1 = ipu_ic_read(ic, IC_IDMAC_1); in ipu_ic_task_idma_init()
478 ic_idmac_2 = ipu_ic_read(ic, IC_IDMAC_2); in ipu_ic_task_idma_init()
479 ic_idmac_3 = ipu_ic_read(ic, IC_IDMAC_3); in ipu_ic_task_idma_init()
579 ipu_ic_write(ic, ic_idmac_1, IC_IDMAC_1); in ipu_ic_task_idma_init()
580 ipu_ic_write(ic, ic_idmac_2, IC_IDMAC_2); in ipu_ic_task_idma_init()
581 ipu_ic_write(ic, ic_idmac_3, IC_IDMAC_3); in ipu_ic_task_idma_init()
584 ic->rotation = true; in ipu_ic_task_idma_init()
592 static void ipu_irt_enable(struct ipu_ic *ic) in ipu_irt_enable() argument
594 struct ipu_ic_priv *priv = ic->priv; in ipu_irt_enable()
602 static void ipu_irt_disable(struct ipu_ic *ic) in ipu_irt_disable() argument
604 struct ipu_ic_priv *priv = ic->priv; in ipu_irt_disable()
612 int ipu_ic_enable(struct ipu_ic *ic) in ipu_ic_enable() argument
614 struct ipu_ic_priv *priv = ic->priv; in ipu_ic_enable()
624 if (ic->rotation) in ipu_ic_enable()
625 ipu_irt_enable(ic); in ipu_ic_enable()
633 int ipu_ic_disable(struct ipu_ic *ic) in ipu_ic_disable() argument
635 struct ipu_ic_priv *priv = ic->priv; in ipu_ic_disable()
648 if (ic->rotation) in ipu_ic_disable()
649 ipu_irt_disable(ic); in ipu_ic_disable()
651 ic->rotation = ic->graphics = false; in ipu_ic_disable()
663 struct ipu_ic *ic, *ret; in ipu_ic_get() local
668 ic = &priv->task[task]; in ipu_ic_get()
672 if (ic->in_use) { in ipu_ic_get()
677 ic->in_use = true; in ipu_ic_get()
678 ret = ic; in ipu_ic_get()
686 void ipu_ic_put(struct ipu_ic *ic) in ipu_ic_put() argument
688 struct ipu_ic_priv *priv = ic->priv; in ipu_ic_put()
692 ic->in_use = false; in ipu_ic_put()
735 void ipu_ic_dump(struct ipu_ic *ic) in ipu_ic_dump() argument
737 struct ipu_ic_priv *priv = ic->priv; in ipu_ic_dump()
741 ipu_ic_read(ic, IC_CONF)); in ipu_ic_dump()
743 ipu_ic_read(ic, IC_PRP_ENC_RSC)); in ipu_ic_dump()
745 ipu_ic_read(ic, IC_PRP_VF_RSC)); in ipu_ic_dump()
747 ipu_ic_read(ic, IC_PP_RSC)); in ipu_ic_dump()
749 ipu_ic_read(ic, IC_CMBP_1)); in ipu_ic_dump()
751 ipu_ic_read(ic, IC_CMBP_2)); in ipu_ic_dump()
753 ipu_ic_read(ic, IC_IDMAC_1)); in ipu_ic_dump()
755 ipu_ic_read(ic, IC_IDMAC_2)); in ipu_ic_dump()
757 ipu_ic_read(ic, IC_IDMAC_3)); in ipu_ic_dump()
759 ipu_ic_read(ic, IC_IDMAC_4)); in ipu_ic_dump()