Commit 31629424 authored by Catalin Climov's avatar Catalin Climov Committed by Linus Torvalds
Browse files

[PATCH] v4l: 631: implemented the v4l2 mpeg api for blackbird cards



- Implemented the v4l2 mpeg api for blackbird cards.

Signed-off-by: default avatarCatalin Climov <catalin@climov.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@brturbo.com.br>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 7df64e8c
Loading
Loading
Loading
Loading
+573 −65

File changed.

Preview size limit exceeded, changes collapsed.

+4 −3
Original line number Original line Diff line number Diff line
@@ -54,7 +54,7 @@ static int cx8802_start_dma(struct cx8802_dev *dev,
{
{
	struct cx88_core *core = dev->core;
	struct cx88_core *core = dev->core;


	dprintk(0, "cx8802_start_dma %d\n", buf->vb.width);
	dprintk(0, "cx8802_start_dma w: %d, h: %d, f: %d\n", dev->width, dev->height, buf->vb.field);


	/* setup fifo + format */
	/* setup fifo + format */
	cx88_sram_channel_setup(core, &cx88_sram_channels[SRAM_CH28],
	cx88_sram_channel_setup(core, &cx88_sram_channels[SRAM_CH28],
@@ -158,7 +158,8 @@ static int cx8802_restart_queue(struct cx8802_dev *dev,


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


int cx8802_buf_prepare(struct cx8802_dev *dev, struct cx88_buffer *buf)
int cx8802_buf_prepare(struct cx8802_dev *dev, struct cx88_buffer *buf,
			enum v4l2_field field)
{
{
	int size = dev->ts_packet_size * dev->ts_packet_count;
	int size = dev->ts_packet_size * dev->ts_packet_count;
	int rc;
	int rc;
@@ -171,7 +172,7 @@ int cx8802_buf_prepare(struct cx8802_dev *dev, struct cx88_buffer *buf)
		buf->vb.width  = dev->ts_packet_size;
		buf->vb.width  = dev->ts_packet_size;
		buf->vb.height = dev->ts_packet_count;
		buf->vb.height = dev->ts_packet_count;
		buf->vb.size   = size;
		buf->vb.size   = size;
		buf->vb.field  = V4L2_FIELD_TOP;
		buf->vb.field  = field /*V4L2_FIELD_TOP*/;


		if (0 != (rc = videobuf_iolock(dev->pci,&buf->vb,NULL)))
		if (0 != (rc = videobuf_iolock(dev->pci,&buf->vb,NULL)))
			goto fail;
			goto fail;
+0 −2
Original line number Original line Diff line number Diff line
@@ -1258,8 +1258,6 @@ int cx88_do_ioctl(struct inode *inode, struct file *file, int radio,


	if (video_debug > 1)
	if (video_debug > 1)
		cx88_print_ioctl(core->name,cmd);
		cx88_print_ioctl(core->name,cmd);
	printk( KERN_INFO "CORE IOCTL: 0x%x\n", cmd );
	cx88_print_ioctl(core->name,cmd);
	dprintk( 1, "CORE IOCTL: 0x%x\n", cmd );
	dprintk( 1, "CORE IOCTL: 0x%x\n", cmd );


	switch (cmd) {
	switch (cmd) {
+18 −1
Original line number Original line Diff line number Diff line
@@ -371,6 +371,14 @@ struct cx8802_suspend_state {
	int                        disabled;
	int                        disabled;
};
};


/* TODO: move this to struct v4l2_mpeg_compression ? */
struct blackbird_dnr {
	u32                       mode;
	u32                       type;
	u32                       spatial;
	u32                       temporal;
};

struct cx8802_dev {
struct cx8802_dev {
	struct cx88_core           *core;
	struct cx88_core           *core;
	spinlock_t                 slock;
	spinlock_t                 slock;
@@ -401,6 +409,10 @@ struct cx8802_dev {


	/* for switching modulation types */
	/* for switching modulation types */
	unsigned char              ts_gen_cntrl;
	unsigned char              ts_gen_cntrl;

	/* mpeg params */
	struct v4l2_mpeg_compression params;
	struct blackbird_dnr       dnr_params;
};
};


/* ----------------------------------------------------------- */
/* ----------------------------------------------------------- */
@@ -542,7 +554,8 @@ void cx88_ir_irq(struct cx88_core *core);
/* ----------------------------------------------------------- */
/* ----------------------------------------------------------- */
/* cx88-mpeg.c                                                 */
/* cx88-mpeg.c                                                 */


int cx8802_buf_prepare(struct cx8802_dev *dev, struct cx88_buffer *buf);
int cx8802_buf_prepare(struct cx8802_dev *dev, struct cx88_buffer *buf,
			enum v4l2_field field);
void cx8802_buf_queue(struct cx8802_dev *dev, struct cx88_buffer *buf);
void cx8802_buf_queue(struct cx8802_dev *dev, struct cx88_buffer *buf);
void cx8802_cancel_buffers(struct cx8802_dev *dev);
void cx8802_cancel_buffers(struct cx8802_dev *dev);


@@ -563,6 +576,10 @@ extern int cx88_do_ioctl(struct inode *inode, struct file *file, int radio,
extern int (*cx88_ioctl_hook)(struct inode *inode, struct file *file,
extern int (*cx88_ioctl_hook)(struct inode *inode, struct file *file,
				unsigned int cmd, void *arg);
				unsigned int cmd, void *arg);
extern unsigned int (*cx88_ioctl_translator)(unsigned int cmd);
extern unsigned int (*cx88_ioctl_translator)(unsigned int cmd);
void blackbird_set_params(struct cx8802_dev *dev,
				struct v4l2_mpeg_compression *params);
void blackbird_set_dnr_params(struct cx8802_dev *dev,
				struct blackbird_dnr* dnr_params);


/*
/*
 * Local variables:
 * Local variables: