All of lore.kernel.org
 help / color / mirror / Atom feed
* about_radeon_dma
@ 2012-06-13  1:44 llittle了了
  2012-06-13 13:57 ` about_radeon_dma Konrad Rzeszutek Wilk
  0 siblings, 1 reply; 6+ messages in thread
From: llittle了了 @ 2012-06-13  1:44 UTC (permalink / raw)
  To: dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 713 bytes --]


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??

      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
 		 	   		  

[-- Attachment #1.2: Type: text/html, Size: 1077 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: about_radeon_dma
  2012-06-13  1:44 about_radeon_dma llittle了了
@ 2012-06-13 13:57 ` Konrad Rzeszutek Wilk
  2012-06-14  1:55   ` about_radeon_dma llittle了了
  0 siblings, 1 reply; 6+ messages in thread
From: Konrad Rzeszutek Wilk @ 2012-06-13 13:57 UTC (permalink / raw)
  To: llittle了了; +Cc: dri-devel

On Wed, Jun 13, 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@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: about_radeon_dma
  2012-06-13 13:57 ` about_radeon_dma Konrad Rzeszutek Wilk
@ 2012-06-14  1:55   ` llittle了了
  2012-06-14  2:35     ` about_radeon_dma Alex Deucher
  0 siblings, 1 reply; 6+ messages in thread
From: llittle了了 @ 2012-06-14  1:55 UTC (permalink / raw)
  To: konrad.wilk; +Cc: dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 1931 bytes --]


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??


> Date: Wed, 13 Jun 2012 09:57:28 -0400
> From: konrad.wilk@oracle.com
> To: sizhiying@hotmail.com
> CC: dri-devel@lists.freedesktop.org
> Subject: Re: about_radeon_dma
> 
> On Wed, Jun 13, 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@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/dri-devel
> 
 		 	   		  

[-- Attachment #1.2: Type: text/html, Size: 2460 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: about_radeon_dma
  2012-06-14  1:55   ` about_radeon_dma llittle了了
@ 2012-06-14  2:35     ` Alex Deucher
  2012-06-14  4:04       ` about_radeon_dma llittle了了
  0 siblings, 1 reply; 6+ messages in thread
From: Alex Deucher @ 2012-06-14  2:35 UTC (permalink / raw)
  To: llittle了了; +Cc: dri-devel

On Wed, Jun 13, 2012 at 9:55 PM, llittle了了 <sizhiying@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@oracle.com
>> To: sizhiying@hotmail.com
>> CC: dri-devel@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@lists.freedesktop.org
>> > http://lists.freedesktop.org/mailman/listinfo/dri-devel
>>
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: about_radeon_dma
  2012-06-14  2:35     ` about_radeon_dma Alex Deucher
@ 2012-06-14  4:04       ` llittle了了
  2012-06-14 14:46         ` about_radeon_dma Jerome Glisse
  0 siblings, 1 reply; 6+ messages in thread
From: llittle了了 @ 2012-06-14  4:04 UTC (permalink / raw)
  To: alexdeucher; +Cc: dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 5504 bytes --]


Yes, I transplant the radeon_driver from 64bit_kernel to a mini 32bit_os. The purpose is to open radeon_benchmark  or Xorg in the mini_32bit_os.
So, I think ring_test success means GPU  work correctly and smmothly. 

But ,my ring_test in the mini_32bit_os does not success. When I read scratch register, it`s not the value wrote into the memory location.So, I think the address space does not map correct. 
>> |--系统内存--|--显存--|--GTT内存--|
>> 0           256M     384M        896MSuch memory alloction in my mini32bit_os has been build up. There are  differences between linux-kernel and my mini32bit_os :
first,  mymini32bit_os does not have TTM;
second, the mini32bit_os use 0x8000,0000-----0x9000,0000 virtual address which map to 0x0----0x1000,0000 physical address . While linux-kernel use 0x9800,0000,fc24,0000――0x9800,0000,ff00,0000 CPU vritual address which map to 0x0000,0000,fc24,0000――0x0000,0000,ff00,0000 physical address.I have 2g memory.

I also use gart_table to tell GPU my mini32bit_os address. set_gart_pages. But ring_test still does not work. If we can use gart_table to tell GPU the ring_buffer memory location, I alloc the ring_buffer from the low 16M memory, then fill the gart_table, GPU would konw that address and ring_test would sucess. But, when I use the low 16M memory for ring_buffer, ring_test failed. I have reserved the low 16M memory  at the boot time.

That is the exactly confused me. Why? I move ring_buffer any other palace, ring_test will not work?


> Date: Wed, 13 Jun 2012 22:35:45 -0400
> Subject: Re: about_radeon_dma
> From: alexdeucher@gmail.com
> To: sizhiying@hotmail.com
> CC: konrad.wilk@oracle.com; dri-devel@lists.freedesktop.org
> 
> On Wed, Jun 13, 2012 at 9:55 PM, llittle了了 <sizhiying@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@oracle.com
> >> To: sizhiying@hotmail.com
> >> CC: dri-devel@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@lists.freedesktop.org
> >> > http://lists.freedesktop.org/mailman/listinfo/dri-devel
> >>
> >
> > _______________________________________________
> > dri-devel mailing list
> > dri-devel@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/dri-devel
> >
 		 	   		  

[-- Attachment #1.2: Type: text/html, Size: 6801 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: about_radeon_dma
  2012-06-14  4:04       ` about_radeon_dma llittle了了
@ 2012-06-14 14:46         ` Jerome Glisse
  0 siblings, 0 replies; 6+ messages in thread
From: Jerome Glisse @ 2012-06-14 14:46 UTC (permalink / raw)
  To: llittle了了; +Cc: dri-devel

On Thu, Jun 14, 2012 at 12:04 AM, llittle了了 <sizhiying@hotmail.com> wrote:
> Yes, I transplant the radeon_driver from 64bit_kernel to a mini 32bit_os.
> The purpose is to open radeon_benchmark  or Xorg in the mini_32bit_os.
> So, I think ring_test success means GPU  work correctly and smmothly.
>
> But ,my ring_test in the mini_32bit_os does not success. When I read scratch
> register, it`s not the value wrote into the memory location.So, I think the
> address space does not map correct.
>
>>> |--系统内存--|--显存--|--GTT内存--|
>>> 0           256M     384M        896M
>
> Such memory alloction in my mini32bit_os has been build up. There are
> differences between linux-kernel and my mini32bit_os :
> first,  mymini32bit_os does not have TTM;
> second, the mini32bit_os use 0x8000,0000-----0x9000,0000 virtual address
> which map to 0x0----0x1000,0000 physical address . While linux-kernel use
> 0x9800,0000,fc24,0000----0x9800,0000,ff00,0000 CPU vritual address which map
> to 0x0000,0000,fc24,0000----0x0000,0000,ff00,0000 physical address.I have 2g
> memory.
>
> I also use gart_table to tell GPU my mini32bit_os address. set_gart_pages.
> But ring_test still does not work. If we can use gart_table to tell GPU the
> ring_buffer memory location, I alloc the ring_buffer from the low 16M
> memory, then fill the gart_table, GPU would konw that address and ring_test
> would sucess. But, when I use the low 16M memory for ring_buffer, ring_test
> faile d. I have reserved the low 16M memory  at the boot time.
>
> That is the exactly confused me. Why? I move ring_buffer any other palace,
> ring_test will not work?
>
>

Virtual address space does not matter for the GPU, what you need to
program is physical page address into GPU gart.

Cheers,
Jerome
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-06-14 14:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-13  1:44 about_radeon_dma llittle了了
2012-06-13 13:57 ` about_radeon_dma Konrad Rzeszutek Wilk
2012-06-14  1:55   ` about_radeon_dma llittle了了
2012-06-14  2:35     ` about_radeon_dma Alex Deucher
2012-06-14  4:04       ` about_radeon_dma llittle了了
2012-06-14 14:46         ` about_radeon_dma Jerome Glisse

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.