* [PATCH] drm/amdgpu: Only retrieve GPU address of GART table after pinning it
@ 2018-08-28 9:27 Michel Dänzer
[not found] ` <20180828092714.2131-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Michel Dänzer @ 2018-08-28 9:27 UTC (permalink / raw)
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
From: Michel Dänzer <michel.daenzer@amd.com>
Doing it earlier hits a WARN_ON_ONCE in amdgpu_bo_gpu_offset.
Fixes: "drm/amdgpu: remove gart.table_addr"
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
---
drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c | 5 ++++-
drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c | 5 ++++-
drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c | 5 ++++-
3 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c
index 543287e5d67b..9c45ea318bd6 100644
--- a/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c
@@ -494,7 +494,7 @@ static void gmc_v6_0_set_prt(struct amdgpu_device *adev, bool enable)
static int gmc_v6_0_gart_enable(struct amdgpu_device *adev)
{
- uint64_t table_addr = amdgpu_bo_gpu_offset(adev->gart.bo);
+ uint64_t table_addr;
int r, i;
u32 field;
@@ -505,6 +505,9 @@ static int gmc_v6_0_gart_enable(struct amdgpu_device *adev)
r = amdgpu_gart_table_vram_pin(adev);
if (r)
return r;
+
+ table_addr = amdgpu_bo_gpu_offset(adev->gart.bo);
+
/* Setup TLB control */
WREG32(mmMC_VM_MX_L1_TLB_CNTL,
(0xA << 7) |
diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c
index 060c79afef80..fc5fe187b614 100644
--- a/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c
@@ -604,7 +604,7 @@ static void gmc_v7_0_set_prt(struct amdgpu_device *adev, bool enable)
*/
static int gmc_v7_0_gart_enable(struct amdgpu_device *adev)
{
- uint64_t table_addr = amdgpu_bo_gpu_offset(adev->gart.bo);
+ uint64_t table_addr;
int r, i;
u32 tmp, field;
@@ -615,6 +615,9 @@ static int gmc_v7_0_gart_enable(struct amdgpu_device *adev)
r = amdgpu_gart_table_vram_pin(adev);
if (r)
return r;
+
+ table_addr = amdgpu_bo_gpu_offset(adev->gart.bo);
+
/* Setup TLB control */
tmp = RREG32(mmMC_VM_MX_L1_TLB_CNTL);
tmp = REG_SET_FIELD(tmp, MC_VM_MX_L1_TLB_CNTL, ENABLE_L1_TLB, 1);
diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
index 3fe9b9755cf7..91216cdf4d1c 100644
--- a/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
@@ -806,7 +806,7 @@ static void gmc_v8_0_set_prt(struct amdgpu_device *adev, bool enable)
*/
static int gmc_v8_0_gart_enable(struct amdgpu_device *adev)
{
- uint64_t table_addr = amdgpu_bo_gpu_offset(adev->gart.bo);
+ uint64_t table_addr;
int r, i;
u32 tmp, field;
@@ -817,6 +817,9 @@ static int gmc_v8_0_gart_enable(struct amdgpu_device *adev)
r = amdgpu_gart_table_vram_pin(adev);
if (r)
return r;
+
+ table_addr = amdgpu_bo_gpu_offset(adev->gart.bo);
+
/* Setup TLB control */
tmp = RREG32(mmMC_VM_MX_L1_TLB_CNTL);
tmp = REG_SET_FIELD(tmp, MC_VM_MX_L1_TLB_CNTL, ENABLE_L1_TLB, 1);
--
2.18.0
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 3+ messages in thread[parent not found: <20180828092714.2131-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org>]
* Re: [PATCH] drm/amdgpu: Only retrieve GPU address of GART table after pinning it [not found] ` <20180828092714.2131-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org> @ 2018-08-28 11:27 ` Christian König 2018-08-29 1:39 ` Zhang, Jerry (Junwei) 1 sibling, 0 replies; 3+ messages in thread From: Christian König @ 2018-08-28 11:27 UTC (permalink / raw) To: Michel Dänzer, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW Am 28.08.2018 um 11:27 schrieb Michel Dänzer: > From: Michel Dänzer <michel.daenzer@amd.com> > > Doing it earlier hits a WARN_ON_ONCE in amdgpu_bo_gpu_offset. > > Fixes: "drm/amdgpu: remove gart.table_addr" > Signed-off-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> > --- > drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c | 5 ++++- > drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c | 5 ++++- > drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c | 5 ++++- > 3 files changed, 12 insertions(+), 3 deletions(-) > > diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c > index 543287e5d67b..9c45ea318bd6 100644 > --- a/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c > +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c > @@ -494,7 +494,7 @@ static void gmc_v6_0_set_prt(struct amdgpu_device *adev, bool enable) > > static int gmc_v6_0_gart_enable(struct amdgpu_device *adev) > { > - uint64_t table_addr = amdgpu_bo_gpu_offset(adev->gart.bo); > + uint64_t table_addr; > int r, i; > u32 field; > > @@ -505,6 +505,9 @@ static int gmc_v6_0_gart_enable(struct amdgpu_device *adev) > r = amdgpu_gart_table_vram_pin(adev); > if (r) > return r; > + > + table_addr = amdgpu_bo_gpu_offset(adev->gart.bo); > + > /* Setup TLB control */ > WREG32(mmMC_VM_MX_L1_TLB_CNTL, > (0xA << 7) | > diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c > index 060c79afef80..fc5fe187b614 100644 > --- a/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c > +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c > @@ -604,7 +604,7 @@ static void gmc_v7_0_set_prt(struct amdgpu_device *adev, bool enable) > */ > static int gmc_v7_0_gart_enable(struct amdgpu_device *adev) > { > - uint64_t table_addr = amdgpu_bo_gpu_offset(adev->gart.bo); > + uint64_t table_addr; > int r, i; > u32 tmp, field; > > @@ -615,6 +615,9 @@ static int gmc_v7_0_gart_enable(struct amdgpu_device *adev) > r = amdgpu_gart_table_vram_pin(adev); > if (r) > return r; > + > + table_addr = amdgpu_bo_gpu_offset(adev->gart.bo); > + > /* Setup TLB control */ > tmp = RREG32(mmMC_VM_MX_L1_TLB_CNTL); > tmp = REG_SET_FIELD(tmp, MC_VM_MX_L1_TLB_CNTL, ENABLE_L1_TLB, 1); > diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c > index 3fe9b9755cf7..91216cdf4d1c 100644 > --- a/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c > +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c > @@ -806,7 +806,7 @@ static void gmc_v8_0_set_prt(struct amdgpu_device *adev, bool enable) > */ > static int gmc_v8_0_gart_enable(struct amdgpu_device *adev) > { > - uint64_t table_addr = amdgpu_bo_gpu_offset(adev->gart.bo); > + uint64_t table_addr; > int r, i; > u32 tmp, field; > > @@ -817,6 +817,9 @@ static int gmc_v8_0_gart_enable(struct amdgpu_device *adev) > r = amdgpu_gart_table_vram_pin(adev); > if (r) > return r; > + > + table_addr = amdgpu_bo_gpu_offset(adev->gart.bo); > + > /* Setup TLB control */ > tmp = RREG32(mmMC_VM_MX_L1_TLB_CNTL); > tmp = REG_SET_FIELD(tmp, MC_VM_MX_L1_TLB_CNTL, ENABLE_L1_TLB, 1); _______________________________________________ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/amdgpu: Only retrieve GPU address of GART table after pinning it [not found] ` <20180828092714.2131-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org> 2018-08-28 11:27 ` Christian König @ 2018-08-29 1:39 ` Zhang, Jerry (Junwei) 1 sibling, 0 replies; 3+ messages in thread From: Zhang, Jerry (Junwei) @ 2018-08-29 1:39 UTC (permalink / raw) To: Michel Dänzer, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW On 08/28/2018 05:27 PM, Michel Dänzer wrote: > From: Michel Dänzer <michel.daenzer@amd.com> > > Doing it earlier hits a WARN_ON_ONCE in amdgpu_bo_gpu_offset. > > Fixes: "drm/amdgpu: remove gart.table_addr" > Signed-off-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com> > --- > drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c | 5 ++++- > drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c | 5 ++++- > drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c | 5 ++++- > 3 files changed, 12 insertions(+), 3 deletions(-) > > diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c > index 543287e5d67b..9c45ea318bd6 100644 > --- a/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c > +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c > @@ -494,7 +494,7 @@ static void gmc_v6_0_set_prt(struct amdgpu_device *adev, bool enable) > > static int gmc_v6_0_gart_enable(struct amdgpu_device *adev) > { > - uint64_t table_addr = amdgpu_bo_gpu_offset(adev->gart.bo); > + uint64_t table_addr; > int r, i; > u32 field; > > @@ -505,6 +505,9 @@ static int gmc_v6_0_gart_enable(struct amdgpu_device *adev) > r = amdgpu_gart_table_vram_pin(adev); > if (r) > return r; > + > + table_addr = amdgpu_bo_gpu_offset(adev->gart.bo); > + > /* Setup TLB control */ > WREG32(mmMC_VM_MX_L1_TLB_CNTL, > (0xA << 7) | > diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c > index 060c79afef80..fc5fe187b614 100644 > --- a/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c > +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c > @@ -604,7 +604,7 @@ static void gmc_v7_0_set_prt(struct amdgpu_device *adev, bool enable) > */ > static int gmc_v7_0_gart_enable(struct amdgpu_device *adev) > { > - uint64_t table_addr = amdgpu_bo_gpu_offset(adev->gart.bo); > + uint64_t table_addr; > int r, i; > u32 tmp, field; > > @@ -615,6 +615,9 @@ static int gmc_v7_0_gart_enable(struct amdgpu_device *adev) > r = amdgpu_gart_table_vram_pin(adev); > if (r) > return r; > + > + table_addr = amdgpu_bo_gpu_offset(adev->gart.bo); > + > /* Setup TLB control */ > tmp = RREG32(mmMC_VM_MX_L1_TLB_CNTL); > tmp = REG_SET_FIELD(tmp, MC_VM_MX_L1_TLB_CNTL, ENABLE_L1_TLB, 1); > diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c > index 3fe9b9755cf7..91216cdf4d1c 100644 > --- a/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c > +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c > @@ -806,7 +806,7 @@ static void gmc_v8_0_set_prt(struct amdgpu_device *adev, bool enable) > */ > static int gmc_v8_0_gart_enable(struct amdgpu_device *adev) > { > - uint64_t table_addr = amdgpu_bo_gpu_offset(adev->gart.bo); > + uint64_t table_addr; > int r, i; > u32 tmp, field; > > @@ -817,6 +817,9 @@ static int gmc_v8_0_gart_enable(struct amdgpu_device *adev) > r = amdgpu_gart_table_vram_pin(adev); > if (r) > return r; > + > + table_addr = amdgpu_bo_gpu_offset(adev->gart.bo); > + > /* Setup TLB control */ > tmp = RREG32(mmMC_VM_MX_L1_TLB_CNTL); > tmp = REG_SET_FIELD(tmp, MC_VM_MX_L1_TLB_CNTL, ENABLE_L1_TLB, 1); > _______________________________________________ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-08-29 1:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-28 9:27 [PATCH] drm/amdgpu: Only retrieve GPU address of GART table after pinning it Michel Dänzer
[not found] ` <20180828092714.2131-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
2018-08-28 11:27 ` Christian König
2018-08-29 1:39 ` Zhang, Jerry (Junwei)
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.