Lines Matching +full:set +full:- +full:top

1 // SPDX-License-Identifier: GPL-2.0-or-later
4 bttv-risc.c -- interfaces to other kernel modules
7 - memory management
8 - generation
10 (c) 2000-2003 Gerd Knorr <kraxel@bytesex.org>
25 #include <media/v4l2-ioctl.h>
31 /* ---------------------------------------------------------- */
54 if ((rc = btcx_riscmem_alloc(btv->c.pci,risc,instructions)) < 0) in bttv_risc_packed()
58 rp = risc->cpu; in bttv_risc_packed()
62 while (skip_lines-- > 0) { in bttv_risc_packed()
70 if ((line >= (store_lines - VCR_HACK_LINES)) && in bttv_risc_packed()
71 btv->opt_vcr_hack) in bttv_risc_packed()
74 offset -= sg_dma_len(sg); in bttv_risc_packed()
77 if (bpl <= sg_dma_len(sg)-offset) { in bttv_risc_packed()
87 (sg_dma_len(sg)-offset)); in bttv_risc_packed()
89 todo -= (sg_dma_len(sg)-offset); in bttv_risc_packed()
96 todo -= sg_dma_len(sg); in bttv_risc_packed()
108 risc->jmp = rp; in bttv_risc_packed()
109 WARN_ON((risc->jmp - risc->cpu + 2) * sizeof(*risc->cpu) > risc->size); in bttv_risc_packed()
137 if ((rc = btcx_riscmem_alloc(btv->c.pci,risc,instructions*4*5)) < 0) in bttv_risc_planar()
141 rp = risc->cpu; in bttv_risc_planar()
150 if ((btv->opt_vcr_hack) && in bttv_risc_planar()
151 (line >= (ylines - VCR_HACK_LINES))) in bttv_risc_planar()
174 for (todo = ybpl; todo > 0; todo -= ylen) { in bttv_risc_planar()
177 yoffset -= sg_dma_len(ysg); in bttv_risc_planar()
184 ylen = sg_dma_len(ysg) - yoffset; in bttv_risc_planar()
187 uoffset -= sg_dma_len(usg); in bttv_risc_planar()
191 voffset -= sg_dma_len(vsg); in bttv_risc_planar()
196 ylen = (sg_dma_len(usg) - uoffset) << hshift; in bttv_risc_planar()
198 ylen = (sg_dma_len(vsg) - voffset) << hshift; in bttv_risc_planar()
229 risc->jmp = rp; in bttv_risc_planar()
230 WARN_ON((risc->jmp - risc->cpu + 2) * sizeof(*risc->cpu) > risc->size); in bttv_risc_planar()
234 /* ---------------------------------------------------------- */
244 int swidth = tvnorm->swidth; in bttv_calc_geo_old()
245 int totalwidth = tvnorm->totalwidth; in bttv_calc_geo_old()
246 int scaledtwidth = tvnorm->scaledtwidth; in bttv_calc_geo_old()
248 if (btv->input == btv->dig) { in bttv_calc_geo_old()
254 vdelay = tvnorm->vdelay; in bttv_calc_geo_old()
257 geo->hscale = ((totalwidth*4096UL)/xsf-4096); in bttv_calc_geo_old()
258 geo->hdelay = tvnorm->hdelayx1; in bttv_calc_geo_old()
259 geo->hdelay = (geo->hdelay*width)/swidth; in bttv_calc_geo_old()
260 geo->hdelay &= 0x3fe; in bttv_calc_geo_old()
261 sr = ((tvnorm->sheight >> (interleaved?0:1))*512)/height - 512; in bttv_calc_geo_old()
262 geo->vscale = (0x10000UL-sr) & 0x1fff; in bttv_calc_geo_old()
263 geo->crop = ((width>>8)&0x03) | ((geo->hdelay>>6)&0x0c) | in bttv_calc_geo_old()
264 ((tvnorm->sheight>>4)&0x30) | ((vdelay>>2)&0xc0); in bttv_calc_geo_old()
265 geo->vscale |= interleaved ? (BT848_VSCALE_INT<<8) : 0; in bttv_calc_geo_old()
266 geo->vdelay = vdelay; in bttv_calc_geo_old()
267 geo->width = width; in bttv_calc_geo_old()
268 geo->sheight = tvnorm->sheight; in bttv_calc_geo_old()
269 geo->vtotal = tvnorm->vtotal; in bttv_calc_geo_old()
271 if (btv->opt_combfilter) { in bttv_calc_geo_old()
272 geo->vtc = (width < 193) ? 2 : ((width < 385) ? 1 : 0); in bttv_calc_geo_old()
273 geo->comb = (width < 769) ? 1 : 0; in bttv_calc_geo_old()
275 geo->vtc = 0; in bttv_calc_geo_old()
276 geo->comb = 0; in bttv_calc_geo_old()
293 if ((crop->left == tvnorm->cropcap.defrect.left in bttv_calc_geo()
294 && crop->top == tvnorm->cropcap.defrect.top in bttv_calc_geo()
295 && crop->width == tvnorm->cropcap.defrect.width in bttv_calc_geo()
296 && crop->height == tvnorm->cropcap.defrect.height in bttv_calc_geo()
297 && width <= tvnorm->swidth /* see PAL-Nc et al */) in bttv_calc_geo()
298 || btv->input == btv->dig) { in bttv_calc_geo()
306 c_width = min((unsigned int) crop->width, width * 16); in bttv_calc_geo()
307 c_height = min((unsigned int) crop->height, height * 16); in bttv_calc_geo()
309 geo->width = width; in bttv_calc_geo()
310 geo->hscale = (c_width * 4096U + (width >> 1)) / width - 4096; in bttv_calc_geo()
312 geo->hdelay = ((crop->left * width + c_width) / c_width) & ~1; in bttv_calc_geo()
314 geo->sheight = c_height; in bttv_calc_geo()
315 geo->vdelay = crop->top - tvnorm->cropcap.bounds.top + MIN_VDELAY; in bttv_calc_geo()
317 sr = (sr * 512U + (height >> 1)) / height - 512; in bttv_calc_geo()
318 geo->vscale = (0x10000UL - sr) & 0x1fff; in bttv_calc_geo()
319 geo->vscale |= both_fields ? (BT848_VSCALE_INT << 8) : 0; in bttv_calc_geo()
320 geo->vtotal = tvnorm->vtotal; in bttv_calc_geo()
322 geo->crop = (((geo->width >> 8) & 0x03) | in bttv_calc_geo()
323 ((geo->hdelay >> 6) & 0x0c) | in bttv_calc_geo()
324 ((geo->sheight >> 4) & 0x30) | in bttv_calc_geo()
325 ((geo->vdelay >> 2) & 0xc0)); in bttv_calc_geo()
327 if (btv->opt_combfilter) { in bttv_calc_geo()
328 geo->vtc = (width < 193) ? 2 : ((width < 385) ? 1 : 0); in bttv_calc_geo()
329 geo->comb = (width < 769) ? 1 : 0; in bttv_calc_geo()
331 geo->vtc = 0; in bttv_calc_geo()
332 geo->comb = 0; in bttv_calc_geo()
341 if (geo->comb) in bttv_apply_geo()
346 btwrite(geo->vtc, BT848_E_VTC+off); in bttv_apply_geo()
347 btwrite(geo->hscale >> 8, BT848_E_HSCALE_HI+off); in bttv_apply_geo()
348 btwrite(geo->hscale & 0xff, BT848_E_HSCALE_LO+off); in bttv_apply_geo()
349 btaor((geo->vscale>>8), 0xe0, BT848_E_VSCALE_HI+off); in bttv_apply_geo()
350 btwrite(geo->vscale & 0xff, BT848_E_VSCALE_LO+off); in bttv_apply_geo()
351 btwrite(geo->width & 0xff, BT848_E_HACTIVE_LO+off); in bttv_apply_geo()
352 btwrite(geo->hdelay & 0xff, BT848_E_HDELAY_LO+off); in bttv_apply_geo()
353 btwrite(geo->sheight & 0xff, BT848_E_VACTIVE_LO+off); in bttv_apply_geo()
354 btwrite(geo->vdelay & 0xff, BT848_E_VDELAY_LO+off); in bttv_apply_geo()
355 btwrite(geo->crop, BT848_E_CROP+off); in bttv_apply_geo()
356 btwrite(geo->vtotal>>8, BT848_VTOTAL_HI); in bttv_apply_geo()
357 btwrite(geo->vtotal & 0xff, BT848_VTOTAL_LO); in bttv_apply_geo()
360 /* ---------------------------------------------------------- */
366 if (btv->loop_irq) { in bttv_set_risc_status()
368 cmd |= (btv->loop_irq & 0x0f) << 16; in bttv_set_risc_status()
369 cmd |= (~btv->loop_irq & 0x0f) << 20; in bttv_set_risc_status()
371 btv->main.cpu[RISC_SLOT_LOOP] = cpu_to_le32(cmd); in bttv_set_risc_status()
376 if (btv->curr.frame_irq || btv->loop_irq || btv->cvbi) in bttv_set_irq_timer()
377 mod_timer(&btv->timeout, jiffies + BTTV_TIMEOUT); in bttv_set_irq_timer()
379 del_timer(&btv->timeout); in bttv_set_irq_timer()
386 if (btv->curr.top || btv->curr.bottom) in bttv_set_capture_control()
390 if (btv->cvbi) in bttv_set_capture_control()
403 if (btv->dma_on) in bttv_start_dma()
405 btwrite(btv->main.dma, BT848_RISC_STRT_ADD); in bttv_start_dma()
408 btv->dma_on = 1; in bttv_start_dma()
413 if (!btv->dma_on) in bttv_stop_dma()
417 btv->dma_on = 0; in bttv_stop_dma()
433 d2printk("%d: capctl=%x lirq=%d top=%08llx/%08llx even=%08llx/%08llx\n", in bttv_set_dma()
434 btv->c.nr,capctl,btv->loop_irq, in bttv_set_dma()
435 btv->cvbi ? (unsigned long long)btv->cvbi->top.dma : 0, in bttv_set_dma()
436 btv->curr.top ? (unsigned long long)btv->curr.top->top.dma : 0, in bttv_set_dma()
437 btv->cvbi ? (unsigned long long)btv->cvbi->bottom.dma : 0, in bttv_set_dma()
438 btv->curr.bottom ? (unsigned long long)btv->curr.bottom->bottom.dma : 0); in bttv_set_dma()
446 if ((rc = btcx_riscmem_alloc(btv->c.pci,&btv->main,PAGE_SIZE)) < 0) in bttv_risc_init_main()
449 btv->c.nr, (unsigned long long)btv->main.dma); in bttv_risc_init_main()
451 btv->main.cpu[0] = cpu_to_le32(BT848_RISC_SYNC | BT848_RISC_RESYNC | in bttv_risc_init_main()
453 btv->main.cpu[1] = cpu_to_le32(0); in bttv_risc_init_main()
454 btv->main.cpu[2] = cpu_to_le32(BT848_RISC_JUMP); in bttv_risc_init_main()
455 btv->main.cpu[3] = cpu_to_le32(btv->main.dma + (4<<2)); in bttv_risc_init_main()
457 /* top field */ in bttv_risc_init_main()
458 btv->main.cpu[4] = cpu_to_le32(BT848_RISC_JUMP); in bttv_risc_init_main()
459 btv->main.cpu[5] = cpu_to_le32(btv->main.dma + (6<<2)); in bttv_risc_init_main()
460 btv->main.cpu[6] = cpu_to_le32(BT848_RISC_JUMP); in bttv_risc_init_main()
461 btv->main.cpu[7] = cpu_to_le32(btv->main.dma + (8<<2)); in bttv_risc_init_main()
463 btv->main.cpu[8] = cpu_to_le32(BT848_RISC_SYNC | BT848_RISC_RESYNC | in bttv_risc_init_main()
465 btv->main.cpu[9] = cpu_to_le32(0); in bttv_risc_init_main()
468 btv->main.cpu[10] = cpu_to_le32(BT848_RISC_JUMP); in bttv_risc_init_main()
469 btv->main.cpu[11] = cpu_to_le32(btv->main.dma + (12<<2)); in bttv_risc_init_main()
470 btv->main.cpu[12] = cpu_to_le32(BT848_RISC_JUMP); in bttv_risc_init_main()
471 btv->main.cpu[13] = cpu_to_le32(btv->main.dma + (14<<2)); in bttv_risc_init_main()
473 /* jump back to top field */ in bttv_risc_init_main()
474 btv->main.cpu[14] = cpu_to_le32(BT848_RISC_JUMP); in bttv_risc_init_main()
475 btv->main.cpu[15] = cpu_to_le32(btv->main.dma + (0<<2)); in bttv_risc_init_main()
485 unsigned long next = btv->main.dma + ((slot+2) << 2); in bttv_risc_hook()
488 d2printk("%d: risc=%p slot[%d]=NULL\n", btv->c.nr, risc, slot); in bttv_risc_hook()
489 btv->main.cpu[slot+1] = cpu_to_le32(next); in bttv_risc_hook()
492 btv->c.nr, risc, slot, in bttv_risc_hook()
493 (unsigned long long)risc->dma, irqflags); in bttv_risc_hook()
500 risc->jmp[0] = cpu_to_le32(cmd); in bttv_risc_hook()
501 risc->jmp[1] = cpu_to_le32(next); in bttv_risc_hook()
502 btv->main.cpu[slot+1] = cpu_to_le32(risc->dma); in bttv_risc_hook()
512 unsigned int padding = VBI_BPL - bpl; in bttv_buffer_risc_vbi()
517 const struct bttv_tvnorm *tvnorm = btv->vbi_fmt.tvnorm; in bttv_buffer_risc_vbi()
518 struct sg_table *sgt = vb2_dma_sg_plane_desc(&buf->vbuf.vb2_buf, 0); in bttv_buffer_risc_vbi()
519 struct scatterlist *list = sgt->sgl; in bttv_buffer_risc_vbi()
521 if (btv->vbi_fmt.fmt.count[0] > 0) in bttv_buffer_risc_vbi()
522 skip_lines0 = max(0, (btv->vbi_fmt.fmt.start[0] - in bttv_buffer_risc_vbi()
523 tvnorm->vbistart[0])); in bttv_buffer_risc_vbi()
524 if (btv->vbi_fmt.fmt.count[1] > 0) in bttv_buffer_risc_vbi()
525 skip_lines1 = max(0, (btv->vbi_fmt.fmt.start[1] - in bttv_buffer_risc_vbi()
526 tvnorm->vbistart[1])); in bttv_buffer_risc_vbi()
528 if (btv->vbi_fmt.fmt.count[0] > 0) { in bttv_buffer_risc_vbi()
529 r = bttv_risc_packed(btv, &buf->top, list, 0, bpl, padding, in bttv_buffer_risc_vbi()
530 skip_lines0, btv->vbi_fmt.fmt.count[0]); in bttv_buffer_risc_vbi()
535 if (btv->vbi_fmt.fmt.count[1] > 0) { in bttv_buffer_risc_vbi()
536 offset = btv->vbi_fmt.fmt.count[0] * VBI_BPL; in bttv_buffer_risc_vbi()
537 r = bttv_risc_packed(btv, &buf->bottom, list, offset, bpl, in bttv_buffer_risc_vbi()
539 btv->vbi_fmt.fmt.count[1]); in bttv_buffer_risc_vbi()
544 if (btv->vbi_fmt.end >= tvnorm->cropcap.bounds.top) in bttv_buffer_risc_vbi()
545 min_vdelay += btv->vbi_fmt.end - tvnorm->cropcap.bounds.top; in bttv_buffer_risc_vbi()
548 buf->geo.vdelay = min_vdelay; in bttv_buffer_risc_vbi()
557 struct btcx_riscmem *top; in bttv_buffer_activate_vbi() local
562 top = NULL; in bttv_buffer_activate_vbi()
570 list_del(&vbi->list); in bttv_buffer_activate_vbi()
576 if (vbi->geo.vdelay > vdelay) { in bttv_buffer_activate_vbi()
577 vdelay = vbi->geo.vdelay & 0xfe; in bttv_buffer_activate_vbi()
578 crop = (crop & 0x3f) | ((vbi->geo.vdelay >> 2) & 0xc0); in bttv_buffer_activate_vbi()
586 if (btv->vbi_count[0] > 0) { in bttv_buffer_activate_vbi()
587 top = &vbi->top; in bttv_buffer_activate_vbi()
591 if (btv->vbi_count[1] > 0) { in bttv_buffer_activate_vbi()
593 bottom = &vbi->bottom; in bttv_buffer_activate_vbi()
598 bttv_risc_hook(btv, RISC_SLOT_O_VBI, top, top_irq_flags); in bttv_buffer_activate_vbi()
606 struct bttv_buffer_set *set) in bttv_buffer_activate_video() argument
609 if (NULL != set->top && NULL != set->bottom) { in bttv_buffer_activate_video()
610 if (set->top == set->bottom) { in bttv_buffer_activate_video()
611 if (set->top->list.next) in bttv_buffer_activate_video()
612 list_del(&set->top->list); in bttv_buffer_activate_video()
614 if (set->top->list.next) in bttv_buffer_activate_video()
615 list_del(&set->top->list); in bttv_buffer_activate_video()
616 if (set->bottom->list.next) in bttv_buffer_activate_video()
617 list_del(&set->bottom->list); in bttv_buffer_activate_video()
619 bttv_apply_geo(btv, &set->top->geo, 1); in bttv_buffer_activate_video()
620 bttv_apply_geo(btv, &set->bottom->geo,0); in bttv_buffer_activate_video()
621 bttv_risc_hook(btv, RISC_SLOT_O_FIELD, &set->top->top, in bttv_buffer_activate_video()
622 set->top_irq); in bttv_buffer_activate_video()
623 bttv_risc_hook(btv, RISC_SLOT_E_FIELD, &set->bottom->bottom, in bttv_buffer_activate_video()
624 set->frame_irq); in bttv_buffer_activate_video()
625 btaor((set->top->btformat & 0xf0) | (set->bottom->btformat & 0x0f), in bttv_buffer_activate_video()
627 btaor((set->top->btswap & 0x0a) | (set->bottom->btswap & 0x05), in bttv_buffer_activate_video()
629 } else if (NULL != set->top) { in bttv_buffer_activate_video()
630 if (set->top->list.next) in bttv_buffer_activate_video()
631 list_del(&set->top->list); in bttv_buffer_activate_video()
632 bttv_apply_geo(btv, &set->top->geo,1); in bttv_buffer_activate_video()
633 bttv_apply_geo(btv, &set->top->geo,0); in bttv_buffer_activate_video()
634 bttv_risc_hook(btv, RISC_SLOT_O_FIELD, &set->top->top, in bttv_buffer_activate_video()
635 set->frame_irq); in bttv_buffer_activate_video()
637 btaor(set->top->btformat & 0xff, ~0xff, BT848_COLOR_FMT); in bttv_buffer_activate_video()
638 btaor(set->top->btswap & 0x0f, ~0x0f, BT848_COLOR_CTL); in bttv_buffer_activate_video()
639 } else if (NULL != set->bottom) { in bttv_buffer_activate_video()
640 if (set->bottom->list.next) in bttv_buffer_activate_video()
641 list_del(&set->bottom->list); in bttv_buffer_activate_video()
642 bttv_apply_geo(btv, &set->bottom->geo,1); in bttv_buffer_activate_video()
643 bttv_apply_geo(btv, &set->bottom->geo,0); in bttv_buffer_activate_video()
645 bttv_risc_hook(btv, RISC_SLOT_E_FIELD, &set->bottom->bottom, in bttv_buffer_activate_video()
646 set->frame_irq); in bttv_buffer_activate_video()
647 btaor(set->bottom->btformat & 0xff, ~0xff, BT848_COLOR_FMT); in bttv_buffer_activate_video()
648 btaor(set->bottom->btswap & 0x0f, ~0x0f, BT848_COLOR_CTL); in bttv_buffer_activate_video()
656 /* ---------------------------------------------------------- */
663 const struct bttv_tvnorm *tvnorm = bttv_tvnorms + btv->tvnorm; in bttv_buffer_risc()
664 struct sg_table *sgt = vb2_dma_sg_plane_desc(&buf->vbuf.vb2_buf, 0); in bttv_buffer_risc()
665 struct scatterlist *list = sgt->sgl; in bttv_buffer_risc()
666 unsigned long size = (btv->fmt->depth * btv->width * btv->height) >> 3; in bttv_buffer_risc()
669 if (btv->fmt->flags & FORMAT_FLAGS_PACKED) { in bttv_buffer_risc()
670 int bpl = (btv->fmt->depth >> 3) * btv->width; in bttv_buffer_risc()
671 int bpf = bpl * (btv->height >> 1); in bttv_buffer_risc()
673 bttv_calc_geo(btv, &buf->geo, btv->width, btv->height, in bttv_buffer_risc()
674 V4L2_FIELD_HAS_BOTH(buf->vbuf.field), tvnorm, in bttv_buffer_risc()
675 &btv->crop[!!btv->do_crop].rect); in bttv_buffer_risc()
676 switch (buf->vbuf.field) { in bttv_buffer_risc()
678 r = bttv_risc_packed(btv, &buf->top, list, 0, bpl, 0, in bttv_buffer_risc()
679 0, btv->height); in bttv_buffer_risc()
682 r = bttv_risc_packed(btv, &buf->bottom, list, 0, bpl, in bttv_buffer_risc()
683 0, 0, btv->height); in bttv_buffer_risc()
686 r = bttv_risc_packed(btv, &buf->top, list, 0, bpl, in bttv_buffer_risc()
687 bpl, 0, btv->height >> 1); in bttv_buffer_risc()
688 r = bttv_risc_packed(btv, &buf->bottom, list, bpl, in bttv_buffer_risc()
689 bpl, bpl, 0, btv->height >> 1); in bttv_buffer_risc()
692 r = bttv_risc_packed(btv, &buf->top, list, 0, bpl, 0, in bttv_buffer_risc()
693 0, btv->height >> 1); in bttv_buffer_risc()
694 r = bttv_risc_packed(btv, &buf->bottom, list, bpf, in bttv_buffer_risc()
695 bpl, 0, 0, btv->height >> 1); in bttv_buffer_risc()
699 return -EINVAL; in bttv_buffer_risc()
703 if (btv->fmt->flags & FORMAT_FLAGS_PLANAR) { in bttv_buffer_risc()
708 uoffset = btv->width * btv->height; in bttv_buffer_risc()
709 voffset = btv->width * btv->height; in bttv_buffer_risc()
710 if (btv->fmt->flags & FORMAT_FLAGS_CrCb) { in bttv_buffer_risc()
711 /* Y-Cr-Cb plane order */ in bttv_buffer_risc()
712 uoffset >>= btv->fmt->hshift; in bttv_buffer_risc()
713 uoffset >>= btv->fmt->vshift; in bttv_buffer_risc()
716 /* Y-Cb-Cr plane order */ in bttv_buffer_risc()
717 voffset >>= btv->fmt->hshift; in bttv_buffer_risc()
718 voffset >>= btv->fmt->vshift; in bttv_buffer_risc()
721 switch (buf->vbuf.field) { in bttv_buffer_risc()
723 bttv_calc_geo(btv, &buf->geo, btv->width, btv->height, in bttv_buffer_risc()
725 &btv->crop[!!btv->do_crop].rect); in bttv_buffer_risc()
726 r = bttv_risc_planar(btv, &buf->top, list, 0, in bttv_buffer_risc()
727 btv->width, 0, btv->height, in bttv_buffer_risc()
729 btv->fmt->hshift, in bttv_buffer_risc()
730 btv->fmt->vshift, 0); in bttv_buffer_risc()
733 bttv_calc_geo(btv, &buf->geo, btv->width, btv->height, in bttv_buffer_risc()
735 &btv->crop[!!btv->do_crop].rect); in bttv_buffer_risc()
736 r = bttv_risc_planar(btv, &buf->bottom, list, 0, in bttv_buffer_risc()
737 btv->width, 0, btv->height, in bttv_buffer_risc()
739 btv->fmt->hshift, in bttv_buffer_risc()
740 btv->fmt->vshift, 0); in bttv_buffer_risc()
743 bttv_calc_geo(btv, &buf->geo, btv->width, btv->height, in bttv_buffer_risc()
745 &btv->crop[!!btv->do_crop].rect); in bttv_buffer_risc()
746 lines = btv->height >> 1; in bttv_buffer_risc()
747 ypadding = btv->width; in bttv_buffer_risc()
748 cpadding = btv->width >> btv->fmt->hshift; in bttv_buffer_risc()
749 r = bttv_risc_planar(btv, &buf->top, list, 0, in bttv_buffer_risc()
750 btv->width, ypadding, lines, in bttv_buffer_risc()
752 btv->fmt->hshift, in bttv_buffer_risc()
753 btv->fmt->vshift, cpadding); in bttv_buffer_risc()
755 r = bttv_risc_planar(btv, &buf->bottom, list, in bttv_buffer_risc()
756 ypadding, btv->width, ypadding, in bttv_buffer_risc()
759 btv->fmt->hshift, in bttv_buffer_risc()
760 btv->fmt->vshift, cpadding); in bttv_buffer_risc()
763 bttv_calc_geo(btv, &buf->geo, btv->width, btv->height, in bttv_buffer_risc()
765 &btv->crop[!!btv->do_crop].rect); in bttv_buffer_risc()
766 lines = btv->height >> 1; in bttv_buffer_risc()
767 ypadding = btv->width; in bttv_buffer_risc()
768 cpadding = btv->width >> btv->fmt->hshift; in bttv_buffer_risc()
769 r = bttv_risc_planar(btv, &buf->top, list, 0, in bttv_buffer_risc()
770 btv->width, 0, lines, in bttv_buffer_risc()
772 btv->fmt->hshift, in bttv_buffer_risc()
773 btv->fmt->vshift, 0); in bttv_buffer_risc()
774 r = bttv_risc_planar(btv, &buf->bottom, list, in bttv_buffer_risc()
776 btv->width, 0, lines, in bttv_buffer_risc()
779 btv->fmt->hshift, in bttv_buffer_risc()
780 btv->fmt->vshift, 0); in bttv_buffer_risc()
784 return -EINVAL; in bttv_buffer_risc()
788 if (btv->fmt->flags & FORMAT_FLAGS_RAW) { in bttv_buffer_risc()
790 buf->vbuf.field = V4L2_FIELD_SEQ_TB; in bttv_buffer_risc()
791 bttv_calc_geo(btv, &buf->geo, tvnorm->swidth, tvnorm->sheight, in bttv_buffer_risc()
792 1, tvnorm, &btv->crop[!!btv->do_crop].rect); in bttv_buffer_risc()
793 r = bttv_risc_packed(btv, &buf->top, list, 0, RAW_BPL, 0, 0, in bttv_buffer_risc()
795 r = bttv_risc_packed(btv, &buf->bottom, list, size / 2, in bttv_buffer_risc()
800 buf->btformat = btv->fmt->btformat; in bttv_buffer_risc()
801 buf->btswap = btv->fmt->btswap; in bttv_buffer_risc()