Skip to contentSkip to conversation

drm/amdgpu: fix hpd bo size calculation error

PATCH In review Kevin Wang 3 participants 4 messages Mar 25, 2020

Subsystems (2)
lore
Share & tools
lore

Kevin Wang

author
#0 lore raw

PATCH 1/1 drm/amdgpu: fix hpd bo size calculation error

the HPD bo size calculation error.
the "mem.size" can't present actual BO size all time.

---
 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(-)
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +1 -1
index 7f9ac1a14e6f..91c82383b016 100644
@@ -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);
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +1 -1
index fb567cf5671b..01b22dad52fd 100644
@@ -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);
Signature · 6 lines
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#1 lore raw

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

Patch is Acked-by: Christian König <[email protected]>

Am 25.03.2020 11:19 schrieb "Wang, Kevin(Yang)" <[email protected]>:
the HPD bo size calculation error.
the "mem.size" can't present actual BO size all time.

---
 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(-)
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +1 -1
index 7f9ac1a14e6f..91c82383b016 100644
@@ -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);
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +1 -1
index fb567cf5671b..01b22dad52fd 100644
@@ -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

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#2 lore raw

[AMD Official Use Only - Internal Distribution Only]

thanks chris.

@Deucher, Alexander<mailto:[email protected]> @Zhang, Hawking<mailto:[email protected]> from the view of driver, could you help me review it, then give me a RB.
thanks.

Best Regards,
Kevin

________________________________
From: Koenig, Christian <[email protected]>
Sent: Wednesday, March 25, 2020 6:28 PM
To: Wang, Kevin(Yang) <[email protected]>
Cc: [email protected] <[email protected]>; Feng, Kenneth <[email protected]>; Deucher, Alexander <[email protected]>
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 <[email protected]>

Am 25.03.2020 11:19 schrieb "Wang, Kevin(Yang)" <[email protected]>:
the HPD bo size calculation error.
the "mem.size" can't present actual BO size all time.

---
 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(-)
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +1 -1
index 7f9ac1a14e6f..91c82383b016 100644
@@ -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);
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +1 -1
index fb567cf5671b..01b22dad52fd 100644
@@ -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

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

maintainer Reviewed-by
#3 lore raw

[AMD Public Use]

________________________________
From: Wang, Kevin(Yang) <[email protected]>
Sent: Wednesday, March 25, 2020 6:44 AM
To: Koenig, Christian <[email protected]>; Deucher, Alexander <[email protected]>; Zhang, Hawking <[email protected]>
Cc: [email protected] <[email protected]>
Subject: Re: [PATCH] drm/amdgpu: fix hpd bo size calculation error

[AMD Official Use Only - Internal Distribution Only]

thanks chris.

@Deucher, Alexander<mailto:[email protected]> @Zhang, Hawking<mailto:[email protected]> from the view of driver, could you help me review it, then give me a RB.
thanks.

Best Regards,
Kevin

________________________________
From: Koenig, Christian <[email protected]>
Sent: Wednesday, March 25, 2020 6:28 PM
To: Wang, Kevin(Yang) <[email protected]>
Cc: [email protected] <[email protected]>; Feng, Kenneth <[email protected]>; Deucher, Alexander <[email protected]>
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 <[email protected]>

Am 25.03.2020 11:19 schrieb "Wang, Kevin(Yang)" <[email protected]>:
the HPD bo size calculation error.
the "mem.size" can't present actual BO size all time.

---
 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(-)
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +1 -1
index 7f9ac1a14e6f..91c82383b016 100644
@@ -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);
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +1 -1
index fb567cf5671b..01b22dad52fd 100644
@@ -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

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx