drm/i915: Use the i915_device name for identifying our request fences
diff mbox series

Message ID 20191211150204.133471-1-chris@chris-wilson.co.uk
State New
Headers show
Series
  • drm/i915: Use the i915_device name for identifying our request fences
Related show

Commit Message

Chris Wilson Dec. 11, 2019, 3:02 p.m. UTC
Use the dev_name(i915) to identify the requests for debugging, so we can
tell different device timelines apart.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Venkata Sandeep Dhanalakota <venkata.s.dhanalakota@intel.com>
---
 drivers/gpu/drm/i915/i915_request.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Venkata Sandeep Dhanalakota Dec. 11, 2019, 3:59 p.m. UTC | #1
On 19/12/11 03:02, Chris Wilson wrote:
> Use the dev_name(i915) to identify the requests for debugging, so we can
> tell different device timelines apart.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Venkata Sandeep Dhanalakota <venkata.s.dhanalakota@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_request.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_request.c b/drivers/gpu/drm/i915/i915_request.c
> index a6238c626a16..9646e02edea3 100644
> --- a/drivers/gpu/drm/i915/i915_request.c
> +++ b/drivers/gpu/drm/i915/i915_request.c
> @@ -57,7 +57,7 @@ static struct i915_global_request {
>  
>  static const char *i915_fence_get_driver_name(struct dma_fence *fence)
>  {
> -	return "i915";
> +	return dev_name(to_request(fence)->i915->drm.dev);
>  }
>  
Sure, should we also update i915_fence_get_timeline_name() 
return to_request(fence)->gem_context->name ?:
i915_fence_get_driver_name(fence);
>  static const char *i915_fence_get_timeline_name(struct dma_fence *fence)
> -- 
> 2.24.0
>
Chris Wilson Dec. 11, 2019, 4:07 p.m. UTC | #2
Quoting Venkata Sandeep Dhanalakota (2019-12-11 15:59:09)
> On 19/12/11 03:02, Chris Wilson wrote:
> > Use the dev_name(i915) to identify the requests for debugging, so we can
> > tell different device timelines apart.
> > 
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: Venkata Sandeep Dhanalakota <venkata.s.dhanalakota@intel.com>
> > ---
> >  drivers/gpu/drm/i915/i915_request.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/i915_request.c b/drivers/gpu/drm/i915/i915_request.c
> > index a6238c626a16..9646e02edea3 100644
> > --- a/drivers/gpu/drm/i915/i915_request.c
> > +++ b/drivers/gpu/drm/i915/i915_request.c
> > @@ -57,7 +57,7 @@ static struct i915_global_request {
> >  
> >  static const char *i915_fence_get_driver_name(struct dma_fence *fence)
> >  {
> > -     return "i915";
> > +     return dev_name(to_request(fence)->i915->drm.dev);
> >  }
> >  
> Sure, should we also update i915_fence_get_timeline_name() 
> return to_request(fence)->gem_context->name ?:
> i915_fence_get_driver_name(fence);

No need really. It's either a user context or a kernel context, the less
said to userspace about internals the better. It will be presented as

00:00:02.00 i915::[i915] (or something like that)

If you would rather that "[i915]" be "[k]" or probably better yet "["
DRIVER_NAME "]"
-Chris
Venkata Sandeep Dhanalakota Dec. 11, 2019, 4:12 p.m. UTC | #3
On 19/12/11 04:07, Chris Wilson wrote:
> Quoting Venkata Sandeep Dhanalakota (2019-12-11 15:59:09)
> > On 19/12/11 03:02, Chris Wilson wrote:
> > > Use the dev_name(i915) to identify the requests for debugging, so we can
> > > tell different device timelines apart.
> > > 
> > > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > > Cc: Venkata Sandeep Dhanalakota <venkata.s.dhanalakota@intel.com>
> > > ---
> > >  drivers/gpu/drm/i915/i915_request.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > diff --git a/drivers/gpu/drm/i915/i915_request.c b/drivers/gpu/drm/i915/i915_request.c
> > > index a6238c626a16..9646e02edea3 100644
> > > --- a/drivers/gpu/drm/i915/i915_request.c
> > > +++ b/drivers/gpu/drm/i915/i915_request.c
> > > @@ -57,7 +57,7 @@ static struct i915_global_request {
> > >  
> > >  static const char *i915_fence_get_driver_name(struct dma_fence *fence)
> > >  {
> > > -     return "i915";
> > > +     return dev_name(to_request(fence)->i915->drm.dev);
> > >  }
> > >  
> > Sure, should we also update i915_fence_get_timeline_name() 
> > return to_request(fence)->gem_context->name ?:
> > i915_fence_get_driver_name(fence);
> 
> No need really. It's either a user context or a kernel context, the less
> said to userspace about internals the better. It will be presented as
> 
> 00:00:02.00 i915::[i915] (or something like that)
> 
> If you would rather that "[i915]" be "[k]" or probably better yet "["
> DRIVER_NAME "]"
got it, having "[i915]" makes sense.

Reviewed-by: Venkata Sandeep Dhanalakota
<venkata.s.dhanalakota@intel.com>
> -Chris

Patch
diff mbox series

diff --git a/drivers/gpu/drm/i915/i915_request.c b/drivers/gpu/drm/i915/i915_request.c
index a6238c626a16..9646e02edea3 100644
--- a/drivers/gpu/drm/i915/i915_request.c
+++ b/drivers/gpu/drm/i915/i915_request.c
@@ -57,7 +57,7 @@  static struct i915_global_request {
 
 static const char *i915_fence_get_driver_name(struct dma_fence *fence)
 {
-	return "i915";
+	return dev_name(to_request(fence)->i915->drm.dev);
 }
 
 static const char *i915_fence_get_timeline_name(struct dma_fence *fence)