drm/i915: Switch context id allocation directly to xarray
IDR internally uses xarray so we can use it directly which simplifies our code by removing the need to do external locking. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Link: https://patchwork.freedesktop.org/patch/msgid/20191224095920.2386297-1-chris@chris-wilson.co.uk
This commit is contained in:
committed by
Chris Wilson
parent
30084b143d
commit
c100777cc0
@ -77,12 +77,13 @@ live_context(struct drm_i915_private *i915, struct file *file)
|
||||
{
|
||||
struct i915_gem_context *ctx;
|
||||
int err;
|
||||
u32 id;
|
||||
|
||||
ctx = i915_gem_create_context(i915, 0);
|
||||
if (IS_ERR(ctx))
|
||||
return ctx;
|
||||
|
||||
err = gem_context_register(ctx, to_drm_file(file)->driver_priv);
|
||||
err = gem_context_register(ctx, to_drm_file(file)->driver_priv, &id);
|
||||
if (err < 0)
|
||||
goto err_ctx;
|
||||
|
||||
|
Reference in New Issue
Block a user