• Home
  • Raw
  • Download

Lines Matching +full:ri +full:- +full:override

3     bttv-risc.c  --  interfaces to other kernel modules
6 - memory management
7 - generation
9 (c) 2000-2003 Gerd Knorr <kraxel@bytesex.org>
37 #include <media/v4l2-ioctl.h>
43 /* ---------------------------------------------------------- */
66 if ((rc = btcx_riscmem_alloc(btv->c.pci,risc,instructions)) < 0) in bttv_risc_packed()
70 rp = risc->cpu; in bttv_risc_packed()
74 while (skip_lines-- > 0) { in bttv_risc_packed()
82 if ((btv->opt_vcr_hack) && in bttv_risc_packed()
83 (line >= (store_lines - VCR_HACK_LINES))) in bttv_risc_packed()
86 offset -= sg_dma_len(sg); in bttv_risc_packed()
89 if (bpl <= sg_dma_len(sg)-offset) { in bttv_risc_packed()
99 (sg_dma_len(sg)-offset)); in bttv_risc_packed()
101 todo -= (sg_dma_len(sg)-offset); in bttv_risc_packed()
108 todo -= sg_dma_len(sg); in bttv_risc_packed()
120 risc->jmp = rp; in bttv_risc_packed()
121 BUG_ON((risc->jmp - risc->cpu + 2) * sizeof(*risc->cpu) > risc->size); in bttv_risc_packed()
136 u32 ri; in bttv_risc_planar() local
149 if ((rc = btcx_riscmem_alloc(btv->c.pci,risc,instructions*4*5)) < 0) in bttv_risc_planar()
153 rp = risc->cpu; in bttv_risc_planar()
162 if ((btv->opt_vcr_hack) && in bttv_risc_planar()
163 (line >= (ylines - VCR_HACK_LINES))) in bttv_risc_planar()
186 for (todo = ybpl; todo > 0; todo -= ylen) { in bttv_risc_planar()
189 yoffset -= sg_dma_len(ysg); in bttv_risc_planar()
196 ylen = sg_dma_len(ysg) - yoffset; in bttv_risc_planar()
199 uoffset -= sg_dma_len(usg); in bttv_risc_planar()
203 voffset -= sg_dma_len(vsg); in bttv_risc_planar()
208 ylen = (sg_dma_len(usg) - uoffset) << hshift; in bttv_risc_planar()
210 ylen = (sg_dma_len(vsg) - voffset) << hshift; in bttv_risc_planar()
211 ri = BT848_RISC_WRITE123; in bttv_risc_planar()
213 ri = BT848_RISC_WRITE1S23; in bttv_risc_planar()
216 ri |= BT848_RISC_SOL; in bttv_risc_planar()
218 ri |= BT848_RISC_EOL; in bttv_risc_planar()
221 *(rp++)=cpu_to_le32(ri | ylen); in bttv_risc_planar()
241 risc->jmp = rp; in bttv_risc_planar()
242 BUG_ON((risc->jmp - risc->cpu + 2) * sizeof(*risc->cpu) > risc->size); in bttv_risc_planar()
255 u32 ri,ra; in bttv_risc_overlay() local
259 skips = kmalloc_array(ov->nclips, sizeof(*skips),GFP_KERNEL); in bttv_risc_overlay()
261 return -ENOMEM; in bttv_risc_overlay()
265 dwords = (3 * ov->nclips + 2) * in bttv_risc_overlay()
266 ((skip_even || skip_odd) ? (ov->w.height+1)>>1 : ov->w.height); in bttv_risc_overlay()
268 if ((rc = btcx_riscmem_alloc(btv->c.pci,risc,dwords*4)) < 0) { in bttv_risc_overlay()
274 rp = risc->cpu; in bttv_risc_overlay()
278 addr = (unsigned long)btv->fbuf.base; in bttv_risc_overlay()
279 addr += btv->fbuf.fmt.bytesperline * ov->w.top; in bttv_risc_overlay()
280 addr += (fmt->depth >> 3) * ov->w.left; in bttv_risc_overlay()
283 for (maxy = -1, line = 0; line < ov->w.height; in bttv_risc_overlay()
284 line++, addr += btv->fbuf.fmt.bytesperline) { in bttv_risc_overlay()
285 if ((btv->opt_vcr_hack) && in bttv_risc_overlay()
286 (line >= (ov->w.height - VCR_HACK_LINES))) in bttv_risc_overlay()
295 btcx_calc_skips(line, ov->w.width, &maxy, in bttv_risc_overlay()
296 skips, &nskips, ov->clips, ov->nclips); in bttv_risc_overlay()
299 for (start = 0, skip = 0; start < ov->w.width; start = end) { in bttv_risc_overlay()
301 ri = BT848_RISC_WRITE; in bttv_risc_overlay()
302 end = ov->w.width; in bttv_risc_overlay()
304 ri = BT848_RISC_WRITE; in bttv_risc_overlay()
307 ri = BT848_RISC_SKIP; in bttv_risc_overlay()
311 if (BT848_RISC_WRITE == ri) in bttv_risc_overlay()
312 ra = addr + (fmt->depth>>3)*start; in bttv_risc_overlay()
317 ri |= BT848_RISC_SOL; in bttv_risc_overlay()
318 if (ov->w.width == end) in bttv_risc_overlay()
319 ri |= BT848_RISC_EOL; in bttv_risc_overlay()
320 ri |= (fmt->depth>>3) * (end-start); in bttv_risc_overlay()
322 *(rp++)=cpu_to_le32(ri); in bttv_risc_overlay()
329 risc->jmp = rp; in bttv_risc_overlay()
330 BUG_ON((risc->jmp - risc->cpu + 2) * sizeof(*risc->cpu) > risc->size); in bttv_risc_overlay()
335 /* ---------------------------------------------------------- */
345 int swidth = tvnorm->swidth; in bttv_calc_geo_old()
346 int totalwidth = tvnorm->totalwidth; in bttv_calc_geo_old()
347 int scaledtwidth = tvnorm->scaledtwidth; in bttv_calc_geo_old()
349 if (btv->input == btv->dig) { in bttv_calc_geo_old()
355 vdelay = tvnorm->vdelay; in bttv_calc_geo_old()
358 geo->hscale = ((totalwidth*4096UL)/xsf-4096); in bttv_calc_geo_old()
359 geo->hdelay = tvnorm->hdelayx1; in bttv_calc_geo_old()
360 geo->hdelay = (geo->hdelay*width)/swidth; in bttv_calc_geo_old()
361 geo->hdelay &= 0x3fe; in bttv_calc_geo_old()
362 sr = ((tvnorm->sheight >> (interleaved?0:1))*512)/height - 512; in bttv_calc_geo_old()
363 geo->vscale = (0x10000UL-sr) & 0x1fff; in bttv_calc_geo_old()
364 geo->crop = ((width>>8)&0x03) | ((geo->hdelay>>6)&0x0c) | in bttv_calc_geo_old()
365 ((tvnorm->sheight>>4)&0x30) | ((vdelay>>2)&0xc0); in bttv_calc_geo_old()
366 geo->vscale |= interleaved ? (BT848_VSCALE_INT<<8) : 0; in bttv_calc_geo_old()
367 geo->vdelay = vdelay; in bttv_calc_geo_old()
368 geo->width = width; in bttv_calc_geo_old()
369 geo->sheight = tvnorm->sheight; in bttv_calc_geo_old()
370 geo->vtotal = tvnorm->vtotal; in bttv_calc_geo_old()
372 if (btv->opt_combfilter) { in bttv_calc_geo_old()
373 geo->vtc = (width < 193) ? 2 : ((width < 385) ? 1 : 0); in bttv_calc_geo_old()
374 geo->comb = (width < 769) ? 1 : 0; in bttv_calc_geo_old()
376 geo->vtc = 0; in bttv_calc_geo_old()
377 geo->comb = 0; in bttv_calc_geo_old()
394 if ((crop->left == tvnorm->cropcap.defrect.left in bttv_calc_geo()
395 && crop->top == tvnorm->cropcap.defrect.top in bttv_calc_geo()
396 && crop->width == tvnorm->cropcap.defrect.width in bttv_calc_geo()
397 && crop->height == tvnorm->cropcap.defrect.height in bttv_calc_geo()
398 && width <= tvnorm->swidth /* see PAL-Nc et al */) in bttv_calc_geo()
399 || btv->input == btv->dig) { in bttv_calc_geo()
407 c_width = min((unsigned int) crop->width, width * 16); in bttv_calc_geo()
408 c_height = min((unsigned int) crop->height, height * 16); in bttv_calc_geo()
410 geo->width = width; in bttv_calc_geo()
411 geo->hscale = (c_width * 4096U + (width >> 1)) / width - 4096; in bttv_calc_geo()
413 geo->hdelay = ((crop->left * width + c_width) / c_width) & ~1; in bttv_calc_geo()
415 geo->sheight = c_height; in bttv_calc_geo()
416 geo->vdelay = crop->top - tvnorm->cropcap.bounds.top + MIN_VDELAY; in bttv_calc_geo()
418 sr = (sr * 512U + (height >> 1)) / height - 512; in bttv_calc_geo()
419 geo->vscale = (0x10000UL - sr) & 0x1fff; in bttv_calc_geo()
420 geo->vscale |= both_fields ? (BT848_VSCALE_INT << 8) : 0; in bttv_calc_geo()
421 geo->vtotal = tvnorm->vtotal; in bttv_calc_geo()
423 geo->crop = (((geo->width >> 8) & 0x03) | in bttv_calc_geo()
424 ((geo->hdelay >> 6) & 0x0c) | in bttv_calc_geo()
425 ((geo->sheight >> 4) & 0x30) | in bttv_calc_geo()
426 ((geo->vdelay >> 2) & 0xc0)); in bttv_calc_geo()
428 if (btv->opt_combfilter) { in bttv_calc_geo()
429 geo->vtc = (width < 193) ? 2 : ((width < 385) ? 1 : 0); in bttv_calc_geo()
430 geo->comb = (width < 769) ? 1 : 0; in bttv_calc_geo()
432 geo->vtc = 0; in bttv_calc_geo()
433 geo->comb = 0; in bttv_calc_geo()
442 if (geo->comb) in bttv_apply_geo()
447 btwrite(geo->vtc, BT848_E_VTC+off); in bttv_apply_geo()
448 btwrite(geo->hscale >> 8, BT848_E_HSCALE_HI+off); in bttv_apply_geo()
449 btwrite(geo->hscale & 0xff, BT848_E_HSCALE_LO+off); in bttv_apply_geo()
450 btaor((geo->vscale>>8), 0xe0, BT848_E_VSCALE_HI+off); in bttv_apply_geo()
451 btwrite(geo->vscale & 0xff, BT848_E_VSCALE_LO+off); in bttv_apply_geo()
452 btwrite(geo->width & 0xff, BT848_E_HACTIVE_LO+off); in bttv_apply_geo()
453 btwrite(geo->hdelay & 0xff, BT848_E_HDELAY_LO+off); in bttv_apply_geo()
454 btwrite(geo->sheight & 0xff, BT848_E_VACTIVE_LO+off); in bttv_apply_geo()
455 btwrite(geo->vdelay & 0xff, BT848_E_VDELAY_LO+off); in bttv_apply_geo()
456 btwrite(geo->crop, BT848_E_CROP+off); in bttv_apply_geo()
457 btwrite(geo->vtotal>>8, BT848_VTOTAL_HI); in bttv_apply_geo()
458 btwrite(geo->vtotal & 0xff, BT848_VTOTAL_LO); in bttv_apply_geo()
461 /* ---------------------------------------------------------- */
465 bttv_set_dma(struct bttv *btv, int override) in bttv_set_dma() argument
470 btv->cap_ctl = 0; in bttv_set_dma()
471 if (NULL != btv->curr.top) btv->cap_ctl |= 0x02; in bttv_set_dma()
472 if (NULL != btv->curr.bottom) btv->cap_ctl |= 0x01; in bttv_set_dma()
473 if (NULL != btv->cvbi) btv->cap_ctl |= 0x0c; in bttv_set_dma()
476 capctl |= (btv->cap_ctl & 0x03) ? 0x03 : 0x00; /* capture */ in bttv_set_dma()
477 capctl |= (btv->cap_ctl & 0x0c) ? 0x0c : 0x00; /* vbi data */ in bttv_set_dma()
478 capctl |= override; in bttv_set_dma()
481 btv->c.nr,capctl,btv->loop_irq, in bttv_set_dma()
482 btv->cvbi ? (unsigned long long)btv->cvbi->top.dma : 0, in bttv_set_dma()
483 btv->curr.top ? (unsigned long long)btv->curr.top->top.dma : 0, in bttv_set_dma()
484 btv->cvbi ? (unsigned long long)btv->cvbi->bottom.dma : 0, in bttv_set_dma()
485 btv->curr.bottom ? (unsigned long long)btv->curr.bottom->bottom.dma : 0); in bttv_set_dma()
488 if (btv->loop_irq) { in bttv_set_dma()
490 cmd |= (btv->loop_irq & 0x0f) << 16; in bttv_set_dma()
491 cmd |= (~btv->loop_irq & 0x0f) << 20; in bttv_set_dma()
493 if (btv->curr.frame_irq || btv->loop_irq || btv->cvbi) { in bttv_set_dma()
494 mod_timer(&btv->timeout, jiffies+BTTV_TIMEOUT); in bttv_set_dma()
496 del_timer(&btv->timeout); in bttv_set_dma()
498 btv->main.cpu[RISC_SLOT_LOOP] = cpu_to_le32(cmd); in bttv_set_dma()
502 if (btv->dma_on) in bttv_set_dma()
504 btwrite(btv->main.dma, BT848_RISC_STRT_ADD); in bttv_set_dma()
506 btv->dma_on = 1; in bttv_set_dma()
508 if (!btv->dma_on) in bttv_set_dma()
511 btv->dma_on = 0; in bttv_set_dma()
521 if ((rc = btcx_riscmem_alloc(btv->c.pci,&btv->main,PAGE_SIZE)) < 0) in bttv_risc_init_main()
524 btv->c.nr, (unsigned long long)btv->main.dma); in bttv_risc_init_main()
526 btv->main.cpu[0] = cpu_to_le32(BT848_RISC_SYNC | BT848_RISC_RESYNC | in bttv_risc_init_main()
528 btv->main.cpu[1] = cpu_to_le32(0); in bttv_risc_init_main()
529 btv->main.cpu[2] = cpu_to_le32(BT848_RISC_JUMP); in bttv_risc_init_main()
530 btv->main.cpu[3] = cpu_to_le32(btv->main.dma + (4<<2)); in bttv_risc_init_main()
533 btv->main.cpu[4] = cpu_to_le32(BT848_RISC_JUMP); in bttv_risc_init_main()
534 btv->main.cpu[5] = cpu_to_le32(btv->main.dma + (6<<2)); in bttv_risc_init_main()
535 btv->main.cpu[6] = cpu_to_le32(BT848_RISC_JUMP); in bttv_risc_init_main()
536 btv->main.cpu[7] = cpu_to_le32(btv->main.dma + (8<<2)); in bttv_risc_init_main()
538 btv->main.cpu[8] = cpu_to_le32(BT848_RISC_SYNC | BT848_RISC_RESYNC | in bttv_risc_init_main()
540 btv->main.cpu[9] = cpu_to_le32(0); in bttv_risc_init_main()
543 btv->main.cpu[10] = cpu_to_le32(BT848_RISC_JUMP); in bttv_risc_init_main()
544 btv->main.cpu[11] = cpu_to_le32(btv->main.dma + (12<<2)); in bttv_risc_init_main()
545 btv->main.cpu[12] = cpu_to_le32(BT848_RISC_JUMP); in bttv_risc_init_main()
546 btv->main.cpu[13] = cpu_to_le32(btv->main.dma + (14<<2)); in bttv_risc_init_main()
549 btv->main.cpu[14] = cpu_to_le32(BT848_RISC_JUMP); in bttv_risc_init_main()
550 btv->main.cpu[15] = cpu_to_le32(btv->main.dma + (0<<2)); in bttv_risc_init_main()
560 unsigned long next = btv->main.dma + ((slot+2) << 2); in bttv_risc_hook()
563 d2printk("%d: risc=%p slot[%d]=NULL\n", btv->c.nr, risc, slot); in bttv_risc_hook()
564 btv->main.cpu[slot+1] = cpu_to_le32(next); in bttv_risc_hook()
567 btv->c.nr, risc, slot, in bttv_risc_hook()
568 (unsigned long long)risc->dma, irqflags); in bttv_risc_hook()
575 risc->jmp[0] = cpu_to_le32(cmd); in bttv_risc_hook()
576 risc->jmp[1] = cpu_to_le32(next); in bttv_risc_hook()
577 btv->main.cpu[slot+1] = cpu_to_le32(risc->dma); in bttv_risc_hook()
585 struct videobuf_dmabuf *dma=videobuf_to_dma(&buf->vb); in bttv_dma_free()
588 videobuf_waiton(q, &buf->vb, 0, 0); in bttv_dma_free()
589 videobuf_dma_unmap(q->dev, dma); in bttv_dma_free()
591 btcx_riscmem_free(btv->c.pci,&buf->bottom); in bttv_dma_free()
592 btcx_riscmem_free(btv->c.pci,&buf->top); in bttv_dma_free()
593 buf->vb.state = VIDEOBUF_NEEDS_INIT; in bttv_dma_free()
613 vbi->vb.state = VIDEOBUF_ACTIVE; in bttv_buffer_activate_vbi()
614 list_del(&vbi->vb.queue); in bttv_buffer_activate_vbi()
620 if (vbi->geo.vdelay > vdelay) { in bttv_buffer_activate_vbi()
621 vdelay = vbi->geo.vdelay & 0xfe; in bttv_buffer_activate_vbi()
622 crop = (crop & 0x3f) | ((vbi->geo.vdelay >> 2) & 0xc0); in bttv_buffer_activate_vbi()
630 if (vbi->vbi_count[0] > 0) { in bttv_buffer_activate_vbi()
631 top = &vbi->top; in bttv_buffer_activate_vbi()
635 if (vbi->vbi_count[1] > 0) { in bttv_buffer_activate_vbi()
637 bottom = &vbi->bottom; in bttv_buffer_activate_vbi()
653 if (NULL != set->top && NULL != set->bottom) { in bttv_buffer_activate_video()
654 if (set->top == set->bottom) { in bttv_buffer_activate_video()
655 set->top->vb.state = VIDEOBUF_ACTIVE; in bttv_buffer_activate_video()
656 if (set->top->vb.queue.next) in bttv_buffer_activate_video()
657 list_del(&set->top->vb.queue); in bttv_buffer_activate_video()
659 set->top->vb.state = VIDEOBUF_ACTIVE; in bttv_buffer_activate_video()
660 set->bottom->vb.state = VIDEOBUF_ACTIVE; in bttv_buffer_activate_video()
661 if (set->top->vb.queue.next) in bttv_buffer_activate_video()
662 list_del(&set->top->vb.queue); in bttv_buffer_activate_video()
663 if (set->bottom->vb.queue.next) in bttv_buffer_activate_video()
664 list_del(&set->bottom->vb.queue); in bttv_buffer_activate_video()
666 bttv_apply_geo(btv, &set->top->geo, 1); in bttv_buffer_activate_video()
667 bttv_apply_geo(btv, &set->bottom->geo,0); in bttv_buffer_activate_video()
668 bttv_risc_hook(btv, RISC_SLOT_O_FIELD, &set->top->top, in bttv_buffer_activate_video()
669 set->top_irq); in bttv_buffer_activate_video()
670 bttv_risc_hook(btv, RISC_SLOT_E_FIELD, &set->bottom->bottom, in bttv_buffer_activate_video()
671 set->frame_irq); in bttv_buffer_activate_video()
672 btaor((set->top->btformat & 0xf0) | (set->bottom->btformat & 0x0f), in bttv_buffer_activate_video()
674 btaor((set->top->btswap & 0x0a) | (set->bottom->btswap & 0x05), in bttv_buffer_activate_video()
676 } else if (NULL != set->top) { in bttv_buffer_activate_video()
677 set->top->vb.state = VIDEOBUF_ACTIVE; in bttv_buffer_activate_video()
678 if (set->top->vb.queue.next) in bttv_buffer_activate_video()
679 list_del(&set->top->vb.queue); in bttv_buffer_activate_video()
680 bttv_apply_geo(btv, &set->top->geo,1); in bttv_buffer_activate_video()
681 bttv_apply_geo(btv, &set->top->geo,0); in bttv_buffer_activate_video()
682 bttv_risc_hook(btv, RISC_SLOT_O_FIELD, &set->top->top, in bttv_buffer_activate_video()
683 set->frame_irq); in bttv_buffer_activate_video()
685 btaor(set->top->btformat & 0xff, ~0xff, BT848_COLOR_FMT); in bttv_buffer_activate_video()
686 btaor(set->top->btswap & 0x0f, ~0x0f, BT848_COLOR_CTL); in bttv_buffer_activate_video()
687 } else if (NULL != set->bottom) { in bttv_buffer_activate_video()
688 set->bottom->vb.state = VIDEOBUF_ACTIVE; in bttv_buffer_activate_video()
689 if (set->bottom->vb.queue.next) in bttv_buffer_activate_video()
690 list_del(&set->bottom->vb.queue); in bttv_buffer_activate_video()
691 bttv_apply_geo(btv, &set->bottom->geo,1); in bttv_buffer_activate_video()
692 bttv_apply_geo(btv, &set->bottom->geo,0); in bttv_buffer_activate_video()
694 bttv_risc_hook(btv, RISC_SLOT_E_FIELD, &set->bottom->bottom, in bttv_buffer_activate_video()
695 set->frame_irq); in bttv_buffer_activate_video()
696 btaor(set->bottom->btformat & 0xff, ~0xff, BT848_COLOR_FMT); in bttv_buffer_activate_video()
697 btaor(set->bottom->btswap & 0x0f, ~0x0f, BT848_COLOR_CTL); in bttv_buffer_activate_video()
705 /* ---------------------------------------------------------- */
711 const struct bttv_tvnorm *tvnorm = bttv_tvnorms + buf->tvnorm; in bttv_buffer_risc()
712 struct videobuf_dmabuf *dma=videobuf_to_dma(&buf->vb); in bttv_buffer_risc()
715 btv->c.nr, v4l2_field_names[buf->vb.field], in bttv_buffer_risc()
716 buf->fmt->name, buf->vb.width, buf->vb.height); in bttv_buffer_risc()
719 if (buf->fmt->flags & FORMAT_FLAGS_PACKED) { in bttv_buffer_risc()
720 int bpl = (buf->fmt->depth >> 3) * buf->vb.width; in bttv_buffer_risc()
721 int bpf = bpl * (buf->vb.height >> 1); in bttv_buffer_risc()
723 bttv_calc_geo(btv,&buf->geo,buf->vb.width,buf->vb.height, in bttv_buffer_risc()
724 V4L2_FIELD_HAS_BOTH(buf->vb.field), in bttv_buffer_risc()
725 tvnorm,&buf->crop); in bttv_buffer_risc()
727 switch (buf->vb.field) { in bttv_buffer_risc()
729 bttv_risc_packed(btv,&buf->top,dma->sglist, in bttv_buffer_risc()
732 buf->vb.height); in bttv_buffer_risc()
735 bttv_risc_packed(btv,&buf->bottom,dma->sglist, in bttv_buffer_risc()
736 0,bpl,0,0,buf->vb.height); in bttv_buffer_risc()
739 bttv_risc_packed(btv,&buf->top,dma->sglist, in bttv_buffer_risc()
740 0,bpl,bpl,0,buf->vb.height >> 1); in bttv_buffer_risc()
741 bttv_risc_packed(btv,&buf->bottom,dma->sglist, in bttv_buffer_risc()
742 bpl,bpl,bpl,0,buf->vb.height >> 1); in bttv_buffer_risc()
745 bttv_risc_packed(btv,&buf->top,dma->sglist, in bttv_buffer_risc()
746 0,bpl,0,0,buf->vb.height >> 1); in bttv_buffer_risc()
747 bttv_risc_packed(btv,&buf->bottom,dma->sglist, in bttv_buffer_risc()
748 bpf,bpl,0,0,buf->vb.height >> 1); in bttv_buffer_risc()
756 if (buf->fmt->flags & FORMAT_FLAGS_PLANAR) { in bttv_buffer_risc()
761 uoffset = buf->vb.width * buf->vb.height; in bttv_buffer_risc()
762 voffset = buf->vb.width * buf->vb.height; in bttv_buffer_risc()
763 if (buf->fmt->flags & FORMAT_FLAGS_CrCb) { in bttv_buffer_risc()
764 /* Y-Cr-Cb plane order */ in bttv_buffer_risc()
765 uoffset >>= buf->fmt->hshift; in bttv_buffer_risc()
766 uoffset >>= buf->fmt->vshift; in bttv_buffer_risc()
769 /* Y-Cb-Cr plane order */ in bttv_buffer_risc()
770 voffset >>= buf->fmt->hshift; in bttv_buffer_risc()
771 voffset >>= buf->fmt->vshift; in bttv_buffer_risc()
775 switch (buf->vb.field) { in bttv_buffer_risc()
777 bttv_calc_geo(btv,&buf->geo,buf->vb.width, in bttv_buffer_risc()
778 buf->vb.height,/* both_fields */ 0, in bttv_buffer_risc()
779 tvnorm,&buf->crop); in bttv_buffer_risc()
780 bttv_risc_planar(btv, &buf->top, dma->sglist, in bttv_buffer_risc()
781 0,buf->vb.width,0,buf->vb.height, in bttv_buffer_risc()
782 uoffset,voffset,buf->fmt->hshift, in bttv_buffer_risc()
783 buf->fmt->vshift,0); in bttv_buffer_risc()
786 bttv_calc_geo(btv,&buf->geo,buf->vb.width, in bttv_buffer_risc()
787 buf->vb.height,0, in bttv_buffer_risc()
788 tvnorm,&buf->crop); in bttv_buffer_risc()
789 bttv_risc_planar(btv, &buf->bottom, dma->sglist, in bttv_buffer_risc()
790 0,buf->vb.width,0,buf->vb.height, in bttv_buffer_risc()
791 uoffset,voffset,buf->fmt->hshift, in bttv_buffer_risc()
792 buf->fmt->vshift,0); in bttv_buffer_risc()
795 bttv_calc_geo(btv,&buf->geo,buf->vb.width, in bttv_buffer_risc()
796 buf->vb.height,1, in bttv_buffer_risc()
797 tvnorm,&buf->crop); in bttv_buffer_risc()
798 lines = buf->vb.height >> 1; in bttv_buffer_risc()
799 ypadding = buf->vb.width; in bttv_buffer_risc()
800 cpadding = buf->vb.width >> buf->fmt->hshift; in bttv_buffer_risc()
801 bttv_risc_planar(btv,&buf->top, in bttv_buffer_risc()
802 dma->sglist, in bttv_buffer_risc()
803 0,buf->vb.width,ypadding,lines, in bttv_buffer_risc()
805 buf->fmt->hshift, in bttv_buffer_risc()
806 buf->fmt->vshift, in bttv_buffer_risc()
808 bttv_risc_planar(btv,&buf->bottom, in bttv_buffer_risc()
809 dma->sglist, in bttv_buffer_risc()
810 ypadding,buf->vb.width,ypadding,lines, in bttv_buffer_risc()
813 buf->fmt->hshift, in bttv_buffer_risc()
814 buf->fmt->vshift, in bttv_buffer_risc()
818 bttv_calc_geo(btv,&buf->geo,buf->vb.width, in bttv_buffer_risc()
819 buf->vb.height,1, in bttv_buffer_risc()
820 tvnorm,&buf->crop); in bttv_buffer_risc()
821 lines = buf->vb.height >> 1; in bttv_buffer_risc()
822 ypadding = buf->vb.width; in bttv_buffer_risc()
823 cpadding = buf->vb.width >> buf->fmt->hshift; in bttv_buffer_risc()
824 bttv_risc_planar(btv,&buf->top, in bttv_buffer_risc()
825 dma->sglist, in bttv_buffer_risc()
826 0,buf->vb.width,0,lines, in bttv_buffer_risc()
829 buf->fmt->hshift, in bttv_buffer_risc()
830 buf->fmt->vshift, in bttv_buffer_risc()
832 bttv_risc_planar(btv,&buf->bottom, in bttv_buffer_risc()
833 dma->sglist, in bttv_buffer_risc()
834 lines * ypadding,buf->vb.width,0,lines, in bttv_buffer_risc()
837 buf->fmt->hshift, in bttv_buffer_risc()
838 buf->fmt->vshift, in bttv_buffer_risc()
847 if (buf->fmt->flags & FORMAT_FLAGS_RAW) { in bttv_buffer_risc()
849 buf->vb.field = V4L2_FIELD_SEQ_TB; in bttv_buffer_risc()
850 bttv_calc_geo(btv,&buf->geo,tvnorm->swidth,tvnorm->sheight, in bttv_buffer_risc()
851 1,tvnorm,&buf->crop); in bttv_buffer_risc()
852 bttv_risc_packed(btv, &buf->top, dma->sglist, in bttv_buffer_risc()
855 bttv_risc_packed(btv, &buf->bottom, dma->sglist, in bttv_buffer_risc()
856 buf->vb.size/2 , RAW_BPL, 0, 0, RAW_LINES); in bttv_buffer_risc()
860 buf->btformat = buf->fmt->btformat; in bttv_buffer_risc()
861 buf->btswap = buf->fmt->btswap; in bttv_buffer_risc()
865 /* ---------------------------------------------------------- */
876 btv->c.nr, v4l2_field_names[buf->vb.field], in bttv_overlay_risc()
877 fmt->name, ov->w.width, ov->w.height); in bttv_overlay_risc()
880 bttv_calc_geo(btv,&buf->geo,ov->w.width,ov->w.height, in bttv_overlay_risc()
881 V4L2_FIELD_HAS_BOTH(ov->field), in bttv_overlay_risc()
882 &bttv_tvnorms[ov->tvnorm],&buf->crop); in bttv_overlay_risc()
885 switch (ov->field) { in bttv_overlay_risc()
887 bttv_risc_overlay(btv, &buf->top, fmt, ov, 0, 0); in bttv_overlay_risc()
890 bttv_risc_overlay(btv, &buf->bottom, fmt, ov, 0, 0); in bttv_overlay_risc()
893 bttv_risc_overlay(btv, &buf->top, fmt, ov, 0, 1); in bttv_overlay_risc()
894 bttv_risc_overlay(btv, &buf->bottom, fmt, ov, 1, 0); in bttv_overlay_risc()
901 buf->btformat = fmt->btformat; in bttv_overlay_risc()
902 buf->btswap = fmt->btswap; in bttv_overlay_risc()
903 buf->vb.field = ov->field; in bttv_overlay_risc()