[igt-dev] [PATCH i-g-t v5 1/2] Introduce device selection API

Katarzyna Dec katarzyna.dec at intel.com
Wed Aug 28 09:00:46 UTC 2019


On Wed, Aug 28, 2019 at 09:23:38AM +0100, Kempczynski, Zbigniew wrote:
> On Wed, 2019-08-28 at 08:10 +0200, Katarzyna Dec wrote:
> > On Fri, Aug 23, 2019 at 09:03:50AM +0200, Zbigniew KempczyƄski wrote:
> > > + * # lsgpu
> > > + *
> > > + * The devices can be scanned and displayed using 'lsgpu' tool. Tool also
> > > + * displays properties and sysattrs (-p switch, means print detail) which
> > > + * can be used during filter implementation.
> > > + *
> > > + * Tool can also be used to try out filters.
> > > + * To select device use '-d' or '--device' argument like:
> > > + *
> > > + * |[<!-- language="plain" -->
> > > + * ./lsgpu -d 'pci:vendor=Intel'
> > > + * === Device filter list ===
> > > + * [ 0]: pci:vendor=Intel
> > > +
> > > + * === Testing device open ===
> > > + * subsystem   : pci
> > > + * chipset     : 1
> > > + * drm card    : /dev/dri/card0
> > > + * drm render  : /dev/dri/renderD128
> > > + * Device /dev/dri/card0 successfully opened
> > > + * Device /dev/dri/renderD128 successfully opened
> > > + * ]|
> > > + *
> > > + * Additionally lsgpu tries to open the card and render nodes to verify
> > > + * permissions. It also uses IGT variable search order:
> > > + * - use --device first (it overrides IGT_DEVICE and .igtrc
> > > Common::Device
> > > + *   settings)
> > > + * - use IGT_DEVICE enviroment variable if no --device are passed
> > > + * - use .igtrc Common::Device if no --device nor IGT_DEVICE are passed
> > > + */
> > 
> > I looked thought code in all patch and it generally looks good.
> > I have a question about lsgpu usage.
> > '-p' prints all devices, but there is not information in help about that
> > '-d' used without '-p' filters and prints details about particular device
> > Mixing '-p' and '-d' has no affect - we still see all devices, not filtered
> > ones. Is it by desing?
> 
> Argument -p displays details for devices filtered with -d. If you use:
> 
> $ lsgpu -d platform:/sys/devices/platform/vgem -p
> 
> will display detail only for vgem device.
This was my first thought that I am doing it wrong. I forgot to add 'platform:'.
Code looks good, thanks for addressing comments from previous revision.
Reviewed-by: Katarzyna Dec <katarzyna.dec at intel.com>

Let's start using it!
Kasia :)
> 
> > 
> > Kasia :)
> 
> Zbigniew


More information about the igt-dev mailing list