staticbool lml33dpath; /* default = 0 * 1 will use digital path in capture * mode instead of analog. It can be * used for picture adjustments using * tool like xawtv while watching image * on TV monitor connected to the output. * However, due to absence of 75 Ohm * load on Bt819 input, there will be * some image imperfections
*/
module_param(lml33dpath, bool, 0644);
MODULE_PARM_DESC(lml33dpath, "Use digital path capture mode (on LML33 cards)");
/* * initialize video front end
*/ staticvoid zr36057_init_vfe(struct zoran *zr)
{
u32 reg;
/* Make sure the bit number is legal * A bit number of -1 (lacking) gives a mask of 0, * making it harmless
*/
mask = (1 << (24 + bit)) & 0xff000000;
reg = btread(ZR36057_GPPGCR1) & ~mask; if (value)
reg |= mask;
btwrite(reg, ZR36057_GPPGCR1);
udelay(1);
}
/* * Wait til post office is no longer busy
*/
int post_office_wait(struct zoran *zr)
{
u32 por;
while ((por = btread(ZR36057_POR)) & ZR36057_POR_PO_PEN) { /* wait for something to happen */ /* TODO add timeout */
} if ((por & ZR36057_POR_PO_TIME) && !zr->card.gws_not_connected) { /* In LML33/BUZ \GWS line is not connected, so it has always timeout set */
pci_info(zr->pci_dev, "pop timeout %08x\n", por); return -1;
}
/* * Set the registers for the size we have specified. Don't bother * trying to understand this without the ZR36057 manual in front of * you [AC].
*/ staticvoid zr36057_adjust_vfe(struct zoran *zr, enum zoran_codec_mode mode)
{
u32 reg;
if (video_width < BUZ_MIN_WIDTH ||
video_height < BUZ_MIN_HEIGHT ||
video_width > wa || video_height > ha) {
pci_err(zr->pci_dev, "set_vfe: w=%d h=%d not valid\n", video_width, video_height); return;
}
/**** zr36057 ****/
/* horizontal */
vid_win_wid = video_width;
X = DIV_ROUND_UP(vid_win_wid * 64, tvn->wa);
we = (vid_win_wid * 64) / X;
hor_dcm = 64 - X;
hcrop1 = 2 * ((tvn->wa - we) / 4);
hcrop2 = tvn->wa - we - hcrop1;
h_start = tvn->h_start ? tvn->h_start : 1; /* (Ronald) Original comment: * "| 1 Doesn't have any effect, tested on both a DC10 and a DC10+" * this is false. It inverses chroma values on the LML33R10 (so Cr * suddenly is shown as Cb and reverse, really cool effect if you * want to see blue faces, not useful otherwise). So don't use |1. * However, the DC10 has '0' as h_start, but does need |1, so we * use a dirty check...
*/
h_end = h_start + tvn->wa - 1;
h_start += hcrop1;
h_end -= hcrop2;
reg = ((h_start & ZR36057_VFEHCR_HMASK) << ZR36057_VFEHCR_H_START)
| ((h_end & ZR36057_VFEHCR_HMASK) << ZR36057_VFEHCR_H_END); if (zr->card.vfe_pol.hsync_pol)
reg |= ZR36057_VFEHCR_HS_POL;
btwrite(reg, ZR36057_VFEHCR);
/* scaler and pixel format */
reg = 0;
reg |= (hor_dcm << ZR36057_VFESPFR_HOR_DCM);
reg |= (ver_dcm << ZR36057_VFESPFR_VER_DCM);
reg |= (disp_mode << ZR36057_VFESPFR_DISP_MODE); /* * RJ: I don't know, why the following has to be the opposite * of the corresponding ZR36060 setting, but only this way * we get the correct colors when uncompressing to the screen
*/ //reg |= ZR36057_VFESPFR_VCLK_POL; /* RJ: Don't know if that is needed for NTSC also */ if (!(zr->norm & V4L2_STD_NTSC))
reg |= ZR36057_VFESPFR_EXT_FL; // NEEDED!!!!!!! Wolfgang
reg |= ZR36057_VFESPFR_TOP_FIELD; if (hor_dcm >= 48)
reg |= 3 << ZR36057_VFESPFR_H_FILTER; /* 5 tap filter */ elseif (hor_dcm >= 32)
reg |= 2 << ZR36057_VFESPFR_H_FILTER; /* 4 tap filter */ elseif (hor_dcm >= 16)
reg |= 1 << ZR36057_VFESPFR_H_FILTER; /* 3 tap filter */
/* Enable/Disable uncompressed memory grabbing of the 36057 */ void zr36057_set_memgrab(struct zoran *zr, int mode)
{ if (mode) { /* We only check SnapShot and not FrameGrab here. SnapShot==1 * means a capture is already in progress, but FrameGrab==1 * doesn't necessary mean that. It's more correct to say a 1 * to 0 transition indicates a capture completed. If a * capture is pending when capturing is tuned off, FrameGrab * will be stuck at 1 until capturing is turned back on.
*/ if (btread(ZR36057_VSSFGR) & ZR36057_VSSFGR_SNAP_SHOT)
pci_warn(zr->pci_dev, "%s(1) with SnapShot on!?\n", __func__);
/* Set zr36057 video front end and enable video */
zr36057_set_vfe(zr, zr->v4l_settings.width,
zr->v4l_settings.height,
zr->v4l_settings.format);
} else { /* switch off VSync interrupts */
btand(~zr->card.vsync_int, ZR36057_ICR); // SW
/* re-enable grabbing to screen if it was running */
btand(~ZR36057_VDCR_VID_EN, ZR36057_VDCR);
btand(~ZR36057_VSSFGR_SNAP_SHOT, ZR36057_VSSFGR);
}
}
/***************************************************************************** * * * Set up the Buz-specific MJPEG part * * *
*****************************************************************************/
case BUZ_MODE_MOTION_DECOMPRESS:
reg = ZR36057_JMC_MJPG_EXP_MODE;
reg |= ZR36057_JMC_SYNC_MSTR; /* RJ: The following is experimental - improves the output to screen */ //if(zr->jpg_settings.VFIFO_FB) reg |= ZR36057_JMC_VFIFO_FB; // No, it doesn't. SM break;
case BUZ_MODE_STILL_COMPRESS:
reg = ZR36057_JMC_JPG_CMP_MODE; break;
case BUZ_MODE_STILL_DECOMPRESS:
reg = ZR36057_JMC_JPG_EXP_MODE; break;
}
reg |= ZR36057_JMC_JPG; if (zr->jpg_settings.field_per_buff == 1)
reg |= ZR36057_JMC_FLD_PER_BUFF;
btwrite(reg, ZR36057_JMC);
/* In motion compress mode, the decoder output must be enabled, and * the video bus direction set to input.
*/
set_videobus_dir(zr, 0);
decoder_call(zr, video, s_stream, 1);
encoder_call(zr, video, s_routing, 0, 0, 0);
/* Take the JPEG codec and the VFE out of sleep */
jpeg_codec_sleep(zr, 0);
case BUZ_MODE_MOTION_DECOMPRESS: /* In motion decompression mode, the decoder output must be disabled, and * the video bus direction set to output.
*/
decoder_call(zr, video, s_stream, 0);
set_videobus_dir(zr, 1);
encoder_call(zr, video, s_routing, 1, 0, 0);
/* Take the JPEG codec and the VFE out of sleep */
jpeg_codec_sleep(zr, 0); /* Setup the VFE */ if (zr->vfe) {
zr->vfe->set_video(zr->vfe, zr->timing, &cap,
&zr->card.vfe_pol);
zr->vfe->set_mode(zr->vfe, CODEC_DO_EXPANSION);
} /* Setup the JPEG codec */
zr->codec->set_video(zr->codec, zr->timing, &cap,
&zr->card.vfe_pol);
zr->codec->set_mode(zr->codec, CODEC_DO_EXPANSION);
init_jpeg_queue(zr);
zr36057_set_jpg(zr, mode); // \P_Reset, ... Video param, FIFO
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.