[media] vb2: replace void *alloc_ctxs by struct device *alloc_devs
Make this a proper typed array. Drop the old allocate context code since that is no longer used. Note that the memops functions now get a struct device pointer instead of the struct device ** that was there initially (actually a void pointer to a struct containing only a struct device pointer). This code is now a lot cleaner. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: Sakari Ailus <sakari.ailus@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Этот коммит содержится в:

коммит произвёл
Mauro Carvalho Chehab

родитель
2548fee63d
Коммит
36c0f8b32c
@@ -45,7 +45,7 @@ static const struct v4l2_dv_timings cea1080p60 = V4L2_DV_BT_CEA_1920X1080P60;
|
||||
|
||||
static int cobalt_queue_setup(struct vb2_queue *q,
|
||||
unsigned int *num_buffers, unsigned int *num_planes,
|
||||
unsigned int sizes[], void *alloc_ctxs[])
|
||||
unsigned int sizes[], struct device *alloc_devs[])
|
||||
{
|
||||
struct cobalt_stream *s = q->drv_priv;
|
||||
unsigned size = s->stride * s->height;
|
||||
|
@@ -1140,7 +1140,7 @@ static int cx23885_initialize_codec(struct cx23885_dev *dev, int startencoder)
|
||||
|
||||
static int queue_setup(struct vb2_queue *q,
|
||||
unsigned int *num_buffers, unsigned int *num_planes,
|
||||
unsigned int sizes[], void *alloc_ctxs[])
|
||||
unsigned int sizes[], struct device *alloc_devs[])
|
||||
{
|
||||
struct cx23885_dev *dev = q->drv_priv;
|
||||
|
||||
|
@@ -94,7 +94,7 @@ DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
|
||||
|
||||
static int queue_setup(struct vb2_queue *q,
|
||||
unsigned int *num_buffers, unsigned int *num_planes,
|
||||
unsigned int sizes[], void *alloc_ctxs[])
|
||||
unsigned int sizes[], struct device *alloc_devs[])
|
||||
{
|
||||
struct cx23885_tsport *port = q->drv_priv;
|
||||
|
||||
|
@@ -122,7 +122,7 @@ static int cx23885_start_vbi_dma(struct cx23885_dev *dev,
|
||||
|
||||
static int queue_setup(struct vb2_queue *q,
|
||||
unsigned int *num_buffers, unsigned int *num_planes,
|
||||
unsigned int sizes[], void *alloc_ctxs[])
|
||||
unsigned int sizes[], struct device *alloc_devs[])
|
||||
{
|
||||
struct cx23885_dev *dev = q->drv_priv;
|
||||
unsigned lines = VBI_PAL_LINE_COUNT;
|
||||
|
@@ -335,7 +335,7 @@ static int cx23885_start_video_dma(struct cx23885_dev *dev,
|
||||
|
||||
static int queue_setup(struct vb2_queue *q,
|
||||
unsigned int *num_buffers, unsigned int *num_planes,
|
||||
unsigned int sizes[], void *alloc_ctxs[])
|
||||
unsigned int sizes[], struct device *alloc_devs[])
|
||||
{
|
||||
struct cx23885_dev *dev = q->drv_priv;
|
||||
|
||||
|
@@ -143,7 +143,7 @@ int cx25821_video_irq(struct cx25821_dev *dev, int chan_num, u32 status)
|
||||
|
||||
static int cx25821_queue_setup(struct vb2_queue *q,
|
||||
unsigned int *num_buffers, unsigned int *num_planes,
|
||||
unsigned int sizes[], void *alloc_ctxs[])
|
||||
unsigned int sizes[], struct device *alloc_devs[])
|
||||
{
|
||||
struct cx25821_channel *chan = q->drv_priv;
|
||||
unsigned size = (chan->fmt->depth * chan->width * chan->height) >> 3;
|
||||
|
@@ -639,7 +639,7 @@ static int blackbird_stop_codec(struct cx8802_dev *dev)
|
||||
|
||||
static int queue_setup(struct vb2_queue *q,
|
||||
unsigned int *num_buffers, unsigned int *num_planes,
|
||||
unsigned int sizes[], void *alloc_ctxs[])
|
||||
unsigned int sizes[], struct device *alloc_devs[])
|
||||
{
|
||||
struct cx8802_dev *dev = q->drv_priv;
|
||||
|
||||
|
@@ -84,7 +84,7 @@ DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
|
||||
|
||||
static int queue_setup(struct vb2_queue *q,
|
||||
unsigned int *num_buffers, unsigned int *num_planes,
|
||||
unsigned int sizes[], void *alloc_ctxs[])
|
||||
unsigned int sizes[], struct device *alloc_devs[])
|
||||
{
|
||||
struct cx8802_dev *dev = q->drv_priv;
|
||||
|
||||
|
@@ -109,7 +109,7 @@ int cx8800_restart_vbi_queue(struct cx8800_dev *dev,
|
||||
|
||||
static int queue_setup(struct vb2_queue *q,
|
||||
unsigned int *num_buffers, unsigned int *num_planes,
|
||||
unsigned int sizes[], void *alloc_ctxs[])
|
||||
unsigned int sizes[], struct device *alloc_devs[])
|
||||
{
|
||||
struct cx8800_dev *dev = q->drv_priv;
|
||||
|
||||
|
@@ -431,7 +431,7 @@ static int restart_video_queue(struct cx8800_dev *dev,
|
||||
|
||||
static int queue_setup(struct vb2_queue *q,
|
||||
unsigned int *num_buffers, unsigned int *num_planes,
|
||||
unsigned int sizes[], void *alloc_ctxs[])
|
||||
unsigned int sizes[], struct device *alloc_devs[])
|
||||
{
|
||||
struct cx8800_dev *dev = q->drv_priv;
|
||||
struct cx88_core *core = dev->core;
|
||||
|
@@ -133,7 +133,7 @@ static int wait_i2c_reg(void __iomem *addr)
|
||||
static int
|
||||
dt3155_queue_setup(struct vb2_queue *vq,
|
||||
unsigned int *nbuffers, unsigned int *num_planes,
|
||||
unsigned int sizes[], void *alloc_ctxs[])
|
||||
unsigned int sizes[], struct device *alloc_devs[])
|
||||
|
||||
{
|
||||
struct dt3155_priv *pd = vb2_get_drv_priv(vq);
|
||||
|
@@ -293,7 +293,7 @@ static int netup_unidvb_queue_setup(struct vb2_queue *vq,
|
||||
unsigned int *nbuffers,
|
||||
unsigned int *nplanes,
|
||||
unsigned int sizes[],
|
||||
void *alloc_ctxs[])
|
||||
struct device *alloc_devs[])
|
||||
{
|
||||
struct netup_dma *dma = vb2_get_drv_priv(vq);
|
||||
|
||||
|
@@ -118,7 +118,7 @@ EXPORT_SYMBOL_GPL(saa7134_ts_buffer_prepare);
|
||||
|
||||
int saa7134_ts_queue_setup(struct vb2_queue *q,
|
||||
unsigned int *nbuffers, unsigned int *nplanes,
|
||||
unsigned int sizes[], void *alloc_ctxs[])
|
||||
unsigned int sizes[], struct device *alloc_devs[])
|
||||
{
|
||||
struct saa7134_dmaqueue *dmaq = q->drv_priv;
|
||||
struct saa7134_dev *dev = dmaq->dev;
|
||||
|
@@ -140,7 +140,7 @@ static int buffer_prepare(struct vb2_buffer *vb2)
|
||||
|
||||
static int queue_setup(struct vb2_queue *q,
|
||||
unsigned int *nbuffers, unsigned int *nplanes,
|
||||
unsigned int sizes[], void *alloc_ctxs[])
|
||||
unsigned int sizes[], struct device *alloc_devs[])
|
||||
{
|
||||
struct saa7134_dmaqueue *dmaq = q->drv_priv;
|
||||
struct saa7134_dev *dev = dmaq->dev;
|
||||
|
@@ -963,7 +963,7 @@ static int buffer_prepare(struct vb2_buffer *vb2)
|
||||
|
||||
static int queue_setup(struct vb2_queue *q,
|
||||
unsigned int *nbuffers, unsigned int *nplanes,
|
||||
unsigned int sizes[], void *alloc_ctxs[])
|
||||
unsigned int sizes[], struct device *alloc_devs[])
|
||||
{
|
||||
struct saa7134_dmaqueue *dmaq = q->drv_priv;
|
||||
struct saa7134_dev *dev = dmaq->dev;
|
||||
|
@@ -853,7 +853,7 @@ int saa7134_ts_buffer_init(struct vb2_buffer *vb2);
|
||||
int saa7134_ts_buffer_prepare(struct vb2_buffer *vb2);
|
||||
int saa7134_ts_queue_setup(struct vb2_queue *q,
|
||||
unsigned int *nbuffers, unsigned int *nplanes,
|
||||
unsigned int sizes[], void *alloc_ctxs[]);
|
||||
unsigned int sizes[], struct device *alloc_devs[]);
|
||||
int saa7134_ts_start_streaming(struct vb2_queue *vq, unsigned int count);
|
||||
void saa7134_ts_stop_streaming(struct vb2_queue *vq);
|
||||
|
||||
|
@@ -664,7 +664,7 @@ static int solo_ring_thread(void *data)
|
||||
static int solo_enc_queue_setup(struct vb2_queue *q,
|
||||
unsigned int *num_buffers,
|
||||
unsigned int *num_planes, unsigned int sizes[],
|
||||
void *alloc_ctxs[])
|
||||
struct device *alloc_devs[])
|
||||
{
|
||||
sizes[0] = FRAME_BUF_SIZE;
|
||||
*num_planes = 1;
|
||||
|
@@ -315,7 +315,7 @@ static void solo_stop_thread(struct solo_dev *solo_dev)
|
||||
|
||||
static int solo_queue_setup(struct vb2_queue *q,
|
||||
unsigned int *num_buffers, unsigned int *num_planes,
|
||||
unsigned int sizes[], void *alloc_ctxs[])
|
||||
unsigned int sizes[], struct device *alloc_devs[])
|
||||
{
|
||||
struct solo_dev *solo_dev = vb2_get_drv_priv(q);
|
||||
|
||||
|
@@ -265,7 +265,7 @@ static void vip_active_buf_next(struct sta2x11_vip *vip)
|
||||
/* Videobuf2 Operations */
|
||||
static int queue_setup(struct vb2_queue *vq,
|
||||
unsigned int *nbuffers, unsigned int *nplanes,
|
||||
unsigned int sizes[], void *alloc_ctxs[])
|
||||
unsigned int sizes[], struct device *alloc_devs[])
|
||||
{
|
||||
struct sta2x11_vip *vip = vb2_get_drv_priv(vq);
|
||||
|
||||
|
@@ -378,7 +378,7 @@ static int tw68_buffer_count(unsigned int size, unsigned int count)
|
||||
|
||||
static int tw68_queue_setup(struct vb2_queue *q,
|
||||
unsigned int *num_buffers, unsigned int *num_planes,
|
||||
unsigned int sizes[], void *alloc_ctxs[])
|
||||
unsigned int sizes[], struct device *alloc_devs[])
|
||||
{
|
||||
struct tw68_dev *dev = vb2_get_drv_priv(q);
|
||||
unsigned tot_bufs = q->num_buffers + *num_buffers;
|
||||
|
@@ -401,7 +401,7 @@ static const struct tw686x_format *format_by_fourcc(unsigned int fourcc)
|
||||
|
||||
static int tw686x_queue_setup(struct vb2_queue *vq,
|
||||
unsigned int *nbuffers, unsigned int *nplanes,
|
||||
unsigned int sizes[], void *alloc_ctxs[])
|
||||
unsigned int sizes[], struct device *alloc_devs[])
|
||||
{
|
||||
struct tw686x_video_channel *vc = vb2_get_drv_priv(vq);
|
||||
unsigned int szimage =
|
||||
|
Ссылка в новой задаче
Block a user