All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v2 06/11] drm/i915: Move pinning of dev_priv->kernel_context into its creator
Date: Mon, 23 May 2016 13:23:20 +0100	[thread overview]
Message-ID: <5742F638.9070303@linux.intel.com> (raw)
In-Reply-To: <20160523121601.GI28975@nuc-i3427.alporthouse.com>



On 23/05/16 13:16, Chris Wilson wrote:
> On Mon, May 23, 2016 at 01:09:02PM +0100, Tvrtko Ursulin wrote:
>>> @@ -426,6 +401,26 @@ int i915_gem_context_init(struct drm_device *dev)
>>>   		return PTR_ERR(ctx);
>>>   	}
>>>
>>> +	if (ctx->legacy_hw_ctx.rcs_state) {
>>> +		int ret;
>>> +
>>> +		/* We may need to do things with the shrinker which
>>> +		 * require us to immediately switch back to the default
>>> +		 * context. This can cause a problem as pinning the
>>> +		 * default context also requires GTT space which may not
>>> +		 * be available. To avoid this we always pin the default
>>> +		 * context.
>>> +		 */
>>> +		ret = i915_gem_obj_ggtt_pin(ctx->legacy_hw_ctx.rcs_state,
>>> +					    get_context_alignment(dev_priv), 0);
>>> +		if (ret) {
>>> +			DRM_ERROR("Failed to pinned default global context (error %d)\n",
>>> +				  ret);
>>
>> idr_remove here as well? Maybe we should split out the idr context
>> API from the GEM context to make it explicit - create context,
>> export it to userspace and back?
>
> No, this one is not in an idr as file_priv is NULL for the kernel
> context.

Oh right, you can claim in the commit you fixed a bug as well then! :))

-	const bool is_global_default_ctx = file_priv == NULL;
...
-	if (is_global_default_ctx && ctx->legacy_hw_ctx.rcs_state) {
...
-			goto err_destroy;
...
-	idr_remove(&file_priv->context_idr, ctx->user_handle);

Regards,

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

  reply	other threads:[~2016-05-23 12:23 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-23 11:34 Context churn Chris Wilson
2016-05-23 11:34 ` [PATCH v2 01/11] drm/i915: Rename struct intel_context Chris Wilson
2016-05-23 11:34 ` [PATCH v2 02/11] drm/i915: Apply lockdep annotations to i915_gem_context.c Chris Wilson
2016-05-23 11:34 ` [PATCH v2 03/11] drm/i915: Rename and inline i915_gem_context_get() Chris Wilson
2016-05-23 11:34 ` [PATCH v2 04/11] drm/i915: Rename i915_gem_context_reference/unreference() Chris Wilson
2016-05-24 11:21   ` Chris Wilson
2016-05-23 11:34 ` [PATCH v2 05/11] drm/i915: Name the inner most per-engine intel_context struct Chris Wilson
2016-05-23 11:34 ` [PATCH v2 06/11] drm/i915: Move pinning of dev_priv->kernel_context into its creator Chris Wilson
2016-05-23 12:09   ` Tvrtko Ursulin
2016-05-23 12:16     ` Chris Wilson
2016-05-23 12:23       ` Tvrtko Ursulin [this message]
2016-05-25  9:25   ` Joonas Lahtinen
2016-05-23 11:34 ` [PATCH v2 07/11] drm/i915: Show i915_gem_context owner in debugfs Chris Wilson
2016-05-23 12:18   ` Tvrtko Ursulin
2016-05-25  9:18   ` Joonas Lahtinen
2016-05-23 11:34 ` [PATCH v2 08/11] drm/i915: Put the kernel_context in drm_i915_private next to its friends Chris Wilson
2016-05-23 11:34 ` [PATCH v2 09/11] drm/i915: Merge legacy+execlists context structs Chris Wilson
2016-05-23 11:34 ` [PATCH v2 10/11] drm/i915: Rearrange i915_gem_context Chris Wilson
2016-05-25  9:15   ` Joonas Lahtinen
2016-05-23 11:34 ` [PATCH v2 11/11] drm/i915: Show context objects in debugfs/i915_gem_objects Chris Wilson
2016-05-23 12:31   ` Tvrtko Ursulin
2016-05-23 12:40     ` Chris Wilson
2016-05-23 13:01     ` [PATCH v3] drm/i915/debugfs: Show context objects in i915_gem_objects Chris Wilson
2016-05-23 13:42       ` kbuild test robot
2016-05-23 13:50       ` kbuild test robot
2016-05-24 11:15       ` Tvrtko Ursulin
2016-05-25  9:55       ` Joonas Lahtinen
2016-05-25 10:00         ` Chris Wilson
2016-05-25  9:33   ` [PATCH v2 11/11] drm/i915: Show context objects in debugfs/i915_gem_objects Joonas Lahtinen
2016-05-23 12:01 ` ✓ Ro.CI.BAT: success for series starting with [v2,01/11] drm/i915: Rename struct intel_context Patchwork
2016-05-23 14:30 ` ✗ Ro.CI.BAT: failure for series starting with [v2,01/11] drm/i915: Rename struct intel_context (rev2) Patchwork
2016-05-24 13:53 ` [CI 01/10] drm/i915: Rename struct intel_context Chris Wilson
2016-05-24 13:53   ` [CI 02/10] drm/i915: Apply lockdep annotations to i915_gem_context.c Chris Wilson
2016-05-24 13:53   ` [CI 03/10] drm/i915: Rename and inline i915_gem_context_get() Chris Wilson
2016-05-24 13:53   ` [CI 04/10] drm/i915: Name the inner most per-engine intel_context struct Chris Wilson
2016-05-24 13:53   ` [CI 05/10] drm/i915: Move pinning of dev_priv->kernel_context into its creator Chris Wilson
2016-05-24 13:53   ` [CI 06/10] drm/i915: Show i915_gem_context owner in debugfs Chris Wilson
2016-05-24 13:53   ` [CI 07/10] drm/i915: Put the kernel_context in drm_i915_private next to its friends Chris Wilson
2016-05-24 13:53   ` [CI 08/10] drm/i915: Merge legacy+execlists context structs Chris Wilson
2016-05-24 13:53   ` [CI 09/10] drm/i915: Rearrange i915_gem_context Chris Wilson
2016-05-24 13:53   ` [CI 10/10] drm/i915/debugfs: Show context objects in i915_gem_objects Chris Wilson
2016-05-24 14:19 ` ✗ Ro.CI.BAT: warning for series starting with [v2,01/11] drm/i915: Rename struct intel_context (rev10) Patchwork

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=5742F638.9070303@linux.intel.com \
    --to=tvrtko.ursulin@linux.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.