aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/common/saa7146_hlp.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2006-01-09 12:32:43 -0500
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-01-09 12:32:43 -0500
commit82a1c359e8cc15d836c139626d747bfdfc408450 (patch)
tree890f929530c36ba750c3b4a640dcc260dddb6b5a /drivers/media/common/saa7146_hlp.c
parent400b7083fbcc8e7a1157a82aa126977179873268 (diff)
V4L/DVB (3195): Fix for 64-bit compile warning
- Add the fix for the saa7146 64-bit compile warning (again). This time with comments and checked by Johannes Stezenbach. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Diffstat (limited to 'drivers/media/common/saa7146_hlp.c')
-rw-r--r--drivers/media/common/saa7146_hlp.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/media/common/saa7146_hlp.c b/drivers/media/common/saa7146_hlp.c
index ec52dff8cb69..33bec8a6843b 100644
--- a/drivers/media/common/saa7146_hlp.c
+++ b/drivers/media/common/saa7146_hlp.c
@@ -562,19 +562,26 @@ static void saa7146_set_position(struct saa7146_dev *dev, int w_x, int w_y, int
562 562
563 int b_depth = vv->ov_fmt->depth; 563 int b_depth = vv->ov_fmt->depth;
564 int b_bpl = vv->ov_fb.fmt.bytesperline; 564 int b_bpl = vv->ov_fb.fmt.bytesperline;
565 u32 base = (u32)vv->ov_fb.base; 565 /* The unsigned long cast is to remove a 64-bit compile warning since
566 it looks like a 64-bit address is cast to a 32-bit value, even
567 though the base pointer is really a 32-bit physical address that
568 goes into a 32-bit DMA register.
569 FIXME: might not work on some 64-bit platforms, but see the FIXME
570 in struct v4l2_framebuffer (videodev2.h) for that.
571 */
572 u32 base = (u32)(unsigned long)vv->ov_fb.base;
566 573
567 struct saa7146_video_dma vdma1; 574 struct saa7146_video_dma vdma1;
568 575
569 /* calculate memory offsets for picture, look if we shall top-down-flip */ 576 /* calculate memory offsets for picture, look if we shall top-down-flip */
570 vdma1.pitch = 2*b_bpl; 577 vdma1.pitch = 2*b_bpl;
571 if ( 0 == vv->vflip ) { 578 if ( 0 == vv->vflip ) {
572 vdma1.base_even = (u32)base + (w_y * (vdma1.pitch/2)) + (w_x * (b_depth / 8)); 579 vdma1.base_even = base + (w_y * (vdma1.pitch/2)) + (w_x * (b_depth / 8));
573 vdma1.base_odd = vdma1.base_even + (vdma1.pitch / 2); 580 vdma1.base_odd = vdma1.base_even + (vdma1.pitch / 2);
574 vdma1.prot_addr = vdma1.base_even + (w_height * (vdma1.pitch / 2)); 581 vdma1.prot_addr = vdma1.base_even + (w_height * (vdma1.pitch / 2));
575 } 582 }
576 else { 583 else {
577 vdma1.base_even = (u32)base + ((w_y+w_height) * (vdma1.pitch/2)) + (w_x * (b_depth / 8)); 584 vdma1.base_even = base + ((w_y+w_height) * (vdma1.pitch/2)) + (w_x * (b_depth / 8));
578 vdma1.base_odd = vdma1.base_even - (vdma1.pitch / 2); 585 vdma1.base_odd = vdma1.base_even - (vdma1.pitch / 2);
579 vdma1.prot_addr = vdma1.base_odd - (w_height * (vdma1.pitch / 2)); 586 vdma1.prot_addr = vdma1.base_odd - (w_height * (vdma1.pitch / 2));
580 } 587 }