Lines Matching refs:rpf

29 static inline u32 vsp1_rpf_read(struct vsp1_rwpf *rpf, u32 reg)  in vsp1_rpf_read()  argument
31 return vsp1_read(rpf->entity.vsp1, in vsp1_rpf_read()
32 reg + rpf->entity.index * VI6_RPF_OFFSET); in vsp1_rpf_read()
35 static inline void vsp1_rpf_write(struct vsp1_rwpf *rpf, u32 reg, u32 data) in vsp1_rpf_write() argument
37 vsp1_write(rpf->entity.vsp1, in vsp1_rpf_write()
38 reg + rpf->entity.index * VI6_RPF_OFFSET, data); in vsp1_rpf_write()
47 struct vsp1_rwpf *rpf = in rpf_s_ctrl() local
51 if (!vsp1_entity_is_streaming(&rpf->entity)) in rpf_s_ctrl()
56 vsp1_rpf_write(rpf, VI6_RPF_VRTCOL_SET, in rpf_s_ctrl()
59 pipe = to_vsp1_pipeline(&rpf->entity.subdev.entity); in rpf_s_ctrl()
60 vsp1_pipeline_propagate_alpha(pipe, &rpf->entity, ctrl->val); in rpf_s_ctrl()
77 struct vsp1_rwpf *rpf = to_rwpf(subdev); in rpf_s_stream() local
78 const struct vsp1_format_info *fmtinfo = rpf->video.fmtinfo; in rpf_s_stream()
79 const struct v4l2_pix_format_mplane *format = &rpf->video.format; in rpf_s_stream()
80 const struct v4l2_rect *crop = &rpf->crop; in rpf_s_stream()
85 ret = vsp1_entity_set_streaming(&rpf->entity, enable); in rpf_s_stream()
98 vsp1_rpf_write(rpf, VI6_RPF_SRC_BSIZE, in rpf_s_stream()
101 vsp1_rpf_write(rpf, VI6_RPF_SRC_ESIZE, in rpf_s_stream()
105 rpf->offsets[0] = crop->top * format->plane_fmt[0].bytesperline in rpf_s_stream()
110 vsp1_rpf_write(rpf, VI6_RPF_SRCM_ADDR_Y, in rpf_s_stream()
111 rpf->buf_addr[0] + rpf->offsets[0]); in rpf_s_stream()
114 rpf->offsets[1] = crop->top * format->plane_fmt[1].bytesperline in rpf_s_stream()
119 vsp1_rpf_write(rpf, VI6_RPF_SRCM_ADDR_C0, in rpf_s_stream()
120 rpf->buf_addr[1] + rpf->offsets[1]); in rpf_s_stream()
123 vsp1_rpf_write(rpf, VI6_RPF_SRCM_ADDR_C1, in rpf_s_stream()
124 rpf->buf_addr[2] + rpf->offsets[1]); in rpf_s_stream()
127 vsp1_rpf_write(rpf, VI6_RPF_SRCM_PSTRIDE, pstride); in rpf_s_stream()
138 if (rpf->entity.formats[RWPF_PAD_SINK].code != in rpf_s_stream()
139 rpf->entity.formats[RWPF_PAD_SOURCE].code) in rpf_s_stream()
142 vsp1_rpf_write(rpf, VI6_RPF_INFMT, infmt); in rpf_s_stream()
143 vsp1_rpf_write(rpf, VI6_RPF_DSWAP, fmtinfo->swap); in rpf_s_stream()
146 vsp1_rpf_write(rpf, VI6_RPF_LOC, in rpf_s_stream()
147 (rpf->location.left << VI6_RPF_LOC_HCOORD_SHIFT) | in rpf_s_stream()
148 (rpf->location.top << VI6_RPF_LOC_VCOORD_SHIFT)); in rpf_s_stream()
154 vsp1_rpf_write(rpf, VI6_RPF_ALPH_SEL, VI6_RPF_ALPH_SEL_AEXT_EXT | in rpf_s_stream()
157 vsp1_rpf_write(rpf, VI6_RPF_MSK_CTRL, 0); in rpf_s_stream()
158 vsp1_rpf_write(rpf, VI6_RPF_CKEY_CTRL, 0); in rpf_s_stream()
192 struct vsp1_rwpf *rpf = container_of(video, struct vsp1_rwpf, video); in rpf_vdev_queue() local
196 rpf->buf_addr[i] = buf->addr[i]; in rpf_vdev_queue()
198 if (!vsp1_entity_is_streaming(&rpf->entity)) in rpf_vdev_queue()
201 vsp1_rpf_write(rpf, VI6_RPF_SRCM_ADDR_Y, in rpf_vdev_queue()
202 buf->addr[0] + rpf->offsets[0]); in rpf_vdev_queue()
204 vsp1_rpf_write(rpf, VI6_RPF_SRCM_ADDR_C0, in rpf_vdev_queue()
205 buf->addr[1] + rpf->offsets[1]); in rpf_vdev_queue()
207 vsp1_rpf_write(rpf, VI6_RPF_SRCM_ADDR_C1, in rpf_vdev_queue()
208 buf->addr[2] + rpf->offsets[1]); in rpf_vdev_queue()
223 struct vsp1_rwpf *rpf; in vsp1_rpf_create() local
226 rpf = devm_kzalloc(vsp1->dev, sizeof(*rpf), GFP_KERNEL); in vsp1_rpf_create()
227 if (rpf == NULL) in vsp1_rpf_create()
230 rpf->max_width = RPF_MAX_WIDTH; in vsp1_rpf_create()
231 rpf->max_height = RPF_MAX_HEIGHT; in vsp1_rpf_create()
233 rpf->entity.type = VSP1_ENTITY_RPF; in vsp1_rpf_create()
234 rpf->entity.index = index; in vsp1_rpf_create()
236 ret = vsp1_entity_init(vsp1, &rpf->entity, 2); in vsp1_rpf_create()
241 subdev = &rpf->entity.subdev; in vsp1_rpf_create()
248 v4l2_set_subdevdata(subdev, rpf); in vsp1_rpf_create()
254 v4l2_ctrl_handler_init(&rpf->ctrls, 1); in vsp1_rpf_create()
255 v4l2_ctrl_new_std(&rpf->ctrls, &rpf_ctrl_ops, V4L2_CID_ALPHA_COMPONENT, in vsp1_rpf_create()
258 rpf->entity.subdev.ctrl_handler = &rpf->ctrls; in vsp1_rpf_create()
260 if (rpf->ctrls.error) { in vsp1_rpf_create()
263 ret = rpf->ctrls.error; in vsp1_rpf_create()
268 video = &rpf->video; in vsp1_rpf_create()
274 ret = vsp1_video_init(video, &rpf->entity); in vsp1_rpf_create()
278 rpf->entity.video = video; in vsp1_rpf_create()
281 ret = media_entity_create_link(&rpf->video.video.entity, 0, in vsp1_rpf_create()
282 &rpf->entity.subdev.entity, in vsp1_rpf_create()
289 return rpf; in vsp1_rpf_create()
292 vsp1_entity_destroy(&rpf->entity); in vsp1_rpf_create()