* [PATCH] virtio-gpu: disable VIRGL with BE kernel
@ 2017-01-24 13:12 ` Laurent Vivier
0 siblings, 0 replies; 3+ messages in thread
From: Laurent Vivier @ 2017-01-24 13:12 UTC (permalink / raw)
To: linux-kernel; +Cc: virtualization, Gerd Hoffmann, dri-devel, David Airlie
VIRTIO_GPU_F_VIRGL is added in features list only
for LE kernel, so we must check for it only on LE kernel,
otherwise virtio_has_feature() calls BUG() and
crashes the kernel.
Suggested-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
---
Note: this patch has been actually written by Gerd,
but to post it I don't know if "Suggested-by" is enough
or if I should change the "author" field.
drivers/gpu/drm/virtio/virtgpu_kms.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/virtio/virtgpu_kms.c b/drivers/gpu/drm/virtio/virtgpu_kms.c
index 1235519..87915d5 100644
--- a/drivers/gpu/drm/virtio/virtgpu_kms.c
+++ b/drivers/gpu/drm/virtio/virtgpu_kms.c
@@ -166,10 +166,14 @@ int virtio_gpu_driver_load(struct drm_device *dev, unsigned long flags)
INIT_WORK(&vgdev->config_changed_work,
virtio_gpu_config_changed_work_func);
+#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 available");
+ vgdev->has_virgl_3d ? "enabled" : "not supported by host");
+#else
+ DRM_INFO("virgl 3d acceleration not supported by guest\n");
+#endif
ret = vgdev->vdev->config->find_vqs(vgdev->vdev, 2, vqs,
callbacks, names);
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] virtio-gpu: disable VIRGL with BE kernel
@ 2017-01-24 13:12 ` Laurent Vivier
0 siblings, 0 replies; 3+ messages in thread
From: Laurent Vivier @ 2017-01-24 13:12 UTC (permalink / raw)
To: linux-kernel; +Cc: David Airlie, dri-devel, virtualization
VIRTIO_GPU_F_VIRGL is added in features list only
for LE kernel, so we must check for it only on LE kernel,
otherwise virtio_has_feature() calls BUG() and
crashes the kernel.
Suggested-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
---
Note: this patch has been actually written by Gerd,
but to post it I don't know if "Suggested-by" is enough
or if I should change the "author" field.
drivers/gpu/drm/virtio/virtgpu_kms.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/virtio/virtgpu_kms.c b/drivers/gpu/drm/virtio/virtgpu_kms.c
index 1235519..87915d5 100644
--- a/drivers/gpu/drm/virtio/virtgpu_kms.c
+++ b/drivers/gpu/drm/virtio/virtgpu_kms.c
@@ -166,10 +166,14 @@ int virtio_gpu_driver_load(struct drm_device *dev, unsigned long flags)
INIT_WORK(&vgdev->config_changed_work,
virtio_gpu_config_changed_work_func);
+#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 available");
+ vgdev->has_virgl_3d ? "enabled" : "not supported by host");
+#else
+ DRM_INFO("virgl 3d acceleration not supported by guest\n");
+#endif
ret = vgdev->vdev->config->find_vqs(vgdev->vdev, 2, vqs,
callbacks, names);
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] virtio-gpu: disable VIRGL with BE kernel
2017-01-24 13:12 ` Laurent Vivier
(?)
@ 2017-01-27 8:15 ` Gerd Hoffmann
-1 siblings, 0 replies; 3+ messages in thread
From: Gerd Hoffmann @ 2017-01-27 8:15 UTC (permalink / raw)
To: Laurent Vivier; +Cc: linux-kernel, dri-devel, virtualization
On Di, 2017-01-24 at 14:12 +0100, Laurent Vivier wrote:
> VIRTIO_GPU_F_VIRGL is added in features list only
> for LE kernel, so we must check for it only on LE kernel,
> otherwise virtio_has_feature() calls BUG() and
> crashes the kernel.
>
> Suggested-by: Gerd Hoffmann <kraxel@redhat.com>
> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Added to drm-qemu branch.
thanks,
Gerd
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-01-27 8:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-24 13:12 [PATCH] virtio-gpu: disable VIRGL with BE kernel Laurent Vivier
2017-01-24 13:12 ` Laurent Vivier
2017-01-27 8:15 ` Gerd Hoffmann
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.