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