[PATCH] drm/amdgpu: fix hpd bo size calculation error

Deucher, Alexander Alexander.Deucher at amd.com
Wed Mar 25 14:30:39 UTC 2020


[AMD Public Use]

Reviewed-by: Alex Deucher <alexander.deucher at amd.com>
________________________________
From: Wang, Kevin(Yang) <Kevin1.Wang at amd.com>
Sent: Wednesday, March 25, 2020 6:44 AM
To: Koenig, Christian <Christian.Koenig at amd.com>; Deucher, Alexander <Alexander.Deucher at amd.com>; Zhang, Hawking <Hawking.Zhang at amd.com>
Cc: amd-gfx at lists.freedesktop.org <amd-gfx at lists.freedesktop.org>
Subject: Re: [PATCH] drm/amdgpu: fix hpd bo size calculation error


[AMD Official Use Only - Internal Distribution Only]

thanks chris.

@Deucher, Alexander<mailto:Alexander.Deucher at amd.com> @Zhang, Hawking<mailto:Hawking.Zhang at amd.com>
from the view of driver, could you help me review it, then give me a RB.
thanks.

Best Regards,
Kevin

________________________________
From: Koenig, Christian <Christian.Koenig at amd.com>
Sent: Wednesday, March 25, 2020 6:28 PM
To: Wang, Kevin(Yang) <Kevin1.Wang at amd.com>
Cc: amd-gfx at lists.freedesktop.org <amd-gfx at lists.freedesktop.org>; Feng, Kenneth <Kenneth.Feng at amd.com>; Deucher, Alexander <Alexander.Deucher at amd.com>
Subject: Re: [PATCH] drm/amdgpu: fix hpd bo size calculation error

Good catch! mem.size is actually the backing store size (usually in pages).

Patch is Acked-by: Christian König <Christian.Koenig at amd.com>

Am 25.03.2020 11:19 schrieb "Wang, Kevin(Yang)" <Kevin1.Wang at amd.com>:
the HPD bo size calculation error.
the "mem.size" can't present actual BO size all time.

Signed-off-by: Kevin Wang <kevin1.wang at amd.com>
---
 drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 2 +-
 drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
index 7f9ac1a14e6f..91c82383b016 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
@@ -1113,7 +1113,7 @@ static int gfx_v10_0_mec_init(struct amdgpu_device *adev)
                 return r;
         }

-       memset(hpd, 0, adev->gfx.mec.hpd_eop_obj->tbo.mem.size);
+       memset(hpd, 0, mec_hpd_size);

         amdgpu_bo_kunmap(adev->gfx.mec.hpd_eop_obj);
         amdgpu_bo_unreserve(adev->gfx.mec.hpd_eop_obj);
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
index fb567cf5671b..01b22dad52fd 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
@@ -1946,7 +1946,7 @@ static int gfx_v9_0_mec_init(struct amdgpu_device *adev)
                 return r;
         }

-       memset(hpd, 0, adev->gfx.mec.hpd_eop_obj->tbo.mem.size);
+       memset(hpd, 0, mec_hpd_size);

         amdgpu_bo_kunmap(adev->gfx.mec.hpd_eop_obj);
         amdgpu_bo_unreserve(adev->gfx.mec.hpd_eop_obj);
--
2.17.1

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20200325/f73af2ca/attachment-0001.htm>


More information about the amd-gfx mailing list