drm/virtio: implement blob resources: probe for the feature.
authorGerd Hoffmann <kraxel@redhat.com>
Thu, 24 Sep 2020 00:32:03 +0000 (17:32 -0700)
committerGerd Hoffmann <kraxel@redhat.com>
Tue, 29 Sep 2020 09:23:20 +0000 (11:23 +0200)
Let's proble for VIRTIO_GPU_F_RESOURCE_BLOB.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Gurchetan Singh <gurchetansingh@chromium.org>
Acked-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20200924003214.662-8-gurchetansingh@chromium.org
drivers/gpu/drm/virtio/virtgpu_debugfs.c
drivers/gpu/drm/virtio/virtgpu_drv.c
drivers/gpu/drm/virtio/virtgpu_drv.h
drivers/gpu/drm/virtio/virtgpu_kms.c

index d5b0c543bd6d72b0fc55a3b873e227b1d8466f24..6b9b8376613f005b27b9ed8596ef9a4043b823d5 100644 (file)
@@ -49,6 +49,7 @@ static int virtio_gpu_features(struct seq_file *m, void *data)
        virtio_add_bool(m, "edid", vgdev->has_edid);
        virtio_add_bool(m, "indirect", vgdev->has_indirect);
        virtio_add_bool(m, "resource uuid", vgdev->has_resource_assign_uuid);
+       virtio_add_bool(m, "blob resources", vgdev->has_resource_blob);
        virtio_add_int(m, "cap sets", vgdev->num_capsets);
        virtio_add_int(m, "scanouts", vgdev->num_scanouts);
        return 0;
index 1f8d6ed11d21490a351eb4d0df5ca902a2c29de9..86330f1ade72ed3de037ffc0bc38556dd419fc91 100644 (file)
@@ -166,6 +166,7 @@ static unsigned int features[] = {
 #endif
        VIRTIO_GPU_F_EDID,
        VIRTIO_GPU_F_RESOURCE_UUID,
+       VIRTIO_GPU_F_RESOURCE_BLOB,
 };
 static struct virtio_driver virtio_gpu_driver = {
        .feature_table = features,
index 272abe177ded6d15224654e9d36e3bc2eb35a3e8..b53478a6a3c089d8527993762128d5ee134b1d29 100644 (file)
@@ -208,6 +208,7 @@ struct virtio_gpu_device {
        bool has_edid;
        bool has_indirect;
        bool has_resource_assign_uuid;
+       bool has_resource_blob;
 
        struct work_struct config_changed_work;
 
index eed57a9313098d652099e98132429a8b06f6aa7f..0678e56100dae482f00ab22eb7338a817358c21a 100644 (file)
@@ -152,10 +152,14 @@ int virtio_gpu_init(struct drm_device *dev)
        if (virtio_has_feature(vgdev->vdev, VIRTIO_GPU_F_RESOURCE_UUID)) {
                vgdev->has_resource_assign_uuid = true;
        }
+       if (virtio_has_feature(vgdev->vdev, VIRTIO_GPU_F_RESOURCE_BLOB)) {
+               vgdev->has_resource_blob = true;
+       }
 
-       DRM_INFO("features: %cvirgl %cedid\n",
-                vgdev->has_virgl_3d ? '+' : '-',
-                vgdev->has_edid     ? '+' : '-');
+       DRM_INFO("features: %cvirgl %cedid %cresource_blob\n",
+                vgdev->has_virgl_3d    ? '+' : '-',
+                vgdev->has_edid        ? '+' : '-',
+                vgdev->has_resource_blob ? '+' : '-');
 
        ret = virtio_find_vqs(vgdev->vdev, 2, vqs, callbacks, names, NULL);
        if (ret) {