All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] /drm/amd/amdgpu: move get memory type function from early init to sw init
@ 2017-06-30  5:32 Jim Qu
       [not found] ` <1498800731-13684-1-git-send-email-Jim.Qu-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Jim Qu @ 2017-06-30  5:32 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Jim Qu

On PX system, it will get memory type before gpu post , and get unkown type.

Change-Id: I79e3760dd789c21a5f552bc4e5754f7a2defdaae
Signed-off-by: Jim Qu <Jim.Qu@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c
index 5cc3f39..5ed6788f 100644
--- a/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c
@@ -765,14 +765,6 @@ static int gmc_v6_0_early_init(void *handle)
 	gmc_v6_0_set_gart_funcs(adev);
 	gmc_v6_0_set_irq_funcs(adev);
 
-	if (adev->flags & AMD_IS_APU) {
-		adev->mc.vram_type = AMDGPU_VRAM_TYPE_UNKNOWN;
-	} else {
-		u32 tmp = RREG32(mmMC_SEQ_MISC0);
-		tmp &= MC_SEQ_MISC0__MT__MASK;
-		adev->mc.vram_type = gmc_v6_0_convert_vram_type(tmp);
-	}
-
 	return 0;
 }
 
@@ -792,6 +784,14 @@ static int gmc_v6_0_sw_init(void *handle)
 	int dma_bits;
 	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
 
+	if (adev->flags & AMD_IS_APU) {
+		adev->mc.vram_type = AMDGPU_VRAM_TYPE_UNKNOWN;
+	} else {
+		u32 tmp = RREG32(mmMC_SEQ_MISC0);
+		tmp &= MC_SEQ_MISC0__MT__MASK;
+		adev->mc.vram_type = gmc_v6_0_convert_vram_type(tmp);
+	}
+
 	r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_LEGACY, 146, &adev->mc.vm_fault);
 	if (r)
 		return r;
-- 
1.9.1

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

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

* RE: [PATCH] /drm/amd/amdgpu: move get memory type function from early init to sw init
       [not found] ` <1498800731-13684-1-git-send-email-Jim.Qu-5C7GfCeVMHo@public.gmane.org>
@ 2017-06-30 14:42   ` Deucher, Alexander
  0 siblings, 0 replies; 2+ messages in thread
From: Deucher, Alexander @ 2017-06-30 14:42 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Qu, Jim



> -----Original Message-----
> From: amd-gfx [mailto:amd-gfx-bounces@lists.freedesktop.org] On Behalf
> Of Jim Qu
> Sent: Friday, June 30, 2017 1:32 AM
> To: amd-gfx@lists.freedesktop.org
> Cc: Qu, Jim
> Subject: [PATCH] /drm/amd/amdgpu: move get memory type function from
> early init to sw init
> 
> On PX system, it will get memory type before gpu post , and get unkown
> type.
> 
> Change-Id: I79e3760dd789c21a5f552bc4e5754f7a2defdaae
> Signed-off-by: Jim Qu <Jim.Qu@amd.com>

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

> ---
>  drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c | 16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c
> b/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c
> index 5cc3f39..5ed6788f 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c
> @@ -765,14 +765,6 @@ static int gmc_v6_0_early_init(void *handle)
>  	gmc_v6_0_set_gart_funcs(adev);
>  	gmc_v6_0_set_irq_funcs(adev);
> 
> -	if (adev->flags & AMD_IS_APU) {
> -		adev->mc.vram_type = AMDGPU_VRAM_TYPE_UNKNOWN;
> -	} else {
> -		u32 tmp = RREG32(mmMC_SEQ_MISC0);
> -		tmp &= MC_SEQ_MISC0__MT__MASK;
> -		adev->mc.vram_type =
> gmc_v6_0_convert_vram_type(tmp);
> -	}
> -
>  	return 0;
>  }
> 
> @@ -792,6 +784,14 @@ static int gmc_v6_0_sw_init(void *handle)
>  	int dma_bits;
>  	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
> 
> +	if (adev->flags & AMD_IS_APU) {
> +		adev->mc.vram_type = AMDGPU_VRAM_TYPE_UNKNOWN;
> +	} else {
> +		u32 tmp = RREG32(mmMC_SEQ_MISC0);
> +		tmp &= MC_SEQ_MISC0__MT__MASK;
> +		adev->mc.vram_type =
> gmc_v6_0_convert_vram_type(tmp);
> +	}
> +
>  	r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_LEGACY, 146,
> &adev->mc.vm_fault);
>  	if (r)
>  		return r;
> --
> 1.9.1
> 
> _______________________________________________
> 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] 2+ messages in thread

end of thread, other threads:[~2017-06-30 14:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-30  5:32 [PATCH] /drm/amd/amdgpu: move get memory type function from early init to sw init Jim Qu
     [not found] ` <1498800731-13684-1-git-send-email-Jim.Qu-5C7GfCeVMHo@public.gmane.org>
2017-06-30 14:42   ` Deucher, Alexander

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.