Skip to contentSkip to conversation

drm/amdgpu: fix the wrong type of gem object creation

PATCH In review Huang Rui 3 participants 3 messages Jun 28, 2018 – Jun 29, 2018 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

Huang Rui

author
#0 lore raw

PATCH 1/1 drm/amdgpu: fix the wrong type of gem object creation

We still use legacy type of gem_object_create, it should update to ttm_bo_type now.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c  | 2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c +1 -1
index bc5fd8e..811c629 100644
@@ -146,7 +146,7 @@ static int amdgpufb_create_pinned_object(struct amdgpu_fbdev *rfbdev,
 				       AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED |
 				       AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS |
 				       AMDGPU_GEM_CREATE_VRAM_CLEARED,
-				       true, NULL, &gobj);
+				       ttm_bo_type_kernel, NULL, &gobj);
 	if (ret) {
 		pr_err("failed to allocate framebuffer (%d)\n", aligned_size);
 		return -ENOMEM;
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +3 -3
index eff716d..97b999c 100644
@@ -265,7 +265,7 @@ int amdgpu_gem_create_ioctl(struct drm_device *dev, void *data,
 
 	r = amdgpu_gem_object_create(adev, size, args->in.alignment,
 				     (u32)(0xffffffff & args->in.domains),
-				     flags, false, resv, &gobj);
+				     flags, ttm_bo_type_device, resv, &gobj);
 	if (flags & AMDGPU_GEM_CREATE_VM_ALWAYS_VALID) {
 		if (!r) {
 			struct amdgpu_bo *abo = gem_to_amdgpu_bo(gobj);
@@ -317,7 +317,7 @@ int amdgpu_gem_userptr_ioctl(struct drm_device *dev, void *data,
 
 	/* create a gem object to contain this object in */
 	r = amdgpu_gem_object_create(adev, args->size, 0, AMDGPU_GEM_DOMAIN_CPU,
-				     0, 0, NULL, &gobj);
+				     0, ttm_bo_type_device, NULL, &gobj);
 	if (r)
 		return r;
 
@@ -766,7 +766,7 @@ int amdgpu_mode_dumb_create(struct drm_file *file_priv,
 				amdgpu_display_supported_domains(adev));
 	r = amdgpu_gem_object_create(adev, args->size, 0, domain,
 				     AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED,
-				     false, NULL, &gobj);
+				     ttm_bo_type_device, NULL, &gobj);
 	if (r)
 		return -ENOMEM;
 
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): 1530179887-24410-1-git-send-email-ray.huang-5C7GfCeVMHo@public.gmane.org

Reviewed-by
#2 lore raw
Quoted 4 lines · Huang Rui

We still use legacy type of gem_object_create, it should update to ttm_bo_type now.

Nice catch. (For anyone wondering: No need for Cc: stable, since the values used previously matched the enum values, so there's no change in behaviour)

Signature · 6 lines
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Reviewed-by Junwei Zhang
#3 lore raw
In reply to a message not in the archive
Quoted 4 lines · Huang Rui

We still use legacy type of gem_object_create, it should update to ttm_bo_type now.

Quoted 42 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c  | 2 +-
  drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 6 +++---
  2 files changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c +1 -1
index bc5fd8e..811c629 100644
@@ -146,7 +146,7 @@ static int amdgpufb_create_pinned_object(struct amdgpu_fbdev *rfbdev,
  				       AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED |
  				       AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS |
  				       AMDGPU_GEM_CREATE_VRAM_CLEARED,
-				       true, NULL, &gobj);
+				       ttm_bo_type_kernel, NULL, &gobj);
  	if (ret) {
  		pr_err("failed to allocate framebuffer (%d)\n", aligned_size);
  		return -ENOMEM;
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +2 -2
index eff716d..97b999c 100644
@@ -265,7 +265,7 @@ int amdgpu_gem_create_ioctl(struct drm_device *dev, void *data,
 
  	r = amdgpu_gem_object_create(adev, size, args->in.alignment,
  				     (u32)(0xffffffff & args->in.domains),
-				     flags, false, resv, &gobj);
+				     flags, ttm_bo_type_device, resv, &gobj);
  	if (flags & AMDGPU_GEM_CREATE_VM_ALWAYS_VALID) {
  		if (!r) {
  			struct amdgpu_bo *abo = gem_to_amdgpu_bo(gobj);
@@ -317,7 +317,7 @@ int amdgpu_gem_userptr_ioctl(struct drm_device *dev, void *data,
 
  	/* create a gem object to contain this object in */
  	r = amdgpu_gem_object_create(adev, args->size, 0, AMDGPU_GEM_DOMAIN_CPU,
-				     0, 0, NULL, &gobj);
+				     0, ttm_bo_type_device, NULL, &gobj);
  	if (r)
  		return r;
 

drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c int amdgpu_mode_dumb_create(struct drm_file *file_priv, · line 772

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +1 -1
@@ -766,7 +766,7 @@ int amdgpu_mode_dumb_create(struct drm_file *file_priv,
  				amdgpu_display_supported_domains(adev));
  	r = amdgpu_gem_object_create(adev, args->size, 0, domain,
  				     AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED,
-				     false, NULL, &gobj);
+				     ttm_bo_type_device, NULL, &gobj);
  	if (r)
  		return -ENOMEM;
 

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