All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Ben Widawsky <ben@bwidawsk.net>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
	Intel Graphics Development <intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH 13/14] drm/i915: don't set up gem ring functions on gen5 for !kms
Date: Fri, 13 Apr 2012 11:07:19 +0200	[thread overview]
Message-ID: <20120413090719.GC4525@phenom.ffwll.local> (raw)
In-Reply-To: <20120412180514.5aefd151@bwidawsk.net>

On Thu, Apr 12, 2012 at 06:05:14PM -0700, Ben Widawsky wrote:
> On Wed, 11 Apr 2012 22:12:58 +0200
> Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> 
> > We already disallow initialition of gem in this case in the
> > corresponding ioctl, so don't bother setting up the gem support ring
> > functions in the legacy dri render ring init.
> > 
> > Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> > ---
> >  drivers/gpu/drm/i915/intel_ringbuffer.c |   24 ++++++++++--------------
> >  1 files changed, 10 insertions(+), 14 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
> > index 111981a..108bfd6 100644
> > --- a/drivers/gpu/drm/i915/intel_ringbuffer.c
> > +++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
> > @@ -1336,21 +1336,17 @@ int intel_render_ring_init_dri(struct drm_device *dev, u64 start, u32 size)
> >  	if (INTEL_INFO(dev)->gen >= 6) {
> >  		/* non-kms not supported on gen6+ */
> >  		return -ENODEV;
> > -	} else if (IS_GEN5(dev)) {
> > -		ring->add_request = pc_render_add_request;
> > -		ring->flush = render_ring_flush;
> > -		ring->get_seqno = pc_render_get_seqno;
> > -		ring->irq_get = gen5_ring_get_irq;
> > -		ring->irq_put = gen5_ring_put_irq;
> > -		ring->irq_enable_mask = GT_USER_INTERRUPT | GT_PIPE_NOTIFY;
> > -	} else {
> > -		ring->add_request = i9xx_add_request;
> > -		ring->flush = render_ring_flush;
> > -		ring->get_seqno = ring_get_seqno;
> > -		ring->irq_get = i9xx_ring_get_irq;
> > -		ring->irq_put = i9xx_ring_put_irq;
> > -		ring->irq_enable_mask = I915_USER_INTERRUPT;
> >  	}
> > +
> > +	/* Note: gem is not supported on gen5/ilk without kms (the corresponding
> > +	 * gem_init ioctl returns with -ENODEV). Hence we do not need to set up
> > +	 * the special gen5 functions. */
> Can we make the check >= 5 above? I think doing so would remove the need
> for this comment.

We can bail out for gen6+ because the driver will flat-out refuse to load,
so we can never actually hit this path. For gen5 we cannot refuse to load
and hence can't fail ring init (otoh it doesn't matter how broken the ring
is). Imo we have two options: Either try not to initialize any of the ring
stuff for gen5 and carefully auditing that this does not have any bad side
effects for vt-switching, suspend/resume where we might fall over a NULL
render ring. Or just initialize it half-assed and add this comment. I've
figured the latter is the less risky option and went with it.
-Daniel

> > +	ring->add_request = i9xx_add_request;
> > +	ring->flush = render_ring_flush;
> > +	ring->get_seqno = ring_get_seqno;
> > +	ring->irq_get = i9xx_ring_get_irq;
> > +	ring->irq_put = i9xx_ring_put_irq;
> > +	ring->irq_enable_mask = I915_USER_INTERRUPT;
> >  	ring->write_tail = ring_write_tail;
> >  	if (INTEL_INFO(dev)->gen >= 4)
> >  		ring->dispatch_execbuffer = i965_dispatch_execbuffer;
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Mail: daniel@ffwll.ch
Mobile: +41 (0)79 365 57 48

  reply	other threads:[~2012-04-13  9:06 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-11 20:12 [PATCH 00/14] intel_ringbuffer.c reorg + cleanups Daniel Vetter
2012-04-11 20:12 ` [PATCH 01/14] drm/i915: rip out ring->irq_mask Daniel Vetter
2012-04-11 20:12 ` [PATCH 02/14] drm/i915: set ring->size in common ring setup code Daniel Vetter
2012-04-12 19:23   ` Ben Widawsky
2012-04-12 20:17     ` Daniel Vetter
2012-04-11 20:12 ` [PATCH 03/14] drm/i915: dynamically set up the render ring functions and params Daniel Vetter
2012-04-11 20:12 ` [PATCH 04/14] drm/i915: dynamically set up bsd " Daniel Vetter
2012-04-11 20:12 ` [PATCH 05/14] drm/i915: dynamically set up blt ring functions and parameters Daniel Vetter
2012-04-11 20:12 ` [PATCH 06/14] drm/i915: don't set up rings on gen6+ for non-kms Daniel Vetter
2012-04-11 20:12 ` [PATCH 07/14] drm/i915: consolidate ring->sync-to functions Daniel Vetter
2012-04-11 20:12 ` [PATCH 08/14] drm/i915: abstract away ring-specific irq_get/put Daniel Vetter
2012-04-11 20:12 ` [PATCH 09/14] drm/i915: split out the gen5 ring irq get/put functions Daniel Vetter
2012-04-11 20:12 ` [PATCH 10/14] drm/i915: don't enable the gen6 bsd ring tail write enable on gen7 Daniel Vetter
2012-04-11 20:12 ` [PATCH 11/14] drm/i915: split up ring->dispatch_execbuffer functions Daniel Vetter
2012-04-11 20:12 ` [PATCH 12/14] drm/i915: consolidate ring->flush a bit Daniel Vetter
2012-04-13  0:54   ` Ben Widawsky
2012-04-13  9:03     ` Daniel Vetter
2012-04-11 20:12 ` [PATCH 13/14] drm/i915: don't set up gem ring functions on gen5 for !kms Daniel Vetter
2012-04-13  1:05   ` Ben Widawsky
2012-04-13  9:07     ` Daniel Vetter [this message]
2012-04-11 20:12 ` [PATCH 14/14] drm/i915: inline enable/disable_irq into ring->get/put_irq Daniel Vetter
2012-04-13  1:03   ` Ben Widawsky
2012-04-13  9:13     ` Daniel Vetter
2012-04-13  9:17       ` Chris Wilson
2012-04-11 20:49 ` [PATCH 00/14] intel_ringbuffer.c reorg + cleanups Chris Wilson
2012-04-11 23:42 ` Eric Anholt
2012-04-13 10:56   ` Daniel Vetter

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=20120413090719.GC4525@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=ben@bwidawsk.net \
    --cc=daniel.vetter@ffwll.ch \
    --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.