summaryrefslogtreecommitdiff
path: root/linux/drivers/media
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2007-08-23 16:31:57 +0200
committerHans Verkuil <hverkuil@xs4all.nl>2007-08-23 16:31:57 +0200
commit7ac202b371d6244773f1d66180b4d3080de8c042 (patch)
tree8b5afea73c9c5c56c65e232cef6445e573662f5c /linux/drivers/media
parent8ac5e2c9cf53a64ef3afe6216f1e99c6623f8719 (diff)
downloadmediapointer-dvb-s2-7ac202b371d6244773f1d66180b4d3080de8c042.tar.gz
mediapointer-dvb-s2-7ac202b371d6244773f1d66180b4d3080de8c042.tar.bz2
ivtv: more ivtv-driver.h cleanups.
From: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Diffstat (limited to 'linux/drivers/media')
-rw-r--r--linux/drivers/media/video/ivtv/ivtv-driver.h68
-rw-r--r--linux/drivers/media/video/ivtv/ivtv-fb.c2
-rw-r--r--linux/drivers/media/video/ivtv/ivtv-irq.c10
3 files changed, 39 insertions, 41 deletions
diff --git a/linux/drivers/media/video/ivtv/ivtv-driver.h b/linux/drivers/media/video/ivtv/ivtv-driver.h
index 0567b0954..5e71d3a69 100644
--- a/linux/drivers/media/video/ivtv/ivtv-driver.h
+++ b/linux/drivers/media/video/ivtv/ivtv-driver.h
@@ -187,11 +187,11 @@ extern int ivtv_debug;
#define IVTV_MAX_PGM_INDEX (400)
struct ivtv_options {
- int kilobytes[IVTV_MAX_STREAMS]; /* Size in kilobytes of each stream */
- int cardtype; /* force card type on load */
- int tuner; /* set tuner on load */
- int radio; /* enable/disable radio */
- int newi2c; /* New I2C algorithm */
+ int kilobytes[IVTV_MAX_STREAMS]; /* size in kilobytes of each stream */
+ int cardtype; /* force card type on load */
+ int tuner; /* set tuner on load */
+ int radio; /* enable/disable radio */
+ int newi2c; /* new I2C algorithm */
};
/* ivtv-specific mailbox template */
@@ -238,10 +238,10 @@ struct ivtv_mailbox_data {
#define IVTV_F_I_DMA 0 /* DMA in progress */
#define IVTV_F_I_UDMA 1 /* UDMA in progress */
#define IVTV_F_I_UDMA_PENDING 2 /* UDMA pending */
-#define IVTV_F_I_SPEED_CHANGE 3 /* A speed change is in progress */
-#define IVTV_F_I_EOS 4 /* End of encoder stream reached */
-#define IVTV_F_I_RADIO_USER 5 /* The radio tuner is selected */
-#define IVTV_F_I_DIG_RST 6 /* Reset digitizer */
+#define IVTV_F_I_SPEED_CHANGE 3 /* a speed change is in progress */
+#define IVTV_F_I_EOS 4 /* end of encoder stream reached */
+#define IVTV_F_I_RADIO_USER 5 /* the radio tuner is selected */
+#define IVTV_F_I_DIG_RST 6 /* reset digitizer */
#define IVTV_F_I_DEC_YUV 7 /* YUV instead of MPG is being decoded */
#define IVTV_F_I_UPDATE_CC 9 /* CC should be updated */
#define IVTV_F_I_UPDATE_WSS 10 /* WSS should be updated */
@@ -249,7 +249,7 @@ struct ivtv_mailbox_data {
#define IVTV_F_I_DECODING_YUV 12 /* this stream is YUV frame decoding */
#define IVTV_F_I_ENC_PAUSED 13 /* the encoder is paused */
#define IVTV_F_I_VALID_DEC_TIMINGS 14 /* last_dec_timing is valid */
-#define IVTV_F_I_HAVE_WORK 15 /* Used in the interrupt handler: there is work to be done */
+#define IVTV_F_I_HAVE_WORK 15 /* used in the interrupt handler: there is work to be done */
#define IVTV_F_I_WORK_HANDLER_VBI 16 /* there is work to be done for VBI */
#define IVTV_F_I_WORK_HANDLER_YUV 17 /* there is work to be done for YUV */
#define IVTV_F_I_WORK_HANDLER_PIO 18 /* there is work to be done for PIO */
@@ -306,19 +306,18 @@ struct ivtv_buffer {
unsigned short b_flags;
unsigned short dma_xfer_cnt;
char *buf;
-
u32 bytesused;
u32 readpos;
};
struct ivtv_queue {
- struct list_head list;
- u32 buffers;
- u32 length;
- u32 bytesused;
+ struct list_head list; /* the list of buffers in this queue */
+ u32 buffers; /* number of buffers in this queue */
+ u32 length; /* total number of bytes of available buffer space */
+ u32 bytesused; /* total number of bytes used in this queue */
};
-struct ivtv; /* forward reference */
+struct ivtv; /* forward reference */
struct ivtv_stream {
/* These first four fields are always set, even if the stream
@@ -329,11 +328,9 @@ struct ivtv_stream {
int type; /* stream type */
u32 id;
- spinlock_t qlock; /* locks access to the queues */
- unsigned long s_flags; /* status flags, see above */
- int dma; /* can be PCI_DMA_TODEVICE,
- PCI_DMA_FROMDEVICE or
- PCI_DMA_NONE */
+ spinlock_t qlock; /* locks access to the queues */
+ unsigned long s_flags; /* status flags, see above */
+ int dma; /* can be PCI_DMA_TODEVICE, PCI_DMA_FROMDEVICE or PCI_DMA_NONE */
u32 pending_offset;
u32 pending_backup;
u64 pending_pts;
@@ -376,10 +373,10 @@ struct ivtv_stream {
};
struct ivtv_open_id {
- u32 open_id;
- int type;
- int yuv_frames;
- enum v4l2_priority prio;
+ u32 open_id; /* unique ID for this file descriptor */
+ int type; /* stream type */
+ int yuv_frames; /* 1: started OUT_UDMA_YUV output mode */
+ enum v4l2_priority prio; /* priority */
struct ivtv *itv;
};
@@ -504,6 +501,14 @@ struct yuv_playback_info
/* VBI data */
struct vbi_info {
+ /* VBI general fixed card data */
+ u32 raw_decoder_line_size; /* raw VBI line size from digitizer */
+ u8 raw_decoder_sav_odd_field; /* raw VBI Start Active Video digitizer code of odd field */
+ u8 raw_decoder_sav_even_field; /* raw VBI Start Active Video digitizer code of even field */
+ u32 sliced_decoder_line_size; /* sliced VBI line size from digitizer */
+ u8 sliced_decoder_sav_odd_field; /* sliced VBI Start Active Video digitizer code of odd field */
+ u8 sliced_decoder_sav_even_field; /* sliced VBI Start Active Video digitizer code of even field */
+
u32 dec_start;
u32 enc_start, enc_size;
int fpi;
@@ -517,12 +522,6 @@ struct vbi_info {
int wss;
u8 wss_found;
u8 wss_no_update;
- u32 raw_decoder_line_size;
- u8 raw_decoder_sav_odd_field;
- u8 raw_decoder_sav_even_field;
- u32 sliced_decoder_line_size;
- u8 sliced_decoder_sav_odd_field;
- u8 sliced_decoder_sav_even_field;
struct v4l2_format in;
/* convenience pointer to sliced struct in vbi_in union */
struct v4l2_sliced_vbi_format *sliced_in;
@@ -603,11 +602,10 @@ struct ivtv {
/* Locking */
spinlock_t lock; /* lock access to this struct */
- /* mutex used to serialize open/close/start/stop/ioctl operations */
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
- struct mutex serialize_lock;
+ struct mutex serialize_lock; /* mutex used to serialize open/close/start/stop/ioctl operations */
#else
- struct semaphore serialize_lock;
+ struct semaphore serialize_lock;/* mutex used to serialize open/close/start/stop/ioctl operations */
#endif
@@ -631,7 +629,7 @@ struct ivtv {
int dma_retries; /* current DMA retry attempt */
struct ivtv_user_dma udma; /* user based DMA for OSD */
struct timer_list dma_timer; /* timer used to catch unfinished DMAs */
- u32 last_vsync_frame; /* last seen vsync field */
+ u32 last_vsync_field; /* last seen vsync field */
wait_queue_head_t dma_waitq; /* wake up when the current DMA is finished */
wait_queue_head_t eos_waitq; /* wake up when EOS arrives */
wait_queue_head_t event_waitq; /* wake up when the next decoder event arrives */
diff --git a/linux/drivers/media/video/ivtv/ivtv-fb.c b/linux/drivers/media/video/ivtv/ivtv-fb.c
index f5ed2cf1c..e80564aed 100644
--- a/linux/drivers/media/video/ivtv/ivtv-fb.c
+++ b/linux/drivers/media/video/ivtv/ivtv-fb.c
@@ -405,7 +405,7 @@ static int ivtvfb_ioctl(struct fb_info *info, unsigned int cmd, unsigned long ar
if (itv->is_50hz && trace > 312) trace -= 312;
else if (itv->is_60hz && trace > 262) trace -= 262;
if (trace == 1) vblank.flags |= FB_VBLANK_VSYNCING;
- vblank.count = itv->last_vsync_frame;
+ vblank.count = itv->last_vsync_field;
vblank.vcount = trace;
vblank.hcount = 0;
if (copy_to_user((void __user *)arg, &vblank, sizeof(vblank)))
diff --git a/linux/drivers/media/video/ivtv/ivtv-irq.c b/linux/drivers/media/video/ivtv/ivtv-irq.c
index 92a6e22bf..b34d3b81f 100644
--- a/linux/drivers/media/video/ivtv/ivtv-irq.c
+++ b/linux/drivers/media/video/ivtv/ivtv-irq.c
@@ -756,8 +756,8 @@ static void ivtv_irq_vsync(struct ivtv *itv)
if (0) IVTV_DEBUG_IRQ("DEC VSYNC\n");
if (((frame ^ itv->yuv_info.sync_field[last_dma_frame]) == 0 &&
- ((itv->last_vsync_frame & 1) ^ itv->yuv_info.sync_field[last_dma_frame])) ||
- (frame != (itv->last_vsync_frame & 1) && !itv->yuv_info.frame_interlaced)) {
+ ((itv->last_vsync_field & 1) ^ itv->yuv_info.sync_field[last_dma_frame])) ||
+ (frame != (itv->last_vsync_field & 1) && !itv->yuv_info.frame_interlaced)) {
int next_dma_frame = last_dma_frame;
if (!(itv->yuv_info.frame_interlaced && itv->yuv_info.field_delay[next_dma_frame] && itv->yuv_info.fields_lapsed < 1)) {
@@ -772,10 +772,10 @@ static void ivtv_irq_vsync(struct ivtv *itv)
}
}
}
- if (frame != (itv->last_vsync_frame & 1)) {
+ if (frame != (itv->last_vsync_field & 1)) {
struct ivtv_stream *s = ivtv_get_output_stream(itv);
- itv->last_vsync_frame += 1;
+ itv->last_vsync_field += 1;
if (frame == 0) {
clear_bit(IVTV_F_I_VALID_DEC_TIMINGS, &itv->i_flags);
clear_bit(IVTV_F_I_EV_VSYNC_FIELD, &itv->i_flags);
@@ -844,7 +844,7 @@ irqreturn_t ivtv_irq_handler(int irq, void *dev_id)
*/
if (~itv->irqmask & IVTV_IRQ_DEC_VSYNC) {
/* vsync is enabled, see if we're in a new field */
- if ((itv->last_vsync_frame & 1) != (read_reg(0x28c0) & 1)) {
+ if ((itv->last_vsync_field & 1) != (read_reg(0x28c0) & 1)) {
/* New field, looks like we missed it */
IVTV_DEBUG_YUV("VSync interrupt missed %d\n",read_reg(0x28c0)>>16);
vsync_force = 1;