STTrife posted on Feb 8 2007 at 12:11 PM said:
two questions: can I load textures into video memory (and how, and would this speed up things) ?
There is no such thing as a "video memory" on the GP2X. With gpu940, almost all the upper 32Mb can serve the purpose of the video memory (as the video controler can be said to display any memory area).
To use a texture with gpu940, you just copy your bitmap in the shared memory buffers and tell gpu940 the address of this buffer and that it holds a texture. When you no longer need the texture, you can reuse this memory (for another texture, a zbuffer, or a frame buffer).
With the helper library, you have a memory allocator that handle these buffers for you.
With OpenGL, you just use glTexImage2D() and/or glTexSubImage2D() that takes care of everything (as long as there is enough room for all the textures). The data you give to these functions are copied to the upper mem where it can be used by gpu940 (plus it convert the pixels to 32bits YUV colors).
Is it usefull to do the mmu-hack?
If I followed correctly, the mmu-hack is a way to have Linux cache the upper 32Mb ?
If so, it won't help much, because Linux programs do not really read/write with the upper mem with gpu940. And when they do, they expect to have the memory uncached (buffer command), so I think using this trick would rather leads to some complex bugs.