2013-06-04 21:22:30 +07:00
|
|
|
/*
|
|
|
|
* vsp1_video.h -- R-Car VSP1 Video Node
|
|
|
|
*
|
2015-03-15 21:33:07 +07:00
|
|
|
* Copyright (C) 2013-2015 Renesas Electronics Corporation
|
2013-06-04 21:22:30 +07:00
|
|
|
*
|
|
|
|
* 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_VIDEO_H__
|
|
|
|
#define __VSP1_VIDEO_H__
|
|
|
|
|
|
|
|
#include <linux/list.h>
|
|
|
|
#include <linux/spinlock.h>
|
|
|
|
|
2015-09-22 20:30:29 +07:00
|
|
|
#include <media/videobuf2-v4l2.h>
|
2013-06-04 21:22:30 +07:00
|
|
|
|
2015-07-29 02:04:47 +07:00
|
|
|
#include "vsp1_rwpf.h"
|
|
|
|
|
2015-07-29 00:17:07 +07:00
|
|
|
struct vsp1_vb2_buffer {
|
[media] media: videobuf2: Restructure vb2_buffer
Remove v4l2 stuff - v4l2_buf, v4l2_plane - from struct vb2_buffer.
Add new member variables - bytesused, length, offset, userptr, fd,
data_offset - to struct vb2_plane in order to cover all information
of v4l2_plane.
struct vb2_plane {
<snip>
unsigned int bytesused;
unsigned int length;
union {
unsigned int offset;
unsigned long userptr;
int fd;
} m;
unsigned int data_offset;
}
Replace v4l2_buf with new member variables - index, type, memory - which
are common fields for buffer management.
struct vb2_buffer {
<snip>
unsigned int index;
unsigned int type;
unsigned int memory;
unsigned int num_planes;
struct vb2_plane planes[VIDEO_MAX_PLANES];
<snip>
};
v4l2 specific fields - flags, field, timestamp, timecode,
sequence - are moved to vb2_v4l2_buffer in videobuf2-v4l2.c
struct vb2_v4l2_buffer {
struct vb2_buffer vb2_buf;
__u32 flags;
__u32 field;
struct timeval timestamp;
struct v4l2_timecode timecode;
__u32 sequence;
};
Signed-off-by: Junghak Sung <jh1009.sung@samsung.com>
Signed-off-by: Geunyoung Kim <nenggun.kim@samsung.com>
Acked-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Acked-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-09-22 20:30:30 +07:00
|
|
|
struct vb2_v4l2_buffer buf;
|
2013-06-04 21:22:30 +07:00
|
|
|
struct list_head queue;
|
2015-07-29 02:04:47 +07:00
|
|
|
struct vsp1_rwpf_memory mem;
|
2013-06-04 21:22:30 +07:00
|
|
|
};
|
|
|
|
|
2015-07-29 00:17:07 +07:00
|
|
|
static inline struct vsp1_vb2_buffer *
|
|
|
|
to_vsp1_vb2_buffer(struct vb2_v4l2_buffer *vbuf)
|
2013-06-04 21:22:30 +07:00
|
|
|
{
|
2015-07-29 00:17:07 +07:00
|
|
|
return container_of(vbuf, struct vsp1_vb2_buffer, buf);
|
2013-06-04 21:22:30 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
struct vsp1_video {
|
2015-07-29 01:46:00 +07:00
|
|
|
struct list_head list;
|
2013-06-04 21:22:30 +07:00
|
|
|
struct vsp1_device *vsp1;
|
2015-07-28 23:54:03 +07:00
|
|
|
struct vsp1_rwpf *rwpf;
|
2013-06-04 21:22:30 +07:00
|
|
|
|
|
|
|
struct video_device video;
|
|
|
|
enum v4l2_buf_type type;
|
|
|
|
struct media_pad pad;
|
|
|
|
|
|
|
|
struct mutex lock;
|
|
|
|
|
|
|
|
unsigned int pipe_index;
|
|
|
|
|
|
|
|
struct vb2_queue queue;
|
|
|
|
spinlock_t irqlock;
|
|
|
|
struct list_head irqqueue;
|
|
|
|
};
|
|
|
|
|
|
|
|
static inline struct vsp1_video *to_vsp1_video(struct video_device *vdev)
|
|
|
|
{
|
|
|
|
return container_of(vdev, struct vsp1_video, video);
|
|
|
|
}
|
|
|
|
|
2015-07-29 01:46:00 +07:00
|
|
|
struct vsp1_video *vsp1_video_create(struct vsp1_device *vsp1,
|
|
|
|
struct vsp1_rwpf *rwpf);
|
2013-06-04 21:22:30 +07:00
|
|
|
void vsp1_video_cleanup(struct vsp1_video *video);
|
|
|
|
|
|
|
|
#endif /* __VSP1_VIDEO_H__ */
|