Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 137987
b: refs/heads/master
c: 7f6adea
h: refs/heads/master
i:
  137985: 35a06ea
  137983: 8e4fde7
v: v3
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed Mar 30, 2009
1 parent 2e48045 commit 10a7466
Show file tree
Hide file tree
Showing 18 changed files with 57 additions and 96 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: 0ab6e1c38d80ab586e3a1ca9e71844131d9f51dc
refs/heads/master: 7f6adeaf2d8800b66c5dd6c2cf2622dfdd68bd31
2 changes: 1 addition & 1 deletion trunk/drivers/media/common/tuners/mt20xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/
#include <linux/delay.h>
#include <linux/i2c.h>
#include <linux/videodev.h>
#include <linux/videodev2.h>
#include "tuner-i2c.h"
#include "mt20xx.h"

Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/media/common/tuners/tda8290.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#include <linux/i2c.h>
#include <linux/delay.h>
#include <linux/videodev.h>
#include <linux/videodev2.h>
#include "tuner-i2c.h"
#include "tda8290.h"
#include "tda827x.h"
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/media/common/tuners/tea5761.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include <linux/i2c.h>
#include <linux/delay.h>
#include <linux/videodev.h>
#include <linux/videodev2.h>
#include <media/tuner.h>
#include "tuner-i2c.h"
#include "tea5761.h"
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/media/common/tuners/tea5767.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

#include <linux/i2c.h>
#include <linux/delay.h>
#include <linux/videodev.h>
#include <linux/videodev2.h>
#include "tuner-i2c.h"
#include "tea5767.h"

Expand Down
2 changes: 0 additions & 2 deletions trunk/drivers/media/video/ks0127.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
#ifndef KS0127_H
#define KS0127_H

#include <linux/videodev.h>

/* input channels */
#define KS_INPUT_COMPOSITE_1 0
#define KS_INPUT_COMPOSITE_2 1
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/media/video/saa6588.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <linux/kernel.h>
#include <linux/i2c.h>
#include <linux/types.h>
#include <linux/videodev.h>
#include <linux/videodev2.h>
#include <linux/init.h>
#include <linux/errno.h>
#include <linux/slab.h>
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/media/video/tvaudio.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include <linux/delay.h>
#include <linux/errno.h>
#include <linux/slab.h>
#include <linux/videodev.h>
#include <linux/videodev2.h>
#include <linux/i2c.h>
#include <linux/init.h>
#include <linux/kthread.h>
Expand Down
9 changes: 2 additions & 7 deletions trunk/drivers/media/video/zoran/videocodec.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
available) - it returns 0 if the mode is possible
set_size -> this fn-ref. sets the norm and image size for
compression/decompression (returns 0 on success)
the norm param is defined in videodev.h (VIDEO_MODE_*)
the norm param is defined in videodev2.h (V4L2_STD_*)
additional setup may be available, too - but the codec should work with
some default values even without this
Expand Down Expand Up @@ -144,9 +144,8 @@ M zr36055[1] 0001 0000c001 00000000 (zr36050[1])
#ifndef __LINUX_VIDEOCODEC_H
#define __LINUX_VIDEOCODEC_H

#include <linux/videodev.h>
#include <linux/videodev2.h>

//should be in videodev.h ??? (VID_DO_....)
#define CODEC_DO_COMPRESSION 0
#define CODEC_DO_EXPANSION 1

Expand Down Expand Up @@ -237,10 +236,6 @@ struct vfe_settings {
__u32 width, height; /* Area to capture */
__u16 decimation; /* Decimation divider */
__u16 flags; /* Flags for capture */
/* flags are the same as in struct video_capture - see videodev.h:
#define VIDEO_CAPTURE_ODD 0
#define VIDEO_CAPTURE_EVEN 1
*/
__u16 quality; /* quality of the video */
};

Expand Down
8 changes: 7 additions & 1 deletion trunk/drivers/media/video/zoran/zoran.h
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,13 @@ struct zoran {
/* Video for Linux parameters */
int input; /* card's norm and input - norm=VIDEO_MODE_* */
v4l2_std_id norm;
struct video_buffer buffer; /* Current buffer params */

/* Current buffer params */
void *vbuf_base;
int vbuf_height, vbuf_width;
int vbuf_depth;
int vbuf_bytesperline;

struct zoran_overlay_settings overlay_settings;
u32 *overlay_mask; /* overlay mask */
enum zoran_lock_activity overlay_active; /* feature currently in use? */
Expand Down
43 changes: 10 additions & 33 deletions trunk/drivers/media/video/zoran/zoran_card.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#include <linux/proc_fs.h>
#include <linux/i2c.h>
#include <linux/i2c-algo-bit.h>
#include <linux/videodev.h>
#include <linux/videodev2.h>
#include <media/v4l2-common.h>
#include <linux/spinlock.h>
#include <linux/sem.h>
Expand All @@ -47,8 +47,6 @@

#include <linux/pci.h>
#include <linux/interrupt.h>
#include <linux/video_decoder.h>
#include <linux/video_encoder.h>
#include <linux/mutex.h>

#include <asm/io.h>
Expand Down Expand Up @@ -108,23 +106,6 @@ static int video_nr[BUZ_MAX] = { [0 ... (BUZ_MAX-1)] = -1 };
module_param_array(video_nr, int, NULL, 0444);
MODULE_PARM_DESC(video_nr, "Video device number (-1=Auto)");

/*
Number and size of grab buffers for Video 4 Linux
The vast majority of applications should not need more than 2,
the very popular BTTV driver actually does ONLY have 2.
Time sensitive applications might need more, the maximum
is VIDEO_MAX_FRAME (defined in <linux/videodev.h>).
The size is set so that the maximum possible request
can be satisfied. Decrease it, if bigphys_area alloc'd
memory is low. If you don't have the bigphys_area patch,
set it to 128 KB. Will you allow only to grab small
images with V4L, but that's better than nothing.
v4l_bufsize has to be given in KB !
*/

int v4l_nbufs = 4;
int v4l_bufsize = 810; /* Everybody should be able to work with this setting */
module_param(v4l_nbufs, int, 0644);
Expand Down Expand Up @@ -1036,20 +1017,19 @@ zr36057_init (struct zoran *zr)
zr->jpg_buffers.allocated = 0;
zr->v4l_buffers.allocated = 0;

zr->buffer.base = (void *) vidmem;
zr->buffer.width = 0;
zr->buffer.height = 0;
zr->buffer.depth = 0;
zr->buffer.bytesperline = 0;
zr->vbuf_base = (void *) vidmem;
zr->vbuf_width = 0;
zr->vbuf_height = 0;
zr->vbuf_depth = 0;
zr->vbuf_bytesperline = 0;

/* Avoid nonsense settings from user for default input/norm */
if (default_norm < VIDEO_MODE_PAL &&
default_norm > VIDEO_MODE_SECAM)
default_norm = VIDEO_MODE_PAL;
if (default_norm == VIDEO_MODE_PAL) {
if (default_norm < 0 && default_norm > 2)
default_norm = 0;
if (default_norm == 0) {
zr->norm = V4L2_STD_PAL;
zr->timing = zr->card.tvn[0];
} else if (default_norm == VIDEO_MODE_NTSC) {
} else if (default_norm == 1) {
zr->norm = V4L2_STD_NTSC;
zr->timing = zr->card.tvn[1];
} else {
Expand Down Expand Up @@ -1547,9 +1527,6 @@ static int __init zoran_init(void)
ZORAN_NAME, vidmem);
}

/* random nonsense */
dprintk(6, KERN_DEBUG "Jotti is een held!\n");

/* some mainboards might not do PCI-PCI data transfer well */
if (pci_pci_problems & (PCIPCI_FAIL|PCIAGP_FAIL|PCIPCI_ALIMAGIK)) {
dprintk(1,
Expand Down
20 changes: 10 additions & 10 deletions trunk/drivers/media/video/zoran/zoran_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -488,27 +488,27 @@ zr36057_overlay (struct zoran *zr,
* All error messages are internal driver checking only! */

/* video display top and bottom registers */
reg = (long) zr->buffer.base +
reg = (long) zr->vbuf_base +
zr->overlay_settings.x *
((zr->overlay_settings.format->depth + 7) / 8) +
zr->overlay_settings.y *
zr->buffer.bytesperline;
zr->vbuf_bytesperline;
btwrite(reg, ZR36057_VDTR);
if (reg & 3)
dprintk(1,
KERN_ERR
"%s: zr36057_overlay() - video_address not aligned\n",
ZR_DEVNAME(zr));
if (zr->overlay_settings.height > BUZ_MAX_HEIGHT / 2)
reg += zr->buffer.bytesperline;
reg += zr->vbuf_bytesperline;
btwrite(reg, ZR36057_VDBR);

/* video stride, status, and frame grab register */
reg = zr->buffer.bytesperline -
reg = zr->vbuf_bytesperline -
zr->overlay_settings.width *
((zr->overlay_settings.format->depth + 7) / 8);
if (zr->overlay_settings.height > BUZ_MAX_HEIGHT / 2)
reg += zr->buffer.bytesperline;
reg += zr->vbuf_bytesperline;
if (reg & 3)
dprintk(1,
KERN_ERR
Expand Down Expand Up @@ -537,7 +537,7 @@ zr36057_overlay (struct zoran *zr,

void
write_overlay_mask (struct file *file,
struct video_clip *vp,
struct v4l2_clip *vp,
int count)
{
struct zoran_fh *fh = file->private_data;
Expand All @@ -554,10 +554,10 @@ write_overlay_mask (struct file *file,

for (i = 0; i < count; ++i) {
/* pick up local copy of clip */
x = vp[i].x;
y = vp[i].y;
width = vp[i].width;
height = vp[i].height;
x = vp[i].c.left;
y = vp[i].c.top;
width = vp[i].c.width;
height = vp[i].c.height;

/* trim clips that extend beyond the window */
if (x < 0) {
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/media/video/zoran/zoran_device.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ extern int jpeg_codec_reset(struct zoran *zr);
extern void zr36057_overlay(struct zoran *zr,
int on);
extern void write_overlay_mask(struct file *file,
struct video_clip *vp,
struct v4l2_clip *vp,
int count);
extern void zr36057_set_memgrab(struct zoran *zr,
int mode);
Expand Down
40 changes: 19 additions & 21 deletions trunk/drivers/media/video/zoran/zoran_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@

#include <linux/spinlock.h>

#include <linux/videodev.h>
#include <linux/videodev2.h>
#include <media/v4l2-common.h>
#include <media/v4l2-ioctl.h>
#include "videocodec.h"
Expand All @@ -69,8 +69,6 @@
#include <asm/uaccess.h>
#include <linux/proc_fs.h>

#include <linux/video_decoder.h>
#include <linux/video_encoder.h>
#include <linux/mutex.h>
#include "zoran.h"
#include "zoran_device.h"
Expand Down Expand Up @@ -1170,12 +1168,12 @@ setup_fbuffer (struct file *file,
return -EINVAL;
}

zr->buffer.base = (void *) ((unsigned long) base & ~3);
zr->buffer.height = height;
zr->buffer.width = width;
zr->buffer.depth = fmt->depth;
zr->vbuf_base = (void *) ((unsigned long) base & ~3);
zr->vbuf_height = height;
zr->vbuf_width = width;
zr->vbuf_depth = fmt->depth;
zr->overlay_settings.format = fmt;
zr->buffer.bytesperline = bytesperline;
zr->vbuf_bytesperline = bytesperline;

/* The user should set new window parameters */
zr->overlay_settings.is_set = 0;
Expand All @@ -1190,17 +1188,17 @@ setup_window (struct file *file,
int y,
int width,
int height,
struct video_clip __user *clips,
struct v4l2_clip __user *clips,
int clipcount,
void __user *bitmap)
{
struct zoran_fh *fh = file->private_data;
struct zoran *zr = fh->zr;
struct video_clip *vcp = NULL;
struct v4l2_clip *vcp = NULL;
int on, end;


if (!zr->buffer.base) {
if (!zr->vbuf_base) {
dprintk(1,
KERN_ERR
"%s: setup_window() - frame buffer has to be set first\n",
Expand All @@ -1220,13 +1218,13 @@ setup_window (struct file *file,
* The video front end needs 4-byte alinged line sizes, we correct that
* silently here if necessary
*/
if (zr->buffer.depth == 15 || zr->buffer.depth == 16) {
if (zr->vbuf_depth == 15 || zr->vbuf_depth == 16) {
end = (x + width) & ~1; /* round down */
x = (x + 1) & ~1; /* round up */
width = end - x;
}

if (zr->buffer.depth == 24) {
if (zr->vbuf_depth == 24) {
end = (x + width) & ~3; /* round down */
x = (x + 3) & ~3; /* round up */
width = end - x;
Expand Down Expand Up @@ -1281,7 +1279,7 @@ setup_window (struct file *file,
}
} else if (clipcount > 0) {
/* write our own bitmap from the clips */
vcp = vmalloc(sizeof(struct video_clip) * (clipcount + 4));
vcp = vmalloc(sizeof(struct v4l2_clip) * (clipcount + 4));
if (vcp == NULL) {
dprintk(1,
KERN_ERR
Expand All @@ -1290,7 +1288,7 @@ setup_window (struct file *file,
return -ENOMEM;
}
if (copy_from_user
(vcp, clips, sizeof(struct video_clip) * clipcount)) {
(vcp, clips, sizeof(struct v4l2_clip) * clipcount)) {
vfree(vcp);
return -EFAULT;
}
Expand Down Expand Up @@ -1349,7 +1347,7 @@ setup_overlay (struct file *file,
zr36057_overlay(zr, 0);
zr->overlay_mask = NULL;
} else {
if (!zr->buffer.base || !fh->overlay_settings.is_set) {
if (!zr->vbuf_base || !fh->overlay_settings.is_set) {
dprintk(1,
KERN_ERR
"%s: setup_overlay() - buffer or window not set\n",
Expand Down Expand Up @@ -2200,7 +2198,7 @@ static int zoran_s_fmt_vid_overlay(struct file *file, void *__fh,
fmt->fmt.win.w.top,
fmt->fmt.win.w.width,
fmt->fmt.win.w.height,
(struct video_clip __user *)
(struct v4l2_clip __user *)
fmt->fmt.win.clips,
fmt->fmt.win.clipcount,
fmt->fmt.win.bitmap);
Expand Down Expand Up @@ -2357,12 +2355,12 @@ static int zoran_g_fbuf(struct file *file, void *__fh,

memset(fb, 0, sizeof(*fb));
mutex_lock(&zr->resource_lock);
fb->base = zr->buffer.base;
fb->fmt.width = zr->buffer.width;
fb->fmt.height = zr->buffer.height;
fb->base = zr->vbuf_base;
fb->fmt.width = zr->vbuf_width;
fb->fmt.height = zr->vbuf_height;
if (zr->overlay_settings.format)
fb->fmt.pixelformat = fh->overlay_settings.format->fourcc;
fb->fmt.bytesperline = zr->buffer.bytesperline;
fb->fmt.bytesperline = zr->vbuf_bytesperline;
mutex_unlock(&zr->resource_lock);
fb->fmt.colorspace = V4L2_COLORSPACE_SRGB;
fb->fmt.field = V4L2_FIELD_INTERLACED;
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/media/video/zoran/zoran_procfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#include <linux/pci.h>
#include <linux/i2c.h>
#include <linux/i2c-algo-bit.h>
#include <linux/videodev.h>
#include <linux/videodev2.h>
#include <linux/spinlock.h>
#include <linux/sem.h>
#include <linux/seq_file.h>
Expand Down
Loading

0 comments on commit 10a7466

Please sign in to comment.