Skip to contentSkip to conversation

drm/virtio: print a single line with device features

PATCH In review Gerd Hoffmann 3 participants 7 messages Oct 18, 2019 – Oct 23, 2019

Subsystems (4)
lore
Share & tools
lore

Gerd Hoffmann

author maintainer
#0 lore raw

PATCH 1/1 drm/virtio: print a single line with device features

---
 drivers/gpu/drm/virtio/virtgpu_kms.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/gpu/drm/virtio/virtgpu_kms.c +4 -5
index 0b3cdb0d83b0..2f5773e43557 100644
@@ -155,16 +155,15 @@ int virtio_gpu_init(struct drm_device *dev)
 #ifdef __LITTLE_ENDIAN
 	if (virtio_has_feature(vgdev->vdev, VIRTIO_GPU_F_VIRGL))
 		vgdev->has_virgl_3d = true;
-	DRM_INFO("virgl 3d acceleration %s\n",
-		 vgdev->has_virgl_3d ? "enabled" : "not supported by host");
-#else
-	DRM_INFO("virgl 3d acceleration not supported by guest\n");
 #endif
 	if (virtio_has_feature(vgdev->vdev, VIRTIO_GPU_F_EDID)) {
 		vgdev->has_edid = true;
-		DRM_INFO("EDID support available.\n");
 	}
 
+	DRM_INFO("features: %cvirgl %cedid\n",
+		 vgdev->has_virgl_3d ? '+' : '-',
+		 vgdev->has_edid     ? '+' : '-');
+
 	ret = virtio_find_vqs(vgdev->vdev, 2, vqs, callbacks, names, NULL);
 	if (ret) {
 		DRM_ERROR("failed to find virt queues\n");
Signature · 6 lines
2.18.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw
Quoted 16 lines · Gerd Hoffmann
---
 drivers/gpu/drm/virtio/virtgpu_kms.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/gpu/drm/virtio/virtgpu_kms.c +0 -3
index 0b3cdb0d83b0..2f5773e43557 100644
@@ -155,16 +155,15 @@ int virtio_gpu_init(struct drm_device *dev)
 #ifdef __LITTLE_ENDIAN
 	if (virtio_has_feature(vgdev->vdev, VIRTIO_GPU_F_VIRGL))
 		vgdev->has_virgl_3d = true;
-	DRM_INFO("virgl 3d acceleration %s\n",
-		 vgdev->has_virgl_3d ? "enabled" : "not supported by host");
-#else

drivers/gpu/drm/virtio/virtgpu_kms.c int virtio_gpu_init(struct drm_device *dev) · line 165

Quoted 10 lines
drivers/gpu/drm/virtio/virtgpu_kms.c +3 -2
-	DRM_INFO("virgl 3d acceleration not supported by guest\n");
 #endif
 	if (virtio_has_feature(vgdev->vdev, VIRTIO_GPU_F_EDID)) {
 		vgdev->has_edid = true;
-		DRM_INFO("EDID support available.\n");
 	}
 
+	DRM_INFO("features: %cvirgl %cedid\n",
+		 vgdev->has_virgl_3d ? '+' : '-',
+		 vgdev->has_edid     ? '+' : '-');

Maybe we should move the various yesno/onoff/enableddisabled helpers from i915_utils.h to drm_utils.h and use them more widely?

Anyway Reviewed-by: Daniel Vetter <[email protected]>

Quoted 7 lines
drivers/gpu/drm/virtio/virtgpu_kms.c +1 -0
+
 	ret = virtio_find_vqs(vgdev->vdev, 2, vqs, callbacks, names, NULL);
 	if (ret) {
 		DRM_ERROR("failed to find virt queues\n");
Signature · 1 line
2.18.1
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
#2 lore raw
In reply to Gerd Hoffmann
Quoted 16 lines · Gerd Hoffmann
---
 drivers/gpu/drm/virtio/virtgpu_kms.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/gpu/drm/virtio/virtgpu_kms.c +0 -3
index 0b3cdb0d83b0..2f5773e43557 100644
@@ -155,16 +155,15 @@ int virtio_gpu_init(struct drm_device *dev)
 #ifdef __LITTLE_ENDIAN
 	if (virtio_has_feature(vgdev->vdev, VIRTIO_GPU_F_VIRGL))
 		vgdev->has_virgl_3d = true;
-	DRM_INFO("virgl 3d acceleration %s\n",
-		 vgdev->has_virgl_3d ? "enabled" : "not supported by host");
-#else

drivers/gpu/drm/virtio/virtgpu_kms.c int virtio_gpu_init(struct drm_device *dev) · line 165

Quoted 10 lines
drivers/gpu/drm/virtio/virtgpu_kms.c +3 -2
-	DRM_INFO("virgl 3d acceleration not supported by guest\n");
 #endif
 	if (virtio_has_feature(vgdev->vdev, VIRTIO_GPU_F_EDID)) {
 		vgdev->has_edid = true;
-		DRM_INFO("EDID support available.\n");
 	}
 
+	DRM_INFO("features: %cvirgl %cedid\n",
+		 vgdev->has_virgl_3d ? '+' : '-',
+		 vgdev->has_edid     ? '+' : '-');

Maybe we should move the various yesno/onoff/enableddisabled helpers from i915_utils.h to drm_utils.h and use them more widely?

Anyway Reviewed-by: Daniel Vetter <[email protected]>

Quoted 7 lines
drivers/gpu/drm/virtio/virtgpu_kms.c +1 -0
+
 	ret = virtio_find_vqs(vgdev->vdev, 2, vqs, callbacks, names, NULL);
 	if (ret) {
 		DRM_ERROR("failed to find virt queues\n");
Signature · 1 line
2.18.1
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
#3 lore raw
Quoted 24 lines · Daniel Vetter
Quoted 23 lines · Gerd Hoffmann
---
 drivers/gpu/drm/virtio/virtgpu_kms.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/gpu/drm/virtio/virtgpu_kms.c +0 -5
index 0b3cdb0d83b0..2f5773e43557 100644
@@ -155,16 +155,15 @@ int virtio_gpu_init(struct drm_device *dev)
 #ifdef __LITTLE_ENDIAN
 	if (virtio_has_feature(vgdev->vdev, VIRTIO_GPU_F_VIRGL))
 		vgdev->has_virgl_3d = true;
-	DRM_INFO("virgl 3d acceleration %s\n",
-		 vgdev->has_virgl_3d ? "enabled" : "not supported by host");
-#else
-	DRM_INFO("virgl 3d acceleration not supported by guest\n");
 #endif
 	if (virtio_has_feature(vgdev->vdev, VIRTIO_GPU_F_EDID)) {
 		vgdev->has_edid = true;
-		DRM_INFO("EDID support available.\n");
 	}
 
Quoted 6 lines

drivers/gpu/drm/virtio/virtgpu_kms.c int virtio_gpu_init(struct drm_device *dev) · line 165

Quoted 3 lines
drivers/gpu/drm/virtio/virtgpu_kms.c +3 -0
+	DRM_INFO("features: %cvirgl %cedid\n",
+		 vgdev->has_virgl_3d ? '+' : '-',
+		 vgdev->has_edid     ? '+' : '-');

Maybe we should move the various yesno/onoff/enableddisabled helpers from i915_utils.h to drm_utils.h and use them more widely?

I'm trying to take it one step further by adding them to include/linux/string-choice.h [1]. Maybe, uh, fourth time's the charm?

BR,
Jani.

[1] http://lore.kernel.org/r/[email protected]

Signature · 1 line
Jani Nikula, Intel Open Source Graphics Center
#4 lore raw
Quoted 33 lines · Jani Nikula
Quoted 24 lines · Daniel Vetter
Quoted 23 lines · Gerd Hoffmann
---
 drivers/gpu/drm/virtio/virtgpu_kms.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/gpu/drm/virtio/virtgpu_kms.c +0 -5
index 0b3cdb0d83b0..2f5773e43557 100644
@@ -155,16 +155,15 @@ int virtio_gpu_init(struct drm_device *dev)
 #ifdef __LITTLE_ENDIAN
     if (virtio_has_feature(vgdev->vdev, VIRTIO_GPU_F_VIRGL))
             vgdev->has_virgl_3d = true;
-    DRM_INFO("virgl 3d acceleration %s\n",
-             vgdev->has_virgl_3d ? "enabled" : "not supported by host");
-#else
-    DRM_INFO("virgl 3d acceleration not supported by guest\n");
 #endif
     if (virtio_has_feature(vgdev->vdev, VIRTIO_GPU_F_EDID)) {
             vgdev->has_edid = true;
-            DRM_INFO("EDID support available.\n");
     }
 
Quoted 6 lines

drivers/gpu/drm/virtio/virtgpu_kms.c int virtio_gpu_init(struct drm_device *dev) · line 165

Quoted 3 lines
drivers/gpu/drm/virtio/virtgpu_kms.c +3 -0
+    DRM_INFO("features: %cvirgl %cedid\n",
+             vgdev->has_virgl_3d ? '+' : '-',
+             vgdev->has_edid     ? '+' : '-');

Maybe we should move the various yesno/onoff/enableddisabled helpers from i915_utils.h to drm_utils.h and use them more widely?

Quoted 7 lines

I'm trying to take it one step further by adding them to include/linux/string-choice.h [1]. Maybe, uh, fourth time's the charm?

BR,
Jani.

[1] http://lore.kernel.org/r/[email protected]

Oh nice, r-b: me on that.

I think the rule for new headers like this is "just do it" once you have enough senior kernel maintainers' approval. Maybe ask Dave Airlie for ack and with Greg's r-b then just stuff it into drm-misc-next or so?
-Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
#5 lore raw
In reply to Jani Nikula
Quoted 33 lines · Jani Nikula
Quoted 24 lines · Daniel Vetter
Quoted 23 lines · Gerd Hoffmann
---
 drivers/gpu/drm/virtio/virtgpu_kms.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/gpu/drm/virtio/virtgpu_kms.c +0 -5
index 0b3cdb0d83b0..2f5773e43557 100644
@@ -155,16 +155,15 @@ int virtio_gpu_init(struct drm_device *dev)
 #ifdef __LITTLE_ENDIAN
     if (virtio_has_feature(vgdev->vdev, VIRTIO_GPU_F_VIRGL))
             vgdev->has_virgl_3d = true;
-    DRM_INFO("virgl 3d acceleration %s\n",
-             vgdev->has_virgl_3d ? "enabled" : "not supported by host");
-#else
-    DRM_INFO("virgl 3d acceleration not supported by guest\n");
 #endif
     if (virtio_has_feature(vgdev->vdev, VIRTIO_GPU_F_EDID)) {
             vgdev->has_edid = true;
-            DRM_INFO("EDID support available.\n");
     }
 
Quoted 6 lines

drivers/gpu/drm/virtio/virtgpu_kms.c int virtio_gpu_init(struct drm_device *dev) · line 165

Quoted 3 lines
drivers/gpu/drm/virtio/virtgpu_kms.c +3 -0
+    DRM_INFO("features: %cvirgl %cedid\n",
+             vgdev->has_virgl_3d ? '+' : '-',
+             vgdev->has_edid     ? '+' : '-');

Maybe we should move the various yesno/onoff/enableddisabled helpers from i915_utils.h to drm_utils.h and use them more widely?

Quoted 7 lines

I'm trying to take it one step further by adding them to include/linux/string-choice.h [1]. Maybe, uh, fourth time's the charm?

BR,
Jani.

[1] http://lore.kernel.org/r/[email protected]

Oh nice, r-b: me on that.

I think the rule for new headers like this is "just do it" once you have enough senior kernel maintainers' approval. Maybe ask Dave Airlie for ack and with Greg's r-b then just stuff it into drm-misc-next or so?
-Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#6 lore raw
In reply to Daniel Vetter
Quoted 24 lines · Daniel Vetter
Quoted 23 lines · Gerd Hoffmann
---
 drivers/gpu/drm/virtio/virtgpu_kms.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/gpu/drm/virtio/virtgpu_kms.c +0 -5
index 0b3cdb0d83b0..2f5773e43557 100644
@@ -155,16 +155,15 @@ int virtio_gpu_init(struct drm_device *dev)
 #ifdef __LITTLE_ENDIAN
 	if (virtio_has_feature(vgdev->vdev, VIRTIO_GPU_F_VIRGL))
 		vgdev->has_virgl_3d = true;
-	DRM_INFO("virgl 3d acceleration %s\n",
-		 vgdev->has_virgl_3d ? "enabled" : "not supported by host");
-#else
-	DRM_INFO("virgl 3d acceleration not supported by guest\n");
 #endif
 	if (virtio_has_feature(vgdev->vdev, VIRTIO_GPU_F_EDID)) {
 		vgdev->has_edid = true;
-		DRM_INFO("EDID support available.\n");
 	}
 
Quoted 6 lines

drivers/gpu/drm/virtio/virtgpu_kms.c int virtio_gpu_init(struct drm_device *dev) · line 165

Quoted 3 lines
drivers/gpu/drm/virtio/virtgpu_kms.c +3 -0
+	DRM_INFO("features: %cvirgl %cedid\n",
+		 vgdev->has_virgl_3d ? '+' : '-',
+		 vgdev->has_edid     ? '+' : '-');

Maybe we should move the various yesno/onoff/enableddisabled helpers from i915_utils.h to drm_utils.h and use them more widely?

I'm trying to take it one step further by adding them to include/linux/string-choice.h [1]. Maybe, uh, fourth time's the charm?

BR,
Jani.

[1] http://lore.kernel.org/r/[email protected]

Signature · 1 line
Jani Nikula, Intel Open Source Graphics Center