diff options
author | Hans Verkuil <devnull@localhost> | 2005-12-19 15:55:06 +0000 |
---|---|---|
committer | Hans Verkuil <devnull@localhost> | 2005-12-19 15:55:06 +0000 |
commit | 2ac297f772cc85e05cf42bfdb61a7de4be25fa30 (patch) | |
tree | a91bfc945a30ea864af8a8f264126b7b10bb7f6a /linux/drivers/media/common/saa7146_hlp.c | |
parent | 1520a3cb54dee708171201dc964a16747079be0d (diff) | |
download | mediapointer-dvb-s2-2ac297f772cc85e05cf42bfdb61a7de4be25fa30.tar.gz mediapointer-dvb-s2-2ac297f772cc85e05cf42bfdb61a7de4be25fa30.tar.bz2 |
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>
Diffstat (limited to 'linux/drivers/media/common/saa7146_hlp.c')
-rw-r--r-- | linux/drivers/media/common/saa7146_hlp.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/linux/drivers/media/common/saa7146_hlp.c b/linux/drivers/media/common/saa7146_hlp.c index 8fd7ed5af..d6bc2e7c9 100644 --- a/linux/drivers/media/common/saa7146_hlp.c +++ b/linux/drivers/media/common/saa7146_hlp.c @@ -563,19 +563,26 @@ static void saa7146_set_position(struct saa7146_dev *dev, int w_x, int w_y, int int b_depth = vv->ov_fmt->depth; int b_bpl = vv->ov_fb.fmt.bytesperline; - u32 base = (u32)vv->ov_fb.base; + /* The unsigned long cast is to remove a 64-bit compile warning since + it looks like a 64-bit address is cast to a 32-bit value, even + though the base pointer is really a 32-bit physical address that + goes into a 32-bit DMA register. + FIXME: might not work on some 64-bit platforms, but see the FIXME + in struct v4l2_framebuffer (videodev2.h) for that. + */ + u32 base = (u32)(unsigned long)vv->ov_fb.base; struct saa7146_video_dma vdma1; /* calculate memory offsets for picture, look if we shall top-down-flip */ vdma1.pitch = 2*b_bpl; if ( 0 == vv->vflip ) { - vdma1.base_even = (u32)base + (w_y * (vdma1.pitch/2)) + (w_x * (b_depth / 8)); + vdma1.base_even = base + (w_y * (vdma1.pitch/2)) + (w_x * (b_depth / 8)); vdma1.base_odd = vdma1.base_even + (vdma1.pitch / 2); vdma1.prot_addr = vdma1.base_even + (w_height * (vdma1.pitch / 2)); } else { - vdma1.base_even = (u32)base + ((w_y+w_height) * (vdma1.pitch/2)) + (w_x * (b_depth / 8)); + vdma1.base_even = base + ((w_y+w_height) * (vdma1.pitch/2)) + (w_x * (b_depth / 8)); vdma1.base_odd = vdma1.base_even - (vdma1.pitch / 2); vdma1.prot_addr = vdma1.base_odd - (w_height * (vdma1.pitch / 2)); } |