Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 76517
b: refs/heads/master
c: 3b5c1c8
h: refs/heads/master
i:
  76515: 5651dcd
v: v3
  • Loading branch information
Ian Armstrong authored and Mauro Carvalho Chehab committed Jan 25, 2008
1 parent 174771d commit c1f6f57
Show file tree
Hide file tree
Showing 4 changed files with 200 additions and 210 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: 406c8b0ff0891ace87440bcb298a91c1927f9ae5
refs/heads/master: 3b5c1c8e71eb8fe2297a5884db59108e3c8b44c5
7 changes: 3 additions & 4 deletions trunk/drivers/media/video/ivtv/ivtv-driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,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
Expand Down Expand Up @@ -465,8 +468,6 @@ struct yuv_playback_info

int decode_height;

int frame_interlaced;

int lace_mode;
int lace_threshold;
int lace_sync_field;
Expand All @@ -477,8 +478,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];
Expand Down
19 changes: 11 additions & 8 deletions trunk/drivers/media/video/ivtv/ivtv-irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -746,15 +746,16 @@ static void ivtv_irq_vsync(struct ivtv *itv)
unsigned int frame = read_reg(0x28c0) & 1;
struct yuv_playback_info *yi = &itv->yuv_info;
int last_dma_frame = atomic_read(&itv->yuv_info.next_dma_frame);
struct yuv_frame_info *f = &yi->new_frame_info[last_dma_frame];

if (0) IVTV_DEBUG_IRQ("DEC VSYNC\n");

if (((frame ^ yi->sync_field[last_dma_frame]) == 0 &&
((itv->last_vsync_field & 1) ^ yi->sync_field[last_dma_frame])) ||
(frame != (itv->last_vsync_field & 1) && !yi->frame_interlaced)) {
if (((frame ^ f->sync_field) == 0 &&
((itv->last_vsync_field & 1) ^ f->sync_field)) ||
(frame != (itv->last_vsync_field & 1) && !f->interlaced)) {
int next_dma_frame = last_dma_frame;

if (!(yi->frame_interlaced && yi->field_delay[next_dma_frame] && yi->fields_lapsed < 1)) {
if (!(f->interlaced && f->delay && yi->fields_lapsed < 1)) {
if (next_dma_frame >= 0 && next_dma_frame != atomic_read(&yi->next_fill_frame)) {
write_reg(yuv_offset[next_dma_frame] >> 4, 0x82c);
write_reg((yuv_offset[next_dma_frame] + IVTV_YUV_BUFFER_UV_OFFSET) >> 4, 0x830);
Expand Down Expand Up @@ -795,13 +796,15 @@ static void ivtv_irq_vsync(struct ivtv *itv)
}

/* Check if we need to update the yuv registers */
if ((yi->yuv_forced_update || yi->new_frame_info[last_dma_frame].update) && last_dma_frame != -1) {
if (!yi->new_frame_info[last_dma_frame].update)
if ((yi->yuv_forced_update || f->update) && last_dma_frame != -1) {
if (!f->update) {
last_dma_frame = (u8)(last_dma_frame - 1) % IVTV_YUV_BUFFERS;
f = &yi->new_frame_info[last_dma_frame];
}

if (yi->new_frame_info[last_dma_frame].src_w) {
if (f->src_w) {
yi->update_frame = last_dma_frame;
yi->new_frame_info[last_dma_frame].update = 0;
f->update = 0;
yi->yuv_forced_update = 0;
set_bit(IVTV_F_I_WORK_HANDLER_YUV, &itv->i_flags);
set_bit(IVTV_F_I_HAVE_WORK, &itv->i_flags);
Expand Down
Loading

0 comments on commit c1f6f57

Please sign in to comment.