* [PATCH 1/3] drm/amdgpu: set snooped flags only on system addresses
@ 2015-12-03 18:55 Christian König
2015-12-03 18:55 ` [PATCH 2/3] drm/amdgpu: take a BO reference in the dispaly code Christian König
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Christian König @ 2015-12-03 18:55 UTC (permalink / raw)
To: alexdeucher; +Cc: dri-devel
From: Christian König <christian.koenig@amd.com>
Not necessary for VRAM.
Signed-off-by: Christian König <christian.koenig@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
index 8051cb9..298fb10 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@ -801,11 +801,12 @@ uint32_t amdgpu_ttm_tt_pte_flags(struct amdgpu_device *adev, struct ttm_tt *ttm,
if (mem && mem->mem_type != TTM_PL_SYSTEM)
flags |= AMDGPU_PTE_VALID;
- if (mem && mem->mem_type == TTM_PL_TT)
+ if (mem && mem->mem_type == TTM_PL_TT) {
flags |= AMDGPU_PTE_SYSTEM;
- if (!ttm || ttm->caching_state == tt_cached)
- flags |= AMDGPU_PTE_SNOOPED;
+ if (!ttm || ttm->caching_state == tt_cached)
+ flags |= AMDGPU_PTE_SNOOPED;
+ }
if (adev->asic_type >= CHIP_TOPAZ)
flags |= AMDGPU_PTE_EXECUTABLE;
--
2.5.0
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/3] drm/amdgpu: take a BO reference in the dispaly code
2015-12-03 18:55 [PATCH 1/3] drm/amdgpu: set snooped flags only on system addresses Christian König
@ 2015-12-03 18:55 ` Christian König
2015-12-03 18:55 ` [PATCH 3/3] drm/amdgpu: take a BO reference for the user fence Christian König
2015-12-04 2:50 ` [PATCH 1/3] drm/amdgpu: set snooped flags only on system addresses Michel Dänzer
2 siblings, 0 replies; 5+ messages in thread
From: Christian König @ 2015-12-03 18:55 UTC (permalink / raw)
To: alexdeucher; +Cc: dri-devel
From: Christian König <christian.koenig@amd.com>
No need for the GEM reference here.
Signed-off-by: Christian König <christian.koenig@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
index e173a5a..ddd7233 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
@@ -109,7 +109,7 @@ static void amdgpu_unpin_work_func(struct work_struct *__work)
} else
DRM_ERROR("failed to reserve buffer after flip\n");
- drm_gem_object_unreference_unlocked(&work->old_rbo->gem_base);
+ amdgpu_bo_unref(&work->old_rbo);
kfree(work->shared);
kfree(work);
}
@@ -148,8 +148,8 @@ int amdgpu_crtc_page_flip(struct drm_crtc *crtc,
obj = old_amdgpu_fb->obj;
/* take a reference to the old object */
- drm_gem_object_reference(obj);
work->old_rbo = gem_to_amdgpu_bo(obj);
+ amdgpu_bo_ref(work->old_rbo);
new_amdgpu_fb = to_amdgpu_framebuffer(fb);
obj = new_amdgpu_fb->obj;
@@ -222,7 +222,7 @@ pflip_cleanup:
amdgpu_bo_unreserve(new_rbo);
cleanup:
- drm_gem_object_unreference_unlocked(&work->old_rbo->gem_base);
+ amdgpu_bo_unref(&work->old_rbo);
fence_put(work->excl);
for (i = 0; i < work->shared_count; ++i)
fence_put(work->shared[i]);
--
2.5.0
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 3/3] drm/amdgpu: take a BO reference for the user fence
2015-12-03 18:55 [PATCH 1/3] drm/amdgpu: set snooped flags only on system addresses Christian König
2015-12-03 18:55 ` [PATCH 2/3] drm/amdgpu: take a BO reference in the dispaly code Christian König
@ 2015-12-03 18:55 ` Christian König
2015-12-04 2:50 ` [PATCH 1/3] drm/amdgpu: set snooped flags only on system addresses Michel Dänzer
2 siblings, 0 replies; 5+ messages in thread
From: Christian König @ 2015-12-03 18:55 UTC (permalink / raw)
To: alexdeucher; +Cc: dri-devel
From: Christian König <christian.koenig@amd.com>
No need for a GEM reference here.
Signed-off-by: Christian König <christian.koenig@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
index 1d44d50..4f352ec 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
@@ -222,6 +222,8 @@ int amdgpu_cs_parser_init(struct amdgpu_cs_parser *p, void *data)
}
p->uf.bo = gem_to_amdgpu_bo(gobj);
+ amdgpu_bo_ref(p->uf.bo);
+ drm_gem_object_unreference_unlocked(gobj);
p->uf.offset = fence_data->offset;
} else {
ret = -EINVAL;
@@ -487,7 +489,7 @@ static void amdgpu_cs_parser_fini(struct amdgpu_cs_parser *parser, int error, bo
amdgpu_ib_free(parser->adev, &parser->ibs[i]);
kfree(parser->ibs);
if (parser->uf.bo)
- drm_gem_object_unreference_unlocked(&parser->uf.bo->gem_base);
+ amdgpu_bo_unref(&parser->uf.bo);
}
static int amdgpu_bo_vm_update_pte(struct amdgpu_cs_parser *p,
@@ -776,7 +778,7 @@ static int amdgpu_cs_free_job(struct amdgpu_job *job)
amdgpu_ib_free(job->adev, &job->ibs[i]);
kfree(job->ibs);
if (job->uf.bo)
- drm_gem_object_unreference_unlocked(&job->uf.bo->gem_base);
+ amdgpu_bo_unref(&job->uf.bo);
return 0;
}
--
2.5.0
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/3] drm/amdgpu: set snooped flags only on system addresses
2015-12-03 18:55 [PATCH 1/3] drm/amdgpu: set snooped flags only on system addresses Christian König
2015-12-03 18:55 ` [PATCH 2/3] drm/amdgpu: take a BO reference in the dispaly code Christian König
2015-12-03 18:55 ` [PATCH 3/3] drm/amdgpu: take a BO reference for the user fence Christian König
@ 2015-12-04 2:50 ` Michel Dänzer
2015-12-04 12:32 ` Christian König
2 siblings, 1 reply; 5+ messages in thread
From: Michel Dänzer @ 2015-12-04 2:50 UTC (permalink / raw)
To: Christian König, alexdeucher; +Cc: dri-devel
On 04.12.2015 03:55, Christian König wrote:
> From: Christian König <christian.koenig@amd.com>
>
> Not necessary for VRAM.
>
> Signed-off-by: Christian König <christian.koenig@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> index 8051cb9..298fb10 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> @@ -801,11 +801,12 @@ uint32_t amdgpu_ttm_tt_pte_flags(struct amdgpu_device *adev, struct ttm_tt *ttm,
> if (mem && mem->mem_type != TTM_PL_SYSTEM)
> flags |= AMDGPU_PTE_VALID;
>
> - if (mem && mem->mem_type == TTM_PL_TT)
> + if (mem && mem->mem_type == TTM_PL_TT) {
> flags |= AMDGPU_PTE_SYSTEM;
>
> - if (!ttm || ttm->caching_state == tt_cached)
> - flags |= AMDGPU_PTE_SNOOPED;
> + if (!ttm || ttm->caching_state == tt_cached)
> + flags |= AMDGPU_PTE_SNOOPED;
> + }
Can ttm be NULL here if mem->mem_type == TTM_PL_TT?
Patches 2 & 3 are
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
--
Earthling Michel Dänzer | http://www.amd.com
Libre software enthusiast | Mesa and X developer
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/3] drm/amdgpu: set snooped flags only on system addresses
2015-12-04 2:50 ` [PATCH 1/3] drm/amdgpu: set snooped flags only on system addresses Michel Dänzer
@ 2015-12-04 12:32 ` Christian König
0 siblings, 0 replies; 5+ messages in thread
From: Christian König @ 2015-12-04 12:32 UTC (permalink / raw)
To: Michel Dänzer, alexdeucher; +Cc: dri-devel
On 04.12.2015 03:50, Michel Dänzer wrote:
> On 04.12.2015 03:55, Christian König wrote:
>> From: Christian König <christian.koenig@amd.com>
>>
>> Not necessary for VRAM.
>>
>> Signed-off-by: Christian König <christian.koenig@amd.com>
>> ---
>> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 7 ++++---
>> 1 file changed, 4 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
>> index 8051cb9..298fb10 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
>> @@ -801,11 +801,12 @@ uint32_t amdgpu_ttm_tt_pte_flags(struct amdgpu_device *adev, struct ttm_tt *ttm,
>> if (mem && mem->mem_type != TTM_PL_SYSTEM)
>> flags |= AMDGPU_PTE_VALID;
>>
>> - if (mem && mem->mem_type == TTM_PL_TT)
>> + if (mem && mem->mem_type == TTM_PL_TT) {
>> flags |= AMDGPU_PTE_SYSTEM;
>>
>> - if (!ttm || ttm->caching_state == tt_cached)
>> - flags |= AMDGPU_PTE_SNOOPED;
>> + if (!ttm || ttm->caching_state == tt_cached)
>> + flags |= AMDGPU_PTE_SNOOPED;
>> + }
> Can ttm be NULL here if mem->mem_type == TTM_PL_TT?
Good point, I think the answer is no. Update patch is on it's way to the
list.
Christian.
>
>
> Patches 2 & 3 are
>
> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
>
>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-12-04 12:32 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-03 18:55 [PATCH 1/3] drm/amdgpu: set snooped flags only on system addresses Christian König
2015-12-03 18:55 ` [PATCH 2/3] drm/amdgpu: take a BO reference in the dispaly code Christian König
2015-12-03 18:55 ` [PATCH 3/3] drm/amdgpu: take a BO reference for the user fence Christian König
2015-12-04 2:50 ` [PATCH 1/3] drm/amdgpu: set snooped flags only on system addresses Michel Dänzer
2015-12-04 12:32 ` Christian König
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.