Thread (4 messages) 4 messages, 2 authors, 2025-02-04

Re: [PATCH v6] drm/virtio: Add drm_panic support

From: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Date: 2025-02-02 17:18:16
Also in: dri-devel, lkml

Hi,

On 1/30/25 12:05, Ryosuke Yasuoka wrote:
...
+static int virtio_drm_get_scanout_buffer(struct drm_plane *plane,
+					 struct drm_scanout_buffer *sb)
+{
+	struct virtio_gpu_object *bo;
+
+	if (!plane->state || !plane->state->fb || !plane->state->visible)
+		return -ENODEV;
+
+	bo = gem_to_virtio_gpu_obj(plane->state->fb->obj[0]);
+	if (virtio_gpu_is_vram(bo) || bo->base.base.import_attach)
+		return -ENODEV;
+
+	/* try to vmap it if possible */
+	if (!bo->base.vaddr) {
+		int ret;
+
+		ret = drm_gem_shmem_vmap(&bo->base, &sb->map[0]);
drm_gem_shmem_vmap() requires BO resv to be locked, it also may invoke
drm_gem_shmem_get_pages() that sleeps. This function can't be used in
atomic context.

For the starter, let's reject !bo->base.vaddr BOs. Normally, shmem FB
BOs are always vmapped.

-- 
Best regards,
Dmitry
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help