dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Rohan Garg <rohan.garg@collabora.com>
To: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v2] drm/ioctl: Add a ioctl to label GEM objects
Date: Thu, 26 Sep 2019 10:49:08 +0200	[thread overview]
Message-ID: <1894757.Cb9dXLQTjU@solembum> (raw)
In-Reply-To: <74b4cb8b-1bce-19d9-1022-aa5ed542e10c@suse.de>


[-- Attachment #1.1: Type: text/plain, Size: 2617 bytes --]

Hi

On jueves, 19 de septiembre de 2019 16:02:57 (CEST) Thomas Zimmermann wrote:
> Hi
> 
> Am 19.09.19 um 14:53 schrieb Rohan Garg:
> > DRM_IOCTL_BO_SET_LABEL lets you label GEM objects, making it
> > easier to debug issues in userspace applications.
> > 
> > Changes in v2:
> >   - Hoist the IOCTL up into the drm_driver framework
> > 
> > Signed-off-by: Rohan Garg <rohan.garg@collabora.com>
> > ---
> > 
> >  drivers/gpu/drm/drm_gem.c      | 64 ++++++++++++++++++++++++++++++++++
> >  drivers/gpu/drm/drm_internal.h |  4 +++
> >  drivers/gpu/drm/drm_ioctl.c    |  1 +
> >  include/drm/drm_drv.h          | 18 ++++++++++
> >  include/drm/drm_gem.h          |  7 ++++
> >  include/uapi/drm/drm.h         | 20 +++++++++++
> >  6 files changed, 114 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c
> > index 6854f5867d51..785ac561619a 100644
> > --- a/drivers/gpu/drm/drm_gem.c
> > +++ b/drivers/gpu/drm/drm_gem.c
> > @@ -941,6 +941,65 @@ drm_gem_release(struct drm_device *dev, struct
> > drm_file *file_private)> 
> >  	idr_destroy(&file_private->object_idr);
> >  
> >  }
> > 
> > +int drm_bo_set_label_ioctl(struct drm_device *dev, void *data,
> > +		       struct drm_file *file_priv)
> > +{
> > +	struct drm_label_object *args = data;
> > +
> > +	if (!args->len || !args->name)
> > +		return -EINVAL;
> > +
> > +	if (dev->driver->label)
> > +		return dev->driver->label(dev, args, file_priv);
> > +
> > +	return -EOPNOTSUPP;
> > +}
> > +
> > +/**
> > + * drm_gem_label - label a given GEM object
> > + * @dev: drm_device for the associated GEM object
> > + * @data: drm_label_bo struct with a label, label length and any relevant
> > flags + * @file_private: drm file-private structure to clean up
> > + */
> > +
> > +int drm_gem_set_label(struct drm_device *dev, struct drm_label_object
> > *args, struct drm_file *file_priv)
> I'd like to set labels for internal GEM objects. Could you split off the
> object update code into something that is easily callable from within
> drivers? Something like
> 
>   // called by ioctl
>   int drm_gem_object_adopt_label(struct drm_gem_object *gem,
>         char *label)
>   {
>         // your object update code goes here
>   }
> 
>   // called by drivers
>   int drm_gem_object_set_label(struct drm_gem_object *gem,
>         const char *label)
>   {
> 	char* new_label = strdup(label)
> 	return drm_gem_object_adopt_label(gem, new_label);
>   }
> 
> 
> We have debugfs support for TTM-based GEM objects at [1]. I think the
> label would be a welcome addition to the output.
> 

Ack, I'll address this in v3.

Cheers
Rohan Garg

[-- Attachment #1.2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2019-09-26  8:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-19 12:53 [PATCH v2] drm/ioctl: Add a ioctl to label GEM objects Rohan Garg
2019-09-19 14:02 ` Thomas Zimmermann
2019-09-26  8:49   ` Rohan Garg [this message]
2019-09-20 15:25 ` Thierry Reding
2019-09-26  8:47   ` Rohan Garg
2019-10-08 16:31     ` 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=1894757.Cb9dXLQTjU@solembum \
    --to=rohan.garg@collabora.com \
    --cc=dri-devel@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