[haiku-development] Re: radeon_hd driver help request

  • From: Alexander von Gluck IV <kallisti5@xxxxxxxxxxx>
  • To: <haiku-development@xxxxxxxxxxxxx>
  • Date: Mon, 03 Dec 2012 09:44:35 -0600

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:
I'm going to allocate a
chunk at the end of the frame buffer, and reduce the reported available
graphics RAM.

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.

Regards,
Gerald





Good 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 that
off 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#l184
radeon_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.c

We 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#n644


All uncharted territory thus far.. this is actually a little more difficult in practice then theory :)

Other related posts:

  • » [haiku-development] Re: radeon_hd driver help request - Alexander von Gluck IV