All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/7] [RFC] Context reference counting
@ 2013-04-04 23:41 Ben Widawsky
  2013-04-04 23:41 ` [PATCH 1/7] drm/i915: Mark context switch likely Ben Widawsky
                   ` (8 more replies)
  0 siblings, 9 replies; 19+ messages in thread
From: Ben Widawsky @ 2013-04-04 23:41 UTC (permalink / raw)
  To: intel-gfx; +Cc: Ben Widawsky

These patches implement full context reference counting. In the patch that
actually adds the reference counting, I explain why I think Mika's reference
counting isn't sufficient for me. Please see/respond to that patch if you
disagree.

Almost all of the actual work occurs in:
"drm/i915: Store last context instead of the obj"

This work is preliminary work for what I'm actually doing at the moment which
is proper PPGTT support. The patches split off quite nicely here, so I'm
submitting it for review separately. I believe these patches provide a superset
of the functionality needed by Mika for ARB_Robustness.

The primary reason I want to track context destruction is for PPGTT support
we'd like to teardown ppgtt state when a context goes away, but can only do so
when we're absolutely certain those PTEs are no longer needed. In my design,
I've made a 1:1 relationship with context->ppgtt, and so refcounting the
context makes sense there. The crux of the solution here is to store the
context pointer in the object that backs it. I could probably use that alone to
solve my problem, but I've gone a bit further and also stored the last context
in the ring, instead of the last context object. I can't show code yet, but
I believe there are a couple of other niceties to having the last context, and
not an object.

There is at least one sticking point in this patch series, which is the
aforementioned storing of the context in the object backs the context. That
patch has been rejected before. I'm open to other ways to handle this.
At the very least, I require being able to teardown PPGTT when a context
dies.

For reference, here is the last time the patch was shot down:
http://lists.freedesktop.org/archives/intel-gfx/2012-June/thread.html#18000

Ben Widawsky (7):
  drm/i915: Mark context switch likely
  drm/i915: Move context special case to get()
  drm/i915: Make object aware that it backs a context
  drm/i915: Better context messages
  drm/i915: Track context status
  drm/i915: Store last context instead of the obj
  drm/i915: Print all contexts in debugfs

 drivers/gpu/drm/i915/i915_debugfs.c     |  30 +++++++-
 drivers/gpu/drm/i915/i915_drv.h         |  10 ++-
 drivers/gpu/drm/i915/i915_gem.c         |   2 +
 drivers/gpu/drm/i915/i915_gem_context.c | 127 ++++++++++++++++++++++----------
 drivers/gpu/drm/i915/intel_ringbuffer.h |   2 +-
 5 files changed, 129 insertions(+), 42 deletions(-)

-- 
1.8.2

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2013-04-08  6:05 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-04 23:41 [PATCH 0/7] [RFC] Context reference counting Ben Widawsky
2013-04-04 23:41 ` [PATCH 1/7] drm/i915: Mark context switch likely Ben Widawsky
2013-04-05  7:09   ` Jani Nikula
2013-04-05 16:44     ` Ben Widawsky
2013-04-05 21:36       ` Daniel Vetter
2013-04-08  6:06       ` Jani Nikula
2013-04-04 23:41 ` [PATCH 2/7] drm/i915: Move context special case to get() Ben Widawsky
2013-04-05 10:41   ` Ville Syrjälä
2013-04-05 16:49     ` Ben Widawsky
2013-04-04 23:41 ` [PATCH 3/7] drm/i915: Make object aware that it backs a context Ben Widawsky
2013-04-04 23:41 ` [PATCH 4/7] drm/i915: A bit better messaging for contexts Ben Widawsky
2013-04-04 23:41 ` [PATCH 4/7] drm/i915: Better context messages Ben Widawsky
2013-04-04 23:41 ` [PATCH 5/7] drm/i915: Track context status Ben Widawsky
2013-04-04 23:41 ` [PATCH 6/7] drm/i915: Store last context instead of the obj Ben Widawsky
2013-04-05  7:51   ` Chris Wilson
2013-04-05 17:28     ` Ben Widawsky
2013-04-04 23:41 ` [PATCH 7/7] drm/i915: Print all contexts in debugfs Ben Widawsky
2013-04-04 23:41 ` [PATCH 0/7] [RFC] Context reference counting Ben Widawsky
2013-04-05  4:52   ` Ben Widawsky

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.