* video-buf warning
@ 2004-04-28 8:57 Meelis Roos
2004-04-28 19:19 ` David S. Miller
0 siblings, 1 reply; 2+ messages in thread
From: Meelis Roos @ 2004-04-28 8:57 UTC (permalink / raw)
To: Gerd Knorr, Linux Kernel list
This is 2.6.6-rc3 on a sparc64. The warning has been there for quite
some time, finally got around to report it.
CC [M] drivers/media/video/video-buf.o
drivers/media/video/video-buf.c: In function `videobuf_iolock':
drivers/media/video/video-buf.c:327: warning: cast from pointer to integer of different size
The specific code is
/* FIXME: need sanity checks for vb->boff */
bus = (dma_addr_t)fbuf->base + vb->boff;
bus is dma_addr_t (==u32 on sparc64), base is void*
So if buf->base is really an arbitrary pointer, it might not fit into
u32. What is it actually?
--
Meelis Roos (mroos@linux.ee)
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: video-buf warning
2004-04-28 8:57 video-buf warning Meelis Roos
@ 2004-04-28 19:19 ` David S. Miller
0 siblings, 0 replies; 2+ messages in thread
From: David S. Miller @ 2004-04-28 19:19 UTC (permalink / raw)
To: Meelis Roos; +Cc: kraxel, linux-kernel
On Wed, 28 Apr 2004 11:57:38 +0300 (EEST)
Meelis Roos <mroos@linux.ee> wrote:
> CC [M] drivers/media/video/video-buf.o
> drivers/media/video/video-buf.c: In function `videobuf_iolock':
> drivers/media/video/video-buf.c:327: warning: cast from pointer to integer of different size
...
> The specific code is
> /* FIXME: need sanity checks for vb->boff */
> bus = (dma_addr_t)fbuf->base + vb->boff;
>
> bus is dma_addr_t (==u32 on sparc64), base is void*
>
> So if buf->base is really an arbitrary pointer, it might not fit into
> u32. What is it actually?
It is the physical address of a frame buffer, this code is allowing
user programs to point the video capturing to go directly onto a
frame buffer at a specific location.
Using dma_addr_t here is a poor choice, since that data type is to
be used to PCI DMA API interfaces for doing transfers to/from real
memory, not frame buffers and the like :-)
Unfortunately, there is no portable interface available for what
this code wants to do, which is device<-->device DMA transfers.
We would need to create an interface that took two device structures,
and some base+offset values, in order to provide a portable way to
do this, then a reworked version of this user interface would be needed
as well.
In short, it's long term to fix this up, don't worry about it for
now.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-04-28 20:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-28 8:57 video-buf warning Meelis Roos
2004-04-28 19:19 ` David S. Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®