On 2012-12-03 5:38 am, Alexander von Gluck IV wrote:
On 2012-12-02 7:48 pm, looncraz wrote:On 12/2/2012 4:22 PM, Gerald Zajac wrote:On 12/02/2012 02:08 PM, looncraz wrote:That's what I did with the video drivers that I wrote (s3, ati, 3dfx). I used a chunk of memory at either the beginning or end of the video memory, and adjusted the frame buffer accordingly.I'm going to allocate achunk at the end of the frame buffer, and reduce the reported availablegraphics RAM.Regards, GeraldGood to know I'm not alone ;-) I'm somehow drawing the cursor into the wrong memory, though... oh well, I probably passed the wrong relative memory location... not killing anything though ;-). .As for where to allocate the cursor memory... i'm not 100% sure about thatoff the top of my head. I could find out from AMD but it may take a few days.
... or a few hours. " The bitmap cursor needs to be placed into vram.For more information see drivers/gpu/drm/radeon/radeon_cursor.c in the kernel.
" http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=blob;f=drivers/gpu/drm/radeon/radeon_cursor.c#l174 drm_gem_object_lookup loads the cursor bitmap into a 'drm_gem_object' http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=blob;f=drivers/gpu/drm/radeon/radeon_cursor.c#l184radeon_bo_pin_restricted reserves some GPU memory and returns the reserved address in gpu_addr.
radeon_set_cursor then tells the card where the cursor is located at in memory.
the drm_gem_object_lookup and radeon_bo_pin_restricted functionality doesn't exist yet in the driver / accelerant.
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=blob;f=drivers/gpu/drm/radeon/radeon_object.cWe really don't do any kind of special fencing of video memory yet... for now i'd say just stick the cursor at the end of the PCI BAR? (minus the size of the cursor)
http://cgit.haiku-os.org/haiku/tree/src/add-ons/kernel/drivers/graphics/radeon_hd/radeon_hd.cpp#n644All uncharted territory thus far.. this is actually a little more difficult in practice then theory :)