Skip to content

Commit 2e819a1

Browse files
committed
drm/virtio: batch resource creation
Move virtio_gpu_notify() to higher-level functions for virtio_gpu_cmd_create_resource(), virtio_gpu_cmd_resource_create_3d() and virtio_gpu_cmd_resource_attach_backing(). virtio_gpu_object_create() will batch commands and notify only once when creating a resource. Signed-off-by: Gerd Hoffmann <[email protected]> Reviewed-by: Chia-I Wu <[email protected]> Reviewed-by: Gurchetan Singh <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 790bcd7 commit 2e819a1

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

drivers/gpu/drm/virtio/virtgpu_object.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ int virtio_gpu_object_create(struct virtio_gpu_device *vgdev,
224224
return ret;
225225
}
226226

227+
virtio_gpu_notify(vgdev);
227228
*bo_ptr = bo;
228229
return 0;
229230

drivers/gpu/drm/virtio/virtgpu_vq.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,6 @@ void virtio_gpu_cmd_create_resource(struct virtio_gpu_device *vgdev,
515515
cmd_p->height = cpu_to_le32(params->height);
516516

517517
virtio_gpu_queue_fenced_ctrl_buffer(vgdev, vbuf, fence);
518-
virtio_gpu_notify(vgdev);
519518
bo->created = true;
520519
}
521520

@@ -644,7 +643,6 @@ virtio_gpu_cmd_resource_attach_backing(struct virtio_gpu_device *vgdev,
644643
vbuf->data_size = sizeof(*ents) * nents;
645644

646645
virtio_gpu_queue_fenced_ctrl_buffer(vgdev, vbuf, fence);
647-
virtio_gpu_notify(vgdev);
648646
}
649647

650648
static void virtio_gpu_cmd_get_display_info_cb(struct virtio_gpu_device *vgdev,
@@ -1011,7 +1009,6 @@ virtio_gpu_cmd_resource_create_3d(struct virtio_gpu_device *vgdev,
10111009
cmd_p->flags = cpu_to_le32(params->flags);
10121010

10131011
virtio_gpu_queue_fenced_ctrl_buffer(vgdev, vbuf, fence);
1014-
virtio_gpu_notify(vgdev);
10151012

10161013
bo->created = true;
10171014
}

0 commit comments

Comments
 (0)