From: Ian Romanick <idr@freedesktop.org>
To: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 09/13] drm/i915: add reset_state for hw_contexts
Date: Tue, 26 Feb 2013 17:47:12 -0800 [thread overview]
Message-ID: <512D65A0.2040305@freedesktop.org> (raw)
In-Reply-To: <1361876716-8625-10-git-send-email-mika.kuoppala@intel.com>
On 02/26/2013 03:05 AM, Mika Kuoppala wrote:
> For arb-robustness, every context needs to have it's own
> reset state tracking. Default context will be handled in a identical
> way as the no-context case in further down in the patch set.
> For no-context case, the reset state will be stored in
> the file_priv part.
>
> v2: handle default context inside get_reset_state
This isn't the interface we want. I already sent you the patches for
Mesa, and you seem to have completely ignored them. Moreover, this
interface provides no mechanism to query for its existence (other than
relying on the kernel version), and no method to deprecate it.
Based on e-mail discussions, I think danvet agrees with me here.
Putting guilty / innocent counting in kernel puts policy decisions in
the kernel that belong with the user space API that implements them.
Putting these choices in the kernel significantly decreases how "future
proof" the interface is. Since any kernel/user interface has to be kept
forever, this is just asking for maintenance trouble down the road.
Also, it's difficult (for me) to tell from the rest of the series
whether or not a context that was not affected by a reset (had no
batches in flight at all) can still observe that a reset occurred.
From the GL point of view, once a context has observed a reset, it's
garbage. Knowing that it saw 1 reset or 43,000,000 resets is the same.
Since it's a count, GL will have to query the values before any
rendering happens or it won't know whether the value 6 means there was a
reset or not.
The right interface is a set of flags indicating the state the context
was in when it observed a reset. As this patch series stands, Mesa will
not use this interface.
> Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
> ---
> drivers/gpu/drm/i915/i915_drv.h | 4 ++++
> drivers/gpu/drm/i915/i915_gem_context.c | 34 +++++++++++++++++++++++++++++++
> 2 files changed, 38 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 1c67fb2..2cc5817 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -1684,6 +1684,10 @@ int i915_switch_context(struct intel_ring_buffer *ring,
> struct drm_file *file, int to_id,
> struct i915_hw_context **ctx);
> void i915_gem_context_free(struct kref *ctx_ref);
> +int i915_gem_context_get_reset_state(struct intel_ring_buffer *ring,
> + struct drm_file *file,
> + u32 id,
> + struct ctx_reset_state **rs);
> int i915_gem_context_create_ioctl(struct drm_device *dev, void *data,
> struct drm_file *file);
> int i915_gem_context_destroy_ioctl(struct drm_device *dev, void *data,
> diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c
> index cba54fb..1b14a06 100644
> --- a/drivers/gpu/drm/i915/i915_gem_context.c
> +++ b/drivers/gpu/drm/i915/i915_gem_context.c
> @@ -304,6 +304,40 @@ static int context_idr_cleanup(int id, void *p, void *data)
> return 0;
> }
>
> +int i915_gem_context_get_reset_state(struct intel_ring_buffer *ring,
> + struct drm_file *file,
> + u32 id,
> + struct ctx_reset_state **rs)
> +{
> + struct drm_i915_private *dev_priv = ring->dev->dev_private;
> + struct drm_i915_file_private *file_priv = file->driver_priv;
> + struct i915_hw_context *to;
> +
> + if (dev_priv->hw_contexts_disabled)
> + return -ENOENT;
> +
> + if (ring->id != RCS)
> + return -EINVAL;
> +
> + if (rs == NULL)
> + return -EINVAL;
> +
> + if (file == NULL)
> + return -EINVAL;
> +
> + if (id == DEFAULT_CONTEXT_ID) {
> + *rs = &file_priv->reset_state;
> + } else {
> + to = i915_gem_context_get(file->driver_priv, id);
> + if (to == NULL)
> + return -ENOENT;
> +
> + *rs = &to->reset_state;
> + }
> +
> + return 0;
> +}
> +
> void i915_gem_context_close(struct drm_device *dev, struct drm_file *file)
> {
> struct drm_i915_file_private *file_priv = file->driver_priv;
>
next prev parent reply other threads:[~2013-02-27 1:47 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-26 11:05 [PATCH 00/13] arb robustness enablers Mika Kuoppala
2013-02-26 11:05 ` [PATCH 01/13] drm/i915: add context parameter to i915_switch_context() Mika Kuoppala
2013-02-26 18:31 ` Ben Widawsky
2013-02-26 11:05 ` [PATCH 02/13] drm/i915: reference count for i915_hw_contexts Mika Kuoppala
2013-02-26 21:45 ` Ben Widawsky
2013-02-26 11:05 ` [PATCH 03/13] drm/i915: pass seqno to i915_hangcheck_ring_idle Mika Kuoppala
2013-02-26 22:41 ` Ben Widawsky
2013-03-01 13:49 ` Mika Kuoppala
2013-02-26 11:05 ` [PATCH 04/13] drm/i915: track ring progression using seqnos Mika Kuoppala
2013-02-26 14:12 ` Chris Wilson
2013-02-26 15:09 ` Mika Kuoppala
2013-02-26 15:31 ` Chris Wilson
2013-02-26 11:05 ` [PATCH 05/13] drm/i915: introduce i915_hangcheck_ring_hung Mika Kuoppala
2013-02-26 23:03 ` Ben Widawsky
2013-02-26 11:05 ` [PATCH 06/13] drm/i915: detect hang using per ring hangcheck_score Mika Kuoppala
2013-02-26 14:16 ` Chris Wilson
2013-02-26 11:05 ` [PATCH 07/13] drm/i915: remove i915_hangcheck_hung Mika Kuoppala
2013-02-26 11:05 ` [PATCH 08/13] drm/i915: add struct ctx_reset_state Mika Kuoppala
2013-02-26 11:05 ` [PATCH 09/13] drm/i915: add reset_state for hw_contexts Mika Kuoppala
2013-02-27 1:47 ` Ian Romanick [this message]
2013-02-27 1:50 ` Ian Romanick
2013-02-27 9:13 ` Chris Wilson
2013-02-28 1:15 ` Ian Romanick
2013-02-28 11:14 ` Chris Wilson
2013-02-28 20:31 ` Ian Romanick
2013-02-27 10:11 ` Mika Kuoppala
2013-02-27 17:20 ` Jesse Barnes
2013-02-26 11:05 ` [PATCH 10/13] drm/i915: mark rings which were waiting when hang happened Mika Kuoppala
2013-02-26 11:05 ` [PATCH 11/13] drm/i915: add batch object and context to i915_add_request() Mika Kuoppala
2013-02-26 14:22 ` Chris Wilson
2013-02-26 11:05 ` [PATCH 12/13] drm/i915: find guilty batch buffer on ring resets Mika Kuoppala
2013-02-26 11:05 ` [PATCH 13/13] drm/i915: refuse to submit more batchbuffers from guilty context Mika Kuoppala
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=512D65A0.2040305@freedesktop.org \
--to=idr@freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=mika.kuoppala@linux.intel.com \
/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.