Lines Matching refs:histo

36 vsp1_histogram_buffer_get(struct vsp1_histogram *histo)  in vsp1_histogram_buffer_get()  argument
41 spin_lock_irqsave(&histo->irqlock, flags); in vsp1_histogram_buffer_get()
43 if (list_empty(&histo->irqqueue)) in vsp1_histogram_buffer_get()
46 buf = list_first_entry(&histo->irqqueue, struct vsp1_histogram_buffer, in vsp1_histogram_buffer_get()
49 histo->readout = true; in vsp1_histogram_buffer_get()
52 spin_unlock_irqrestore(&histo->irqlock, flags); in vsp1_histogram_buffer_get()
56 void vsp1_histogram_buffer_complete(struct vsp1_histogram *histo, in vsp1_histogram_buffer_complete() argument
60 struct vsp1_pipeline *pipe = histo->entity.pipe; in vsp1_histogram_buffer_complete()
73 spin_lock_irqsave(&histo->irqlock, flags); in vsp1_histogram_buffer_complete()
74 histo->readout = false; in vsp1_histogram_buffer_complete()
75 wake_up(&histo->wait_queue); in vsp1_histogram_buffer_complete()
76 spin_unlock_irqrestore(&histo->irqlock, flags); in vsp1_histogram_buffer_complete()
87 struct vsp1_histogram *histo = vb2_get_drv_priv(vq); in histo_queue_setup() local
93 if (sizes[0] < histo->data_size) in histo_queue_setup()
100 sizes[0] = histo->data_size; in histo_queue_setup()
108 struct vsp1_histogram *histo = vb2_get_drv_priv(vb->vb2_queue); in histo_buffer_prepare() local
114 if (vb2_plane_size(vb, 0) < histo->data_size) in histo_buffer_prepare()
125 struct vsp1_histogram *histo = vb2_get_drv_priv(vb->vb2_queue); in histo_buffer_queue() local
129 spin_lock_irqsave(&histo->irqlock, flags); in histo_buffer_queue()
130 list_add_tail(&buf->queue, &histo->irqqueue); in histo_buffer_queue()
131 spin_unlock_irqrestore(&histo->irqlock, flags); in histo_buffer_queue()
141 struct vsp1_histogram *histo = vb2_get_drv_priv(vq); in histo_stop_streaming() local
145 spin_lock_irqsave(&histo->irqlock, flags); in histo_stop_streaming()
148 list_for_each_entry(buffer, &histo->irqqueue, queue) in histo_stop_streaming()
150 INIT_LIST_HEAD(&histo->irqqueue); in histo_stop_streaming()
153 wait_event_lock_irq(histo->wait_queue, !histo->readout, histo->irqlock); in histo_stop_streaming()
155 spin_unlock_irqrestore(&histo->irqlock, flags); in histo_stop_streaming()
176 struct vsp1_histogram *histo = subdev_to_histo(subdev); in histo_enum_mbus_code() local
183 return vsp1_subdev_enum_mbus_code(subdev, cfg, code, histo->formats, in histo_enum_mbus_code()
184 histo->num_formats); in histo_enum_mbus_code()
203 struct vsp1_histogram *histo = subdev_to_histo(subdev); in histo_get_selection() local
212 mutex_lock(&histo->entity.lock); in histo_get_selection()
214 config = vsp1_entity_get_pad_config(&histo->entity, cfg, sel->which); in histo_get_selection()
223 crop = vsp1_entity_get_pad_selection(&histo->entity, config, in histo_get_selection()
234 format = vsp1_entity_get_pad_format(&histo->entity, config, in histo_get_selection()
244 sel->r = *vsp1_entity_get_pad_selection(&histo->entity, config, in histo_get_selection()
254 mutex_unlock(&histo->entity.lock); in histo_get_selection()
262 struct vsp1_histogram *histo = subdev_to_histo(subdev); in histo_set_crop() local
267 format = vsp1_entity_get_pad_format(&histo->entity, config, in histo_set_crop()
277 selection = vsp1_entity_get_pad_selection(&histo->entity, config, in histo_set_crop()
281 selection = vsp1_entity_get_pad_selection(&histo->entity, config, in histo_set_crop()
293 struct vsp1_histogram *histo = subdev_to_histo(subdev); in histo_set_compose() local
306 crop = vsp1_entity_get_pad_selection(&histo->entity, config, sel->pad, in histo_set_compose()
332 compose = vsp1_entity_get_pad_selection(&histo->entity, config, in histo_set_compose()
344 struct vsp1_histogram *histo = subdev_to_histo(subdev); in histo_set_selection() local
351 mutex_lock(&histo->entity.lock); in histo_set_selection()
353 config = vsp1_entity_get_pad_config(&histo->entity, cfg, sel->which); in histo_set_selection()
367 mutex_unlock(&histo->entity.lock); in histo_set_selection()
391 struct vsp1_histogram *histo = subdev_to_histo(subdev); in histo_set_format() local
397 histo->formats, histo->num_formats, in histo_set_format()
423 struct vsp1_histogram *histo = vdev_to_histo(vfh->vdev); in histo_v4l2_querycap() local
431 strscpy(cap->card, histo->video.name, sizeof(cap->card)); in histo_v4l2_querycap()
433 dev_name(histo->entity.vsp1->dev)); in histo_v4l2_querycap()
442 struct vsp1_histogram *histo = vdev_to_histo(vfh->vdev); in histo_v4l2_enum_format() local
444 if (f->index > 0 || f->type != histo->queue.type) in histo_v4l2_enum_format()
447 f->pixelformat = histo->meta_format; in histo_v4l2_enum_format()
456 struct vsp1_histogram *histo = vdev_to_histo(vfh->vdev); in histo_v4l2_get_format() local
459 if (format->type != histo->queue.type) in histo_v4l2_get_format()
464 meta->dataformat = histo->meta_format; in histo_v4l2_get_format()
465 meta->buffersize = histo->data_size; in histo_v4l2_get_format()
499 static void vsp1_histogram_cleanup(struct vsp1_histogram *histo) in vsp1_histogram_cleanup() argument
501 if (video_is_registered(&histo->video)) in vsp1_histogram_cleanup()
502 video_unregister_device(&histo->video); in vsp1_histogram_cleanup()
504 media_entity_cleanup(&histo->video.entity); in vsp1_histogram_cleanup()
509 struct vsp1_histogram *histo = subdev_to_histo(&entity->subdev); in vsp1_histogram_destroy() local
511 vsp1_histogram_cleanup(histo); in vsp1_histogram_destroy()
514 int vsp1_histogram_init(struct vsp1_device *vsp1, struct vsp1_histogram *histo, in vsp1_histogram_init() argument
522 histo->formats = formats; in vsp1_histogram_init()
523 histo->num_formats = num_formats; in vsp1_histogram_init()
524 histo->data_size = data_size; in vsp1_histogram_init()
525 histo->meta_format = meta_format; in vsp1_histogram_init()
527 histo->pad.flags = MEDIA_PAD_FL_SINK; in vsp1_histogram_init()
528 histo->video.vfl_dir = VFL_DIR_RX; in vsp1_histogram_init()
530 mutex_init(&histo->lock); in vsp1_histogram_init()
531 spin_lock_init(&histo->irqlock); in vsp1_histogram_init()
532 INIT_LIST_HEAD(&histo->irqqueue); in vsp1_histogram_init()
533 init_waitqueue_head(&histo->wait_queue); in vsp1_histogram_init()
536 histo->entity.ops = ops; in vsp1_histogram_init()
537 histo->entity.type = type; in vsp1_histogram_init()
539 ret = vsp1_entity_init(vsp1, &histo->entity, name, 2, &histo_ops, in vsp1_histogram_init()
545 ret = media_entity_pads_init(&histo->video.entity, 1, &histo->pad); in vsp1_histogram_init()
550 histo->video.v4l2_dev = &vsp1->v4l2_dev; in vsp1_histogram_init()
551 histo->video.fops = &histo_v4l2_fops; in vsp1_histogram_init()
552 snprintf(histo->video.name, sizeof(histo->video.name), in vsp1_histogram_init()
553 "%s histo", histo->entity.subdev.name); in vsp1_histogram_init()
554 histo->video.vfl_type = VFL_TYPE_VIDEO; in vsp1_histogram_init()
555 histo->video.release = video_device_release_empty; in vsp1_histogram_init()
556 histo->video.ioctl_ops = &histo_v4l2_ioctl_ops; in vsp1_histogram_init()
557 histo->video.device_caps = V4L2_CAP_META_CAPTURE | V4L2_CAP_STREAMING; in vsp1_histogram_init()
559 video_set_drvdata(&histo->video, histo); in vsp1_histogram_init()
562 histo->queue.type = V4L2_BUF_TYPE_META_CAPTURE; in vsp1_histogram_init()
563 histo->queue.io_modes = VB2_MMAP | VB2_USERPTR | VB2_DMABUF; in vsp1_histogram_init()
564 histo->queue.lock = &histo->lock; in vsp1_histogram_init()
565 histo->queue.drv_priv = histo; in vsp1_histogram_init()
566 histo->queue.buf_struct_size = sizeof(struct vsp1_histogram_buffer); in vsp1_histogram_init()
567 histo->queue.ops = &histo_video_queue_qops; in vsp1_histogram_init()
568 histo->queue.mem_ops = &vb2_vmalloc_memops; in vsp1_histogram_init()
569 histo->queue.timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY; in vsp1_histogram_init()
570 histo->queue.dev = vsp1->dev; in vsp1_histogram_init()
571 ret = vb2_queue_init(&histo->queue); in vsp1_histogram_init()
578 histo->video.queue = &histo->queue; in vsp1_histogram_init()
579 ret = video_register_device(&histo->video, VFL_TYPE_VIDEO, -1); in vsp1_histogram_init()
588 vsp1_histogram_cleanup(histo); in vsp1_histogram_init()