All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jordan Justen <jordan.l.justen@intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [CI 2/4] drm/i915: Create/destroy VM (ppGTT) for use with contexts
Date: Sat, 30 Mar 2019 02:46:49 -0700	[thread overview]
Message-ID: <155393920894.9385.1744649129101279985@jljusten-skl> (raw)
In-Reply-To: <20190322092325.5883-2-chris@chris-wilson.co.uk>

On 2019-03-22 02:23:23, Chris Wilson wrote:
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c
> index 00dec72f6875..d0a56c8d0bb9 100644
> --- a/drivers/gpu/drm/i915/i915_gem_context.c
> +++ b/drivers/gpu/drm/i915/i915_gem_context.c
<snip>
> +
> +static int set_ppgtt(struct i915_gem_context *ctx,
> +                    struct drm_i915_gem_context_param *args)
> +{
> +       struct drm_i915_file_private *file_priv = ctx->file_priv;
> +       struct i915_hw_ppgtt *ppgtt, *old;
> +       int err;
> +
> +       if (args->size)
> +               return -EINVAL;
> +
> +       if (!ctx->ppgtt)
> +               return -ENODEV;
> +
> +       if (upper_32_bits(args->value))
> +               return -ENOENT;
> +
> +       err = mutex_lock_interruptible(&file_priv->vm_idr_lock);
> +       if (err)
> +               return err;
> +
> +       ppgtt = idr_find(&file_priv->vm_idr, args->value);

I tried using I915_CONTEXT_CREATE_EXT_SETPARAM with
I915_CONTEXT_PARAM_VM, but this line was segfaulting (file_priv was
NULL).

I think it was because in i915_gem_context_create_ioctl, we process
the I915_CONTEXT_CREATE_FLAGS_USE_EXTENSIONS flag before we call
gem_context_register. (gem_context_register sets ctx->file_priv) If I
move the gem_context_register call before the
I915_CONTEXT_CREATE_FLAGS_USE_EXTENSIONS handling, the segfault goes
away.

-Jordan
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2019-03-30  9:46 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-22  9:23 [CI 1/4] drm/i915: Introduce the i915_user_extension_method Chris Wilson
2019-03-22  9:23 ` [CI 2/4] drm/i915: Create/destroy VM (ppGTT) for use with contexts Chris Wilson
2019-03-30  9:46   ` Jordan Justen [this message]
2019-03-30  9:53     ` Chris Wilson
2019-03-22  9:23 ` [CI 3/4] drm/i915: Extend CONTEXT_CREATE to set parameters upon construction Chris Wilson
2019-03-22  9:23 ` [CI 4/4] drm/i915: Allow contexts to share a single timeline across all engines Chris Wilson
2019-03-22 10:02 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [CI,1/4] drm/i915: Introduce the i915_user_extension_method Patchwork
2019-03-22 10:04 ` ✗ Fi.CI.SPARSE: " Patchwork
2019-03-22 10:27 ` ✗ Fi.CI.BAT: failure " Patchwork
2019-03-22 11:34 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [CI,1/4] drm/i915: Introduce the i915_user_extension_method (rev2) Patchwork
2019-03-22 11:37 ` ✗ Fi.CI.SPARSE: " Patchwork
2019-03-22 11:54 ` ✗ Fi.CI.BAT: failure " Patchwork
2019-03-22 12:28 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [CI,1/4] drm/i915: Introduce the i915_user_extension_method (rev3) Patchwork
2019-03-22 12:31 ` ✗ Fi.CI.SPARSE: " Patchwork
2019-03-22 13:10 ` ✗ Fi.CI.BAT: failure " Patchwork
2019-03-22 13:12   ` Chris Wilson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=155393920894.9385.1744649129101279985@jljusten-skl \
    --to=jordan.l.justen@intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.