driver incorrectly handles the setting of frame rates

PR:	36415
Submitted by:	brandt@fokus.gmd.de
This commit is contained in:
jpaetzel 2017-06-27 03:45:09 +00:00
parent 4c38c193d4
commit 7ad107d1b8

View File

@ -972,7 +972,7 @@ video_open( bktr_ptr_t bktr )
bktr->flags |= METEOR_OPEN; bktr->flags |= METEOR_OPEN;
#ifdef BT848_DUMP #ifdef BT848_DUMP
dump_bt848( bt848 ); dump_bt848(bktr);
#endif #endif
bktr->clr_on_start = FALSE; bktr->clr_on_start = FALSE;
@ -1688,7 +1688,7 @@ video_ioctl( bktr_ptr_t bktr, int unit, ioctl_cmd_t cmd, caddr_t arg, struct thr
BT848_INT_VSYNC | BT848_INT_VSYNC |
BT848_INT_FMTCHG); BT848_INT_FMTCHG);
#ifdef BT848_DUMP #ifdef BT848_DUMP
dump_bt848( bt848 ); dump_bt848(bktr);
#endif #endif
break; break;
@ -2522,7 +2522,7 @@ common_ioctl( bktr_ptr_t bktr, ioctl_cmd_t cmd, caddr_t arg )
/* /*
* *
*/ */
#ifdef BT848_DEBUG #if defined(BT848_DEBUG) || defined(BT848_DUMP)
static int static int
dump_bt848( bktr_ptr_t bktr ) dump_bt848( bktr_ptr_t bktr )
{ {
@ -2542,7 +2542,7 @@ dump_bt848( bktr_ptr_t bktr )
r[i], INL(bktr, r[i]), r[i], INL(bktr, r[i]),
r[i+1], INL(bktr, r[i+1]), r[i+1], INL(bktr, r[i+1]),
r[i+2], INL(bktr, r[i+2]), r[i+2], INL(bktr, r[i+2]),
r[i+3], INL(bktr, r[i+3]])); r[i+3], INL(bktr, r[i+3]));
} }
printf("%s: INT STAT %x \n", bktr_name(bktr), printf("%s: INT STAT %x \n", bktr_name(bktr),
@ -3705,28 +3705,26 @@ start_capture( bktr_ptr_t bktr, unsigned type )
/* /*
* * Set the temporal decimation register to get the desired frame rate.
* We use the 'skip frame' modus always and always start dropping on an
* odd field.
*/ */
static void static void
set_fps( bktr_ptr_t bktr, u_short fps ) set_fps( bktr_ptr_t bktr, u_short fps )
{ {
struct format_params *fp; struct format_params *fp;
int i_flag;
fp = &format_params[bktr->format_params]; fp = &format_params[bktr->format_params];
switch(bktr->flags & METEOR_ONLY_FIELDS_MASK) { switch(bktr->flags & METEOR_ONLY_FIELDS_MASK) {
case METEOR_ONLY_EVEN_FIELDS: case METEOR_ONLY_EVEN_FIELDS:
bktr->flags |= METEOR_WANT_EVEN; bktr->flags |= METEOR_WANT_EVEN;
i_flag = 1;
break; break;
case METEOR_ONLY_ODD_FIELDS: case METEOR_ONLY_ODD_FIELDS:
bktr->flags |= METEOR_WANT_ODD; bktr->flags |= METEOR_WANT_ODD;
i_flag = 1;
break; break;
default: default:
bktr->flags |= METEOR_WANT_MASK; bktr->flags |= METEOR_WANT_MASK;
i_flag = 2;
break; break;
} }
@ -3737,7 +3735,7 @@ set_fps( bktr_ptr_t bktr, u_short fps )
OUTB(bktr, BKTR_TDEC, 0); OUTB(bktr, BKTR_TDEC, 0);
if (fps < fp->frame_rate) if (fps < fp->frame_rate)
OUTB(bktr, BKTR_TDEC, i_flag*(fp->frame_rate - fps) & 0x3f); OUTB(bktr, BKTR_TDEC, (fp->frame_rate - fps) & 0x3f);
else else
OUTB(bktr, BKTR_TDEC, 0); OUTB(bktr, BKTR_TDEC, 0);
return; return;