public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: Ben Widawsky <ben@bwidawsk.net>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/2] drm/i915: Group the GT routines together in both code and vtable
Date: Wed, 13 Jun 2012 20:47:11 +0100	[thread overview]
Message-ID: <1339616841_17498@CP5-2952> (raw)
In-Reply-To: <20120613120719.79caed44@bwidawsk.net>

On Wed, 13 Jun 2012 12:07:19 -0700, Ben Widawsky <ben@bwidawsk.net> wrote:
> On Wed, 13 Jun 2012 18:29:51 +0100
> Chris Wilson <chris@chris-wilson.co.uk> wrote:
> 
> > Tidy up the routines for interacting with the GT (in particular the
> > forcewake dance) which are scattered throughout the code in a single
> > structure.
> 
> A few comments inline. First though, the bikeshed:
> 
> I'd really rather the structure not be named, "gt" unless you have
> further reaching plans for it. GT is way to generic. Also, I think it
> makes a lot of sense to move the forcewake dancing into intel_pm.c

This patch predated the intel_pm split. I toyed with the idea of
updating it, but preferred to get feedback first. Shall we call it
grantsdale instead? Or uncore? My opinion is that this more core
functionality than power-management, but first and foremost it
should not be scattered across multiple files.
 
> > 
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > ---
> >  drivers/gpu/drm/i915/i915_dma.c      |    2 +-
> >  drivers/gpu/drm/i915/i915_drv.c      |  100 ++++++++++++++++++++++++----------
> >  drivers/gpu/drm/i915/i915_drv.h      |   17 +++---
> >  drivers/gpu/drm/i915/intel_display.c |    3 -
> >  drivers/gpu/drm/i915/intel_pm.c      |   30 ----------
> >  5 files changed, 81 insertions(+), 71 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
> > index fa8f269..a605928 100644
> > --- a/drivers/gpu/drm/i915/i915_dma.c
> > +++ b/drivers/gpu/drm/i915/i915_dma.c
> > @@ -1548,6 +1548,7 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
> >  	}
> >  
> >  	intel_irq_init(dev);
> > +	intel_gt_init(dev);
> >  
> >  	/* Try to make sure MCHBAR is enabled before poking at it */
> >  	intel_setup_mchbar(dev);
> > @@ -1580,7 +1581,6 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
> >  	if (!IS_I945G(dev) && !IS_I945GM(dev))
> >  		pci_enable_msi(dev->pdev);
> >  
> > -	spin_lock_init(&dev_priv->gt_lock);
> >  	spin_lock_init(&dev_priv->irq_lock);
> >  	spin_lock_init(&dev_priv->error_lock);
> >  	spin_lock_init(&dev_priv->rps_lock);
> 
> By this logic, we should also move the irq_lock init to intel_irq_init,
> and the rps_lock init to enable_rps or something.
> 
> > diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> > index 238a521..2058316 100644
> > --- a/drivers/gpu/drm/i915/i915_drv.c
> > +++ b/drivers/gpu/drm/i915/i915_drv.c
> > @@ -32,6 +32,7 @@
> >  #include "drm.h"
> >  #include "i915_drm.h"
> >  #include "i915_drv.h"
> > +#include "i915_trace.h"
> >  #include "intel_drv.h"
> >  
> >  #include <linux/console.h>
> 
> What is this doing here?

An earlier version was more funky with grander purpose.
 
> > @@ -423,36 +424,38 @@ bool i915_semaphore_is_enabled(struct drm_device *dev)
> >  	return 1;
> >  }
> >  
> > -void __gen6_gt_force_wake_get(struct drm_i915_private *dev_priv)
> > +static void __gen6_gt_force_wake_get(struct drm_i915_private *dev_priv)
> >  {
> > -	int count;
> > +	unsigned long timeout;
> >  
> > -	count = 0;
> > -	while (count++ < 50 && (I915_READ_NOTRACE(FORCEWAKE_ACK) & 1))
> > -		udelay(10);
> > +	timeout = jiffies + msecs_to_jiffies(1);
> > +	while (I915_READ_NOTRACE(FORCEWAKE_ACK) & 1 &&
> > +	       time_before(jiffies, timeout))
> > +		;
> > 
> 
> Can't we just use the wait_for macros here?
Yes.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre

  reply	other threads:[~2012-06-13 19:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-13 17:29 [PATCH 1/2] drm/i915: Group the GT routines together in both code and vtable Chris Wilson
2012-06-13 17:29 ` [PATCH 2/2] drm/i915: Implement w/a for sporadic read failures on waking from rc6 Chris Wilson
2012-06-15 18:31   ` Eugeni Dodonov
2012-06-13 19:07 ` [PATCH 1/2] drm/i915: Group the GT routines together in both code and vtable Ben Widawsky
2012-06-13 19:47   ` Chris Wilson [this message]
2012-06-15 15:11     ` Eugeni Dodonov

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=1339616841_17498@CP5-2952 \
    --to=chris@chris-wilson.co.uk \
    --cc=ben@bwidawsk.net \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox