Skip to content

Commit c58949f

Browse files
committed
drm/i915: Do not re-calculate num_rings locally
Since bb8f0f5 ("drm/i915: Split intel_engine allocation and initialisation") intel_info->num_rings is set early in the load sequence and so available to be used direclty in the 2nd load phase. Signed-off-by: Tvrtko Ursulin <[email protected]> Reviewed-by: Chris Wilson <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 33def1f commit c58949f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/gpu/drm/i915/intel_ringbuffer.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2140,7 +2140,7 @@ static void intel_ring_default_vfuncs(struct drm_i915_private *dev_priv,
21402140

21412141
engine->emit_breadcrumb = gen6_sema_emit_breadcrumb;
21422142

2143-
num_rings = hweight32(INTEL_INFO(dev_priv)->ring_mask) - 1;
2143+
num_rings = INTEL_INFO(dev_priv)->num_rings - 1;
21442144
if (INTEL_GEN(dev_priv) >= 8) {
21452145
engine->emit_breadcrumb_sz += num_rings * 6;
21462146
} else {
@@ -2184,8 +2184,7 @@ int intel_init_render_ring_buffer(struct intel_engine_cs *engine)
21842184

21852185
engine->semaphore.signal = gen8_rcs_signal;
21862186

2187-
num_rings =
2188-
hweight32(INTEL_INFO(dev_priv)->ring_mask) - 1;
2187+
num_rings = INTEL_INFO(dev_priv)->num_rings - 1;
21892188
engine->emit_breadcrumb_sz += num_rings * 8;
21902189
}
21912190
} else if (INTEL_GEN(dev_priv) >= 6) {

0 commit comments

Comments
 (0)