Commit 43c29e1f authored by Changbin Du's avatar Changbin Du Committed by Zhenyu Wang

drm/i915/gvt: remove redundant ring id check which cause significant CPU misprediction

From perf data, found a significant overhead at ring id check in the
function get_opcode. This inline function is frequently used.

Since Intel static predictor will predict the branch to fall through
so the prediction most fail. This is wasting CPU pipeline resource.
We do not need check the engine id everywhere, it should be reliable.
Signed-off-by: default avatarChangbin Du <changbin.du@intel.com>
Signed-off-by: default avatarZhenyu Wang <zhenyuw@linux.intel.com>
parent 80901ca8
...@@ -616,9 +616,6 @@ static inline u32 get_opcode(u32 cmd, int ring_id) ...@@ -616,9 +616,6 @@ static inline u32 get_opcode(u32 cmd, int ring_id)
{ {
struct decode_info *d_info; struct decode_info *d_info;
if (ring_id >= I915_NUM_ENGINES)
return INVALID_OP;
d_info = ring_decode_info[ring_id][CMD_TYPE(cmd)]; d_info = ring_decode_info[ring_id][CMD_TYPE(cmd)];
if (d_info == NULL) if (d_info == NULL)
return INVALID_OP; return INVALID_OP;
...@@ -661,9 +658,6 @@ static inline void print_opcode(u32 cmd, int ring_id) ...@@ -661,9 +658,6 @@ static inline void print_opcode(u32 cmd, int ring_id)
struct decode_info *d_info; struct decode_info *d_info;
int i; int i;
if (ring_id >= I915_NUM_ENGINES)
return;
d_info = ring_decode_info[ring_id][CMD_TYPE(cmd)]; d_info = ring_decode_info[ring_id][CMD_TYPE(cmd)];
if (d_info == NULL) if (d_info == NULL)
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment