Lines Matching refs:wpf
29 static inline u32 vsp1_wpf_read(struct vsp1_rwpf *wpf, u32 reg) in vsp1_wpf_read() argument
31 return vsp1_read(wpf->entity.vsp1, in vsp1_wpf_read()
32 reg + wpf->entity.index * VI6_WPF_OFFSET); in vsp1_wpf_read()
35 static inline void vsp1_wpf_write(struct vsp1_rwpf *wpf, u32 reg, u32 data) in vsp1_wpf_write() argument
37 vsp1_write(wpf->entity.vsp1, in vsp1_wpf_write()
38 reg + wpf->entity.index * VI6_WPF_OFFSET, data); in vsp1_wpf_write()
47 struct vsp1_rwpf *wpf = in wpf_s_ctrl() local
51 if (!vsp1_entity_is_streaming(&wpf->entity)) in wpf_s_ctrl()
56 value = vsp1_wpf_read(wpf, VI6_WPF_OUTFMT); in wpf_s_ctrl()
59 vsp1_wpf_write(wpf, VI6_WPF_OUTFMT, value); in wpf_s_ctrl()
77 struct vsp1_rwpf *wpf = to_rwpf(subdev); in wpf_s_stream() local
78 struct vsp1_device *vsp1 = wpf->entity.vsp1; in wpf_s_stream()
79 const struct v4l2_rect *crop = &wpf->crop; in wpf_s_stream()
85 ret = vsp1_entity_set_streaming(&wpf->entity, enable); in wpf_s_stream()
90 vsp1_write(vsp1, VI6_WPF_IRQ_ENB(wpf->entity.index), 0); in wpf_s_stream()
91 vsp1_wpf_write(wpf, VI6_WPF_SRCRPF, 0); in wpf_s_stream()
111 vsp1_wpf_write(wpf, VI6_WPF_SRCRPF, srcrpf); in wpf_s_stream()
115 struct v4l2_pix_format_mplane *format = &wpf->video.format; in wpf_s_stream()
117 vsp1_wpf_write(wpf, VI6_WPF_DSTM_STRIDE_Y, in wpf_s_stream()
120 vsp1_wpf_write(wpf, VI6_WPF_DSTM_STRIDE_C, in wpf_s_stream()
124 vsp1_wpf_write(wpf, VI6_WPF_HSZCLIP, VI6_WPF_SZCLIP_EN | in wpf_s_stream()
127 vsp1_wpf_write(wpf, VI6_WPF_VSZCLIP, VI6_WPF_SZCLIP_EN | in wpf_s_stream()
133 const struct vsp1_format_info *fmtinfo = wpf->video.fmtinfo; in wpf_s_stream()
144 vsp1_wpf_write(wpf, VI6_WPF_DSWAP, fmtinfo->swap); in wpf_s_stream()
147 if (wpf->entity.formats[RWPF_PAD_SINK].code != in wpf_s_stream()
148 wpf->entity.formats[RWPF_PAD_SOURCE].code) in wpf_s_stream()
154 mutex_lock(wpf->ctrls.lock); in wpf_s_stream()
155 outfmt |= vsp1_wpf_read(wpf, VI6_WPF_OUTFMT) & VI6_WPF_OUTFMT_PDV_MASK; in wpf_s_stream()
156 vsp1_wpf_write(wpf, VI6_WPF_OUTFMT, outfmt); in wpf_s_stream()
157 mutex_unlock(wpf->ctrls.lock); in wpf_s_stream()
159 vsp1_write(vsp1, VI6_DPR_WPF_FPORCH(wpf->entity.index), in wpf_s_stream()
165 vsp1_write(vsp1, VI6_WPF_IRQ_STA(wpf->entity.index), 0); in wpf_s_stream()
166 vsp1_write(vsp1, VI6_WPF_IRQ_ENB(wpf->entity.index), in wpf_s_stream()
201 struct vsp1_rwpf *wpf = container_of(video, struct vsp1_rwpf, video); in wpf_vdev_queue() local
203 vsp1_wpf_write(wpf, VI6_WPF_DSTM_ADDR_Y, buf->addr[0]); in wpf_vdev_queue()
205 vsp1_wpf_write(wpf, VI6_WPF_DSTM_ADDR_C0, buf->addr[1]); in wpf_vdev_queue()
207 vsp1_wpf_write(wpf, VI6_WPF_DSTM_ADDR_C1, buf->addr[2]); in wpf_vdev_queue()
222 struct vsp1_rwpf *wpf; in vsp1_wpf_create() local
226 wpf = devm_kzalloc(vsp1->dev, sizeof(*wpf), GFP_KERNEL); in vsp1_wpf_create()
227 if (wpf == NULL) in vsp1_wpf_create()
230 wpf->max_width = WPF_MAX_WIDTH; in vsp1_wpf_create()
231 wpf->max_height = WPF_MAX_HEIGHT; in vsp1_wpf_create()
233 wpf->entity.type = VSP1_ENTITY_WPF; in vsp1_wpf_create()
234 wpf->entity.index = index; in vsp1_wpf_create()
236 ret = vsp1_entity_init(vsp1, &wpf->entity, 2); in vsp1_wpf_create()
241 subdev = &wpf->entity.subdev; in vsp1_wpf_create()
248 v4l2_set_subdevdata(subdev, wpf); in vsp1_wpf_create()
254 v4l2_ctrl_handler_init(&wpf->ctrls, 1); in vsp1_wpf_create()
255 v4l2_ctrl_new_std(&wpf->ctrls, &wpf_ctrl_ops, V4L2_CID_ALPHA_COMPONENT, in vsp1_wpf_create()
258 wpf->entity.subdev.ctrl_handler = &wpf->ctrls; in vsp1_wpf_create()
260 if (wpf->ctrls.error) { in vsp1_wpf_create()
263 ret = wpf->ctrls.error; in vsp1_wpf_create()
268 video = &wpf->video; in vsp1_wpf_create()
274 ret = vsp1_video_init(video, &wpf->entity); in vsp1_wpf_create()
278 wpf->entity.video = video; in vsp1_wpf_create()
287 ret = media_entity_create_link(&wpf->entity.subdev.entity, in vsp1_wpf_create()
289 &wpf->video.video.entity, 0, flags); in vsp1_wpf_create()
293 wpf->entity.sink = &wpf->video.video.entity; in vsp1_wpf_create()
295 return wpf; in vsp1_wpf_create()
298 vsp1_entity_destroy(&wpf->entity); in vsp1_wpf_create()