All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/amdgpu: access stolen VRAM directly on KV/KB
@ 2016-11-07  9:21 Christian König
       [not found] ` <1478510481-1768-1-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Christian König @ 2016-11-07  9:21 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

From: Christian König <christian.koenig@amd.com>

We don't need to use the PCI BAR on APUs. This allows us to access
the full VRAM directly without being limited by the BAR size.

Signed-off-by: Christian König <christian.koenig@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c
index 3a25f72..70585b1 100644
--- a/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c
@@ -375,9 +375,16 @@ static int gmc_v7_0_mc_init(struct amdgpu_device *adev)
 	/* size in MB on si */
 	adev->mc.mc_vram_size = RREG32(mmCONFIG_MEMSIZE) * 1024ULL * 1024ULL;
 	adev->mc.real_vram_size = RREG32(mmCONFIG_MEMSIZE) * 1024ULL * 1024ULL;
-	adev->mc.visible_vram_size = adev->mc.aper_size;
+
+#ifdef CONFIG_X86_64
+	if (adev->flags & AMD_IS_APU) {
+		adev->mc.aper_base = RREG32(mmMC_VM_FB_OFFSET) << 22ULL;
+		adev->mc.aper_size = adev->mc.real_vram_size;
+	}
+#endif
 
 	/* In case the PCI BAR is larger than the actual amount of vram */
+	adev->mc.visible_vram_size = adev->mc.aper_size;
 	if (adev->mc.visible_vram_size > adev->mc.real_vram_size)
 		adev->mc.visible_vram_size = adev->mc.real_vram_size;
 
-- 
2.7.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* [PATCH 2/2] drm/amdgpu: access stolen VRAM directly on CZ
       [not found] ` <1478510481-1768-1-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
@ 2016-11-07  9:21   ` Christian König
       [not found]     ` <1478510481-1768-2-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
  2016-11-07  9:29   ` [PATCH 1/2] drm/amdgpu: access stolen VRAM directly on KV/KB Michel Dänzer
  2016-11-07 22:02   ` Felix Kuehling
  2 siblings, 1 reply; 12+ messages in thread
From: Christian König @ 2016-11-07  9:21 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

From: Christian König <christian.koenig@amd.com>

We don't need to use the PCI BAR on APUs. This allows us to access
the full VRAM directly without being limited by the BAR size.

Signed-off-by: Christian König <christian.koenig@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
index f7372d3..0323f5d 100644
--- a/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
@@ -462,9 +462,16 @@ static int gmc_v8_0_mc_init(struct amdgpu_device *adev)
 	/* size in MB on si */
 	adev->mc.mc_vram_size = RREG32(mmCONFIG_MEMSIZE) * 1024ULL * 1024ULL;
 	adev->mc.real_vram_size = RREG32(mmCONFIG_MEMSIZE) * 1024ULL * 1024ULL;
-	adev->mc.visible_vram_size = adev->mc.aper_size;
+
+#ifdef CONFIG_X86_64
+	if (adev->flags & AMD_IS_APU) {
+		adev->mc.aper_base = RREG32(mmMC_VM_FB_OFFSET) << 22ULL;
+		adev->mc.aper_size = adev->mc.real_vram_size;
+	}
+#endif
 
 	/* In case the PCI BAR is larger than the actual amount of vram */
+	adev->mc.visible_vram_size = adev->mc.aper_size;
 	if (adev->mc.visible_vram_size > adev->mc.real_vram_size)
 		adev->mc.visible_vram_size = adev->mc.real_vram_size;
 
-- 
2.7.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: [PATCH 1/2] drm/amdgpu: access stolen VRAM directly on KV/KB
       [not found] ` <1478510481-1768-1-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
  2016-11-07  9:21   ` [PATCH 2/2] drm/amdgpu: access stolen VRAM directly on CZ Christian König
@ 2016-11-07  9:29   ` Michel Dänzer
       [not found]     ` <9d218698-d588-090a-eb47-d0142cfdb623-otUistvHUpPR7s880joybQ@public.gmane.org>
  2016-11-07 22:02   ` Felix Kuehling
  2 siblings, 1 reply; 12+ messages in thread
From: Michel Dänzer @ 2016-11-07  9:29 UTC (permalink / raw)
  To: Christian König; +Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

On 07/11/16 06:21 PM, Christian König wrote:
> From: Christian König <christian.koenig@amd.com>
> 
> We don't need to use the PCI BAR on APUs. This allows us to access
> the full VRAM directly without being limited by the BAR size.
> 
> Signed-off-by: Christian König <christian.koenig@amd.com>

The series is

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>


We could also drop the HDP flushes / invalidates in this case, right?


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: [PATCH 1/2] drm/amdgpu: access stolen VRAM directly on KV/KB
       [not found]     ` <9d218698-d588-090a-eb47-d0142cfdb623-otUistvHUpPR7s880joybQ@public.gmane.org>
@ 2016-11-07  9:33       ` Christian König
       [not found]         ` <7be5b56d-fae3-d71b-485f-01227172859d-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Christian König @ 2016-11-07  9:33 UTC (permalink / raw)
  To: Michel Dänzer; +Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

Am 07.11.2016 um 10:29 schrieb Michel Dänzer:
> On 07/11/16 06:21 PM, Christian König wrote:
>> From: Christian König <christian.koenig@amd.com>
>>
>> We don't need to use the PCI BAR on APUs. This allows us to access
>> the full VRAM directly without being limited by the BAR size.
>>
>> Signed-off-by: Christian König <christian.koenig@amd.com>
> The series is
>
> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
>
>
> We could also drop the HDP flushes / invalidates in this case, right?
Could be, but I'm not 100% sure how those are actually wired up on APUs.

Might be that they are NOPs anyway, but could be that at least the 
flushes are still vital.

Regards,
Christian.
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: [PATCH 2/2] drm/amdgpu: access stolen VRAM directly on CZ
       [not found]     ` <1478510481-1768-2-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
@ 2016-11-07 20:31       ` Dave Airlie
       [not found]         ` <CAPM=9twmcyE4fOzZXJexdfViNx32vkc39sciQ3Ha+7UhetJJKA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Dave Airlie @ 2016-11-07 20:31 UTC (permalink / raw)
  To: Christian König; +Cc: amd-gfx mailing list

On 7 November 2016 at 19:21, Christian König <deathsimple@vodafone.de> wrote:
> From: Christian König <christian.koenig@amd.com>
>
> We don't need to use the PCI BAR on APUs. This allows us to access
> the full VRAM directly without being limited by the BAR size.

I'm feeling coherency issues, has this approach been validated with the hw team?

Dave.

>
> Signed-off-by: Christian König <christian.koenig@amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
> index f7372d3..0323f5d 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
> @@ -462,9 +462,16 @@ static int gmc_v8_0_mc_init(struct amdgpu_device *adev)
>         /* size in MB on si */
>         adev->mc.mc_vram_size = RREG32(mmCONFIG_MEMSIZE) * 1024ULL * 1024ULL;
>         adev->mc.real_vram_size = RREG32(mmCONFIG_MEMSIZE) * 1024ULL * 1024ULL;
> -       adev->mc.visible_vram_size = adev->mc.aper_size;
> +
> +#ifdef CONFIG_X86_64
> +       if (adev->flags & AMD_IS_APU) {
> +               adev->mc.aper_base = RREG32(mmMC_VM_FB_OFFSET) << 22ULL;
> +               adev->mc.aper_size = adev->mc.real_vram_size;
> +       }
> +#endif
>
>         /* In case the PCI BAR is larger than the actual amount of vram */
> +       adev->mc.visible_vram_size = adev->mc.aper_size;
>         if (adev->mc.visible_vram_size > adev->mc.real_vram_size)
>                 adev->mc.visible_vram_size = adev->mc.real_vram_size;
>
> --
> 2.7.4
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: [PATCH 1/2] drm/amdgpu: access stolen VRAM directly on KV/KB
       [not found] ` <1478510481-1768-1-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
  2016-11-07  9:21   ` [PATCH 2/2] drm/amdgpu: access stolen VRAM directly on CZ Christian König
  2016-11-07  9:29   ` [PATCH 1/2] drm/amdgpu: access stolen VRAM directly on KV/KB Michel Dänzer
@ 2016-11-07 22:02   ` Felix Kuehling
  2 siblings, 0 replies; 12+ messages in thread
From: Felix Kuehling @ 2016-11-07 22:02 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

As a next step, you could also remove HDP flushing on APUs.

Regards,
  Felix


On 16-11-07 04:21 AM, Christian König wrote:
> From: Christian König <christian.koenig@amd.com>
>
> We don't need to use the PCI BAR on APUs. This allows us to access
> the full VRAM directly without being limited by the BAR size.
>
> Signed-off-by: Christian König <christian.koenig@amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c
> index 3a25f72..70585b1 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c
> @@ -375,9 +375,16 @@ static int gmc_v7_0_mc_init(struct amdgpu_device *adev)
>  	/* size in MB on si */
>  	adev->mc.mc_vram_size = RREG32(mmCONFIG_MEMSIZE) * 1024ULL * 1024ULL;
>  	adev->mc.real_vram_size = RREG32(mmCONFIG_MEMSIZE) * 1024ULL * 1024ULL;
> -	adev->mc.visible_vram_size = adev->mc.aper_size;
> +
> +#ifdef CONFIG_X86_64
> +	if (adev->flags & AMD_IS_APU) {
> +		adev->mc.aper_base = RREG32(mmMC_VM_FB_OFFSET) << 22ULL;
> +		adev->mc.aper_size = adev->mc.real_vram_size;
> +	}
> +#endif
>  
>  	/* In case the PCI BAR is larger than the actual amount of vram */
> +	adev->mc.visible_vram_size = adev->mc.aper_size;
>  	if (adev->mc.visible_vram_size > adev->mc.real_vram_size)
>  		adev->mc.visible_vram_size = adev->mc.real_vram_size;
>  

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: [PATCH 2/2] drm/amdgpu: access stolen VRAM directly on CZ
       [not found]         ` <CAPM=9twmcyE4fOzZXJexdfViNx32vkc39sciQ3Ha+7UhetJJKA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2016-11-08  7:29           ` Michel Dänzer
  0 siblings, 0 replies; 12+ messages in thread
From: Michel Dänzer @ 2016-11-08  7:29 UTC (permalink / raw)
  To: Dave Airlie, Christian König; +Cc: amd-gfx mailing list

On 08/11/16 05:31 AM, Dave Airlie wrote:
> On 7 November 2016 at 19:21, Christian König <deathsimple@vodafone.de> wrote:
>> From: Christian König <christian.koenig@amd.com>
>>
>> We don't need to use the PCI BAR on APUs. This allows us to access
>> the full VRAM directly without being limited by the BAR size.
> 
> I'm feeling coherency issues, has this approach been validated with the hw team?

I raised this concern internally as well, but the response indicated
that it should be fine. Apparently x86 defines that write-combined
writes complete before any access to UC memory (such as writing to an
MMIO register or doorbell to submit a GPU operation).


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: [PATCH 1/2] drm/amdgpu: access stolen VRAM directly on KV/KB
       [not found]         ` <7be5b56d-fae3-d71b-485f-01227172859d-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
@ 2016-11-08  7:31           ` Michel Dänzer
       [not found]             ` <8372afd6-8a51-1102-99a3-28a719088fa6-otUistvHUpPR7s880joybQ@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Michel Dänzer @ 2016-11-08  7:31 UTC (permalink / raw)
  To: Christian König; +Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

On 07/11/16 06:33 PM, Christian König wrote:
> Am 07.11.2016 um 10:29 schrieb Michel Dänzer:
>> On 07/11/16 06:21 PM, Christian König wrote:
>>> From: Christian König <christian.koenig@amd.com>
>>>
>>> We don't need to use the PCI BAR on APUs. This allows us to access
>>> the full VRAM directly without being limited by the BAR size.
>>>
>>> Signed-off-by: Christian König <christian.koenig@amd.com>
>> The series is
>>
>> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
>>
>>
>> We could also drop the HDP flushes / invalidates in this case, right?
> Could be, but I'm not 100% sure how those are actually wired up on APUs.
> 
> Might be that they are NOPs anyway, but could be that at least the
> flushes are still vital.

My assumption is that since CPU access to VRAM doesn't go through the
HDP at all with this change, HDP flushes / invalidates can't have any
useful effect.


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: [PATCH 1/2] drm/amdgpu: access stolen VRAM directly on KV/KB
       [not found]             ` <8372afd6-8a51-1102-99a3-28a719088fa6-otUistvHUpPR7s880joybQ@public.gmane.org>
@ 2016-11-08  9:23               ` Christian König
       [not found]                 ` <f04a0ad6-e2cb-98c9-cb09-8af3218b9dca-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Christian König @ 2016-11-08  9:23 UTC (permalink / raw)
  To: Michel Dänzer; +Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

Am 08.11.2016 um 08:31 schrieb Michel Dänzer:
> On 07/11/16 06:33 PM, Christian König wrote:
>> Am 07.11.2016 um 10:29 schrieb Michel Dänzer:
>>> On 07/11/16 06:21 PM, Christian König wrote:
>>>> From: Christian König <christian.koenig@amd.com>
>>>>
>>>> We don't need to use the PCI BAR on APUs. This allows us to access
>>>> the full VRAM directly without being limited by the BAR size.
>>>>
>>>> Signed-off-by: Christian König <christian.koenig@amd.com>
>>> The series is
>>>
>>> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
>>>
>>>
>>> We could also drop the HDP flushes / invalidates in this case, right?
>> Could be, but I'm not 100% sure how those are actually wired up on APUs.
>>
>> Might be that they are NOPs anyway, but could be that at least the
>> flushes are still vital.
> My assumption is that since CPU access to VRAM doesn't go through the
> HDP at all with this change, HDP flushes / invalidates can't have any
> useful effect.

Well writes to GTT still use the HDP if I understand it correctly.

So we still need to handle either flushes or invalidations (I doesn't of 
hand remember which was that).

Regards,
Christian.
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: [PATCH 1/2] drm/amdgpu: access stolen VRAM directly on KV/KB
       [not found]                 ` <f04a0ad6-e2cb-98c9-cb09-8af3218b9dca-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
@ 2016-11-08  9:37                   ` Michel Dänzer
       [not found]                     ` <930d7e26-a894-c119-e5ec-b6dc1dae1ea4-otUistvHUpPR7s880joybQ@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Michel Dänzer @ 2016-11-08  9:37 UTC (permalink / raw)
  To: Christian König; +Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

On 08/11/16 06:23 PM, Christian König wrote:
> Am 08.11.2016 um 08:31 schrieb Michel Dänzer:
>> On 07/11/16 06:33 PM, Christian König wrote:
>>> Am 07.11.2016 um 10:29 schrieb Michel Dänzer:
>>>> On 07/11/16 06:21 PM, Christian König wrote:
>>>>> From: Christian König <christian.koenig@amd.com>
>>>>>
>>>>> We don't need to use the PCI BAR on APUs. This allows us to access
>>>>> the full VRAM directly without being limited by the BAR size.
>>>>>
>>>>> Signed-off-by: Christian König <christian.koenig@amd.com>
>>>> The series is
>>>>
>>>> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
>>>>
>>>>
>>>> We could also drop the HDP flushes / invalidates in this case, right?
>>> Could be, but I'm not 100% sure how those are actually wired up on APUs.
>>>
>>> Might be that they are NOPs anyway, but could be that at least the
>>> flushes are still vital.
>> My assumption is that since CPU access to VRAM doesn't go through the
>> HDP at all with this change, HDP flushes / invalidates can't have any
>> useful effect.
> 
> Well writes to GTT still use the HDP if I understand it correctly.
> 
> So we still need to handle either flushes or invalidations (I doesn't of
> hand remember which was that).

Do you mean GPU access to GTT? If so, not sure why it would be writes only?


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* RE: [PATCH 1/2] drm/amdgpu: access stolen VRAM directly on KV/KB
       [not found]                     ` <930d7e26-a894-c119-e5ec-b6dc1dae1ea4-otUistvHUpPR7s880joybQ@public.gmane.org>
@ 2016-11-08 13:36                       ` Deucher, Alexander
       [not found]                         ` <MWHPR12MB16944B5018FC8CFF710EF3FFF7A60-Gy0DoCVfaSW4WA4dJ5YXGAdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Deucher, Alexander @ 2016-11-08 13:36 UTC (permalink / raw)
  To: 'Michel Dänzer', Christian König
  Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

> -----Original Message-----
> From: amd-gfx [mailto:amd-gfx-bounces@lists.freedesktop.org] On Behalf
> Of Michel Dänzer
> Sent: Tuesday, November 08, 2016 4:37 AM
> To: Christian König
> Cc: amd-gfx@lists.freedesktop.org
> Subject: Re: [PATCH 1/2] drm/amdgpu: access stolen VRAM directly on
> KV/KB
> 
> On 08/11/16 06:23 PM, Christian König wrote:
> > Am 08.11.2016 um 08:31 schrieb Michel Dänzer:
> >> On 07/11/16 06:33 PM, Christian König wrote:
> >>> Am 07.11.2016 um 10:29 schrieb Michel Dänzer:
> >>>> On 07/11/16 06:21 PM, Christian König wrote:
> >>>>> From: Christian König <christian.koenig@amd.com>
> >>>>>
> >>>>> We don't need to use the PCI BAR on APUs. This allows us to access
> >>>>> the full VRAM directly without being limited by the BAR size.
> >>>>>
> >>>>> Signed-off-by: Christian König <christian.koenig@amd.com>
> >>>> The series is
> >>>>
> >>>> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
> >>>>
> >>>>
> >>>> We could also drop the HDP flushes / invalidates in this case, right?
> >>> Could be, but I'm not 100% sure how those are actually wired up on
> APUs.
> >>>
> >>> Might be that they are NOPs anyway, but could be that at least the
> >>> flushes are still vital.
> >> My assumption is that since CPU access to VRAM doesn't go through the
> >> HDP at all with this change, HDP flushes / invalidates can't have any
> >> useful effect.
> >
> > Well writes to GTT still use the HDP if I understand it correctly.
> >
> > So we still need to handle either flushes or invalidations (I doesn't of
> > hand remember which was that).
> 
> Do you mean GPU access to GTT? If so, not sure why it would be writes only?

The HDP has a read cache and a write queue.  It only affects access via the BAR (either the CPU or another PCIe device).  AFAIK, the APU access would only use the HDP if you mapped the BAR via the GART.

Alex

> 
> 
> --
> Earthling Michel Dänzer               |               http://www.amd.com
> Libre software enthusiast             |             Mesa and X developer
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: [PATCH 1/2] drm/amdgpu: access stolen VRAM directly on KV/KB
       [not found]                         ` <MWHPR12MB16944B5018FC8CFF710EF3FFF7A60-Gy0DoCVfaSW4WA4dJ5YXGAdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
@ 2016-11-08 14:27                           ` Christian König
  0 siblings, 0 replies; 12+ messages in thread
From: Christian König @ 2016-11-08 14:27 UTC (permalink / raw)
  To: Deucher, Alexander, 'Michel Dänzer'
  Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

Am 08.11.2016 um 14:36 schrieb Deucher, Alexander:
>> -----Original Message-----
>> From: amd-gfx [mailto:amd-gfx-bounces@lists.freedesktop.org] On Behalf
>> Of Michel Dänzer
>> Sent: Tuesday, November 08, 2016 4:37 AM
>> To: Christian König
>> Cc: amd-gfx@lists.freedesktop.org
>> Subject: Re: [PATCH 1/2] drm/amdgpu: access stolen VRAM directly on
>> KV/KB
>>
>> On 08/11/16 06:23 PM, Christian König wrote:
>>> Am 08.11.2016 um 08:31 schrieb Michel Dänzer:
>>>> On 07/11/16 06:33 PM, Christian König wrote:
>>>>> Am 07.11.2016 um 10:29 schrieb Michel Dänzer:
>>>>>> On 07/11/16 06:21 PM, Christian König wrote:
>>>>>>> From: Christian König <christian.koenig@amd.com>
>>>>>>>
>>>>>>> We don't need to use the PCI BAR on APUs. This allows us to access
>>>>>>> the full VRAM directly without being limited by the BAR size.
>>>>>>>
>>>>>>> Signed-off-by: Christian König <christian.koenig@amd.com>
>>>>>> The series is
>>>>>>
>>>>>> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
>>>>>>
>>>>>>
>>>>>> We could also drop the HDP flushes / invalidates in this case, right?
>>>>> Could be, but I'm not 100% sure how those are actually wired up on
>> APUs.
>>>>> Might be that they are NOPs anyway, but could be that at least the
>>>>> flushes are still vital.
>>>> My assumption is that since CPU access to VRAM doesn't go through the
>>>> HDP at all with this change, HDP flushes / invalidates can't have any
>>>> useful effect.
>>> Well writes to GTT still use the HDP if I understand it correctly.
>>>
>>> So we still need to handle either flushes or invalidations (I doesn't of
>>> hand remember which was that).
>> Do you mean GPU access to GTT? If so, not sure why it would be writes only?
> The HDP has a read cache and a write queue.  It only affects access via the BAR (either the CPU or another PCIe device).  AFAIK, the APU access would only use the HDP if you mapped the BAR via the GART.

Ok, my understanding was that the HDP was responsible for both 
directions. E.g. writes/reads from the CPU side to the BAR as well as 
writes/reads from the GPU to system memory.

Since this needs intense testing anyway I will just wait for the first 
two patches to land, wait for a release to make sure they don't cause 
problems and then disable HDP flushes on APUs as well.

Christian.

>
> Alex
>
>>
>> --
>> Earthling Michel Dänzer               |               http://www.amd.com
>> Libre software enthusiast             |             Mesa and X developer
>> _______________________________________________
>> amd-gfx mailing list
>> amd-gfx@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx


_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

end of thread, other threads:[~2016-11-08 14:27 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-07  9:21 [PATCH 1/2] drm/amdgpu: access stolen VRAM directly on KV/KB Christian König
     [not found] ` <1478510481-1768-1-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2016-11-07  9:21   ` [PATCH 2/2] drm/amdgpu: access stolen VRAM directly on CZ Christian König
     [not found]     ` <1478510481-1768-2-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2016-11-07 20:31       ` Dave Airlie
     [not found]         ` <CAPM=9twmcyE4fOzZXJexdfViNx32vkc39sciQ3Ha+7UhetJJKA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-11-08  7:29           ` Michel Dänzer
2016-11-07  9:29   ` [PATCH 1/2] drm/amdgpu: access stolen VRAM directly on KV/KB Michel Dänzer
     [not found]     ` <9d218698-d588-090a-eb47-d0142cfdb623-otUistvHUpPR7s880joybQ@public.gmane.org>
2016-11-07  9:33       ` Christian König
     [not found]         ` <7be5b56d-fae3-d71b-485f-01227172859d-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2016-11-08  7:31           ` Michel Dänzer
     [not found]             ` <8372afd6-8a51-1102-99a3-28a719088fa6-otUistvHUpPR7s880joybQ@public.gmane.org>
2016-11-08  9:23               ` Christian König
     [not found]                 ` <f04a0ad6-e2cb-98c9-cb09-8af3218b9dca-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2016-11-08  9:37                   ` Michel Dänzer
     [not found]                     ` <930d7e26-a894-c119-e5ec-b6dc1dae1ea4-otUistvHUpPR7s880joybQ@public.gmane.org>
2016-11-08 13:36                       ` Deucher, Alexander
     [not found]                         ` <MWHPR12MB16944B5018FC8CFF710EF3FFF7A60-Gy0DoCVfaSW4WA4dJ5YXGAdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2016-11-08 14:27                           ` Christian König
2016-11-07 22:02   ` Felix Kuehling

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.