Skip to contentSkip to conversation

drm/amdgpu: use drm_gem_private_object_init

PATCH In review Christian König 4 participants 5 messages Feb 16, 2018 – Feb 19, 2018 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 drm/amdgpu: use drm_gem_private_object_init

We use our own backing store and don't need the shmem file.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +1 -5
index 512612ec3557..969de54b62da 100644
@@ -371,11 +371,7 @@ static int amdgpu_bo_do_create(struct amdgpu_device *adev,
 	bo = kzalloc(sizeof(struct amdgpu_bo), GFP_KERNEL);
 	if (bo == NULL)
 		return -ENOMEM;
-	r = drm_gem_object_init(adev->ddev, &bo->gem_base, size);
-	if (unlikely(r)) {
-		kfree(bo);
-		return r;
-	}
+	drm_gem_private_object_init(adev->ddev, &bo->gem_base, size);
 	INIT_LIST_HEAD(&bo->shadow_list);
 	INIT_LIST_HEAD(&bo->va);
 	bo->preferred_domains = domain & (AMDGPU_GEM_DOMAIN_VRAM |
Signature · 6 lines
2.14.1

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

A message that is not in the archive (sent off-list or not yet received): 20180216092635.64271-1-christian.koenig-5C7GfCeVMHo@public.gmane.org

#2 lore raw

PATCH 2/2 drm/radeon: use drm_gem_private_object_init

We use our own backing store and don't need the shmem file.

---
 drivers/gpu/drm/radeon/radeon_object.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/gpu/drm/radeon/radeon_object.c +1 -5
index 15404af9d740..c38fea37a67d 100644
@@ -204,11 +204,7 @@ int radeon_bo_create(struct radeon_device *rdev,
 	bo = kzalloc(sizeof(struct radeon_bo), GFP_KERNEL);
 	if (bo == NULL)
 		return -ENOMEM;
-	r = drm_gem_object_init(rdev->ddev, &bo->gem_base, size);
-	if (unlikely(r)) {
-		kfree(bo);
-		return r;
-	}
+	drm_gem_private_object_init(rdev->ddev, &bo->gem_base, size);
 	bo->rdev = rdev;
 	bo->surface_reg = -1;
 	INIT_LIST_HEAD(&bo->list);
Signature · 6 lines
2.14.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#3 lore raw
In reply to Christian König
Quoted 3 lines · Christian König

We use our own backing store and don't need the shmem file.

I thought ttm swaps to the shmem when under memory pressure. Or does it allocate it's own shmem file for that?
-Daniel

Quoted 28 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +1 -5
index 512612ec3557..969de54b62da 100644
@@ -371,11 +371,7 @@ static int amdgpu_bo_do_create(struct amdgpu_device *adev,
 	bo = kzalloc(sizeof(struct amdgpu_bo), GFP_KERNEL);
 	if (bo == NULL)
 		return -ENOMEM;
-	r = drm_gem_object_init(adev->ddev, &bo->gem_base, size);
-	if (unlikely(r)) {
-		kfree(bo);
-		return r;
-	}
+	drm_gem_private_object_init(adev->ddev, &bo->gem_base, size);
 	INIT_LIST_HEAD(&bo->shadow_list);
 	INIT_LIST_HEAD(&bo->va);
 	bo->preferred_domains = domain & (AMDGPU_GEM_DOMAIN_VRAM |
Signature · 6 lines
2.14.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#4 lore raw

Am 19.02.2018 um 16:32 schrieb Daniel Vetter:

Quoted 6 lines · Christian König
Quoted 3 lines

We use our own backing store and don't need the shmem file.

I thought ttm swaps to the shmem when under memory pressure. Or does it allocate it's own shmem file for that?

It allocates a separate shmem file for that.

Christian.

Quoted 26 lines

-Daniel

Quoted 24 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 6 +-----
  1 file changed, 1 insertion(+), 5 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +1 -5
index 512612ec3557..969de54b62da 100644
@@ -371,11 +371,7 @@ static int amdgpu_bo_do_create(struct amdgpu_device *adev,
  	bo = kzalloc(sizeof(struct amdgpu_bo), GFP_KERNEL);
  	if (bo == NULL)
  		return -ENOMEM;
-	r = drm_gem_object_init(adev->ddev, &bo->gem_base, size);
-	if (unlikely(r)) {
-		kfree(bo);
-		return r;
-	}
+	drm_gem_private_object_init(adev->ddev, &bo->gem_base, size);
  	INIT_LIST_HEAD(&bo->shadow_list);
  	INIT_LIST_HEAD(&bo->va);
  	bo->preferred_domains = domain & (AMDGPU_GEM_DOMAIN_VRAM |
Signature · 1 line
2.14.1
Quoted 4 lines
Quoted 4 lines

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

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

A message that is not in the archive (sent off-list or not yet received): 998b0171-35c3-31fd-52ab-3f730b40187f-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

#6 lore raw
Quoted 9 lines · Christian König

Am 19.02.2018 um 16:32 schrieb Daniel Vetter:

Quoted 6 lines · Christian König
Quoted 3 lines

We use our own backing store and don't need the shmem file.

I thought ttm swaps to the shmem when under memory pressure. Or does it allocate it's own shmem file for that?

It allocates a separate shmem file for that.

fwiw Acked-by: Daniel Vetter <[email protected]> on both. -Daniel

Quoted 34 lines

Christian.

Quoted 30 lines

-Daniel

Quoted 28 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 6 +-----
  1 file changed, 1 insertion(+), 5 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +1 -5
index 512612ec3557..969de54b62da 100644
@@ -371,11 +371,7 @@ static int amdgpu_bo_do_create(struct amdgpu_device *adev,
  	bo = kzalloc(sizeof(struct amdgpu_bo), GFP_KERNEL);
  	if (bo == NULL)
  		return -ENOMEM;
-	r = drm_gem_object_init(adev->ddev, &bo->gem_base, size);
-	if (unlikely(r)) {
-		kfree(bo);
-		return r;
-	}
+	drm_gem_private_object_init(adev->ddev, &bo->gem_base, size);
  	INIT_LIST_HEAD(&bo->shadow_list);
  	INIT_LIST_HEAD(&bo->va);
  	bo->preferred_domains = domain & (AMDGPU_GEM_DOMAIN_VRAM |
Signature · 6 lines
2.14.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx