aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChangbin Du <changbin.du@intel.com>2017-04-05 22:55:55 -0400
committerZhenyu Wang <zhenyuw@linux.intel.com>2017-04-12 01:57:51 -0400
commit43c29e1f449d596ed92f12cc19e41d9731ec3312 (patch)
tree2ba2342b21706c8c9d80ffa2a1d6d3b95027d85e
parent80901ca879083ecb5fd08a8d3413220bec9612ac (diff)
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: Changbin Du <changbin.du@intel.com> Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
-rw-r--r--drivers/gpu/drm/i915/gvt/cmd_parser.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/drivers/gpu/drm/i915/gvt/cmd_parser.c b/drivers/gpu/drm/i915/gvt/cmd_parser.c
index 94f2e701e4d4..1abd153bec28 100644
--- a/drivers/gpu/drm/i915/gvt/cmd_parser.c
+++ b/drivers/gpu/drm/i915/gvt/cmd_parser.c
@@ -616,9 +616,6 @@ static inline u32 get_opcode(u32 cmd, int ring_id)
616{ 616{
617 struct decode_info *d_info; 617 struct decode_info *d_info;
618 618
619 if (ring_id >= I915_NUM_ENGINES)
620 return INVALID_OP;
621
622 d_info = ring_decode_info[ring_id][CMD_TYPE(cmd)]; 619 d_info = ring_decode_info[ring_id][CMD_TYPE(cmd)];
623 if (d_info == NULL) 620 if (d_info == NULL)
624 return INVALID_OP; 621 return INVALID_OP;
@@ -661,9 +658,6 @@ static inline void print_opcode(u32 cmd, int ring_id)
661 struct decode_info *d_info; 658 struct decode_info *d_info;
662 int i; 659 int i;
663 660
664 if (ring_id >= I915_NUM_ENGINES)
665 return;
666
667 d_info = ring_decode_info[ring_id][CMD_TYPE(cmd)]; 661 d_info = ring_decode_info[ring_id][CMD_TYPE(cmd)];
668 if (d_info == NULL) 662 if (d_info == NULL)
669 return; 663 return;