Commit 99362e32 authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Mauro Carvalho Chehab

[media] v4l: vsp1: Add histogram support

The histogram common code will be used to implement support for both the
HGO and HGT histogram computation engines.
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent fb9ffa6a
...@@ -420,6 +420,7 @@ config VIDEO_RENESAS_VSP1 ...@@ -420,6 +420,7 @@ config VIDEO_RENESAS_VSP1
depends on (ARCH_RENESAS && OF) || COMPILE_TEST depends on (ARCH_RENESAS && OF) || COMPILE_TEST
depends on (!ARM64 && !VIDEO_RENESAS_FCP) || VIDEO_RENESAS_FCP depends on (!ARM64 && !VIDEO_RENESAS_FCP) || VIDEO_RENESAS_FCP
select VIDEOBUF2_DMA_CONTIG select VIDEOBUF2_DMA_CONTIG
select VIDEOBUF2_VMALLOC
---help--- ---help---
This is a V4L2 driver for the Renesas VSP1 video processing engine. This is a V4L2 driver for the Renesas VSP1 video processing engine.
......
...@@ -3,6 +3,7 @@ vsp1-y += vsp1_dl.o vsp1_drm.o vsp1_video.o ...@@ -3,6 +3,7 @@ vsp1-y += vsp1_dl.o vsp1_drm.o vsp1_video.o
vsp1-y += vsp1_rpf.o vsp1_rwpf.o vsp1_wpf.o vsp1-y += vsp1_rpf.o vsp1_rwpf.o vsp1_wpf.o
vsp1-y += vsp1_clu.o vsp1_hsit.o vsp1_lut.o vsp1-y += vsp1_clu.o vsp1_hsit.o vsp1_lut.o
vsp1-y += vsp1_bru.o vsp1_sru.o vsp1_uds.o vsp1-y += vsp1_bru.o vsp1_sru.o vsp1_uds.o
vsp1-y += vsp1_histo.o
vsp1-y += vsp1_lif.o vsp1-y += vsp1_lif.o
obj-$(CONFIG_VIDEO_RENESAS_VSP1) += vsp1.o obj-$(CONFIG_VIDEO_RENESAS_VSP1) += vsp1.o
This diff is collapsed.
/*
* vsp1_histo.h -- R-Car VSP1 Histogram API
*
* Copyright (C) 2016 Renesas Electronics Corporation
* Copyright (C) 2016 Laurent Pinchart
*
* Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*/
#ifndef __VSP1_HISTO_H__
#define __VSP1_HISTO_H__
#include <linux/list.h>
#include <linux/mutex.h>
#include <linux/spinlock.h>
#include <media/media-entity.h>
#include <media/v4l2-dev.h>
#include <media/videobuf2-v4l2.h>
#include "vsp1_entity.h"
struct vsp1_device;
struct vsp1_pipeline;
#define HISTO_PAD_SINK 0
#define HISTO_PAD_SOURCE 1
struct vsp1_histogram_buffer {
struct vb2_v4l2_buffer buf;
struct list_head queue;
void *addr;
};
struct vsp1_histogram {
struct vsp1_pipeline *pipe;
struct vsp1_entity entity;
struct video_device video;
struct media_pad pad;
const u32 *formats;
unsigned int num_formats;
size_t data_size;
u32 meta_format;
struct mutex lock;
struct vb2_queue queue;
spinlock_t irqlock;
struct list_head irqqueue;
wait_queue_head_t wait_queue;
bool readout;
};
static inline struct vsp1_histogram *vdev_to_histo(struct video_device *vdev)
{
return container_of(vdev, struct vsp1_histogram, video);
}
static inline struct vsp1_histogram *subdev_to_histo(struct v4l2_subdev *subdev)
{
return container_of(subdev, struct vsp1_histogram, entity.subdev);
}
int vsp1_histogram_init(struct vsp1_device *vsp1, struct vsp1_histogram *histo,
enum vsp1_entity_type type, const char *name,
const struct vsp1_entity_operations *ops,
const unsigned int *formats, unsigned int num_formats,
size_t data_size, u32 meta_format);
void vsp1_histogram_destroy(struct vsp1_entity *entity);
struct vsp1_histogram_buffer *
vsp1_histogram_buffer_get(struct vsp1_histogram *histo);
void vsp1_histogram_buffer_complete(struct vsp1_histogram *histo,
struct vsp1_histogram_buffer *buf,
size_t size);
#endif /* __VSP1_HISTO_H__ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment