Lines Matching refs:ctx

126 void bdisp_hw_free_nodes(struct bdisp_ctx *ctx)  in bdisp_hw_free_nodes()  argument
128 if (ctx && ctx->node[0]) { in bdisp_hw_free_nodes()
132 dma_free_attrs(ctx->bdisp_dev->dev, in bdisp_hw_free_nodes()
134 ctx->node[0], ctx->node_paddr[0], &attrs); in bdisp_hw_free_nodes()
147 int bdisp_hw_alloc_nodes(struct bdisp_ctx *ctx) in bdisp_hw_alloc_nodes() argument
149 struct device *dev = ctx->bdisp_dev->dev; in bdisp_hw_alloc_nodes()
167 ctx->node[i] = base; in bdisp_hw_alloc_nodes()
168 ctx->node_paddr[i] = paddr; in bdisp_hw_alloc_nodes()
169 dev_dbg(dev, "node[%d]=0x%p (paddr=%pad)\n", i, ctx->node[i], in bdisp_hw_alloc_nodes()
333 static int bdisp_hw_get_hv_inc(struct bdisp_ctx *ctx, u16 *h_inc, u16 *v_inc) in bdisp_hw_get_hv_inc() argument
337 src_w = ctx->src.crop.width; in bdisp_hw_get_hv_inc()
338 src_h = ctx->src.crop.height; in bdisp_hw_get_hv_inc()
339 dst_w = ctx->dst.crop.width; in bdisp_hw_get_hv_inc()
340 dst_h = ctx->dst.crop.height; in bdisp_hw_get_hv_inc()
344 dev_err(ctx->bdisp_dev->dev, in bdisp_hw_get_hv_inc()
363 static int bdisp_hw_get_op_cfg(struct bdisp_ctx *ctx, struct bdisp_op_cfg *c) in bdisp_hw_get_op_cfg() argument
365 struct device *dev = ctx->bdisp_dev->dev; in bdisp_hw_get_op_cfg()
366 struct bdisp_frame *src = &ctx->src; in bdisp_hw_get_op_cfg()
367 struct bdisp_frame *dst = &ctx->dst; in bdisp_hw_get_op_cfg()
376 c->hflip = ctx->hflip; in bdisp_hw_get_op_cfg()
377 c->vflip = ctx->vflip; in bdisp_hw_get_op_cfg()
393 if (bdisp_hw_get_hv_inc(ctx, &c->h_inc, &c->v_inc)) { in bdisp_hw_get_op_cfg()
462 static void bdisp_hw_build_node(struct bdisp_ctx *ctx, in bdisp_hw_build_node() argument
467 struct bdisp_frame *src = &ctx->src; in bdisp_hw_build_node()
468 struct bdisp_frame *dst = &ctx->dst; in bdisp_hw_build_node()
477 dev_dbg(ctx->bdisp_dev->dev, "%s\n", __func__); in bdisp_hw_build_node()
486 dst_x_offset = (src_x_offset * dst_width) / ctx->src.crop.width; in bdisp_hw_build_node()
488 dst_rect.width = (src_rect.width * dst_width) / ctx->src.crop.width; in bdisp_hw_build_node()
697 static int bdisp_hw_build_all_nodes(struct bdisp_ctx *ctx) in bdisp_hw_build_all_nodes() argument
704 if (!ctx->node[i]) { in bdisp_hw_build_all_nodes()
705 dev_err(ctx->bdisp_dev->dev, "node %d is null\n", i); in bdisp_hw_build_all_nodes()
710 if (bdisp_hw_get_op_cfg(ctx, &cfg)) in bdisp_hw_build_all_nodes()
716 bdisp_hw_build_node(ctx, &cfg, ctx->node[nid], in bdisp_hw_build_all_nodes()
720 ctx->node[nid - 1]->nip = ctx->node_paddr[nid]; in bdisp_hw_build_all_nodes()
725 bdisp_hw_build_node(ctx, &cfg, ctx->node[nid], in bdisp_hw_build_all_nodes()
727 ctx->node[nid - 1]->nip = ctx->node_paddr[nid]; in bdisp_hw_build_all_nodes()
733 if (src_x_offset >= ctx->src.crop.width) in bdisp_hw_build_all_nodes()
738 ctx->node[nid - 1]->nip = 0; in bdisp_hw_build_all_nodes()
752 static void bdisp_hw_save_request(struct bdisp_ctx *ctx) in bdisp_hw_save_request() argument
754 struct bdisp_node **copy_node = ctx->bdisp_dev->dbg.copy_node; in bdisp_hw_save_request()
755 struct bdisp_request *request = &ctx->bdisp_dev->dbg.copy_request; in bdisp_hw_save_request()
756 struct bdisp_node **node = ctx->node; in bdisp_hw_save_request()
760 request->src = ctx->src; in bdisp_hw_save_request()
761 request->dst = ctx->dst; in bdisp_hw_save_request()
762 request->hflip = ctx->hflip; in bdisp_hw_save_request()
763 request->vflip = ctx->vflip; in bdisp_hw_save_request()
770 copy_node[i] = devm_kzalloc(ctx->bdisp_dev->dev, in bdisp_hw_save_request()
789 int bdisp_hw_update(struct bdisp_ctx *ctx) in bdisp_hw_update() argument
792 struct bdisp_dev *bdisp = ctx->bdisp_dev; in bdisp_hw_update()
799 ret = bdisp_hw_build_all_nodes(ctx); in bdisp_hw_update()
806 bdisp_hw_save_request(ctx); in bdisp_hw_update()
813 writel(ctx->node_paddr[0], bdisp->regs + BLT_AQ1_IP); in bdisp_hw_update()
817 if (!ctx->node[node_id]->nip) in bdisp_hw_update()
820 writel(ctx->node_paddr[node_id], bdisp->regs + BLT_AQ1_LNA); in bdisp_hw_update()