aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/bt8xx
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2007-08-23 15:37:49 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-10-09 21:14:55 -0400
commitc1accaa21bdef38ec0f36eaaf7ce3384fff9d0c5 (patch)
tree3a2c8206555af6c9e2eecdb20b052be70e6b93dd /drivers/media/video/bt8xx
parent7a7d9a89d0307b1743d782197e2c5fc5ddf183f3 (diff)
V4L/DVB (6252): Adapt drivers to use the newer videobuf modules
PCI-dependent videobuf_foo methods were renamed as videobuf_pci_foo. Also, videobuf_dmabuf is now part of videobuf-dma-sg private struct. So, to access it, a subroutine call is needed. This patch renames all occurences of those function calls to be consistent with the video-buf split. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org> http://thread.gmane.org/gmane.comp.video.video4linux/34978/focus=34981 Reviewed-by: Ricardo Cerqueira <v4l@cerqueira.org>
Diffstat (limited to 'drivers/media/video/bt8xx')
-rw-r--r--drivers/media/video/bt8xx/Kconfig2
-rw-r--r--drivers/media/video/bt8xx/bttv-driver.c17
-rw-r--r--drivers/media/video/bt8xx/bttv-risc.c35
-rw-r--r--drivers/media/video/bt8xx/bttv-vbi.c5
-rw-r--r--drivers/media/video/bt8xx/bttvp.h2
5 files changed, 34 insertions, 27 deletions
diff --git a/drivers/media/video/bt8xx/Kconfig b/drivers/media/video/bt8xx/Kconfig
index 58eae887a629..2ca162b390a2 100644
--- a/drivers/media/video/bt8xx/Kconfig
+++ b/drivers/media/video/bt8xx/Kconfig
@@ -4,7 +4,7 @@ config VIDEO_BT848
4 select I2C_ALGOBIT 4 select I2C_ALGOBIT
5 select FW_LOADER 5 select FW_LOADER
6 select VIDEO_BTCX 6 select VIDEO_BTCX
7 select VIDEO_BUF 7 select VIDEOBUF_DMA_SG
8 select VIDEO_IR 8 select VIDEO_IR
9 select VIDEO_TUNER 9 select VIDEO_TUNER
10 select VIDEO_TVEEPROM 10 select VIDEO_TVEEPROM
diff --git a/drivers/media/video/bt8xx/bttv-driver.c b/drivers/media/video/bt8xx/bttv-driver.c
index 0711c9507843..4ab4e14b5c64 100644
--- a/drivers/media/video/bt8xx/bttv-driver.c
+++ b/drivers/media/video/bt8xx/bttv-driver.c
@@ -2582,7 +2582,7 @@ static int setup_window(struct bttv_fh *fh, struct bttv *btv,
2582 if (check_btres(fh, RESOURCE_OVERLAY)) { 2582 if (check_btres(fh, RESOURCE_OVERLAY)) {
2583 struct bttv_buffer *new; 2583 struct bttv_buffer *new;
2584 2584
2585 new = videobuf_alloc(sizeof(*new)); 2585 new = videobuf_pci_alloc(sizeof(*new));
2586 new->crop = btv->crop[!!fh->do_crop].rect; 2586 new->crop = btv->crop[!!fh->do_crop].rect;
2587 bttv_overlay_risc(btv, &fh->ov, fh->ovfmt, new); 2587 bttv_overlay_risc(btv, &fh->ov, fh->ovfmt, new);
2588 retval = bttv_switch_overlay(btv,fh,new); 2588 retval = bttv_switch_overlay(btv,fh,new);
@@ -3048,7 +3048,7 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file,
3048 mutex_lock(&fh->cap.lock); 3048 mutex_lock(&fh->cap.lock);
3049 if (*on) { 3049 if (*on) {
3050 fh->ov.tvnorm = btv->tvnorm; 3050 fh->ov.tvnorm = btv->tvnorm;
3051 new = videobuf_alloc(sizeof(*new)); 3051 new = videobuf_pci_alloc(sizeof(*new));
3052 new->crop = btv->crop[!!fh->do_crop].rect; 3052 new->crop = btv->crop[!!fh->do_crop].rect;
3053 bttv_overlay_risc(btv, &fh->ov, fh->ovfmt, new); 3053 bttv_overlay_risc(btv, &fh->ov, fh->ovfmt, new);
3054 } else { 3054 } else {
@@ -3141,9 +3141,12 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file,
3141 retval = -EIO; 3141 retval = -EIO;
3142 /* fall through */ 3142 /* fall through */
3143 case STATE_DONE: 3143 case STATE_DONE:
3144 videobuf_dma_sync(&fh->cap,&buf->vb.dma); 3144 {
3145 struct videobuf_dmabuf *dma=videobuf_to_dma(&buf->vb);
3146 videobuf_dma_sync(&fh->cap,dma);
3145 bttv_dma_free(&fh->cap,btv,buf); 3147 bttv_dma_free(&fh->cap,btv,buf);
3146 break; 3148 break;
3149 }
3147 default: 3150 default:
3148 retval = -EINVAL; 3151 retval = -EINVAL;
3149 break; 3152 break;
@@ -3337,7 +3340,7 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file,
3337 if (check_btres(fh, RESOURCE_OVERLAY)) { 3340 if (check_btres(fh, RESOURCE_OVERLAY)) {
3338 struct bttv_buffer *new; 3341 struct bttv_buffer *new;
3339 3342
3340 new = videobuf_alloc(sizeof(*new)); 3343 new = videobuf_pci_alloc(sizeof(*new));
3341 new->crop = btv->crop[!!fh->do_crop].rect; 3344 new->crop = btv->crop[!!fh->do_crop].rect;
3342 bttv_overlay_risc(btv,&fh->ov,fh->ovfmt,new); 3345 bttv_overlay_risc(btv,&fh->ov,fh->ovfmt,new);
3343 retval = bttv_switch_overlay(btv,fh,new); 3346 retval = bttv_switch_overlay(btv,fh,new);
@@ -3696,7 +3699,7 @@ static unsigned int bttv_poll(struct file *file, poll_table *wait)
3696 mutex_unlock(&fh->cap.lock); 3699 mutex_unlock(&fh->cap.lock);
3697 return POLLERR; 3700 return POLLERR;
3698 } 3701 }
3699 fh->cap.read_buf = videobuf_alloc(fh->cap.msize); 3702 fh->cap.read_buf = videobuf_pci_alloc(fh->cap.msize);
3700 if (NULL == fh->cap.read_buf) { 3703 if (NULL == fh->cap.read_buf) {
3701 mutex_unlock(&fh->cap.lock); 3704 mutex_unlock(&fh->cap.lock);
3702 return POLLERR; 3705 return POLLERR;
@@ -3763,13 +3766,13 @@ static int bttv_open(struct inode *inode, struct file *file)
3763 fh->ov.setup_ok = 0; 3766 fh->ov.setup_ok = 0;
3764 v4l2_prio_open(&btv->prio,&fh->prio); 3767 v4l2_prio_open(&btv->prio,&fh->prio);
3765 3768
3766 videobuf_queue_init(&fh->cap, &bttv_video_qops, 3769 videobuf_queue_pci_init(&fh->cap, &bttv_video_qops,
3767 btv->c.pci, &btv->s_lock, 3770 btv->c.pci, &btv->s_lock,
3768 V4L2_BUF_TYPE_VIDEO_CAPTURE, 3771 V4L2_BUF_TYPE_VIDEO_CAPTURE,
3769 V4L2_FIELD_INTERLACED, 3772 V4L2_FIELD_INTERLACED,
3770 sizeof(struct bttv_buffer), 3773 sizeof(struct bttv_buffer),
3771 fh); 3774 fh);
3772 videobuf_queue_init(&fh->vbi, &bttv_vbi_qops, 3775 videobuf_queue_pci_init(&fh->vbi, &bttv_vbi_qops,
3773 btv->c.pci, &btv->s_lock, 3776 btv->c.pci, &btv->s_lock,
3774 V4L2_BUF_TYPE_VBI_CAPTURE, 3777 V4L2_BUF_TYPE_VBI_CAPTURE,
3775 V4L2_FIELD_SEQ_TB, 3778 V4L2_FIELD_SEQ_TB,
diff --git a/drivers/media/video/bt8xx/bttv-risc.c b/drivers/media/video/bt8xx/bttv-risc.c
index e7104d9cb4bd..58986f1a5f1a 100644
--- a/drivers/media/video/bt8xx/bttv-risc.c
+++ b/drivers/media/video/bt8xx/bttv-risc.c
@@ -574,10 +574,12 @@ bttv_risc_hook(struct bttv *btv, int slot, struct btcx_riscmem *risc,
574void 574void
575bttv_dma_free(struct videobuf_queue *q,struct bttv *btv, struct bttv_buffer *buf) 575bttv_dma_free(struct videobuf_queue *q,struct bttv *btv, struct bttv_buffer *buf)
576{ 576{
577 struct videobuf_dmabuf *dma=videobuf_to_dma(&buf->vb);
578
577 BUG_ON(in_interrupt()); 579 BUG_ON(in_interrupt());
578 videobuf_waiton(&buf->vb,0,0); 580 videobuf_waiton(&buf->vb,0,0);
579 videobuf_dma_unmap(q, &buf->vb.dma); 581 videobuf_dma_unmap(q, dma);
580 videobuf_dma_free(&buf->vb.dma); 582 videobuf_dma_free(dma);
581 btcx_riscmem_free(btv->c.pci,&buf->bottom); 583 btcx_riscmem_free(btv->c.pci,&buf->bottom);
582 btcx_riscmem_free(btv->c.pci,&buf->top); 584 btcx_riscmem_free(btv->c.pci,&buf->top);
583 buf->vb.state = STATE_NEEDS_INIT; 585 buf->vb.state = STATE_NEEDS_INIT;
@@ -699,6 +701,7 @@ int
699bttv_buffer_risc(struct bttv *btv, struct bttv_buffer *buf) 701bttv_buffer_risc(struct bttv *btv, struct bttv_buffer *buf)
700{ 702{
701 const struct bttv_tvnorm *tvnorm = bttv_tvnorms + buf->tvnorm; 703 const struct bttv_tvnorm *tvnorm = bttv_tvnorms + buf->tvnorm;
704 struct videobuf_dmabuf *dma=videobuf_to_dma(&buf->vb);
702 705
703 dprintk(KERN_DEBUG 706 dprintk(KERN_DEBUG
704 "bttv%d: buffer field: %s format: %s size: %dx%d\n", 707 "bttv%d: buffer field: %s format: %s size: %dx%d\n",
@@ -716,25 +719,25 @@ bttv_buffer_risc(struct bttv *btv, struct bttv_buffer *buf)
716 719
717 switch (buf->vb.field) { 720 switch (buf->vb.field) {
718 case V4L2_FIELD_TOP: 721 case V4L2_FIELD_TOP:
719 bttv_risc_packed(btv,&buf->top,buf->vb.dma.sglist, 722 bttv_risc_packed(btv,&buf->top,dma->sglist,
720 /* offset */ 0,bpl, 723 /* offset */ 0,bpl,
721 /* padding */ 0,/* skip_lines */ 0, 724 /* padding */ 0,/* skip_lines */ 0,
722 buf->vb.height); 725 buf->vb.height);
723 break; 726 break;
724 case V4L2_FIELD_BOTTOM: 727 case V4L2_FIELD_BOTTOM:
725 bttv_risc_packed(btv,&buf->bottom,buf->vb.dma.sglist, 728 bttv_risc_packed(btv,&buf->bottom,dma->sglist,
726 0,bpl,0,0,buf->vb.height); 729 0,bpl,0,0,buf->vb.height);
727 break; 730 break;
728 case V4L2_FIELD_INTERLACED: 731 case V4L2_FIELD_INTERLACED:
729 bttv_risc_packed(btv,&buf->top,buf->vb.dma.sglist, 732 bttv_risc_packed(btv,&buf->top,dma->sglist,
730 0,bpl,bpl,0,buf->vb.height >> 1); 733 0,bpl,bpl,0,buf->vb.height >> 1);
731 bttv_risc_packed(btv,&buf->bottom,buf->vb.dma.sglist, 734 bttv_risc_packed(btv,&buf->bottom,dma->sglist,
732 bpl,bpl,bpl,0,buf->vb.height >> 1); 735 bpl,bpl,bpl,0,buf->vb.height >> 1);
733 break; 736 break;
734 case V4L2_FIELD_SEQ_TB: 737 case V4L2_FIELD_SEQ_TB:
735 bttv_risc_packed(btv,&buf->top,buf->vb.dma.sglist, 738 bttv_risc_packed(btv,&buf->top,dma->sglist,
736 0,bpl,0,0,buf->vb.height >> 1); 739 0,bpl,0,0,buf->vb.height >> 1);
737 bttv_risc_packed(btv,&buf->bottom,buf->vb.dma.sglist, 740 bttv_risc_packed(btv,&buf->bottom,dma->sglist,
738 bpf,bpl,0,0,buf->vb.height >> 1); 741 bpf,bpl,0,0,buf->vb.height >> 1);
739 break; 742 break;
740 default: 743 default:
@@ -767,7 +770,7 @@ bttv_buffer_risc(struct bttv *btv, struct bttv_buffer *buf)
767 bttv_calc_geo(btv,&buf->geo,buf->vb.width, 770 bttv_calc_geo(btv,&buf->geo,buf->vb.width,
768 buf->vb.height,/* both_fields */ 0, 771 buf->vb.height,/* both_fields */ 0,
769 tvnorm,&buf->crop); 772 tvnorm,&buf->crop);
770 bttv_risc_planar(btv, &buf->top, buf->vb.dma.sglist, 773 bttv_risc_planar(btv, &buf->top, dma->sglist,
771 0,buf->vb.width,0,buf->vb.height, 774 0,buf->vb.width,0,buf->vb.height,
772 uoffset,voffset,buf->fmt->hshift, 775 uoffset,voffset,buf->fmt->hshift,
773 buf->fmt->vshift,0); 776 buf->fmt->vshift,0);
@@ -776,7 +779,7 @@ bttv_buffer_risc(struct bttv *btv, struct bttv_buffer *buf)
776 bttv_calc_geo(btv,&buf->geo,buf->vb.width, 779 bttv_calc_geo(btv,&buf->geo,buf->vb.width,
777 buf->vb.height,0, 780 buf->vb.height,0,
778 tvnorm,&buf->crop); 781 tvnorm,&buf->crop);
779 bttv_risc_planar(btv, &buf->bottom, buf->vb.dma.sglist, 782 bttv_risc_planar(btv, &buf->bottom, dma->sglist,
780 0,buf->vb.width,0,buf->vb.height, 783 0,buf->vb.width,0,buf->vb.height,
781 uoffset,voffset,buf->fmt->hshift, 784 uoffset,voffset,buf->fmt->hshift,
782 buf->fmt->vshift,0); 785 buf->fmt->vshift,0);
@@ -789,14 +792,14 @@ bttv_buffer_risc(struct bttv *btv, struct bttv_buffer *buf)
789 ypadding = buf->vb.width; 792 ypadding = buf->vb.width;
790 cpadding = buf->vb.width >> buf->fmt->hshift; 793 cpadding = buf->vb.width >> buf->fmt->hshift;
791 bttv_risc_planar(btv,&buf->top, 794 bttv_risc_planar(btv,&buf->top,
792 buf->vb.dma.sglist, 795 dma->sglist,
793 0,buf->vb.width,ypadding,lines, 796 0,buf->vb.width,ypadding,lines,
794 uoffset,voffset, 797 uoffset,voffset,
795 buf->fmt->hshift, 798 buf->fmt->hshift,
796 buf->fmt->vshift, 799 buf->fmt->vshift,
797 cpadding); 800 cpadding);
798 bttv_risc_planar(btv,&buf->bottom, 801 bttv_risc_planar(btv,&buf->bottom,
799 buf->vb.dma.sglist, 802 dma->sglist,
800 ypadding,buf->vb.width,ypadding,lines, 803 ypadding,buf->vb.width,ypadding,lines,
801 uoffset+cpadding, 804 uoffset+cpadding,
802 voffset+cpadding, 805 voffset+cpadding,
@@ -812,7 +815,7 @@ bttv_buffer_risc(struct bttv *btv, struct bttv_buffer *buf)
812 ypadding = buf->vb.width; 815 ypadding = buf->vb.width;
813 cpadding = buf->vb.width >> buf->fmt->hshift; 816 cpadding = buf->vb.width >> buf->fmt->hshift;
814 bttv_risc_planar(btv,&buf->top, 817 bttv_risc_planar(btv,&buf->top,
815 buf->vb.dma.sglist, 818 dma->sglist,
816 0,buf->vb.width,0,lines, 819 0,buf->vb.width,0,lines,
817 uoffset >> 1, 820 uoffset >> 1,
818 voffset >> 1, 821 voffset >> 1,
@@ -820,7 +823,7 @@ bttv_buffer_risc(struct bttv *btv, struct bttv_buffer *buf)
820 buf->fmt->vshift, 823 buf->fmt->vshift,
821 0); 824 0);
822 bttv_risc_planar(btv,&buf->bottom, 825 bttv_risc_planar(btv,&buf->bottom,
823 buf->vb.dma.sglist, 826 dma->sglist,
824 lines * ypadding,buf->vb.width,0,lines, 827 lines * ypadding,buf->vb.width,0,lines,
825 lines * ypadding + (uoffset >> 1), 828 lines * ypadding + (uoffset >> 1),
826 lines * ypadding + (voffset >> 1), 829 lines * ypadding + (voffset >> 1),
@@ -839,10 +842,10 @@ bttv_buffer_risc(struct bttv *btv, struct bttv_buffer *buf)
839 buf->vb.field = V4L2_FIELD_SEQ_TB; 842 buf->vb.field = V4L2_FIELD_SEQ_TB;
840 bttv_calc_geo(btv,&buf->geo,tvnorm->swidth,tvnorm->sheight, 843 bttv_calc_geo(btv,&buf->geo,tvnorm->swidth,tvnorm->sheight,
841 1,tvnorm,&buf->crop); 844 1,tvnorm,&buf->crop);
842 bttv_risc_packed(btv, &buf->top, buf->vb.dma.sglist, 845 bttv_risc_packed(btv, &buf->top, dma->sglist,
843 /* offset */ 0, RAW_BPL, /* padding */ 0, 846 /* offset */ 0, RAW_BPL, /* padding */ 0,
844 /* skip_lines */ 0, RAW_LINES); 847 /* skip_lines */ 0, RAW_LINES);
845 bttv_risc_packed(btv, &buf->bottom, buf->vb.dma.sglist, 848 bttv_risc_packed(btv, &buf->bottom, dma->sglist,
846 buf->vb.size/2 , RAW_BPL, 0, 0, RAW_LINES); 849 buf->vb.size/2 , RAW_BPL, 0, 0, RAW_LINES);
847 } 850 }
848 851
diff --git a/drivers/media/video/bt8xx/bttv-vbi.c b/drivers/media/video/bt8xx/bttv-vbi.c
index 007485aa4f01..346ce019bdcb 100644
--- a/drivers/media/video/bt8xx/bttv-vbi.c
+++ b/drivers/media/video/bt8xx/bttv-vbi.c
@@ -150,13 +150,14 @@ static int vbi_buffer_prepare(struct videobuf_queue *q,
150 150
151 if (redo_dma_risc) { 151 if (redo_dma_risc) {
152 unsigned int bpl, padding, offset; 152 unsigned int bpl, padding, offset;
153 struct videobuf_dmabuf *dma=videobuf_to_dma(&buf->vb);
153 154
154 bpl = 2044; /* max. vbipack */ 155 bpl = 2044; /* max. vbipack */
155 padding = VBI_BPL - bpl; 156 padding = VBI_BPL - bpl;
156 157
157 if (fh->vbi_fmt.fmt.count[0] > 0) { 158 if (fh->vbi_fmt.fmt.count[0] > 0) {
158 rc = bttv_risc_packed(btv, &buf->top, 159 rc = bttv_risc_packed(btv, &buf->top,
159 buf->vb.dma.sglist, 160 dma->sglist,
160 /* offset */ 0, bpl, 161 /* offset */ 0, bpl,
161 padding, skip_lines0, 162 padding, skip_lines0,
162 fh->vbi_fmt.fmt.count[0]); 163 fh->vbi_fmt.fmt.count[0]);
@@ -168,7 +169,7 @@ static int vbi_buffer_prepare(struct videobuf_queue *q,
168 offset = fh->vbi_fmt.fmt.count[0] * VBI_BPL; 169 offset = fh->vbi_fmt.fmt.count[0] * VBI_BPL;
169 170
170 rc = bttv_risc_packed(btv, &buf->bottom, 171 rc = bttv_risc_packed(btv, &buf->bottom,
171 buf->vb.dma.sglist, 172 dma->sglist,
172 offset, bpl, 173 offset, bpl,
173 padding, skip_lines1, 174 padding, skip_lines1,
174 fh->vbi_fmt.fmt.count[1]); 175 fh->vbi_fmt.fmt.count[1]);
diff --git a/drivers/media/video/bt8xx/bttvp.h b/drivers/media/video/bt8xx/bttvp.h
index 5b25faca1504..0b92c35a8435 100644
--- a/drivers/media/video/bt8xx/bttvp.h
+++ b/drivers/media/video/bt8xx/bttvp.h
@@ -41,7 +41,7 @@
41#include <media/v4l2-common.h> 41#include <media/v4l2-common.h>
42 42
43#include <linux/device.h> 43#include <linux/device.h>
44#include <media/video-buf.h> 44#include <media/videobuf-dma-sg.h>
45#include <media/tuner.h> 45#include <media/tuner.h>
46#include <media/tveeprom.h> 46#include <media/tveeprom.h>
47#include <media/ir-common.h> 47#include <media/ir-common.h>