Skip to contentSkip to conversation

drm/amdgpu: add contiguous flag in ucode bo create

PATCH In review horchen 2 participants 4 messages Jun 9, 2017 3 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

horchen

author
#0 lore raw

PATCH 1/1 drm/amdgpu: add contiguous flag in ucode bo create

Under VF environment, the ucode would be settled to the visible VRAM, As it would be pinned to the visible VRAM, it's better to add contiguous flag,otherwise it need to move gpu address during the pin process. This movement is not necessary.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c +2 -1
index cd6d3d0..3b1ee05 100644
@@ -379,7 +379,8 @@ int amdgpu_ucode_init_bo(struct amdgpu_device *adev)
 
 	err = amdgpu_bo_create(adev, adev->firmware.fw_size, PAGE_SIZE, true,
 				amdgpu_sriov_vf(adev) ? AMDGPU_GEM_DOMAIN_VRAM : AMDGPU_GEM_DOMAIN_GTT,
-				0, NULL, NULL, bo);
+				amdgpu_sriov_vf(adev) ? AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS : 0,
+				NULL, NULL, bo);
 	if (err) {
 		dev_err(adev->dev, "(%d) Firmware buffer allocate failed\n", err);
 		goto failed;
Signature · 6 lines
2.7.4

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

A message that is not in the archive (sent off-list or not yet received): 1497009541-2635-1-git-send-email-horace.chen-5C7GfCeVMHo@public.gmane.org

#2 lore raw

Am 09.06.2017 um 13:59 schrieb horchen:

Quoted 15 lines

Under VF environment, the ucode would be settled to the visible VRAM, As it would be pinned to the visible VRAM, it's better to add contiguous flag,otherwise it need to move gpu address during the pin process. This movement is not necessary.

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c +0 -0
index cd6d3d0..3b1ee05 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c int amdgpu_ucode_init_bo(struct amdgpu_device *adev) · line 383

Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c +2 -1
@@ -379,7 +379,8 @@ int amdgpu_ucode_init_bo(struct amdgpu_device *adev)
 
  	err = amdgpu_bo_create(adev, adev->firmware.fw_size, PAGE_SIZE, true,
  				amdgpu_sriov_vf(adev) ? AMDGPU_GEM_DOMAIN_VRAM : AMDGPU_GEM_DOMAIN_GTT,
-				0, NULL, NULL, bo);
+				amdgpu_sriov_vf(adev) ? AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS : 0,
+				NULL, NULL, bo);

Mhm, did you missed my comment? You can add the AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS unconditionally here, e.g. without checking amdgpu_sriov_vf(adev).

With that fixed the patch is Reviewed-by: Christian König <[email protected]>.

drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c int amdgpu_ucode_init_bo(struct amdgpu_device *adev) · line 386

Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c +0 -0
  	if (err) {
  		dev_err(adev->dev, "(%d) Firmware buffer allocate failed\n", err);
  		goto failed;

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

A message that is not in the archive (sent off-list or not yet received): 4c9e08c4-0d9e-17b4-e3df-30e447c34ea0-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org

#4 lore raw

Hi Christian,

Sorry, it's my first time to submit code to the staging. I have done the fix. Attached the fixed review. Thank you for the review.

Regards,
Horace.

-----Original Message-----
From: Christian König [mailto:[email protected]]
Sent: Friday, June 09, 2017 8:25 PM
To: Chen, Horace; [email protected]
Cc: Huang, Ray
Subject: Re: [PATCH] drm/amdgpu: add contiguous flag in ucode bo create

Am 09.06.2017 um 13:59 schrieb horchen:

Quoted 16 lines

Under VF environment, the ucode would be settled to the visible VRAM, As it would be pinned to the visible VRAM, it's better to add contiguous flag,otherwise it need to move gpu address during the pin process. This movement is not necessary.

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c +0 -0
index cd6d3d0..3b1ee05 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c int amdgpu_ucode_init_bo(struct amdgpu_device · line 384

Quoted 7 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c +2 -1
@@ -379,7 +379,8 @@ int amdgpu_ucode_init_bo(struct amdgpu_device 
 *adev)
 
  	err = amdgpu_bo_create(adev, adev->firmware.fw_size, PAGE_SIZE, true,
  				amdgpu_sriov_vf(adev) ? AMDGPU_GEM_DOMAIN_VRAM : AMDGPU_GEM_DOMAIN_GTT,
-				0, NULL, NULL, bo);
+				amdgpu_sriov_vf(adev) ? AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS : 0,
+				NULL, NULL, bo);

Mhm, did you missed my comment? You can add the AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS unconditionally here, e.g. without checking amdgpu_sriov_vf(adev).

With that fixed the patch is Reviewed-by: Christian König <[email protected]>.

Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c +0 -0
  	if (err) {
  		dev_err(adev->dev, "(%d) Firmware buffer allocate failed\n", err);

goto failed;

Under VF environment, the ucode would be settled to the visible VRAM, As it would be pinned to the visible VRAM, it's better to add contiguous flag,otherwise it need to move gpu address during the pin process. This movement is not necessary.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c +2 -1
index cd6d3d0..4f50eeb 100644
@@ -379,7 +379,8 @@ int amdgpu_ucode_init_bo(struct amdgpu_device *adev)
 
        err = amdgpu_bo_create(adev, adev->firmware.fw_size, PAGE_SIZE, true,
                                amdgpu_sriov_vf(adev) ? AMDGPU_GEM_DOMAIN_VRAM : AMDGPU_GEM_DOMAIN_GTT,
-                               0, NULL, NULL, bo);
+                               AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS,
+                               NULL, NULL, bo);
        if (err) {
                dev_err(adev->dev, "(%d) Firmware buffer allocate failed\n", err);
                goto failed;

--
2.7.4

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

A message that is not in the archive (sent off-list or not yet received): MWHPR12MB1629B8FDE5C086109492DCB1E1CE0-Gy0DoCVfaSVXJjvGLpYL8gdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org

#6 lore raw

Hi Horace,

yeah that looks good to me, feel free to add my reviewed-by line and push it.

Regards,
Christian.

Am 09.06.2017 um 15:45 schrieb Chen, Horace:

Quoted 49 lines

Hi Christian,

Sorry, it's my first time to submit code to the staging. I have done the fix. Attached the fixed review. Thank you for the review.

Regards,
Horace.

-----Original Message-----
From: Christian König [mailto:[email protected]]
Sent: Friday, June 09, 2017 8:25 PM
To: Chen, Horace; [email protected]
Cc: Huang, Ray
Subject: Re: [PATCH] drm/amdgpu: add contiguous flag in ucode bo create

Am 09.06.2017 um 13:59 schrieb horchen:

Quoted 16 lines

Under VF environment, the ucode would be settled to the visible VRAM, As it would be pinned to the visible VRAM, it's better to add contiguous flag,otherwise it need to move gpu address during the pin process. This movement is not necessary.

---
   drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c | 3 ++-
   1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c +0 -0
index cd6d3d0..3b1ee05 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c int amdgpu_ucode_init_bo(struct amdgpu_device · line 384

Quoted 7 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c +2 -1
@@ -379,7 +379,8 @@ int amdgpu_ucode_init_bo(struct amdgpu_device
 *adev)
 
   	err = amdgpu_bo_create(adev, adev->firmware.fw_size, PAGE_SIZE, true,
   				amdgpu_sriov_vf(adev) ? AMDGPU_GEM_DOMAIN_VRAM : AMDGPU_GEM_DOMAIN_GTT,
-				0, NULL, NULL, bo);
+				amdgpu_sriov_vf(adev) ? AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS : 0,
+				NULL, NULL, bo);

Mhm, did you missed my comment? You can add the AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS unconditionally here, e.g. without checking amdgpu_sriov_vf(adev).

With that fixed the patch is Reviewed-by: Christian König <[email protected]>.

Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c +0 -0
   	if (err) {
   		dev_err(adev->dev, "(%d) Firmware buffer allocate failed\n", err);
   		goto failed;
Quoted 4 lines

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

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