From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>,
Lionel Landwerlin <lionel.g.landwerlin@intel.com>,
intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 3/4] drm/i915: expose engine availability through sysfs
Date: Wed, 29 Nov 2017 08:39:25 +0000 [thread overview]
Message-ID: <9b810476-e939-37f6-e9bc-ef578ebdfcb7@linux.intel.com> (raw)
In-Reply-To: <151190518139.22640.14785744859178383405@mail.alporthouse.com>
On 28/11/2017 21:39, Chris Wilson wrote:
> Quoting Chris Wilson (2017-11-28 20:56:23)
>> 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.
>
> So /sys/dev/char/226:128/ does not link to /sys/dev/char/226:0/. Maybe
> we should just add a card symlink from each minor back to our sysfs
> root? That seems doable.
>
> Then we just need open("/sys/dev/char/%u:%u/card");
There is a link via what I wrote above -
"/sys/dev/char/%u:%u/device/drm/cardX", but the "X" part is cumbersome.
Adding a link with a constant name would indeed be better, but I wasn't
sure if it is conceptually allowed and even forgot to mention it.
Regards,
Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-11-29 8:39 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-20 12:23 [PATCH 0/4] drm/i915: Expose more GPU properties through sysfs Lionel Landwerlin
2017-11-20 12:23 ` [PATCH 1/4] drm/i915: store all subslice masks Lionel Landwerlin
2017-11-20 12:23 ` [PATCH 2/4] drm/i915/debugfs: reuse max slice/subslices already stored in sseu Lionel Landwerlin
2017-11-20 12:23 ` [PATCH 3/4] drm/i915: expose engine availability through sysfs Lionel Landwerlin
2017-11-20 15:57 ` Tvrtko Ursulin
2017-11-21 12:41 ` Ewelina Musial
2017-11-20 16:03 ` Tvrtko Ursulin
2017-11-20 16:33 ` Lionel Landwerlin
2017-11-20 17:08 ` Tvrtko Ursulin
2017-11-28 18:17 ` Tvrtko Ursulin
2017-11-28 20:56 ` Chris Wilson
2017-11-28 21:39 ` Chris Wilson
2017-11-29 8:39 ` Tvrtko Ursulin [this message]
2017-11-20 12:23 ` [PATCH 4/4] drm/i915: expose EU topology " Lionel Landwerlin
2017-11-20 16:13 ` Tvrtko Ursulin
2017-11-20 16:54 ` Lionel Landwerlin
2017-11-20 12:45 ` ✓ Fi.CI.BAT: success for drm/i915: Expose more GPU properties through sysfs (rev3) Patchwork
2017-11-20 13:33 ` ✓ Fi.CI.IGT: " Patchwork
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=9b810476-e939-37f6-e9bc-ef578ebdfcb7@linux.intel.com \
--to=tvrtko.ursulin@linux.intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=intel-gfx@lists.freedesktop.org \
--cc=lionel.g.landwerlin@intel.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.