Lines Matching +full:8 +full:dev
13 …*clip_format |= (( ((palette&0xf00)>>8) << 30) | ((palette&0x00f) << 24) | (((palette&0x0f0)>>4) … in calculate_output_format_register()
16 static void calculate_hps_source_and_sync(struct saa7146_dev *dev, int source, int sync, u32* hps_c… in calculate_hps_source_and_sync() argument
48 {0x00, 2}, {0x02, 4}, {0x00, 4}, {0x06, 8}, {0x02, 8},
49 {0x08, 8}, {0x00, 8}, {0x1E, 16}, {0x0E, 8}, {0x26, 8},
50 {0x06, 8}, {0x42, 8}, {0x02, 8}, {0x80, 8}, {0x00, 8},
51 {0xFE, 16}, {0xFE, 8}, {0x7E, 8}, {0x7E, 8}, {0x3E, 8},
52 {0x3E, 8}, {0x1E, 8}, {0x1E, 8}, {0x0E, 8}, {0x0E, 8},
53 {0x06, 8}, {0x06, 8}, {0x02, 8}, {0x02, 8}, {0x00, 8},
54 {0x00, 8}, {0xFE, 16}, {0xFE, 8}, {0xFE, 8}, {0xFE, 8},
55 {0xFE, 8}, {0xFE, 8}, {0xFE, 8}, {0xFE, 8}, {0xFE, 8},
56 {0xFE, 8}, {0xFE, 8}, {0xFE, 8}, {0xFE, 8}, {0xFE, 8},
57 {0xFE, 8}, {0xFE, 8}, {0xFE, 8}, {0xFE, 8}, {0x7E, 8},
58 {0x7E, 8}, {0x3E, 8}, {0x3E, 8}, {0x1E, 8}, {0x1E, 8},
59 {0x0E, 8}, {0x0E, 8}, {0x06, 8}, {0x06, 8}, {0x02, 8},
60 {0x02, 8}, {0x00, 8}, {0x00, 8}, {0xFE, 16}
64 static u8 h_attenuation[] = { 1, 2, 4, 8, 2, 4, 8, 16, 0};
67 static int calculate_h_scale_registers(struct saa7146_dev *dev, in calculate_h_scale_registers() argument
185 *hps_h_prescale |= (dcgx << 27) | ((xpsc-1) << 18) | (xacm << 17) | (cxy << 8) | (cxuv << 0); in calculate_h_scale_registers()
194 {0x0100, 2}, {0x0102, 4}, {0x0300, 4}, {0x0106, 8}, {0x0502, 8},
195 {0x0708, 8}, {0x0F00, 8}, {0x011E, 16}, {0x110E, 16}, {0x1926, 16},
210 static u16 v_attenuation[] = { 2, 4, 8, 16, 32, 64, 128, 256, 0};
213 static int calculate_v_scale_registers(struct saa7146_dev *dev, enum v4l2_field field, in calculate_v_scale_registers() argument
300 *hps_v_scale |= (yacm << 31) | (ysci << 21) | (yacl << 15) | (ypo << 8 ) | (ype << 1); in calculate_v_scale_registers()
309 static void saa7146_set_window(struct saa7146_dev *dev, int width, int height, enum v4l2_field fiel… in saa7146_set_window() argument
311 struct saa7146_vv *vv = dev->vv_data; in saa7146_set_window()
320 hps_v_gain = 0; /* fixme: saa7146_read(dev, HPS_V_GAIN);*/ in saa7146_set_window()
321 …calculate_v_scale_registers(dev, field, vv->standard->v_field*2, height, &hps_v_scale, &hps_v_gain… in saa7146_set_window()
327 …calculate_h_scale_registers(dev, vv->standard->h_pixels, width, vv->hflip, &hps_ctrl, &hps_v_gain,… in saa7146_set_window()
331 calculate_hps_source_and_sync(dev, source, sync, &hps_ctrl); in saa7146_set_window()
334 saa7146_write(dev, HPS_V_SCALE, hps_v_scale); in saa7146_set_window()
335 saa7146_write(dev, HPS_V_GAIN, hps_v_gain); in saa7146_set_window()
336 saa7146_write(dev, HPS_CTRL, hps_ctrl); in saa7146_set_window()
337 saa7146_write(dev, HPS_H_PRESCALE,hps_h_prescale); in saa7146_set_window()
338 saa7146_write(dev, HPS_H_SCALE, hps_h_scale); in saa7146_set_window()
341 saa7146_write(dev, MC2, (MASK_05 | MASK_06 | MASK_21 | MASK_22) ); in saa7146_set_window()
344 static void saa7146_set_output_format(struct saa7146_dev *dev, unsigned long palette) in saa7146_set_output_format() argument
346 u32 clip_format = saa7146_read(dev, CLIP_FORMAT_CTRL); in saa7146_set_output_format()
349 calculate_output_format_register(dev,palette,&clip_format); in saa7146_set_output_format()
352 saa7146_write(dev, CLIP_FORMAT_CTRL, clip_format); in saa7146_set_output_format()
353 saa7146_write(dev, MC2, (MASK_05 | MASK_21)); in saa7146_set_output_format()
357 void saa7146_set_hps_source_and_sync(struct saa7146_dev *dev, int source, int sync) in saa7146_set_hps_source_and_sync() argument
359 struct saa7146_vv *vv = dev->vv_data; in saa7146_set_hps_source_and_sync()
363 hps_ctrl = saa7146_read(dev, HPS_CTRL); in saa7146_set_hps_source_and_sync()
369 saa7146_write(dev, HPS_CTRL, hps_ctrl); in saa7146_set_hps_source_and_sync()
370 saa7146_write(dev, MC2, (MASK_05 | MASK_21)); in saa7146_set_hps_source_and_sync()
377 void saa7146_write_out_dma(struct saa7146_dev* dev, int which, struct saa7146_video_dma* vdma) in saa7146_write_out_dma() argument
388 saa7146_write(dev, where, vdma->base_odd); in saa7146_write_out_dma()
389 saa7146_write(dev, where+0x04, vdma->base_even); in saa7146_write_out_dma()
390 saa7146_write(dev, where+0x08, vdma->prot_addr); in saa7146_write_out_dma()
391 saa7146_write(dev, where+0x0c, vdma->pitch); in saa7146_write_out_dma()
392 saa7146_write(dev, where+0x10, vdma->base_page); in saa7146_write_out_dma()
393 saa7146_write(dev, where+0x14, vdma->num_line_byte); in saa7146_write_out_dma()
396 saa7146_write(dev, MC2, (MASK_02<<(which-1))|(MASK_18<<(which-1))); in saa7146_write_out_dma()
407 static int calculate_video_dma_grab_packed(struct saa7146_dev* dev, struct saa7146_buf *buf) in calculate_video_dma_grab_packed() argument
409 struct saa7146_vv *vv = dev->vv_data; in calculate_video_dma_grab_packed()
412 struct saa7146_format *sfmt = saa7146_format_by_fourcc(dev, pix->pixelformat); in calculate_video_dma_grab_packed()
427 vdma1.pitch = (width*depth*2)/8; in calculate_video_dma_grab_packed()
466 saa7146_write_out_dma(dev, 1, &vdma1); in calculate_video_dma_grab_packed()
532 static int calculate_video_dma_grab_planar(struct saa7146_dev* dev, struct saa7146_buf *buf) in calculate_video_dma_grab_planar() argument
534 struct saa7146_vv *vv = dev->vv_data; in calculate_video_dma_grab_planar()
539 struct saa7146_format *sfmt = saa7146_format_by_fourcc(dev, pix->pixelformat); in calculate_video_dma_grab_planar()
627 saa7146_write_out_dma(dev, 1, &vdma1); in calculate_video_dma_grab_planar()
629 saa7146_write_out_dma(dev, 3, &vdma2); in calculate_video_dma_grab_planar()
630 saa7146_write_out_dma(dev, 2, &vdma3); in calculate_video_dma_grab_planar()
632 saa7146_write_out_dma(dev, 2, &vdma2); in calculate_video_dma_grab_planar()
633 saa7146_write_out_dma(dev, 3, &vdma3); in calculate_video_dma_grab_planar()
638 static void program_capture_engine(struct saa7146_dev *dev, int planar) in program_capture_engine() argument
640 struct saa7146_vv *vv = dev->vv_data; in program_capture_engine()
651 WRITE_RPS0(CMD_WR_REG | (1 << 8) | (MC2/4)); in program_capture_engine()
706 static void saa7146_disable_clipping(struct saa7146_dev *dev) in saa7146_disable_clipping() argument
708 u32 clip_format = saa7146_read(dev, CLIP_FORMAT_CTRL); in saa7146_disable_clipping()
714 saa7146_write(dev, CLIP_FORMAT_CTRL, clip_format); in saa7146_disable_clipping()
715 saa7146_write(dev, MC2, (MASK_05 | MASK_21)); in saa7146_disable_clipping()
718 saa7146_write(dev, MC1, MASK_21); in saa7146_disable_clipping()
721 void saa7146_set_capture(struct saa7146_dev *dev, struct saa7146_buf *buf, struct saa7146_buf *next) in saa7146_set_capture() argument
723 struct saa7146_vv *vv = dev->vv_data; in saa7146_set_capture()
725 struct saa7146_format *sfmt = saa7146_format_by_fourcc(dev, pix->pixelformat); in saa7146_set_capture()
730 vdma1_prot_addr = saa7146_read(dev, PROT_ADDR1); in saa7146_set_capture()
734 saa7146_write(dev, MC2, MASK_27 ); in saa7146_set_capture()
737 saa7146_set_window(dev, pix->width, pix->height, pix->field); in saa7146_set_capture()
738 saa7146_set_output_format(dev, sfmt->trans); in saa7146_set_capture()
739 saa7146_disable_clipping(dev); in saa7146_set_capture()
749 calculate_video_dma_grab_planar(dev, buf); in saa7146_set_capture()
750 program_capture_engine(dev,1); in saa7146_set_capture()
752 calculate_video_dma_grab_packed(dev, buf); in saa7146_set_capture()
753 program_capture_engine(dev,0); in saa7146_set_capture()
757 printk("vdma%d.base_even: 0x%08x\n", 1,saa7146_read(dev,BASE_EVEN1)); in saa7146_set_capture()
758 printk("vdma%d.base_odd: 0x%08x\n", 1,saa7146_read(dev,BASE_ODD1)); in saa7146_set_capture()
759 printk("vdma%d.prot_addr: 0x%08x\n", 1,saa7146_read(dev,PROT_ADDR1)); in saa7146_set_capture()
760 printk("vdma%d.base_page: 0x%08x\n", 1,saa7146_read(dev,BASE_PAGE1)); in saa7146_set_capture()
761 printk("vdma%d.pitch: 0x%08x\n", 1,saa7146_read(dev,PITCH1)); in saa7146_set_capture()
762 printk("vdma%d.num_line_byte: 0x%08x\n", 1,saa7146_read(dev,NUM_LINE_BYTE1)); in saa7146_set_capture()
763 printk("vdma%d => vptr : 0x%08x\n", 1,saa7146_read(dev,PCI_VDP1)); in saa7146_set_capture()
767 saa7146_write(dev, RPS_ADDR0, dev->d_rps0.dma_handle); in saa7146_set_capture()
770 saa7146_write(dev, MC1, (MASK_12 | MASK_28)); in saa7146_set_capture()