Skip to contentSkip to conversation

drm/v3d: Drop allocation of object without mountpoint

PATCH Superseded [email protected] 3 participants 4 messages Oct 28, 2024 – Oct 29, 2024

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/v3d: Drop allocation of object without mountpoint

From: Matthias Brugger <[email protected]>

Function drm_gem_shmem_create_with_mnt() creates an object without using the mountpoint if gemfs is NULL.

Drop the else branch calling drm_gem_shmem_create().

---
 drivers/gpu/drm/v3d/v3d_bo.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/gpu/drm/v3d/v3d_bo.c +1 -6
index 7055f7c7bcfe5700aee10b09ecc0005197323b01..f6df9e0947b6ee06043cdbb42c4f98a71bdeba4d 100644
@@ -157,13 +157,8 @@ struct v3d_bo *v3d_bo_create(struct drm_device *dev, struct drm_file *file_priv,
 	struct v3d_bo *bo;
 	int ret;
 
-	/* Let the user opt out of allocating the BOs with THP */
-	if (v3d->gemfs)
-		shmem_obj = drm_gem_shmem_create_with_mnt(dev, unaligned_size,
+	shmem_obj = drm_gem_shmem_create_with_mnt(dev, unaligned_size,
 							  v3d->gemfs);
-	else
-		shmem_obj = drm_gem_shmem_create(dev, unaligned_size);
-
 	if (IS_ERR(shmem_obj))
 		return ERR_CAST(shmem_obj);
 	bo = to_v3d_bo(&shmem_obj->base);

---
base-commit: dec9255a128e19c5fcc3bdb18175d78094cc624d
change-id: 20241028-v3d-1d2546ed92d7

Best regards,

Signature · 1 line
Matthias Brugger <[email protected]>
maintainer
#1 lore raw

Hi Matthias,

Thanks for your patch!

Quoted 17 lines · On 28/10/24 11:27, [email protected] wrote:

From: Matthias Brugger <[email protected]>

Function drm_gem_shmem_create_with_mnt() creates an object without using the mountpoint if gemfs is NULL.

Drop the else branch calling drm_gem_shmem_create().

---
  drivers/gpu/drm/v3d/v3d_bo.c | 7 +------
  1 file changed, 1 insertion(+), 6 deletions(-)
drivers/gpu/drm/v3d/v3d_bo.c +0 -0
index 7055f7c7bcfe5700aee10b09ecc0005197323b01..f6df9e0947b6ee06043cdbb42c4f98a71bdeba4d 100644

drivers/gpu/drm/v3d/v3d_bo.c struct v3d_bo *v3d_bo_create(struct drm_device *dev, struct drm_file *file_priv, · line 161

Quoted 8 lines
drivers/gpu/drm/v3d/v3d_bo.c +1 -3
@@ -157,13 +157,8 @@ struct v3d_bo *v3d_bo_create(struct drm_device *dev, struct drm_file *file_priv,
  	struct v3d_bo *bo;
  	int ret;
 
-	/* Let the user opt out of allocating the BOs with THP */
-	if (v3d->gemfs)
-		shmem_obj = drm_gem_shmem_create_with_mnt(dev, unaligned_size,
+	shmem_obj = drm_gem_shmem_create_with_mnt(dev, unaligned_size,
  							  v3d->gemfs);

Please, run scripts/checkpatch.pl before sending the patch.

Best Regards,
- Maíra

Quoted 12 lines
drivers/gpu/drm/v3d/v3d_bo.c +0 -4
-	else
-		shmem_obj = drm_gem_shmem_create(dev, unaligned_size);
-
  	if (IS_ERR(shmem_obj))
  		return ERR_CAST(shmem_obj);
  	bo = to_v3d_bo(&shmem_obj->base);
 
---

base-commit: dec9255a128e19c5fcc3bdb18175d78094cc624d
change-id: 20241028-v3d-1d2546ed92d7

Best regards,

#2 lore raw

Hi Maria,

Quoted 17 lines · Maíra Canal

Hi Matthias,

Thanks for your patch!

Quoted 12 lines · On 28/10/24 11:27, [email protected] wrote:

From: Matthias Brugger <[email protected]>

Function drm_gem_shmem_create_with_mnt() creates an object without using the mountpoint if gemfs is NULL.

Drop the else branch calling drm_gem_shmem_create().

---
  drivers/gpu/drm/v3d/v3d_bo.c | 7 +------

  1 file changed, 1 insertion(+), 6 deletions(-)
Quoted 16 lines

drivers/gpu/drm/v3d/v3d_bo.c struct v3d_bo *v3d_bo_create(struct drm_device *dev, · line 161

Quoted 13 lines
drivers/gpu/drm/v3d/v3d_bo.c +1 -3
index 7055f7c7bcfe5700aee10b09ecc0005197323b01..f6df9e0947b6ee06043cdbb42c4f98a71bdeba4d 100644
@@ -157,13 +157,8 @@ struct v3d_bo *v3d_bo_create(struct drm_device *dev, 
 struct drm_file *file_priv,
       struct v3d_bo *bo;
       int ret;
-    /* Let the user opt out of allocating the BOs with THP */
-    if (v3d->gemfs)
-        shmem_obj = drm_gem_shmem_create_with_mnt(dev, unaligned_size,
+    shmem_obj = drm_gem_shmem_create_with_mnt(dev, unaligned_size,
                                 v3d->gemfs);

Please, run scripts/checkpatch.pl before sending the patch.

I did with b4 prep --check which gave no errors, just double checked with:

$ ./scripts/checkpatch.pl 0001-drm-v3d-Drop-allocation-of-object-without-mountpoint.patch
total: 0 errors, 0 warnings, 14 lines checked

0001-drm-v3d-Drop-allocation-of-object-without-mountpoint.patch has no obvious style problems and is ready for submission.

I suppose you want line "v3d->gemfs" to get an extra tab, correct?

Regards,
Matthias

Quoted 16 lines

Best Regards,
- Maíra

Quoted 12 lines
drivers/gpu/drm/v3d/v3d_bo.c +0 -4
-    else
-        shmem_obj = drm_gem_shmem_create(dev, unaligned_size);
-
       if (IS_ERR(shmem_obj))
           return ERR_CAST(shmem_obj);
       bo = to_v3d_bo(&shmem_obj->base);
 
---

base-commit: dec9255a128e19c5fcc3bdb18175d78094cc624d
change-id: 20241028-v3d-1d2546ed92d7

Best regards,

maintainer
#3 lore raw

Hi Matthias,

Quoted 37 lines · Matthias Brugger

Hi Maria,

Quoted 17 lines · Maíra Canal

Hi Matthias,

Thanks for your patch!

Quoted 12 lines · On 28/10/24 11:27, [email protected] wrote:

From: Matthias Brugger <[email protected]>

Function drm_gem_shmem_create_with_mnt() creates an object without using the mountpoint if gemfs is NULL.

Drop the else branch calling drm_gem_shmem_create().

---
  drivers/gpu/drm/v3d/v3d_bo.c | 7 +------

  1 file changed, 1 insertion(+), 6 deletions(-)
Quoted 16 lines

drivers/gpu/drm/v3d/v3d_bo.c struct v3d_bo *v3d_bo_create(struct drm_device · line 161

Quoted 13 lines
drivers/gpu/drm/v3d/v3d_bo.c +1 -3
index 7055f7c7bcfe5700aee10b09ecc0005197323b01..f6df9e0947b6ee06043cdbb42c4f98a71bdeba4d 100644
@@ -157,13 +157,8 @@ struct v3d_bo *v3d_bo_create(struct drm_device 
 *dev, struct drm_file *file_priv,
       struct v3d_bo *bo;
       int ret;
-    /* Let the user opt out of allocating the BOs with THP */
-    if (v3d->gemfs)
-        shmem_obj = drm_gem_shmem_create_with_mnt(dev, unaligned_size,
+    shmem_obj = drm_gem_shmem_create_with_mnt(dev, unaligned_size,
                                 v3d->gemfs);

Please, run scripts/checkpatch.pl before sending the patch.

Quoted 7 lines

I did with b4 prep --check which gave no errors, just double checked with:

$ ./scripts/checkpatch.pl 0001-drm-v3d-Drop-allocation-of-object- without-mountpoint.patch
total: 0 errors, 0 warnings, 14 lines checked

0001-drm-v3d-Drop-allocation-of-object-without-mountpoint.patch has no obvious style problems and is ready for submission.

I suppose you want line "v3d->gemfs" to get an extra tab, correct?

Yes. A tip is running checkpatch.pl with the flag --strict.

$ ./scripts/checkpatch.pl --strict -g HEAD
CHECK: Alignment should match open parenthesis
#28: FILE: drivers/gpu/drm/v3d/v3d_bo.c:161:
+	shmem_obj = drm_gem_shmem_create_with_mnt(dev, unaligned_size,
 							  v3d->gemfs);

total: 0 errors, 0 warnings, 1 checks, 14 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or
--fix-inplace.

Commit d2ba234a691f ("drm/v3d: Drop allocation of object without mountpoint") has style problems, please review.

NOTE: If any of the errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.

Best Regards,
- Maíra

Quoted 20 lines

Regards,
Matthias

Quoted 16 lines

Best Regards,
- Maíra

Quoted 12 lines
drivers/gpu/drm/v3d/v3d_bo.c +0 -4
-    else
-        shmem_obj = drm_gem_shmem_create(dev, unaligned_size);
-
       if (IS_ERR(shmem_obj))
           return ERR_CAST(shmem_obj);
       bo = to_v3d_bo(&shmem_obj->base);
 
---

base-commit: dec9255a128e19c5fcc3bdb18175d78094cc624d
change-id: 20241028-v3d-1d2546ed92d7

Best regards,