Skip to contentSkip to conversation

drm/msm: Split gpu/kms cleanups

PATCH In review Rob Clark 4 participants 7 messages Jul 5, 2025 – Jul 7, 2025

Subsystems (3)
lore
Share & tools
lore

Rob Clark

author maintainer
#0 lore raw

cover drm/msm: Split gpu/kms cleanups

Applies on top of https://lore.kernel.org/all/[email protected]/

Rob Clark (2):
drm/msm: Clean up split driver features drm/msm: Take the ioctls away from the KMS-only driver

 drivers/gpu/drm/msm/msm_drv.c | 33 ++++++++++++++++-----------------
 1 file changed, 16 insertions(+), 17 deletions(-)
Signature · 1 line
2.50.0
author maintainer
#1 lore raw

PATCH 1/2 drm/msm: Clean up split driver features

Avoid the possibility of missing features between the split and unified drm driver cases by defining DRIVER_FEATURES_GPU / KMS and using those in the drm_driver initializations.

---
 drivers/gpu/drm/msm/msm_drv.c | 31 ++++++++++++++++---------------
 1 file changed, 16 insertions(+), 15 deletions(-)
drivers/gpu/drm/msm/msm_drv.c +16 -15
index b6efc5b9933b..5695de1bbae2 100644
@@ -816,14 +816,21 @@ static const struct file_operations fops = {
 	.show_fdinfo = drm_show_fdinfo,
 };
 
+#define DRIVER_FEATURES_GPU ( \
+		DRIVER_GEM | \
+		DRIVER_GEM_GPUVA | \
+		DRIVER_RENDER | \
+		DRIVER_SYNCOBJ_TIMELINE | \
+		0 )
+
+#define DRIVER_FEATURES_KMS ( \
+		DRIVER_GEM | \
+		DRIVER_ATOMIC | \
+		DRIVER_MODESET | \
+		0 )
+
 static const struct drm_driver msm_driver = {
-	.driver_features    = DRIVER_GEM |
-				DRIVER_GEM_GPUVA |
-				DRIVER_RENDER |
-				DRIVER_ATOMIC |
-				DRIVER_MODESET |
-				DRIVER_SYNCOBJ_TIMELINE |
-				DRIVER_SYNCOBJ,
+	.driver_features    = DRIVER_FEATURES_GPU | DRIVER_FEATURES_KMS,
 	.open               = msm_open,
 	.postclose          = msm_postclose,
 	.dumb_create        = msm_gem_dumb_create,
@@ -846,9 +853,7 @@ static const struct drm_driver msm_driver = {
 };
 
 static const struct drm_driver msm_kms_driver = {
-	.driver_features    = DRIVER_GEM |
-				DRIVER_ATOMIC |
-				DRIVER_MODESET,
+	.driver_features    = DRIVER_FEATURES_KMS,
 	.open               = msm_open,
 	.postclose          = msm_postclose,
 	.dumb_create        = msm_gem_dumb_create,
@@ -870,11 +875,7 @@ static const struct drm_driver msm_kms_driver = {
 };
 
 static const struct drm_driver msm_gpu_driver = {
-	.driver_features    = DRIVER_GEM |
-				DRIVER_GEM_GPUVA |
-				DRIVER_RENDER |
-				DRIVER_SYNCOBJ_TIMELINE |
-				DRIVER_SYNCOBJ,
+	.driver_features    = DRIVER_FEATURES_GPU,
 	.open               = msm_open,
 	.postclose          = msm_postclose,
 	.gem_prime_import_sg_table = msm_gem_prime_import_sg_table,
Signature · 1 line
2.50.0
Reviewed-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] drm/msm: Clean up split driver features

Quoted 9 lines · Rob Clark

Avoid the possibility of missing features between the split and unified drm driver cases by defining DRIVER_FEATURES_GPU / KMS and using those in the drm_driver initializations.

---
 drivers/gpu/drm/msm/msm_drv.c | 31 ++++++++++++++++---------------
 1 file changed, 16 insertions(+), 15 deletions(-)
Signature · 2 lines
With best wishes
Dmitry
#3 lore raw

Re: [PATCH 1/2] drm/msm: Clean up split driver features

In reply to Rob Clark
Quoted 19 lines · Rob Clark

Avoid the possibility of missing features between the split and unified drm driver cases by defining DRIVER_FEATURES_GPU / KMS and using those in the drm_driver initializations.

---
 drivers/gpu/drm/msm/msm_drv.c | 31 ++++++++++++++++---------------
 1 file changed, 16 insertions(+), 15 deletions(-)
drivers/gpu/drm/msm/msm_drv.c +2 -0
index b6efc5b9933b..5695de1bbae2 100644
@@ -816,14 +816,21 @@ static const struct file_operations fops = {
 	.show_fdinfo = drm_show_fdinfo,
 };
 
+#define DRIVER_FEATURES_GPU ( \
+		DRIVER_GEM | \

drivers/gpu/drm/msm/msm_drv.c static const struct file_operations fops = { · line 830

Quoted 10 lines
drivers/gpu/drm/msm/msm_drv.c +10 -0
+		DRIVER_GEM_GPUVA | \
+		DRIVER_RENDER | \
+		DRIVER_SYNCOBJ_TIMELINE | \
+		0 )
+
+#define DRIVER_FEATURES_KMS ( \
+		DRIVER_GEM | \
+		DRIVER_ATOMIC | \
+		DRIVER_MODESET | \
+		0 )

Perhaps I'm missing some C lore, but do we need the "| 0"?

Konrad

#4 lore raw

Re: [PATCH 1/2] drm/msm: Clean up split driver features

Quoted 19 lines · Konrad Dybcio
Quoted 17 lines · Rob Clark

Avoid the possibility of missing features between the split and unified drm driver cases by defining DRIVER_FEATURES_GPU / KMS and using those in the drm_driver initializations.

---
 drivers/gpu/drm/msm/msm_drv.c | 31 ++++++++++++++++---------------
 1 file changed, 16 insertions(+), 15 deletions(-)
drivers/gpu/drm/msm/msm_drv.c +0 -0
index b6efc5b9933b..5695de1bbae2 100644
@@ -816,14 +816,21 @@ static const struct file_operations fops = {
      .show_fdinfo = drm_show_fdinfo,
 };
 
Quoted 14 lines

drivers/gpu/drm/msm/msm_drv.c static const struct file_operations fops = { · line 830

Quoted 12 lines
drivers/gpu/drm/msm/msm_drv.c +12 -0
+#define DRIVER_FEATURES_GPU ( \
+             DRIVER_GEM | \
+             DRIVER_GEM_GPUVA | \
+             DRIVER_RENDER | \
+             DRIVER_SYNCOBJ_TIMELINE | \
+             0 )
+
+#define DRIVER_FEATURES_KMS ( \
+             DRIVER_GEM | \
+             DRIVER_ATOMIC | \
+             DRIVER_MODESET | \
+             0 )

Perhaps I'm missing some C lore, but do we need the "| 0"?

It is just to avoid later diffstat noise when new flags are added :-)

BR,
-R

author maintainer
#5 lore raw

PATCH 2/2 drm/msm: Take the ioctls away from the KMS-only driver

In reply to Rob Clark

KMS-only drivers should only allocate dumb buffers. The driver custom ioctls are only meant for the usermode gpu driver (mesa), and not for general consumption, so they don't make sense for standalone KMS drivers.

---
 drivers/gpu/drm/msm/msm_drv.c | 2 --
 1 file changed, 2 deletions(-)
drivers/gpu/drm/msm/msm_drv.c +0 -2
index 5695de1bbae2..3c856c0ae855 100644
@@ -864,8 +864,6 @@ static const struct drm_driver msm_kms_driver = {
 #endif
 	MSM_FBDEV_DRIVER_OPS,
 	.show_fdinfo        = msm_show_fdinfo,
-	.ioctls             = msm_ioctls,
-	.num_ioctls         = ARRAY_SIZE(msm_ioctls),
 	.fops               = &fops,
 	.name               = "msm-kms",
 	.desc               = "MSM Snapdragon DRM",
Signature · 1 line
2.50.0
Reviewed-by on v1 2/2
#6 lore raw

Re: [PATCH 2/2] drm/msm: Take the ioctls away from the KMS-only driver

Quoted 10 lines · Rob Clark

KMS-only drivers should only allocate dumb buffers. The driver custom ioctls are only meant for the usermode gpu driver (mesa), and not for general consumption, so they don't make sense for standalone KMS drivers.

---
 drivers/gpu/drm/msm/msm_drv.c | 2 --
 1 file changed, 2 deletions(-)

If we need GEM IOCTLs for the KMS node, we can think about it later. Let's remove them for now.

Signature · 2 lines
With best wishes
Dmitry