public inbox for amd-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: fix AGP location with VRAM at 0x0
@ 2018-10-04  9:02 Christian König
       [not found] ` <20181004090210.1904-1-christian.koenig-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Christian König @ 2018-10-04  9:02 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

That also simplifies handling quite a bit.

Signed-off-by: Christian König <christian.koenig@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
index 9a5b252784a1..999e15945355 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
@@ -200,16 +200,13 @@ void amdgpu_gmc_agp_location(struct amdgpu_device *adev, struct amdgpu_gmc *mc)
 	}
 
 	if (size_bf > size_af) {
-		mc->agp_start = mc->fb_start > mc->gart_start ?
-			mc->gart_end + 1 : 0;
+		mc->agp_start = (mc->fb_start - size_bf) & sixteen_gb_mask;
 		mc->agp_size = size_bf;
 	} else {
-		mc->agp_start = (mc->fb_start > mc->gart_start ?
-			mc->fb_end : mc->gart_end) + 1,
+		mc->agp_start = ALIGN(mc->fb_end + 1, sixteen_gb);
 		mc->agp_size = size_af;
 	}
 
-	mc->agp_start = ALIGN(mc->agp_start, sixteen_gb);
 	mc->agp_end = mc->agp_start + mc->agp_size - 1;
 	dev_info(adev->dev, "AGP: %lluM 0x%016llX - 0x%016llX\n",
 			mc->agp_size >> 20, mc->agp_start, mc->agp_end);
-- 
2.14.1

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

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

* Re: [PATCH] drm/amdgpu: fix AGP location with VRAM at 0x0
       [not found] ` <20181004090210.1904-1-christian.koenig-5C7GfCeVMHo@public.gmane.org>
@ 2018-10-08 11:35   ` Christian König
  2018-10-09  6:45   ` Zhang, Jerry(Junwei)
  2018-10-09 10:47   ` Huang Rui
  2 siblings, 0 replies; 4+ messages in thread
From: Christian König @ 2018-10-08 11:35 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

Ping, can anybody review this?

Am 04.10.2018 um 11:02 schrieb Christian König:
> That also simplifies handling quite a bit.
>
> Signed-off-by: Christian König <christian.koenig@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 7 ++-----
>   1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
> index 9a5b252784a1..999e15945355 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
> @@ -200,16 +200,13 @@ void amdgpu_gmc_agp_location(struct amdgpu_device *adev, struct amdgpu_gmc *mc)
>   	}
>   
>   	if (size_bf > size_af) {
> -		mc->agp_start = mc->fb_start > mc->gart_start ?
> -			mc->gart_end + 1 : 0;
> +		mc->agp_start = (mc->fb_start - size_bf) & sixteen_gb_mask;
>   		mc->agp_size = size_bf;
>   	} else {
> -		mc->agp_start = (mc->fb_start > mc->gart_start ?
> -			mc->fb_end : mc->gart_end) + 1,
> +		mc->agp_start = ALIGN(mc->fb_end + 1, sixteen_gb);
>   		mc->agp_size = size_af;
>   	}
>   
> -	mc->agp_start = ALIGN(mc->agp_start, sixteen_gb);
>   	mc->agp_end = mc->agp_start + mc->agp_size - 1;
>   	dev_info(adev->dev, "AGP: %lluM 0x%016llX - 0x%016llX\n",
>   			mc->agp_size >> 20, mc->agp_start, mc->agp_end);

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

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

* Re: [PATCH] drm/amdgpu: fix AGP location with VRAM at 0x0
       [not found] ` <20181004090210.1904-1-christian.koenig-5C7GfCeVMHo@public.gmane.org>
  2018-10-08 11:35   ` Christian König
@ 2018-10-09  6:45   ` Zhang, Jerry(Junwei)
  2018-10-09 10:47   ` Huang Rui
  2 siblings, 0 replies; 4+ messages in thread
From: Zhang, Jerry(Junwei) @ 2018-10-09  6:45 UTC (permalink / raw)
  To: Christian König, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

On 10/04/2018 05:02 PM, Christian König wrote:
> That also simplifies handling quite a bit.
>
> Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 7 ++-----
>   1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
> index 9a5b252784a1..999e15945355 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
> @@ -200,16 +200,13 @@ void amdgpu_gmc_agp_location(struct amdgpu_device *adev, struct amdgpu_gmc *mc)
>   	}
>   
>   	if (size_bf > size_af) {
> -		mc->agp_start = mc->fb_start > mc->gart_start ?
> -			mc->gart_end + 1 : 0;
> +		mc->agp_start = (mc->fb_start - size_bf) & sixteen_gb_mask;
>   		mc->agp_size = size_bf;
>   	} else {
> -		mc->agp_start = (mc->fb_start > mc->gart_start ?
> -			mc->fb_end : mc->gart_end) + 1,
> +		mc->agp_start = ALIGN(mc->fb_end + 1, sixteen_gb);
>   		mc->agp_size = size_af;
>   	}
>   
> -	mc->agp_start = ALIGN(mc->agp_start, sixteen_gb);
>   	mc->agp_end = mc->agp_start + mc->agp_size - 1;
>   	dev_info(adev->dev, "AGP: %lluM 0x%016llX - 0x%016llX\n",
>   			mc->agp_size >> 20, mc->agp_start, mc->agp_end);

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

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

* Re: [PATCH] drm/amdgpu: fix AGP location with VRAM at 0x0
       [not found] ` <20181004090210.1904-1-christian.koenig-5C7GfCeVMHo@public.gmane.org>
  2018-10-08 11:35   ` Christian König
  2018-10-09  6:45   ` Zhang, Jerry(Junwei)
@ 2018-10-09 10:47   ` Huang Rui
  2 siblings, 0 replies; 4+ messages in thread
From: Huang Rui @ 2018-10-09 10:47 UTC (permalink / raw)
  To: Christian König; +Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

On Thu, Oct 04, 2018 at 11:02:10AM +0200, Christian König wrote:
> That also simplifies handling quite a bit.
> 
> Signed-off-by: Christian König <christian.koenig@amd.com>

Reviewed-by: Huang Rui <ray.huang@amd.com>

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
> index 9a5b252784a1..999e15945355 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
> @@ -200,16 +200,13 @@ void amdgpu_gmc_agp_location(struct amdgpu_device *adev, struct amdgpu_gmc *mc)
>  	}
>  
>  	if (size_bf > size_af) {
> -		mc->agp_start = mc->fb_start > mc->gart_start ?
> -			mc->gart_end + 1 : 0;
> +		mc->agp_start = (mc->fb_start - size_bf) & sixteen_gb_mask;
>  		mc->agp_size = size_bf;
>  	} else {
> -		mc->agp_start = (mc->fb_start > mc->gart_start ?
> -			mc->fb_end : mc->gart_end) + 1,
> +		mc->agp_start = ALIGN(mc->fb_end + 1, sixteen_gb);
>  		mc->agp_size = size_af;
>  	}
>  
> -	mc->agp_start = ALIGN(mc->agp_start, sixteen_gb);
>  	mc->agp_end = mc->agp_start + mc->agp_size - 1;
>  	dev_info(adev->dev, "AGP: %lluM 0x%016llX - 0x%016llX\n",
>  			mc->agp_size >> 20, mc->agp_start, mc->agp_end);
> -- 
> 2.14.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] 4+ messages in thread

end of thread, other threads:[~2018-10-09 10:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-04  9:02 [PATCH] drm/amdgpu: fix AGP location with VRAM at 0x0 Christian König
     [not found] ` <20181004090210.1904-1-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2018-10-08 11:35   ` Christian König
2018-10-09  6:45   ` Zhang, Jerry(Junwei)
2018-10-09 10:47   ` Huang Rui

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox