V4L/DVB (8750): V4L: check inval in video_register_device_index()
[safe/jmp/linux-2.6] / drivers / media / video / ivtv / ivtv-driver.h
index 12ff938..2ceb522 100644 (file)
 #include <linux/dvb/video.h>
 #include <linux/dvb/audio.h>
 #include <media/v4l2-common.h>
+#include <media/v4l2-ioctl.h>
 #include <media/tuner.h>
 #include <media/cx2341x.h>
 
 #include <linux/ivtv.h>
 
-
 /* Memory layout */
 #define IVTV_ENCODER_OFFSET    0x00000000
 #define IVTV_ENCODER_SIZE      0x00800000      /* Total size is 0x01000000, but only first half is used */
@@ -251,6 +251,7 @@ struct ivtv_mailbox_data {
 #define IVTV_F_I_DEC_PAUSED       20   /* the decoder is paused */
 #define IVTV_F_I_INITED                   21   /* set after first open */
 #define IVTV_F_I_FAILED                   22   /* set if first open failed */
+#define IVTV_F_I_WORK_INITED       23  /* worker thread was initialized */
 
 /* Event notifications */
 #define IVTV_F_I_EV_DEC_STOPPED           28   /* decoder stopped event */
@@ -260,6 +261,12 @@ struct ivtv_mailbox_data {
 
 /* Scatter-Gather array element, used in DMA transfers */
 struct ivtv_sg_element {
+       __le32 src;
+       __le32 dst;
+       __le32 size;
+};
+
+struct ivtv_sg_host_element {
        u32 src;
        u32 dst;
        u32 size;
@@ -350,8 +357,8 @@ struct ivtv_stream {
        u16 dma_xfer_cnt;
 
        /* Base Dev SG Array for cx23415/6 */
-       struct ivtv_sg_element *sg_pending;
-       struct ivtv_sg_element *sg_processing;
+       struct ivtv_sg_host_element *sg_pending;
+       struct ivtv_sg_host_element *sg_processing;
        struct ivtv_sg_element *sg_dma;
        dma_addr_t sg_handle;
        int sg_pending_size;
@@ -392,6 +399,9 @@ struct yuv_frame_info
        u32 tru_h;
        u32 offset_y;
        s32 lace_mode;
+       u32 sync_field;
+       u32 delay;
+       u32 interlaced;
 };
 
 #define IVTV_YUV_MODE_INTERLACED       0x00
@@ -454,6 +464,8 @@ struct yuv_playback_info
        int v_filter_2;
        int h_filter;
 
+       u8 track_osd; /* Should yuv output track the OSD size & position */
+
        u32 osd_x_offset;
        u32 osd_y_offset;
 
@@ -463,9 +475,10 @@ struct yuv_playback_info
        u32 osd_vis_w;
        u32 osd_vis_h;
 
-       int decode_height;
+       u32 osd_full_w;
+       u32 osd_full_h;
 
-       int frame_interlaced;
+       int decode_height;
 
        int lace_mode;
        int lace_threshold;
@@ -477,8 +490,6 @@ struct yuv_playback_info
        u32 yuv_forced_update;
        int update_frame;
 
-       int sync_field[IVTV_YUV_BUFFERS];  /* Field to sync on */
-       int field_delay[IVTV_YUV_BUFFERS]; /* Flag to extend duration of previous frame */
        u8 fields_lapsed;   /* Counter used when delaying a frame */
 
        struct yuv_frame_info new_frame_info[IVTV_YUV_BUFFERS];
@@ -492,6 +503,10 @@ struct yuv_playback_info
 
        u8 draw_frame; /* PVR350 buffer to draw into */
        u8 max_frames_buffered; /* Maximum number of frames to buffer */
+
+       struct v4l2_rect main_rect;
+       u32 v4l2_src_w;
+       u32 v4l2_src_h;
 };
 
 #define IVTV_VBI_FRAMES 32
@@ -584,13 +599,13 @@ struct ivtv {
        struct pci_dev *dev;            /* PCI device */
        const struct ivtv_card *card;   /* card information */
        const char *card_name;          /* full name of the card */
+       const struct ivtv_card_tuner_i2c *card_i2c; /* i2c addresses to probe for tuner */
        u8 has_cx23415;                 /* 1 if it is a cx23415 based card, 0 for cx23416 */
        u8 pvr150_workaround;           /* 1 if the cx25840 needs to workaround a PVR150 bug */
        u8 nof_inputs;                  /* number of video inputs */
        u8 nof_audio_inputs;            /* number of audio inputs */
        u32 v4l2_cap;                   /* V4L2 capabilities of card */
        u32 hw_flags;                   /* hardware description of the board */
-       int tunerid;                    /* userspace tuner ID for experimental Xceive tuner support */
        v4l2_std_id tuner_std;          /* the norm of the card's tuner (fixed) */
                                        /* controlling video decoder function */
        int (*video_dec_func)(struct ivtv *, unsigned int, void *);
@@ -622,7 +637,6 @@ struct ivtv {
        spinlock_t lock;                /* lock access to this struct */
        struct mutex serialize_lock;    /* mutex used to serialize open/close/start/stop/ioctl operations */
 
-
        /* Streams */
        int stream_buf_size[IVTV_MAX_STREAMS];          /* stream buffer size */
        struct ivtv_stream streams[IVTV_MAX_STREAMS];   /* stream data */