diff mbox

[1/5] drm/i915: use dev_priv directly in gen8_ppgtt_notify_vgt

Message ID 1460476663-24890-1-git-send-email-matthew.auld@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Matthew Auld April 12, 2016, 3:57 p.m. UTC
Remove dev local and use to_i915() in gen8_ppgtt_notify_vgt.

v2: use dev_priv directly for QUESTION_MACROS (Joonas Lahtinen)

Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
---
 drivers/gpu/drm/i915/i915_gem_gtt.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Joonas Lahtinen April 18, 2016, 12:51 p.m. UTC | #1
On ti, 2016-04-12 at 16:57 +0100, Matthew Auld wrote:
> Remove dev local and use to_i915() in gen8_ppgtt_notify_vgt.
> 
> v2: use dev_priv directly for QUESTION_MACROS (Joonas Lahtinen)
> 
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>

Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>

> Signed-off-by: Matthew Auld <matthew.auld@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_gem_gtt.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
> index c5cb049..5ed713d 100644
> --- a/drivers/gpu/drm/i915/i915_gem_gtt.c
> +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
> @@ -905,11 +905,10 @@ static int gen8_init_scratch(struct i915_address_space *vm)
>  static int gen8_ppgtt_notify_vgt(struct i915_hw_ppgtt *ppgtt, bool create)
>  {
>  	enum vgt_g2v_type msg;
> -	struct drm_device *dev = ppgtt->base.dev;
> -	struct drm_i915_private *dev_priv = dev->dev_private;
> +	struct drm_i915_private *dev_priv = to_i915(ppgtt->base.dev);
>  	int i;
>  
> -	if (USES_FULL_48BIT_PPGTT(dev)) {
> +	if (USES_FULL_48BIT_PPGTT(dev_priv)) {
>  		u64 daddr = px_dma(&ppgtt->pml4);
>  
>  		I915_WRITE(vgtif_reg(pdp[0].lo), lower_32_bits(daddr));
Chris Wilson April 18, 2016, 1:11 p.m. UTC | #2
On Mon, Apr 18, 2016 at 03:51:20PM +0300, Joonas Lahtinen wrote:
> On ti, 2016-04-12 at 16:57 +0100, Matthew Auld wrote:
> > Remove dev local and use to_i915() in gen8_ppgtt_notify_vgt.
> > 
> > v2: use dev_priv directly for QUESTION_MACROS (Joonas Lahtinen)
> > 
> > Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> 
> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> 
> > Signed-off-by: Matthew Auld <matthew.auld@intel.com>
> > ---
> >  drivers/gpu/drm/i915/i915_gem_gtt.c | 5 ++---
> >  1 file changed, 2 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
> > index c5cb049..5ed713d 100644
> > --- a/drivers/gpu/drm/i915/i915_gem_gtt.c
> > +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
> > @@ -905,11 +905,10 @@ static int gen8_init_scratch(struct i915_address_space *vm)
> >  static int gen8_ppgtt_notify_vgt(struct i915_hw_ppgtt *ppgtt, bool create)
> >  {
> >  	enum vgt_g2v_type msg;
> > -	struct drm_device *dev = ppgtt->base.dev;
> > -	struct drm_i915_private *dev_priv = dev->dev_private;
> > +	struct drm_i915_private *dev_priv = to_i915(ppgtt->base.dev);
> >  	int i;
> >  
> > -	if (USES_FULL_48BIT_PPGTT(dev)) {
> > +	if (USES_FULL_48BIT_PPGTT(dev_priv)) {

The irony of this macro, is that it doesn't use its argument, and should
it ever do so, it will use information stored in the ppgtt->vm.
-Chris
Joonas Lahtinen April 18, 2016, 1:28 p.m. UTC | #3
On ma, 2016-04-18 at 14:11 +0100, Chris Wilson wrote:
> On Mon, Apr 18, 2016 at 03:51:20PM +0300, Joonas Lahtinen wrote:
> > 
> > On ti, 2016-04-12 at 16:57 +0100, Matthew Auld wrote:
> > > 
> > > Remove dev local and use to_i915() in gen8_ppgtt_notify_vgt.
> > > 
> > > v2: use dev_priv directly for QUESTION_MACROS (Joonas Lahtinen)
> > > 
> > > Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> > Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> > 
> > > 
> > > Signed-off-by: Matthew Auld <matthew.auld@intel.com>
> > > ---
> > >  drivers/gpu/drm/i915/i915_gem_gtt.c | 5 ++---
> > >  1 file changed, 2 insertions(+), 3 deletions(-)
> > > 
> > > diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
> > > index c5cb049..5ed713d 100644
> > > --- a/drivers/gpu/drm/i915/i915_gem_gtt.c
> > > +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
> > > @@ -905,11 +905,10 @@ static int gen8_init_scratch(struct i915_address_space *vm)
> > >  static int gen8_ppgtt_notify_vgt(struct i915_hw_ppgtt *ppgtt, bool create)
> > >  {
> > >  	enum vgt_g2v_type msg;
> > > -	struct drm_device *dev = ppgtt->base.dev;
> > > -	struct drm_i915_private *dev_priv = dev->dev_private;
> > > +	struct drm_i915_private *dev_priv = to_i915(ppgtt->base.dev);
> > >  	int i;
> > >  
> > > -	if (USES_FULL_48BIT_PPGTT(dev)) {
> > > +	if (USES_FULL_48BIT_PPGTT(dev_priv)) {
> The irony of this macro, is that it doesn't use its argument, and should
> it ever do so, it will use information stored in the ppgtt->vm.

Oh dear, only now looked at it. Pretty horrible macro :P

Regards, Joonas

> -Chris
>
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
index c5cb049..5ed713d 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
@@ -905,11 +905,10 @@  static int gen8_init_scratch(struct i915_address_space *vm)
 static int gen8_ppgtt_notify_vgt(struct i915_hw_ppgtt *ppgtt, bool create)
 {
 	enum vgt_g2v_type msg;
-	struct drm_device *dev = ppgtt->base.dev;
-	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct drm_i915_private *dev_priv = to_i915(ppgtt->base.dev);
 	int i;
 
-	if (USES_FULL_48BIT_PPGTT(dev)) {
+	if (USES_FULL_48BIT_PPGTT(dev_priv)) {
 		u64 daddr = px_dma(&ppgtt->pml4);
 
 		I915_WRITE(vgtif_reg(pdp[0].lo), lower_32_bits(daddr));