From: =?UTF-8?Q?Christian_K=c3=b6nig?= Subject: Re: [PATCH 3/3] drm/amdgpu: cleanup adjust_mc_addr handling Date: Mon, 15 May 2017 11:37:45 +0200 Message-ID: <244d4206-affc-434d-e5f8-32b5c3d3ea82@vodafone.de> References: <1494596880-3968-1-git-send-email-deathsimple@vodafone.de> <1494596880-3968-3-git-send-email-deathsimple@vodafone.de> <674b18c3-045e-2c77-1349-b1f24e72067c@amd.com> <59191B2D.7000604@amd.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0651043120==" Return-path: In-Reply-To: <59191B2D.7000604-5C7GfCeVMHo@public.gmane.org> List-Id: Discussion list for AMD gfx List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org Sender: "amd-gfx" To: zhoucm1 , Felix Kuehling , amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org, =?UTF-8?Q?Christian_K=c3=b6nig?= , "Russell, Kent" This is a multi-part message in MIME format. --===============0651043120== Content-Type: multipart/alternative; boundary="------------0E59316D41B905271FF51D57" This is a multi-part message in MIME format. --------------0E59316D41B905271FF51D57 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Am 15.05.2017 um 05:06 schrieb zhoucm1: > On 2017年05月13日 02:57, Felix Kuehling wrote: >> [SNIP] >>> amdgpu_vm_do_set_ptes(¶ms, >>> last_shadow, >>> - pt_addr, count, >>> - incr, >>> - AMDGPU_PTE_VALID); >>> + entry, count, >>> + incr, 0); >> [FK] For count >=3 this would result in an SDMA_OP_PTEPDE packet with >> flags=0 and the flags included in the address. Could SDMA mask out the >> flags bits from the address before it applies the flags? The SDMA 4.0 >> MAS includes pseudo code that looks like it wouldn't. > > 5. > > > Generate PTE/PDE > > It would work like this in C pseudo code: > > For (i = 0; i < count; i++) > > { > > Write ( Mask | ( Initial Value + ( i * Increment ) ) ) to Dest Addr > // result is a 64 bit value > > Dest Addr += 8 bytes; > > } > > Yes, it wouldn't. > Well Felix is right with the point that this is actually at least a little bit ugly and not the intended use. I will just keep setting the valid bit outside of that function. Regards, Christian. --------------0E59316D41B905271FF51D57 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit
Am 15.05.2017 um 05:06 schrieb zhoucm1:
On 2017年05月13日 02:57, Felix Kuehling wrote:
[SNIP]
 					amdgpu_vm_do_set_ptes(&params,
 							      last_shadow,
-							      pt_addr, count,
-							      incr,
-							      AMDGPU_PTE_VALID);
+							      entry, count,
+							      incr, 0);
[FK] For count >=3 this would result in an SDMA_OP_PTEPDE packet with
flags=0 and the flags included in the address. Could SDMA mask out the
flags bits from the address before it applies the flags? The SDMA 4.0
MAS includes pseudo code that looks like it wouldn't.
      1. Generate PTE/PDE

It would work like this in C pseudo code:

For (i = 0; i < count; i++)

{

                Write ( Mask | ( Initial Value + ( i * Increment ) ) ) to Dest Addr  // result is a 64 bit value

                Dest Addr += 8 bytes;

}

Yes, it wouldn't.

Well Felix is right with the point that this is actually at least a little bit ugly and not the intended use.

I will just keep setting the valid bit outside of that function.

Regards,
Christian.
--------------0E59316D41B905271FF51D57-- --===============0651043120== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KYW1kLWdmeCBt YWlsaW5nIGxpc3QKYW1kLWdmeEBsaXN0cy5mcmVlZGVza3RvcC5vcmcKaHR0cHM6Ly9saXN0cy5m cmVlZGVza3RvcC5vcmcvbWFpbG1hbi9saXN0aW5mby9hbWQtZ2Z4Cg== --===============0651043120==--