[Intel-gfx] [PATCH 3/4] drm/i915: expose engine availability through sysfs

Chris Wilson chris at chris-wilson.co.uk
Tue Nov 28 20:56:23 UTC 2017


Quoting Tvrtko Ursulin (2017-11-28 18:17:54)
> 
> On 20/11/2017 12:23, Lionel Landwerlin wrote:
> > This enables userspace to discover the engines available on the GPU.
> > Here is the layout on a Skylake GT4:
> > 
> > /sys/devices/pci0000:00/0000:00:02.0/drm/card0/gt
> 
> On this one I think Joonas had a concern that it is difficult for
> userspace to get to the sysfs root from the drm file descriptor.
> 
> Lionel pointed out that for master nodes it is quite easy:
> 
> fstat(fd, &st);
> sprintf(sysfs_root, "/sys/dev/char/%u:%u", major(st.st_rdev), minor(st.st_rdev));
> 
> For render nodes it is trickier in a way that they would have to
> additional resolve an unknown master drm card number. For instance:
> 
> /sys/dev/char/%u:%u/device/drm/cardX
> 
> Where the "X" is unknown.
> 
> But, is it even an use case for render nodes to try and get to the
> sysfs root of the master card? Are they allowed to do so?

Yes. Mesa uses render nodes, and mesa needs the topology for its
performance monitoring api.
-Chris


More information about the Intel-gfx mailing list