[PATCH 1/2] drm/amdgpu: fix mask in GART location calculation

Deucher, Alexander Alexander.Deucher at amd.com
Fri Sep 14 13:47:45 UTC 2018


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

________________________________
From: amd-gfx <amd-gfx-bounces at lists.freedesktop.org> on behalf of Christian König <ckoenig.leichtzumerken at gmail.com>
Sent: Friday, September 14, 2018 6:57 AM
To: amd-gfx at lists.freedesktop.org
Subject: [PATCH 1/2] drm/amdgpu: fix mask in GART location calculation

We need to mask the lower bits not the upper one.

Fixes: ec210e3226dc0 drm/amdgpu: put GART away from VRAM v2

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

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
index ae4467113240..9a5b252784a1 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
@@ -166,7 +166,7 @@ void amdgpu_gmc_gart_location(struct amdgpu_device *adev, struct amdgpu_gmc *mc)
         else
                 mc->gart_start = mc->mc_mask - mc->gart_size + 1;

-       mc->gart_start &= four_gb - 1;
+       mc->gart_start &= ~(four_gb - 1);
         mc->gart_end = mc->gart_start + mc->gart_size - 1;
         dev_info(adev->dev, "GART: %lluM 0x%016llX - 0x%016llX\n",
                         mc->gart_size >> 20, mc->gart_start, mc->gart_end);
--
2.14.1

_______________________________________________
amd-gfx mailing list
amd-gfx at lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20180914/484024fe/attachment.html>


More information about the amd-gfx mailing list