Lines Matching refs:cmd
160 struct virtio_gpu_ctrl_command *cmd, in virtio_gpu_ctrl_response() argument
166 if (cmd->cmd_hdr.flags & VIRTIO_GPU_FLAG_FENCE) { in virtio_gpu_ctrl_response()
168 resp->fence_id = cmd->cmd_hdr.fence_id; in virtio_gpu_ctrl_response()
169 resp->ctx_id = cmd->cmd_hdr.ctx_id; in virtio_gpu_ctrl_response()
172 s = iov_from_buf(cmd->elem.in_sg, cmd->elem.in_num, 0, resp, resp_len); in virtio_gpu_ctrl_response()
178 virtqueue_push(cmd->vq, &cmd->elem, s); in virtio_gpu_ctrl_response()
179 virtio_notify(VIRTIO_DEVICE(g), cmd->vq); in virtio_gpu_ctrl_response()
180 cmd->finished = true; in virtio_gpu_ctrl_response()
184 struct virtio_gpu_ctrl_command *cmd, in virtio_gpu_ctrl_response_nodata() argument
191 virtio_gpu_ctrl_response(g, cmd, &resp, sizeof(resp)); in virtio_gpu_ctrl_response_nodata()
195 struct virtio_gpu_ctrl_command *cmd) in virtio_gpu_get_display_info() argument
203 virtio_gpu_ctrl_response(g, cmd, &display_info.hdr, in virtio_gpu_get_display_info()
208 struct virtio_gpu_ctrl_command *cmd) in virtio_gpu_get_edid() argument
218 cmd->error = VIRTIO_GPU_RESP_ERR_INVALID_PARAMETER; in virtio_gpu_get_edid()
226 virtio_gpu_ctrl_response(g, cmd, &edid.hdr, sizeof(edid)); in virtio_gpu_get_edid()
242 struct virtio_gpu_ctrl_command *cmd) in virtio_gpu_resource_create_2d() argument
256 cmd->error = VIRTIO_GPU_RESP_ERR_INVALID_RESOURCE_ID; in virtio_gpu_resource_create_2d()
264 cmd->error = VIRTIO_GPU_RESP_ERR_INVALID_RESOURCE_ID; in virtio_gpu_resource_create_2d()
281 cmd->error = VIRTIO_GPU_RESP_ERR_INVALID_PARAMETER; in virtio_gpu_resource_create_2d()
314 cmd->error = VIRTIO_GPU_RESP_ERR_OUT_OF_MEMORY; in virtio_gpu_resource_create_2d()
323 struct virtio_gpu_ctrl_command *cmd) in virtio_gpu_resource_create_blob() argument
336 cmd->error = VIRTIO_GPU_RESP_ERR_INVALID_RESOURCE_ID; in virtio_gpu_resource_create_blob()
344 cmd->error = VIRTIO_GPU_RESP_ERR_INVALID_PARAMETER; in virtio_gpu_resource_create_blob()
351 cmd->error = VIRTIO_GPU_RESP_ERR_INVALID_RESOURCE_ID; in virtio_gpu_resource_create_blob()
360 cmd, &res->addrs, &res->iov, in virtio_gpu_resource_create_blob()
363 cmd->error = VIRTIO_GPU_RESP_ERR_UNSPEC; in virtio_gpu_resource_create_blob()
415 struct virtio_gpu_ctrl_command *cmd) in virtio_gpu_resource_unref() argument
428 cmd->error = VIRTIO_GPU_RESP_ERR_INVALID_RESOURCE_ID; in virtio_gpu_resource_unref()
439 struct virtio_gpu_ctrl_command *cmd) in virtio_gpu_transfer_to_host_2d() argument
453 __func__, &cmd->error); in virtio_gpu_transfer_to_host_2d()
468 cmd->error = VIRTIO_GPU_RESP_ERR_INVALID_PARAMETER; in virtio_gpu_transfer_to_host_2d()
496 struct virtio_gpu_ctrl_command *cmd) in virtio_gpu_resource_flush() argument
512 __func__, &cmd->error); in virtio_gpu_resource_flush()
543 cmd->error = VIRTIO_GPU_RESP_ERR_INVALID_PARAMETER; in virtio_gpu_resource_flush()
559 cmd->error = VIRTIO_GPU_RESP_ERR_INVALID_PARAMETER; in virtio_gpu_resource_flush()
693 struct virtio_gpu_ctrl_command *cmd) in virtio_gpu_set_scanout() argument
707 cmd->error = VIRTIO_GPU_RESP_ERR_INVALID_SCANOUT_ID; in virtio_gpu_set_scanout()
717 __func__, &cmd->error); in virtio_gpu_set_scanout()
730 &fb, res, &ss.r, &cmd->error); in virtio_gpu_set_scanout()
734 struct virtio_gpu_ctrl_command *cmd) in virtio_gpu_set_scanout_blob() argument
750 cmd->error = VIRTIO_GPU_RESP_ERR_INVALID_SCANOUT_ID; in virtio_gpu_set_scanout_blob()
760 __func__, &cmd->error); in virtio_gpu_set_scanout_blob()
770 cmd->error = VIRTIO_GPU_RESP_ERR_INVALID_PARAMETER; in virtio_gpu_set_scanout_blob()
787 cmd->error = VIRTIO_GPU_RESP_ERR_INVALID_PARAMETER; in virtio_gpu_set_scanout_blob()
792 &fb, res, &ss.r, &cmd->error); in virtio_gpu_set_scanout_blob()
797 struct virtio_gpu_ctrl_command *cmd, in virtio_gpu_create_mapping_iov() argument
814 s = iov_to_buf(cmd->elem.out_sg, cmd->elem.out_num, in virtio_gpu_create_mapping_iov()
905 struct virtio_gpu_ctrl_command *cmd) in virtio_gpu_resource_attach_backing() argument
919 cmd->error = VIRTIO_GPU_RESP_ERR_INVALID_RESOURCE_ID; in virtio_gpu_resource_attach_backing()
924 cmd->error = VIRTIO_GPU_RESP_ERR_UNSPEC; in virtio_gpu_resource_attach_backing()
928 ret = virtio_gpu_create_mapping_iov(g, ab.nr_entries, sizeof(ab), cmd, in virtio_gpu_resource_attach_backing()
931 cmd->error = VIRTIO_GPU_RESP_ERR_UNSPEC; in virtio_gpu_resource_attach_backing()
938 struct virtio_gpu_ctrl_command *cmd) in virtio_gpu_resource_detach_backing() argument
948 __func__, &cmd->error); in virtio_gpu_resource_detach_backing()
956 struct virtio_gpu_ctrl_command *cmd) in virtio_gpu_simple_process_cmd() argument
958 VIRTIO_GPU_FILL_CMD(cmd->cmd_hdr); in virtio_gpu_simple_process_cmd()
959 virtio_gpu_ctrl_hdr_bswap(&cmd->cmd_hdr); in virtio_gpu_simple_process_cmd()
961 switch (cmd->cmd_hdr.type) { in virtio_gpu_simple_process_cmd()
963 virtio_gpu_get_display_info(g, cmd); in virtio_gpu_simple_process_cmd()
966 virtio_gpu_get_edid(g, cmd); in virtio_gpu_simple_process_cmd()
969 virtio_gpu_resource_create_2d(g, cmd); in virtio_gpu_simple_process_cmd()
973 cmd->error = VIRTIO_GPU_RESP_ERR_INVALID_PARAMETER; in virtio_gpu_simple_process_cmd()
976 virtio_gpu_resource_create_blob(g, cmd); in virtio_gpu_simple_process_cmd()
979 virtio_gpu_resource_unref(g, cmd); in virtio_gpu_simple_process_cmd()
982 virtio_gpu_resource_flush(g, cmd); in virtio_gpu_simple_process_cmd()
985 virtio_gpu_transfer_to_host_2d(g, cmd); in virtio_gpu_simple_process_cmd()
988 virtio_gpu_set_scanout(g, cmd); in virtio_gpu_simple_process_cmd()
992 cmd->error = VIRTIO_GPU_RESP_ERR_INVALID_PARAMETER; in virtio_gpu_simple_process_cmd()
995 virtio_gpu_set_scanout_blob(g, cmd); in virtio_gpu_simple_process_cmd()
998 virtio_gpu_resource_attach_backing(g, cmd); in virtio_gpu_simple_process_cmd()
1001 virtio_gpu_resource_detach_backing(g, cmd); in virtio_gpu_simple_process_cmd()
1004 cmd->error = VIRTIO_GPU_RESP_ERR_UNSPEC; in virtio_gpu_simple_process_cmd()
1007 if (!cmd->finished) { in virtio_gpu_simple_process_cmd()
1009 virtio_gpu_ctrl_response_nodata(g, cmd, cmd->error ? cmd->error : in virtio_gpu_simple_process_cmd()
1029 struct virtio_gpu_ctrl_command *cmd; in virtio_gpu_process_cmdq() local
1037 cmd = QTAILQ_FIRST(&g->cmdq); in virtio_gpu_process_cmdq()
1044 vgc->process_cmd(g, cmd); in virtio_gpu_process_cmdq()
1046 QTAILQ_REMOVE(&g->cmdq, cmd, next); in virtio_gpu_process_cmdq()
1051 if (!cmd->finished) { in virtio_gpu_process_cmdq()
1052 QTAILQ_INSERT_TAIL(&g->fenceq, cmd, next); in virtio_gpu_process_cmdq()
1061 g_free(cmd); in virtio_gpu_process_cmdq()
1069 struct virtio_gpu_ctrl_command *cmd, *tmp; in virtio_gpu_process_fenceq() local
1071 QTAILQ_FOREACH_SAFE(cmd, &g->fenceq, next, tmp) { in virtio_gpu_process_fenceq()
1072 trace_virtio_gpu_fence_resp(cmd->cmd_hdr.fence_id); in virtio_gpu_process_fenceq()
1073 virtio_gpu_ctrl_response_nodata(g, cmd, VIRTIO_GPU_RESP_OK_NODATA); in virtio_gpu_process_fenceq()
1074 QTAILQ_REMOVE(&g->fenceq, cmd, next); in virtio_gpu_process_fenceq()
1075 g_free(cmd); in virtio_gpu_process_fenceq()
1094 struct virtio_gpu_ctrl_command *cmd; in virtio_gpu_handle_ctrl() local
1100 cmd = virtqueue_pop(vq, sizeof(struct virtio_gpu_ctrl_command)); in virtio_gpu_handle_ctrl()
1101 while (cmd) { in virtio_gpu_handle_ctrl()
1102 cmd->vq = vq; in virtio_gpu_handle_ctrl()
1103 cmd->error = 0; in virtio_gpu_handle_ctrl()
1104 cmd->finished = false; in virtio_gpu_handle_ctrl()
1105 QTAILQ_INSERT_TAIL(&g->cmdq, cmd, next); in virtio_gpu_handle_ctrl()
1106 cmd = virtqueue_pop(vq, sizeof(struct virtio_gpu_ctrl_command)); in virtio_gpu_handle_ctrl()
1551 struct virtio_gpu_ctrl_command *cmd; in virtio_gpu_reset() local
1564 cmd = QTAILQ_FIRST(&g->cmdq); in virtio_gpu_reset()
1565 QTAILQ_REMOVE(&g->cmdq, cmd, next); in virtio_gpu_reset()
1566 g_free(cmd); in virtio_gpu_reset()
1570 cmd = QTAILQ_FIRST(&g->fenceq); in virtio_gpu_reset()
1571 QTAILQ_REMOVE(&g->fenceq, cmd, next); in virtio_gpu_reset()
1573 g_free(cmd); in virtio_gpu_reset()