> On Tue, Dec 28, 2004 at 09:10:12AM +0100, Thomas Hellstr�m wrote: >> Vladimir Dergachev wrote: >> > Can someone more knowledgable explain to me how to properly access >> AGP >> >space from within Mesa driver ? > >> This has just been implemented in the Unichrome driver, and I'm not sure >> wether it's the best or most appopriate way to do it but it works as >> follows: >> >> 1. The Mesa driver fills a "malloced" system memory buffer with vertex >> data. >> 2. The Mesa driver then calls the DRM through a via-specific IOCTL. >> (via_ioctl.c) >> 3. The via drm copies the buffer to another buffer in kernel system >> memory ( static storage ), (via_dma.c) >> 4. The via drm verifies the content of the buffer to reject buffers that >> contain commands that are considered harmful. (via_verifier.c) >> 5. The buffer is copied to AGP space, and the engine pointers are >> updated. (via_dma.c) >> >> The reason for 3. is that running the verifier directly on AGP memory is >> very slow. > > Is there some reason you can't run the verifier on the user-space > buffers? Copying the data twice seems terribly wasteful. >
Hi! It's simply because nobody should be allowed to change the buffer contents after it's been verified, but before it's copied to AGP. I assume at least a multithreaded DRI application on an SMP machine would be able to do that. In reality the second copy seems to take very little time. Ideally one would write a copy_from_user_while_verifying(), but since I'm not that familiar with kernel programming, I haven't yet. /Thomas > Enlightenment requested :) > > Phil > > -- > http://www.kantaka.co.uk/ .oOo. public key: > http://www.kantaka.co.uk/gpg.txt > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://productguide.itmanagersjournal.com/ > -- > _______________________________________________ > Dri-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/dri-devel > ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/ -- _______________________________________________ Dri-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/dri-devel
