* [PATCH] drm/amdgpu: fix the wrong value of UVD bo size
@ 2016-08-23 6:20 jimqu
[not found] ` <1471933228-23515-1-git-send-email-Jim.Qu-5C7GfCeVMHo@public.gmane.org>
0 siblings, 1 reply; 5+ messages in thread
From: jimqu @ 2016-08-23 6:20 UTC (permalink / raw)
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: jimqu
Driver allocate bo for restore UVD fw ,cache, stack , etc.
the firmware size is not only ucode size but the ucode and header.
Change-Id: I886c099fa123c4814de9b7db3559c30e7b41fd1b
Signed-off-by: JimQu <Jim.Qu@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
index 533d702..13ad44e 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
@@ -198,7 +198,7 @@ int amdgpu_uvd_sw_init(struct amdgpu_device *adev)
DRM_ERROR("POLARIS10/11 UVD firmware version %hu.%hu is too old.\n",
version_major, version_minor);
- bo_size = AMDGPU_GPU_PAGE_ALIGN(le32_to_cpu(hdr->ucode_size_bytes) + 8)
+ bo_size = AMDGPU_GPU_PAGE_ALIGN(le32_to_cpu(adev->uvd.fw->size) + 8)
+ AMDGPU_UVD_STACK_SIZE + AMDGPU_UVD_HEAP_SIZE
+ AMDGPU_UVD_SESSION_SIZE * adev->uvd.max_handles;
r = amdgpu_bo_create_kernel(adev, bo_size, PAGE_SIZE,
--
1.9.1
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 5+ messages in thread[parent not found: <1471933228-23515-1-git-send-email-Jim.Qu-5C7GfCeVMHo@public.gmane.org>]
* Re: [PATCH] drm/amdgpu: fix the wrong value of UVD bo size [not found] ` <1471933228-23515-1-git-send-email-Jim.Qu-5C7GfCeVMHo@public.gmane.org> @ 2016-08-23 8:02 ` Christian König [not found] ` <149ffeec-251d-0f76-0442-a32430536eb7-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org> 0 siblings, 1 reply; 5+ messages in thread From: Christian König @ 2016-08-23 8:02 UTC (permalink / raw) To: jimqu, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW Am 23.08.2016 um 08:20 schrieb jimqu: > Driver allocate bo for restore UVD fw ,cache, stack , etc. > the firmware size is not only ucode size but the ucode and header. Nope that isn't correct. Only the firmware is copied to the BO, not the header. See amdgpu_uvd_resume(). Saying this we should probably use the length from the header instead of calculating it manually again in amdgpu_uvd_resume(). Christian. > > Change-Id: I886c099fa123c4814de9b7db3559c30e7b41fd1b > Signed-off-by: JimQu <Jim.Qu@amd.com> > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c > index 533d702..13ad44e 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c > @@ -198,7 +198,7 @@ int amdgpu_uvd_sw_init(struct amdgpu_device *adev) > DRM_ERROR("POLARIS10/11 UVD firmware version %hu.%hu is too old.\n", > version_major, version_minor); > > - bo_size = AMDGPU_GPU_PAGE_ALIGN(le32_to_cpu(hdr->ucode_size_bytes) + 8) > + bo_size = AMDGPU_GPU_PAGE_ALIGN(le32_to_cpu(adev->uvd.fw->size) + 8) > + AMDGPU_UVD_STACK_SIZE + AMDGPU_UVD_HEAP_SIZE > + AMDGPU_UVD_SESSION_SIZE * adev->uvd.max_handles; > r = amdgpu_bo_create_kernel(adev, bo_size, PAGE_SIZE, _______________________________________________ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx ^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <149ffeec-251d-0f76-0442-a32430536eb7-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>]
* 答复: [PATCH] drm/amdgpu: fix the wrong value of UVD bo size [not found] ` <149ffeec-251d-0f76-0442-a32430536eb7-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org> @ 2016-08-23 8:33 ` Qu, Jim [not found] ` <BY2PR12MB06142C9FB06F7E1AF19619E599EB0-K//h7OWB4q5SmL+xRiD5tgdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org> 0 siblings, 1 reply; 5+ messages in thread From: Qu, Jim @ 2016-08-23 8:33 UTC (permalink / raw) To: Christian König, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org Hi Christian: Yes, I have misunderstand the AMDGPU_UVD_FIRMWARE_OFFSET in amdgpu_uvd_mc_resume(). I will update the patch. Thanks JimQu ________________________________________ 发件人: Christian König <deathsimple@vodafone.de> 发送时间: 2016年8月23日 16:02:11 收件人: Qu, Jim; amd-gfx@lists.freedesktop.org 主题: Re: [PATCH] drm/amdgpu: fix the wrong value of UVD bo size Am 23.08.2016 um 08:20 schrieb jimqu: > Driver allocate bo for restore UVD fw ,cache, stack , etc. > the firmware size is not only ucode size but the ucode and header. Nope that isn't correct. Only the firmware is copied to the BO, not the header. See amdgpu_uvd_resume(). Saying this we should probably use the length from the header instead of calculating it manually again in amdgpu_uvd_resume(). Christian. > > Change-Id: I886c099fa123c4814de9b7db3559c30e7b41fd1b > Signed-off-by: JimQu <Jim.Qu@amd.com> > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c > index 533d702..13ad44e 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c > @@ -198,7 +198,7 @@ int amdgpu_uvd_sw_init(struct amdgpu_device *adev) > DRM_ERROR("POLARIS10/11 UVD firmware version %hu.%hu is too old.\n", > version_major, version_minor); > > - bo_size = AMDGPU_GPU_PAGE_ALIGN(le32_to_cpu(hdr->ucode_size_bytes) + 8) > + bo_size = AMDGPU_GPU_PAGE_ALIGN(le32_to_cpu(adev->uvd.fw->size) + 8) > + AMDGPU_UVD_STACK_SIZE + AMDGPU_UVD_HEAP_SIZE > + AMDGPU_UVD_SESSION_SIZE * adev->uvd.max_handles; > r = amdgpu_bo_create_kernel(adev, bo_size, PAGE_SIZE, _______________________________________________ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx ^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <BY2PR12MB06142C9FB06F7E1AF19619E599EB0-K//h7OWB4q5SmL+xRiD5tgdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>]
* Re: 答复: [PATCH] drm/amdgpu: fix the wrong value of UVD bo size [not found] ` <BY2PR12MB06142C9FB06F7E1AF19619E599EB0-K//h7OWB4q5SmL+xRiD5tgdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org> @ 2016-08-23 8:53 ` Christian König [not found] ` <a9e6da05-5977-0cbc-eecc-ac6462554325-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org> 0 siblings, 1 reply; 5+ messages in thread From: Christian König @ 2016-08-23 8:53 UTC (permalink / raw) To: Qu, Jim, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org > I will update the patch. Let me do this. I already had a couple of other TODOs on this part of the code. Christian. Am 23.08.2016 um 10:33 schrieb Qu, Jim: > Hi Christian: > > Yes, I have misunderstand the AMDGPU_UVD_FIRMWARE_OFFSET in amdgpu_uvd_mc_resume(). > > I will update the patch. > > Thanks > JimQu > > ________________________________________ > 发件人: Christian König <deathsimple@vodafone.de> > 发送时间: 2016年8月23日 16:02:11 > 收件人: Qu, Jim; amd-gfx@lists.freedesktop.org > 主题: Re: [PATCH] drm/amdgpu: fix the wrong value of UVD bo size > > Am 23.08.2016 um 08:20 schrieb jimqu: >> Driver allocate bo for restore UVD fw ,cache, stack , etc. >> the firmware size is not only ucode size but the ucode and header. > Nope that isn't correct. Only the firmware is copied to the BO, not the > header. See amdgpu_uvd_resume(). > > Saying this we should probably use the length from the header instead of > calculating it manually again in amdgpu_uvd_resume(). > > Christian. > >> Change-Id: I886c099fa123c4814de9b7db3559c30e7b41fd1b >> Signed-off-by: JimQu <Jim.Qu@amd.com> >> --- >> drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c >> index 533d702..13ad44e 100644 >> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c >> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c >> @@ -198,7 +198,7 @@ int amdgpu_uvd_sw_init(struct amdgpu_device *adev) >> DRM_ERROR("POLARIS10/11 UVD firmware version %hu.%hu is too old.\n", >> version_major, version_minor); >> >> - bo_size = AMDGPU_GPU_PAGE_ALIGN(le32_to_cpu(hdr->ucode_size_bytes) + 8) >> + bo_size = AMDGPU_GPU_PAGE_ALIGN(le32_to_cpu(adev->uvd.fw->size) + 8) >> + AMDGPU_UVD_STACK_SIZE + AMDGPU_UVD_HEAP_SIZE >> + AMDGPU_UVD_SESSION_SIZE * adev->uvd.max_handles; >> r = amdgpu_bo_create_kernel(adev, bo_size, PAGE_SIZE, > > _______________________________________________ > 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] 5+ messages in thread
[parent not found: <a9e6da05-5977-0cbc-eecc-ac6462554325-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>]
* 答复: 答复: [PATCH] drm/amdgpu: fix the wrong value of UVD bo size [not found] ` <a9e6da05-5977-0cbc-eecc-ac6462554325-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org> @ 2016-08-23 8:54 ` Qu, Jim 0 siblings, 0 replies; 5+ messages in thread From: Qu, Jim @ 2016-08-23 8:54 UTC (permalink / raw) To: Christian König, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org OK. Thanks JimQu ________________________________________ 发件人: Christian König <deathsimple@vodafone.de> 发送时间: 2016年8月23日 16:53:50 收件人: Qu, Jim; amd-gfx@lists.freedesktop.org 主题: Re: 答复: [PATCH] drm/amdgpu: fix the wrong value of UVD bo size > I will update the patch. Let me do this. I already had a couple of other TODOs on this part of the code. Christian. Am 23.08.2016 um 10:33 schrieb Qu, Jim: > Hi Christian: > > Yes, I have misunderstand the AMDGPU_UVD_FIRMWARE_OFFSET in amdgpu_uvd_mc_resume(). > > I will update the patch. > > Thanks > JimQu > > ________________________________________ > 发件人: Christian König <deathsimple@vodafone.de> > 发送时间: 2016年8月23日 16:02:11 > 收件人: Qu, Jim; amd-gfx@lists.freedesktop.org > 主题: Re: [PATCH] drm/amdgpu: fix the wrong value of UVD bo size > > Am 23.08.2016 um 08:20 schrieb jimqu: >> Driver allocate bo for restore UVD fw ,cache, stack , etc. >> the firmware size is not only ucode size but the ucode and header. > Nope that isn't correct. Only the firmware is copied to the BO, not the > header. See amdgpu_uvd_resume(). > > Saying this we should probably use the length from the header instead of > calculating it manually again in amdgpu_uvd_resume(). > > Christian. > >> Change-Id: I886c099fa123c4814de9b7db3559c30e7b41fd1b >> Signed-off-by: JimQu <Jim.Qu@amd.com> >> --- >> drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c >> index 533d702..13ad44e 100644 >> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c >> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c >> @@ -198,7 +198,7 @@ int amdgpu_uvd_sw_init(struct amdgpu_device *adev) >> DRM_ERROR("POLARIS10/11 UVD firmware version %hu.%hu is too old.\n", >> version_major, version_minor); >> >> - bo_size = AMDGPU_GPU_PAGE_ALIGN(le32_to_cpu(hdr->ucode_size_bytes) + 8) >> + bo_size = AMDGPU_GPU_PAGE_ALIGN(le32_to_cpu(adev->uvd.fw->size) + 8) >> + AMDGPU_UVD_STACK_SIZE + AMDGPU_UVD_HEAP_SIZE >> + AMDGPU_UVD_SESSION_SIZE * adev->uvd.max_handles; >> r = amdgpu_bo_create_kernel(adev, bo_size, PAGE_SIZE, > > _______________________________________________ > 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] 5+ messages in thread
end of thread, other threads:[~2016-08-23 8:54 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-23 6:20 [PATCH] drm/amdgpu: fix the wrong value of UVD bo size jimqu
[not found] ` <1471933228-23515-1-git-send-email-Jim.Qu-5C7GfCeVMHo@public.gmane.org>
2016-08-23 8:02 ` Christian König
[not found] ` <149ffeec-251d-0f76-0442-a32430536eb7-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2016-08-23 8:33 ` 答复: " Qu, Jim
[not found] ` <BY2PR12MB06142C9FB06F7E1AF19619E599EB0-K//h7OWB4q5SmL+xRiD5tgdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2016-08-23 8:53 ` Christian König
[not found] ` <a9e6da05-5977-0cbc-eecc-ac6462554325-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2016-08-23 8:54 ` 答复: " Qu, Jim
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.