Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1565843 > unrolled thread

[PATCH] virtio-gpu: disable VIRGL with BE kernel

Started byLaurent Vivier <lvivier@redhat.com>
First post2017-01-24 14:20 +0100
Last post2017-01-27 09:20 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] virtio-gpu: disable VIRGL with BE kernel Laurent Vivier <lvivier@redhat.com> - 2017-01-24 14:20 +0100
    Re: [PATCH] virtio-gpu: disable VIRGL with BE kernel Gerd Hoffmann <kraxel@redhat.com> - 2017-01-27 09:20 +0100

#1565843 — [PATCH] virtio-gpu: disable VIRGL with BE kernel

FromLaurent Vivier <lvivier@redhat.com>
Date2017-01-24 14:20 +0100
Subject[PATCH] virtio-gpu: disable VIRGL with BE kernel
Message-ID<t39aW-4LM-11@gated-at.bofh.it>
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

[toc] | [next] | [standalone]


#1567931

FromGerd Hoffmann <kraxel@redhat.com>
Date2017-01-27 09:20 +0100
Message-ID<t49Vg-1J9-1@gated-at.bofh.it>
In reply to#1565843
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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web