@@ -944,7 +944,7 @@ void virtio_gpu_cmd_context_attach_resource(struct virtio_gpu_device *vgdev,
uint32_t ctx_id,
struct virtio_gpu_object_array *objs)
{
- struct virtio_gpu_object *bo = gem_to_virtio_gpu_obj(objs->objs[0]);
+ uint32_t handle = virtio_gpu_get_handle(objs->objs[0]);
struct virtio_gpu_ctx_resource *cmd_p;
struct virtio_gpu_vbuffer *vbuf;
@@ -954,7 +954,7 @@ void virtio_gpu_cmd_context_attach_resource(struct virtio_gpu_device *vgdev,
cmd_p->hdr.type = cpu_to_le32(VIRTIO_GPU_CMD_CTX_ATTACH_RESOURCE);
cmd_p->hdr.ctx_id = cpu_to_le32(ctx_id);
- cmd_p->resource_id = cpu_to_le32(bo->hw_res_handle);
+ cmd_p->resource_id = cpu_to_le32(handle);
virtio_gpu_queue_ctrl_buffer(vgdev, vbuf);
}
@@ -962,7 +962,7 @@ void virtio_gpu_cmd_context_detach_resource(struct virtio_gpu_device *vgdev,
uint32_t ctx_id,
struct virtio_gpu_object_array *objs)
{
- struct virtio_gpu_object *bo = gem_to_virtio_gpu_obj(objs->objs[0]);
+ uint32_t handle = virtio_gpu_get_handle(objs->objs[0]);
struct virtio_gpu_ctx_resource *cmd_p;
struct virtio_gpu_vbuffer *vbuf;
@@ -972,7 +972,7 @@ void virtio_gpu_cmd_context_detach_resource(struct virtio_gpu_device *vgdev,
cmd_p->hdr.type = cpu_to_le32(VIRTIO_GPU_CMD_CTX_DETACH_RESOURCE);
cmd_p->hdr.ctx_id = cpu_to_le32(ctx_id);
- cmd_p->resource_id = cpu_to_le32(bo->hw_res_handle);
+ cmd_p->resource_id = cpu_to_le32(handle);
virtio_gpu_queue_ctrl_buffer(vgdev, vbuf);
}
These hypercalls are reusable by both shmem and (planned) vram based virtio_gpu objects. Signed-off-by: Gurchetan Singh <gurchetansingh@chromium.org> --- drivers/gpu/drm/virtio/virtgpu_vq.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)