[Intel-gfx] [PATCH 1/2] drm/i915: allow userspace forcewake references also on gen7

2012-01-24 Thread Daniel Vetter
We need this to correctly access registers in the gt power well from
userspace.

Signed-Off-by: Daniel Vetter 
---
 drivers/gpu/drm/i915/i915_debugfs.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c 
b/drivers/gpu/drm/i915/i915_debugfs.c
index 6c3be86..4a93dfc 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -1666,7 +1666,7 @@ static int i915_forcewake_open(struct inode *inode, 
struct file *file)
struct drm_i915_private *dev_priv = dev->dev_private;
int ret;
 
-   if (!IS_GEN6(dev))
+   if (INTEL_INFO(dev)->gen < 6)
return 0;
 
ret = mutex_lock_interruptible(&dev->struct_mutex);
@@ -1683,7 +1683,7 @@ int i915_forcewake_release(struct inode *inode, struct 
file *file)
struct drm_device *dev = inode->i_private;
struct drm_i915_private *dev_priv = dev->dev_private;
 
-   if (!IS_GEN6(dev))
+   if (INTEL_INFO(dev)->gen < 6)
return 0;
 
/*
-- 
1.7.8.3

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH 1/2] drm/i915: allow userspace forcewake references also on gen7

2012-01-24 Thread Chris Wilson
On Tue, 24 Jan 2012 09:44:28 +0100, Daniel Vetter  
wrote:
> We need this to correctly access registers in the gt power well from
> userspace.

How about a INTEL_INFO(dev)->has_forcewake or check for the
 ->forcewake_get? That would be more self-documenting, and we are less
likely to miss one in the future, than adding more random generation
checks.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH 1/2] drm/i915: allow userspace forcewake references also on gen7

2012-01-24 Thread Daniel Vetter
On Tue, Jan 24, 2012 at 10:35:04AM +, Chris Wilson wrote:
> On Tue, 24 Jan 2012 09:44:28 +0100, Daniel Vetter  
> wrote:
> > We need this to correctly access registers in the gt power well from
> > userspace.
> 
> How about a INTEL_INFO(dev)->has_forcewake or check for the
>  ->forcewake_get? That would be more self-documenting, and we are less
> likely to miss one in the future, than adding more random generation
> checks.

I'll jot down a todo to create a cleanup patch for -next that introduce
some feature flags like has_forcewake has_rc6 and such to avoid such
gaffles (hopefully).
-Daniel
-- 
Daniel Vetter
Mail: dan...@ffwll.ch
Mobile: +41 (0)79 365 57 48
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH 1/2] drm/i915: allow userspace forcewake references also on gen7

2012-01-24 Thread Eugeni Dodonov
On Tue, Jan 24, 2012 at 06:44, Daniel Vetter  wrote:

> We need this to correctly access registers in the gt power well from
> userspace.
>
> Signed-Off-by: Daniel Vetter 
>

Reviewed-by: Eugeni Dodonov 

-- 
Eugeni Dodonov

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH 1/2] drm/i915: allow userspace forcewake references also on gen7

2012-01-24 Thread Eugeni Dodonov
On Tue, Jan 24, 2012 at 09:04, Daniel Vetter  wrote:

> On Tue, Jan 24, 2012 at 10:35:04AM +, Chris Wilson wrote:
> > On Tue, 24 Jan 2012 09:44:28 +0100, Daniel Vetter <
> daniel.vet...@ffwll.ch> wrote:
> > > We need this to correctly access registers in the gt power well from
> > > userspace.
> >
> > How about a INTEL_INFO(dev)->has_forcewake or check for the
> >  ->forcewake_get? That would be more self-documenting, and we are less
> > likely to miss one in the future, than adding more random generation
> > checks.
>
> I'll jot down a todo to create a cleanup patch for -next that introduce
> some feature flags like has_forcewake has_rc6 and such to avoid such
> gaffles (hopefully).
>

I actually wrote about the very same idea in my previous email :). So +1 to
that!

-- 
Eugeni Dodonov
 
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH 1/2] drm/i915: allow userspace forcewake references also on gen7

2012-01-24 Thread Keith Packard
On Tue, 24 Jan 2012 09:44:28 +0100, Daniel Vetter  
wrote:

> We need this to correctly access registers in the gt power well from
> userspace.

Reviewed-by: Keith Packard 

-- 
keith.pack...@intel.com


pgpc10TGPRS2j.pgp
Description: PGP signature
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH 1/2] drm/i915: allow userspace forcewake references also on gen7

2012-01-24 Thread Keith Packard
On Tue, 24 Jan 2012 09:44:28 +0100, Daniel Vetter  
wrote:
> We need this to correctly access registers in the gt power well from
> userspace.

I've merged this and to -fixes.

-- 
keith.pack...@intel.com


pgpuG2f8so6ue.pgp
Description: PGP signature
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx