Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 92653
b: refs/heads/master
c: 59d3448
h: refs/heads/master
i:
  92651: c98d92e
v: v3
  • Loading branch information
Mauro Carvalho Chehab committed Apr 24, 2008
1 parent 6aaafc0 commit 29ca49c
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3b5fa928a6b2971ec65571745defc5d9758b4bc1
refs/heads/master: 59d3448995a4c0ca98cbe82f6dac9460323377c1
7 changes: 7 additions & 0 deletions trunk/drivers/media/video/videobuf-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,13 @@ int videobuf_iolock(struct videobuf_queue *q, struct videobuf_buffer *vb,
return CALL(q, iolock, q, vb, fbuf);
}

void *videobuf_queue_to_vmalloc (struct videobuf_queue *q,
struct videobuf_buffer *buf)
{
return CALL(q, vmalloc, buf);
}
EXPORT_SYMBOL_GPL(videobuf_queue_to_vmalloc);

/* --------------------------------------------------------------------- */


Expand Down
11 changes: 11 additions & 0 deletions trunk/drivers/media/video/videobuf-dma-sg.c
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,16 @@ static void *__videobuf_alloc(size_t size)
return vb;
}

static void *__videobuf_to_vmalloc (struct videobuf_buffer *buf)
{
struct videobuf_dma_sg_memory *mem = buf->priv;
BUG_ON(!mem);

MAGIC_CHECK(mem->magic, MAGIC_SG_MEM);

return mem->dma.vmalloc;
}

static int __videobuf_iolock (struct videobuf_queue* q,
struct videobuf_buffer *vb,
struct v4l2_framebuffer *fbuf)
Expand Down Expand Up @@ -677,6 +687,7 @@ static struct videobuf_qtype_ops sg_ops = {
.mmap_mapper = __videobuf_mmap_mapper,
.video_copy_to_user = __videobuf_copy_to_user,
.copy_stream = __videobuf_copy_stream,
.vmalloc = __videobuf_to_vmalloc,
};

void *videobuf_sg_alloc(size_t size)
Expand Down
10 changes: 6 additions & 4 deletions trunk/drivers/media/video/videobuf-dvb.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@
#include <linux/fs.h>
#include <linux/kthread.h>
#include <linux/file.h>

#include <linux/freezer.h>

#include <media/videobuf-dma-sg.h>
#include <media/videobuf-core.h>
#include <media/videobuf-dvb.h>

/* ------------------------------------------------------------------ */
Expand All @@ -45,7 +46,7 @@ static int videobuf_dvb_thread(void *data)
struct videobuf_buffer *buf;
unsigned long flags;
int err;
struct videobuf_dmabuf *dma;
void *outp;

dprintk("dvb thread started\n");
set_freezable();
Expand All @@ -66,9 +67,10 @@ static int videobuf_dvb_thread(void *data)
try_to_freeze();

/* feed buffer data to demux */
dma=videobuf_to_dma(buf);
outp = videobuf_queue_to_vmalloc (&dvb->dvbq, buf);

if (buf->state == VIDEOBUF_DONE)
dvb_dmx_swfilter(&dvb->demux, dma->vmalloc,
dvb_dmx_swfilter(&dvb->demux, outp,
buf->size);

/* requeue buffer */
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/media/video/videobuf-vmalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,7 @@ static struct videobuf_qtype_ops qops = {
.mmap_mapper = __videobuf_mmap_mapper,
.video_copy_to_user = __videobuf_copy_to_user,
.copy_stream = __videobuf_copy_stream,
.vmalloc = videobuf_to_vmalloc,
};

void videobuf_queue_vmalloc_init(struct videobuf_queue* q,
Expand Down
18 changes: 10 additions & 8 deletions trunk/include/media/videobuf-core.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
* the Free Software Foundation; either version 2
*/

#ifndef _VIDEOBUF_CORE_H
#define _VIDEOBUF_CORE_H

#include <linux/poll.h>
#ifdef CONFIG_VIDEO_V4L1_COMPAT
#include <linux/videodev.h>
Expand Down Expand Up @@ -123,7 +126,8 @@ struct videobuf_queue_ops {
struct videobuf_qtype_ops {
u32 magic;

void* (*alloc) (size_t size);
void *(*alloc) (size_t size);
void *(*vmalloc) (struct videobuf_buffer *buf);
int (*iolock) (struct videobuf_queue* q,
struct videobuf_buffer *vb,
struct v4l2_framebuffer *fbuf);
Expand Down Expand Up @@ -185,6 +189,10 @@ int videobuf_iolock(struct videobuf_queue* q, struct videobuf_buffer *vb,

void *videobuf_alloc(struct videobuf_queue* q);

/* Used on videobuf-dvb */
void *videobuf_queue_to_vmalloc (struct videobuf_queue* q,
struct videobuf_buffer *buf);

void videobuf_queue_core_init(struct videobuf_queue *q,
struct videobuf_queue_ops *ops,
struct device *dev,
Expand Down Expand Up @@ -233,10 +241,4 @@ int videobuf_mmap_free(struct videobuf_queue *q);
int videobuf_mmap_mapper(struct videobuf_queue *q,
struct vm_area_struct *vma);

/* --------------------------------------------------------------------- */

/*
* Local variables:
* c-basic-offset: 8
* End:
*/
#endif
4 changes: 4 additions & 0 deletions trunk/include/media/videobuf-vmalloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2
*/
#ifndef _VIDEOBUF_VMALLOC_H
#define _VIDEOBUF_VMALLOC_H

#include <media/videobuf-core.h>

Expand Down Expand Up @@ -39,3 +41,5 @@ void videobuf_queue_vmalloc_init(struct videobuf_queue* q,
void *videobuf_to_vmalloc (struct videobuf_buffer *buf);

void videobuf_vmalloc_free (struct videobuf_buffer *buf);

#endif

0 comments on commit 29ca49c

Please sign in to comment.