* [PATCH 1/3] drm/amdgpu: change pointer of mqd_ptr to void
@ 2017-02-16 7:25 Xiangliang Yu
[not found] ` <1487229920-4897-1-git-send-email-Xiangliang.Yu-5C7GfCeVMHo@public.gmane.org>
0 siblings, 1 reply; 6+ messages in thread
From: Xiangliang Yu @ 2017-02-16 7:25 UTC (permalink / raw)
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Xiangliang Yu
vi_mqd is only used by VI family but mqd_ptr is common for all
ASIC, so change the pointer to void.
Signed-off-by: Xiangliang Yu <Xiangliang.Yu@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h | 2 +-
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 26 +++++++++++++++++---------
2 files changed, 18 insertions(+), 10 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h
index 3fd4ce8..a1bfc4e 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h
@@ -162,7 +162,7 @@ struct amdgpu_ring {
u32 queue;
struct amdgpu_bo *mqd_obj;
uint64_t mqd_gpu_addr;
- struct vi_mqd *mqd_ptr;
+ void *mqd_ptr;
u32 doorbell_index;
bool use_doorbell;
unsigned wptr_offs;
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
index 772c42b..2202f02 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
@@ -4940,8 +4940,10 @@ static int gfx_v8_0_kiq_resume(struct amdgpu_device *adev)
gfx_v8_0_cp_compute_enable(adev, true);
ring = &adev->gfx.kiq.ring;
- if (!amdgpu_bo_kmap(ring->mqd_obj, (void **)&ring->mqd_ptr)) {
- r = gfx_v8_0_kiq_init_queue(ring, ring->mqd_ptr, ring->mqd_gpu_addr);
+ if (!amdgpu_bo_kmap(ring->mqd_obj, &ring->mqd_ptr)) {
+ r = gfx_v8_0_kiq_init_queue(ring,
+ (struct vi_mqd *)ring->mqd_ptr,
+ ring->mqd_gpu_addr);
amdgpu_bo_kunmap(ring->mqd_obj);
ring->mqd_ptr = NULL;
if (r)
@@ -4952,8 +4954,10 @@ static int gfx_v8_0_kiq_resume(struct amdgpu_device *adev)
for (i = 0; i < adev->gfx.num_compute_rings; i++) {
ring = &adev->gfx.compute_ring[i];
- if (!amdgpu_bo_kmap(ring->mqd_obj, (void **)&ring->mqd_ptr)) {
- r = gfx_v8_0_kiq_init_queue(ring, ring->mqd_ptr, ring->mqd_gpu_addr);
+ if (!amdgpu_bo_kmap(ring->mqd_obj, &ring->mqd_ptr)) {
+ r = gfx_v8_0_kiq_init_queue(ring,
+ (struct vi_mqd *)ring->mqd_ptr,
+ ring->mqd_gpu_addr);
amdgpu_bo_kunmap(ring->mqd_obj);
ring->mqd_ptr = NULL;
if (r)
@@ -7333,7 +7337,7 @@ static int gfx_v8_0_compute_mqd_soft_init(struct amdgpu_device *adev)
if (!ring->mqd_obj) {
r = amdgpu_bo_create_kernel(adev, sizeof(struct vi_mqd), PAGE_SIZE,
AMDGPU_GEM_DOMAIN_GTT, &ring->mqd_obj,
- &ring->mqd_gpu_addr, (void **)&ring->mqd_ptr);
+ &ring->mqd_gpu_addr, &ring->mqd_ptr);
if (r) {
dev_warn(adev->dev, "failed to create ring mqd ob (%d)", r);
return r;
@@ -7352,7 +7356,7 @@ static int gfx_v8_0_compute_mqd_soft_init(struct amdgpu_device *adev)
if (!ring->mqd_obj) {
r = amdgpu_bo_create_kernel(adev, sizeof(struct vi_mqd), PAGE_SIZE,
AMDGPU_GEM_DOMAIN_GTT, &ring->mqd_obj,
- &ring->mqd_gpu_addr, (void **)&ring->mqd_ptr);
+ &ring->mqd_gpu_addr, &ring->mqd_ptr);
if (r) {
dev_warn(adev->dev, "failed to create ring mqd ob (%d)", r);
return r;
@@ -7375,9 +7379,13 @@ static void gfx_v8_0_compute_mqd_soft_fini(struct amdgpu_device *adev)
for (i = 0; i < adev->gfx.num_compute_rings; i++) {
ring = &adev->gfx.compute_ring[i];
- amdgpu_bo_free_kernel(&ring->mqd_obj, &ring->mqd_gpu_addr, (void **)&ring->mqd_ptr);
+ amdgpu_bo_free_kernel(&ring->mqd_obj,
+ &ring->mqd_gpu_addr,
+ &ring->mqd_ptr);
}
ring = &adev->gfx.kiq.ring;
- amdgpu_bo_free_kernel(&ring->mqd_obj, &ring->mqd_gpu_addr, (void **)&ring->mqd_ptr);
-}
\ No newline at end of file
+ amdgpu_bo_free_kernel(&ring->mqd_obj,
+ &ring->mqd_gpu_addr,
+ &ring->mqd_ptr);
+}
--
2.7.4
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/3] drm/amdgpu/virt: fix typo
[not found] ` <1487229920-4897-1-git-send-email-Xiangliang.Yu-5C7GfCeVMHo@public.gmane.org>
@ 2017-02-16 7:25 ` Xiangliang Yu
2017-02-16 7:25 ` [PATCH 3/3] drm/amdgpu/gfx: free memory of mqd backup Xiangliang Yu
2017-02-16 9:16 ` [PATCH 1/3] drm/amdgpu: change pointer of mqd_ptr to void Christian König
2 siblings, 0 replies; 6+ messages in thread
From: Xiangliang Yu @ 2017-02-16 7:25 UTC (permalink / raw)
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Xiangliang Yu
When send messages to hypervior, the messages format should be is
idh_request, not idh_event.
Signed-off-by: Xiangliang Yu <Xiangliang.Yu@amd.com>
---
drivers/gpu/drm/amd/amdgpu/mxgpu_vi.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/mxgpu_vi.c b/drivers/gpu/drm/amd/amdgpu/mxgpu_vi.c
index 98cbcd9..3164d61 100644
--- a/drivers/gpu/drm/amd/amdgpu/mxgpu_vi.c
+++ b/drivers/gpu/drm/amd/amdgpu/mxgpu_vi.c
@@ -350,13 +350,13 @@ static void xgpu_vi_mailbox_set_valid(struct amdgpu_device *adev, bool val)
}
static void xgpu_vi_mailbox_trans_msg(struct amdgpu_device *adev,
- enum idh_event event)
+ enum idh_request req)
{
u32 reg;
reg = RREG32_NO_KIQ(mmMAILBOX_MSGBUF_TRN_DW0);
reg = REG_SET_FIELD(reg, MAILBOX_MSGBUF_TRN_DW0,
- MSGBUF_DATA, event);
+ MSGBUF_DATA, req);
WREG32_NO_KIQ(mmMAILBOX_MSGBUF_TRN_DW0, reg);
xgpu_vi_mailbox_set_valid(adev, true);
@@ -458,20 +458,20 @@ static int xgpu_vi_request_reset(struct amdgpu_device *adev)
static int xgpu_vi_request_full_gpu_access(struct amdgpu_device *adev,
bool init)
{
- enum idh_event event;
+ enum idh_request req;
- event = init ? IDH_REQ_GPU_INIT_ACCESS : IDH_REQ_GPU_FINI_ACCESS;
- return xgpu_vi_send_access_requests(adev, event);
+ req = init ? IDH_REQ_GPU_INIT_ACCESS : IDH_REQ_GPU_FINI_ACCESS;
+ return xgpu_vi_send_access_requests(adev, req);
}
static int xgpu_vi_release_full_gpu_access(struct amdgpu_device *adev,
bool init)
{
- enum idh_event event;
+ enum idh_request req;
int r = 0;
- event = init ? IDH_REL_GPU_INIT_ACCESS : IDH_REL_GPU_FINI_ACCESS;
- r = xgpu_vi_send_access_requests(adev, event);
+ req = init ? IDH_REL_GPU_INIT_ACCESS : IDH_REL_GPU_FINI_ACCESS;
+ r = xgpu_vi_send_access_requests(adev, req);
return r;
}
--
2.7.4
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/3] drm/amdgpu/gfx: free memory of mqd backup
[not found] ` <1487229920-4897-1-git-send-email-Xiangliang.Yu-5C7GfCeVMHo@public.gmane.org>
2017-02-16 7:25 ` [PATCH 2/3] drm/amdgpu/virt: fix typo Xiangliang Yu
@ 2017-02-16 7:25 ` Xiangliang Yu
[not found] ` <1487229920-4897-3-git-send-email-Xiangliang.Yu-5C7GfCeVMHo@public.gmane.org>
2017-02-16 9:16 ` [PATCH 1/3] drm/amdgpu: change pointer of mqd_ptr to void Christian König
2 siblings, 1 reply; 6+ messages in thread
From: Xiangliang Yu @ 2017-02-16 7:25 UTC (permalink / raw)
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Xiangliang Yu
Need to free mqd backup when destroying ring.
Signed-off-by: Xiangliang Yu <Xiangliang.Yu@amd.com>
---
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
index 2202f02..23cf6fa 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
@@ -7379,12 +7379,14 @@ static void gfx_v8_0_compute_mqd_soft_fini(struct amdgpu_device *adev)
for (i = 0; i < adev->gfx.num_compute_rings; i++) {
ring = &adev->gfx.compute_ring[i];
+ kfree(adev->gfx.mec.mqd_backup[i]);
amdgpu_bo_free_kernel(&ring->mqd_obj,
&ring->mqd_gpu_addr,
&ring->mqd_ptr);
}
ring = &adev->gfx.kiq.ring;
+ kfree(adev->gfx.mec.mqd_backup[AMDGPU_MAX_COMPUTE_RINGS]);
amdgpu_bo_free_kernel(&ring->mqd_obj,
&ring->mqd_gpu_addr,
&ring->mqd_ptr);
--
2.7.4
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/3] drm/amdgpu: change pointer of mqd_ptr to void
[not found] ` <1487229920-4897-1-git-send-email-Xiangliang.Yu-5C7GfCeVMHo@public.gmane.org>
2017-02-16 7:25 ` [PATCH 2/3] drm/amdgpu/virt: fix typo Xiangliang Yu
2017-02-16 7:25 ` [PATCH 3/3] drm/amdgpu/gfx: free memory of mqd backup Xiangliang Yu
@ 2017-02-16 9:16 ` Christian König
[not found] ` <220014f3-9d36-95e8-58cf-f504c0a0588a-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2 siblings, 1 reply; 6+ messages in thread
From: Christian König @ 2017-02-16 9:16 UTC (permalink / raw)
To: Xiangliang Yu, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
Am 16.02.2017 um 08:25 schrieb Xiangliang Yu:
> vi_mqd is only used by VI family but mqd_ptr is common for all
> ASIC, so change the pointer to void.
>
> Signed-off-by: Xiangliang Yu <Xiangliang.Yu@amd.com>
Nice cleanup, patch is Reviewed-by: Christian König
<christian.koenig@amd.com>.
Patch #2 and #3 are Acked-by: Christian König <christian.koenig@amd.com>.
Regards,
Christian.
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h | 2 +-
> drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 26 +++++++++++++++++---------
> 2 files changed, 18 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h
> index 3fd4ce8..a1bfc4e 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h
> @@ -162,7 +162,7 @@ struct amdgpu_ring {
> u32 queue;
> struct amdgpu_bo *mqd_obj;
> uint64_t mqd_gpu_addr;
> - struct vi_mqd *mqd_ptr;
> + void *mqd_ptr;
> u32 doorbell_index;
> bool use_doorbell;
> unsigned wptr_offs;
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
> index 772c42b..2202f02 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
> @@ -4940,8 +4940,10 @@ static int gfx_v8_0_kiq_resume(struct amdgpu_device *adev)
> gfx_v8_0_cp_compute_enable(adev, true);
>
> ring = &adev->gfx.kiq.ring;
> - if (!amdgpu_bo_kmap(ring->mqd_obj, (void **)&ring->mqd_ptr)) {
> - r = gfx_v8_0_kiq_init_queue(ring, ring->mqd_ptr, ring->mqd_gpu_addr);
> + if (!amdgpu_bo_kmap(ring->mqd_obj, &ring->mqd_ptr)) {
> + r = gfx_v8_0_kiq_init_queue(ring,
> + (struct vi_mqd *)ring->mqd_ptr,
> + ring->mqd_gpu_addr);
> amdgpu_bo_kunmap(ring->mqd_obj);
> ring->mqd_ptr = NULL;
> if (r)
> @@ -4952,8 +4954,10 @@ static int gfx_v8_0_kiq_resume(struct amdgpu_device *adev)
>
> for (i = 0; i < adev->gfx.num_compute_rings; i++) {
> ring = &adev->gfx.compute_ring[i];
> - if (!amdgpu_bo_kmap(ring->mqd_obj, (void **)&ring->mqd_ptr)) {
> - r = gfx_v8_0_kiq_init_queue(ring, ring->mqd_ptr, ring->mqd_gpu_addr);
> + if (!amdgpu_bo_kmap(ring->mqd_obj, &ring->mqd_ptr)) {
> + r = gfx_v8_0_kiq_init_queue(ring,
> + (struct vi_mqd *)ring->mqd_ptr,
> + ring->mqd_gpu_addr);
> amdgpu_bo_kunmap(ring->mqd_obj);
> ring->mqd_ptr = NULL;
> if (r)
> @@ -7333,7 +7337,7 @@ static int gfx_v8_0_compute_mqd_soft_init(struct amdgpu_device *adev)
> if (!ring->mqd_obj) {
> r = amdgpu_bo_create_kernel(adev, sizeof(struct vi_mqd), PAGE_SIZE,
> AMDGPU_GEM_DOMAIN_GTT, &ring->mqd_obj,
> - &ring->mqd_gpu_addr, (void **)&ring->mqd_ptr);
> + &ring->mqd_gpu_addr, &ring->mqd_ptr);
> if (r) {
> dev_warn(adev->dev, "failed to create ring mqd ob (%d)", r);
> return r;
> @@ -7352,7 +7356,7 @@ static int gfx_v8_0_compute_mqd_soft_init(struct amdgpu_device *adev)
> if (!ring->mqd_obj) {
> r = amdgpu_bo_create_kernel(adev, sizeof(struct vi_mqd), PAGE_SIZE,
> AMDGPU_GEM_DOMAIN_GTT, &ring->mqd_obj,
> - &ring->mqd_gpu_addr, (void **)&ring->mqd_ptr);
> + &ring->mqd_gpu_addr, &ring->mqd_ptr);
> if (r) {
> dev_warn(adev->dev, "failed to create ring mqd ob (%d)", r);
> return r;
> @@ -7375,9 +7379,13 @@ static void gfx_v8_0_compute_mqd_soft_fini(struct amdgpu_device *adev)
>
> for (i = 0; i < adev->gfx.num_compute_rings; i++) {
> ring = &adev->gfx.compute_ring[i];
> - amdgpu_bo_free_kernel(&ring->mqd_obj, &ring->mqd_gpu_addr, (void **)&ring->mqd_ptr);
> + amdgpu_bo_free_kernel(&ring->mqd_obj,
> + &ring->mqd_gpu_addr,
> + &ring->mqd_ptr);
> }
>
> ring = &adev->gfx.kiq.ring;
> - amdgpu_bo_free_kernel(&ring->mqd_obj, &ring->mqd_gpu_addr, (void **)&ring->mqd_ptr);
> -}
> \ No newline at end of file
> + amdgpu_bo_free_kernel(&ring->mqd_obj,
> + &ring->mqd_gpu_addr,
> + &ring->mqd_ptr);
> +}
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 6+ messages in thread
* 答复: [PATCH 1/3] drm/amdgpu: change pointer of mqd_ptr to void
[not found] ` <220014f3-9d36-95e8-58cf-f504c0a0588a-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
@ 2017-02-16 10:37 ` Liu, Monk
0 siblings, 0 replies; 6+ messages in thread
From: Liu, Monk @ 2017-02-16 10:37 UTC (permalink / raw)
To: Christian König, Yu, Xiangliang,
amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
[-- Attachment #1.1: Type: text/plain, Size: 6206 bytes --]
Xiangliang
good cleanup, but there are more, please help proceed them all:
struct amdgpu_mec {
struct amdgpu_bo *hpd_eop_obj;
u64 hpd_eop_gpu_addr;
u32 num_pipe;
u32 num_mec;
u32 num_queue;
struct vi_mqd *mqd_backup[AMDGPU_MAX_COMPUTE_RINGS + 1];
};
change:
struct vi_mqd *mqd_backup[AMDGPU_MAX_COMPUTE_RINGS + 1];
to:
void *mqd_backup[AMDGPU_MAX_COMPUTE_RINGS + 1];
thanks
with above address,
Reviewed-by: Monk Liu <monk.liu@amd.com>
other two patches:
Reviewed-by: Monk Liu <monk.liu@amd.com>
BR Monk
________________________________
发件人: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> 代表 Christian König <deathsimple@vodafone.de>
发送时间: 2017年2月16日 17:16:15
收件人: Yu, Xiangliang; amd-gfx@lists.freedesktop.org
主题: Re: [PATCH 1/3] drm/amdgpu: change pointer of mqd_ptr to void
Am 16.02.2017 um 08:25 schrieb Xiangliang Yu:
> vi_mqd is only used by VI family but mqd_ptr is common for all
> ASIC, so change the pointer to void.
>
> Signed-off-by: Xiangliang Yu <Xiangliang.Yu@amd.com>
Nice cleanup, patch is Reviewed-by: Christian König
<christian.koenig@amd.com>.
Patch #2 and #3 are Acked-by: Christian König <christian.koenig@amd.com>.
Regards,
Christian.
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h | 2 +-
> drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 26 +++++++++++++++++---------
> 2 files changed, 18 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h
> index 3fd4ce8..a1bfc4e 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h
> @@ -162,7 +162,7 @@ struct amdgpu_ring {
> u32 queue;
> struct amdgpu_bo *mqd_obj;
> uint64_t mqd_gpu_addr;
> - struct vi_mqd *mqd_ptr;
> + void *mqd_ptr;
> u32 doorbell_index;
> bool use_doorbell;
> unsigned wptr_offs;
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
> index 772c42b..2202f02 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
> @@ -4940,8 +4940,10 @@ static int gfx_v8_0_kiq_resume(struct amdgpu_device *adev)
> gfx_v8_0_cp_compute_enable(adev, true);
>
> ring = &adev->gfx.kiq.ring;
> - if (!amdgpu_bo_kmap(ring->mqd_obj, (void **)&ring->mqd_ptr)) {
> - r = gfx_v8_0_kiq_init_queue(ring, ring->mqd_ptr, ring->mqd_gpu_addr);
> + if (!amdgpu_bo_kmap(ring->mqd_obj, &ring->mqd_ptr)) {
> + r = gfx_v8_0_kiq_init_queue(ring,
> + (struct vi_mqd *)ring->mqd_ptr,
> + ring->mqd_gpu_addr);
> amdgpu_bo_kunmap(ring->mqd_obj);
> ring->mqd_ptr = NULL;
> if (r)
> @@ -4952,8 +4954,10 @@ static int gfx_v8_0_kiq_resume(struct amdgpu_device *adev)
>
> for (i = 0; i < adev->gfx.num_compute_rings; i++) {
> ring = &adev->gfx.compute_ring[i];
> - if (!amdgpu_bo_kmap(ring->mqd_obj, (void **)&ring->mqd_ptr)) {
> - r = gfx_v8_0_kiq_init_queue(ring, ring->mqd_ptr, ring->mqd_gpu_addr);
> + if (!amdgpu_bo_kmap(ring->mqd_obj, &ring->mqd_ptr)) {
> + r = gfx_v8_0_kiq_init_queue(ring,
> + (struct vi_mqd *)ring->mqd_ptr,
> + ring->mqd_gpu_addr);
> amdgpu_bo_kunmap(ring->mqd_obj);
> ring->mqd_ptr = NULL;
> if (r)
> @@ -7333,7 +7337,7 @@ static int gfx_v8_0_compute_mqd_soft_init(struct amdgpu_device *adev)
> if (!ring->mqd_obj) {
> r = amdgpu_bo_create_kernel(adev, sizeof(struct vi_mqd), PAGE_SIZE,
> AMDGPU_GEM_DOMAIN_GTT, &ring->mqd_obj,
> - &ring->mqd_gpu_addr, (void **)&ring->mqd_ptr);
> + &ring->mqd_gpu_addr, &ring->mqd_ptr);
> if (r) {
> dev_warn(adev->dev, "failed to create ring mqd ob (%d)", r);
> return r;
> @@ -7352,7 +7356,7 @@ static int gfx_v8_0_compute_mqd_soft_init(struct amdgpu_device *adev)
> if (!ring->mqd_obj) {
> r = amdgpu_bo_create_kernel(adev, sizeof(struct vi_mqd), PAGE_SIZE,
> AMDGPU_GEM_DOMAIN_GTT, &ring->mqd_obj,
> - &ring->mqd_gpu_addr, (void **)&ring->mqd_ptr);
> + &ring->mqd_gpu_addr, &ring->mqd_ptr);
> if (r) {
> dev_warn(adev->dev, "failed to create ring mqd ob (%d)", r);
> return r;
> @@ -7375,9 +7379,13 @@ static void gfx_v8_0_compute_mqd_soft_fini(struct amdgpu_device *adev)
>
> for (i = 0; i < adev->gfx.num_compute_rings; i++) {
> ring = &adev->gfx.compute_ring[i];
> - amdgpu_bo_free_kernel(&ring->mqd_obj, &ring->mqd_gpu_addr, (void **)&ring->mqd_ptr);
> + amdgpu_bo_free_kernel(&ring->mqd_obj,
> + &ring->mqd_gpu_addr,
> + &ring->mqd_ptr);
> }
>
> ring = &adev->gfx.kiq.ring;
> - amdgpu_bo_free_kernel(&ring->mqd_obj, &ring->mqd_gpu_addr, (void **)&ring->mqd_ptr);
> -}
> \ No newline at end of file
> + amdgpu_bo_free_kernel(&ring->mqd_obj,
> + &ring->mqd_gpu_addr,
> + &ring->mqd_ptr);
> +}
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[-- Attachment #1.2: Type: text/html, Size: 15371 bytes --]
[-- Attachment #2: Type: text/plain, Size: 154 bytes --]
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH 3/3] drm/amdgpu/gfx: free memory of mqd backup
[not found] ` <1487229920-4897-3-git-send-email-Xiangliang.Yu-5C7GfCeVMHo@public.gmane.org>
@ 2017-02-16 14:57 ` Deucher, Alexander
0 siblings, 0 replies; 6+ messages in thread
From: Deucher, Alexander @ 2017-02-16 14:57 UTC (permalink / raw)
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Yu, Xiangliang
> -----Original Message-----
> From: amd-gfx [mailto:amd-gfx-bounces@lists.freedesktop.org] On Behalf
> Of Xiangliang Yu
> Sent: Thursday, February 16, 2017 2:25 AM
> To: amd-gfx@lists.freedesktop.org
> Cc: Yu, Xiangliang
> Subject: [PATCH 3/3] drm/amdgpu/gfx: free memory of mqd backup
>
> Need to free mqd backup when destroying ring.
>
> Signed-off-by: Xiangliang Yu <Xiangliang.Yu@amd.com>
Series is:
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
> b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
> index 2202f02..23cf6fa 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
> @@ -7379,12 +7379,14 @@ static void
> gfx_v8_0_compute_mqd_soft_fini(struct amdgpu_device *adev)
>
> for (i = 0; i < adev->gfx.num_compute_rings; i++) {
> ring = &adev->gfx.compute_ring[i];
> + kfree(adev->gfx.mec.mqd_backup[i]);
> amdgpu_bo_free_kernel(&ring->mqd_obj,
> &ring->mqd_gpu_addr,
> &ring->mqd_ptr);
> }
>
> ring = &adev->gfx.kiq.ring;
> + kfree(adev-
> >gfx.mec.mqd_backup[AMDGPU_MAX_COMPUTE_RINGS]);
> amdgpu_bo_free_kernel(&ring->mqd_obj,
> &ring->mqd_gpu_addr,
> &ring->mqd_ptr);
> --
> 2.7.4
>
> _______________________________________________
> 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] 6+ messages in thread
end of thread, other threads:[~2017-02-16 14:57 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-16 7:25 [PATCH 1/3] drm/amdgpu: change pointer of mqd_ptr to void Xiangliang Yu
[not found] ` <1487229920-4897-1-git-send-email-Xiangliang.Yu-5C7GfCeVMHo@public.gmane.org>
2017-02-16 7:25 ` [PATCH 2/3] drm/amdgpu/virt: fix typo Xiangliang Yu
2017-02-16 7:25 ` [PATCH 3/3] drm/amdgpu/gfx: free memory of mqd backup Xiangliang Yu
[not found] ` <1487229920-4897-3-git-send-email-Xiangliang.Yu-5C7GfCeVMHo@public.gmane.org>
2017-02-16 14:57 ` Deucher, Alexander
2017-02-16 9:16 ` [PATCH 1/3] drm/amdgpu: change pointer of mqd_ptr to void Christian König
[not found] ` <220014f3-9d36-95e8-58cf-f504c0a0588a-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-02-16 10:37 ` 答复: " Liu, Monk
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.