Skip to content

Commit 1c71bc5

Browse files
llandwerlin-intelickle
authored andcommitted
drm/i915/perf: simplify configure all context function
We don't need any special treatment on error so just return as soon as possible. Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Tvrtko Ursulin <[email protected]> Signed-off-by: Chris Wilson <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent a64f888 commit 1c71bc5

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

drivers/gpu/drm/i915/i915_perf.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1819,7 +1819,7 @@ static int gen8_configure_all_contexts(struct drm_i915_private *dev_priv,
18191819
/* Switch away from any user context. */
18201820
ret = gen8_switch_to_updated_kernel_context(dev_priv, oa_config);
18211821
if (ret)
1822-
goto out;
1822+
return ret;
18231823

18241824
/*
18251825
* The OA register config is setup through the context image. This image
@@ -1838,7 +1838,7 @@ static int gen8_configure_all_contexts(struct drm_i915_private *dev_priv,
18381838
wait_flags,
18391839
MAX_SCHEDULE_TIMEOUT);
18401840
if (ret)
1841-
goto out;
1841+
return ret;
18421842

18431843
/* Update all contexts now that we've stalled the submission. */
18441844
list_for_each_entry(ctx, &dev_priv->contexts.list, link) {
@@ -1850,10 +1850,8 @@ static int gen8_configure_all_contexts(struct drm_i915_private *dev_priv,
18501850
continue;
18511851

18521852
regs = i915_gem_object_pin_map(ce->state->obj, I915_MAP_WB);
1853-
if (IS_ERR(regs)) {
1854-
ret = PTR_ERR(regs);
1855-
goto out;
1856-
}
1853+
if (IS_ERR(regs))
1854+
return PTR_ERR(regs);
18571855

18581856
ce->state->obj->mm.dirty = true;
18591857
regs += LRC_STATE_PN * PAGE_SIZE / sizeof(*regs);
@@ -1863,7 +1861,6 @@ static int gen8_configure_all_contexts(struct drm_i915_private *dev_priv,
18631861
i915_gem_object_unpin_map(ce->state->obj);
18641862
}
18651863

1866-
out:
18671864
return ret;
18681865
}
18691866

0 commit comments

Comments
 (0)