about_radeon_dma

Alex Deucher alexdeucher at gmail.com
Wed Jun 13 19:35:45 PDT 2012


On Wed, Jun 13, 2012 at 9:55 PM, llittle了了 <sizhiying at hotmail.com> wrote:
> Thanks for you reply!
>
> I use PCI----MMIO to access VRAM and GTT areas. And for ring_buffer, it
> alloced from the vmalloc--area and vmap to the physical address using page
> table.
>
>  If  enable the radeon_benchmark, it first to prepare the dma channel.
> "set_tex_resource(), set_render_target(), cp_set_surface_sync()" ,such
> functions only write ring_buffer. The ring_buffer is vma-area, even it map
> to physical area. But for radeon_card, how it know the physical-area??
>
>  The question is same to the SCRACH test, ring_test. Why I write into
> ring_buffer,then the card register will know the value "deadbeef" ??
>
> Do I not understand the real card work?  ring_test??

What exactly are you trying to accomplish?  The GPU has it's own
internal address space that is used by on chip clients. Within that
address space you map can map vram, AGP, and on-chip gart apertures.
The on chip gart aperture lets you map system pages into a contiguous
linear aperture within the GPU's address space.  Once you have these
apertures set up, internal GPU clients need only point to the
appropriate internal address to access a buffer in either system ram
(via on-chip gart or AGP) or vram.  For example, you can store
textures in system memory pages and point the texture hardware at them
and the chip will read from those pages and use the textures on a quad
rendered to vram, or vice versa.

Command are sent to the GPU via a command processor (CP) that fetches
commands from a ring buffer.  You write the commands into the ring
buffer and update the write pointer.  The CP then executes the
commands in the ring buffer until the read pointer and write pointer
both point to the same index.  At that point the CP stops and waits
until the write pointer is updated again.  In the ring test, we put
command packets on the ring to write to a scatch register or memory
location.  When the CP is done, we check the register or memory
location to make sure it was properly updated.  That way we know the
ring buffer is working.

Alex

>
>
>> Date: Wed, 13 Jun 2012 09:57:28 -0400
>> From: konrad.wilk at oracle.com
>> To: sizhiying at hotmail.com
>> CC: dri-devel at lists.freedesktop.org
>> Subject: Re: about_radeon_dma
>>
>> On Wed, Jun 1 3, 2012 at 09:44:19AM +0800, llittle了了 wrote:
>> >
>> > HI,all
>> > Now, my lab is using radeon_ati card。And, I need ati_card dma
>> > function。But, I do not clear that how the ati card know the dma address
>> > which alloced by kernel??
>>
>> By using the PCI API.
>>
>> >
>>
>> > Can any kernel drivers for radeon card give me some advise or explain
>> > the answer?
>> >
>> > I have read the radeon driver in kernel (/driver/gpu/drm/randeon/xxx
>> > )and the TTM manager. So, as I know, If I use GFP_KERNEL sign to alloc
>> > memory, the radeon_card work right, but any other palce ,it failed. Why and
>> > how this happened?
>> > Is there any way to tell the dma address and ring buffer address in
>> > kernel to the radeon_card ?
>> >
>> > It`s so confused! Hope for your answer!
>> >
>> >
>> > Thanks so much!
>> > zhiyig Si
>> >
>>
>> > _______________________________________________
>> > dri-devel mailing list
>> > dri-devel at lists.freedesktop.org
>> > http://lists.freedesktop.org/mailman/listinfo/dri-devel
>>
>
> _______________________________________________
> dri-devel mailing list
> dri-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>


More information about the dri-devel mailing list