aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/gvt/cmd_parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/i915/gvt/cmd_parser.c')
-rw-r--r--drivers/gpu/drm/i915/gvt/cmd_parser.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/gvt/cmd_parser.c b/drivers/gpu/drm/i915/gvt/cmd_parser.c
index 0dd88fe2e39a..4ba503ef5d2c 100644
--- a/drivers/gpu/drm/i915/gvt/cmd_parser.c
+++ b/drivers/gpu/drm/i915/gvt/cmd_parser.c
@@ -1817,6 +1817,8 @@ static int cmd_handler_mi_batch_buffer_start(struct parser_exec_state *s)
1817 return ret; 1817 return ret;
1818} 1818}
1819 1819
1820static int mi_noop_index;
1821
1820static struct cmd_info cmd_info[] = { 1822static struct cmd_info cmd_info[] = {
1821 {"MI_NOOP", OP_MI_NOOP, F_LEN_CONST, R_ALL, D_ALL, 0, 1, NULL}, 1823 {"MI_NOOP", OP_MI_NOOP, F_LEN_CONST, R_ALL, D_ALL, 0, 1, NULL},
1822 1824
@@ -2502,7 +2504,12 @@ static int cmd_parser_exec(struct parser_exec_state *s)
2502 2504
2503 cmd = cmd_val(s, 0); 2505 cmd = cmd_val(s, 0);
2504 2506
2505 info = get_cmd_info(s->vgpu->gvt, cmd, s->ring_id); 2507 /* fastpath for MI_NOOP */
2508 if (cmd == MI_NOOP)
2509 info = &cmd_info[mi_noop_index];
2510 else
2511 info = get_cmd_info(s->vgpu->gvt, cmd, s->ring_id);
2512
2506 if (info == NULL) { 2513 if (info == NULL) {
2507 gvt_vgpu_err("unknown cmd 0x%x, opcode=0x%x, addr_type=%s, ring %d, workload=%p\n", 2514 gvt_vgpu_err("unknown cmd 0x%x, opcode=0x%x, addr_type=%s, ring %d, workload=%p\n",
2508 cmd, get_opcode(cmd, s->ring_id), 2515 cmd, get_opcode(cmd, s->ring_id),
@@ -2904,6 +2911,8 @@ static int init_cmd_table(struct intel_gvt *gvt)
2904 info->name); 2911 info->name);
2905 return -EEXIST; 2912 return -EEXIST;
2906 } 2913 }
2914 if (cmd_info[i].opcode == OP_MI_NOOP)
2915 mi_noop_index = i;
2907 2916
2908 INIT_HLIST_NODE(&e->hlist); 2917 INIT_HLIST_NODE(&e->hlist);
2909 add_cmd_entry(gvt, e); 2918 add_cmd_entry(gvt, e);