[PATCH 1/3] drm/i915: Show engine flags in sysfs

Chris Wilson chris at chris-wilson.co.uk
Wed Jun 3 08:03:43 UTC 2020


Quoting Tvrtko Ursulin (2020-06-03 08:37:36)
> 
> On 02/06/2020 16:55, Chris Wilson wrote:
> > Quoting Tvrtko Ursulin (2020-06-02 16:42:45)
> >> From: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> >>
> >> Show engine flags together with other per-engine data in sysfs.
> >>
> >> We need this in order to be able to support heterogenous feature sets
> >> between the engines which are currently not visible from the scheduler
> >> caps interface.
> >>
> >> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> >> ---
> >>   drivers/gpu/drm/i915/gt/sysfs_engines.c | 86 +++++++++++++++++++++----
> >>   1 file changed, 75 insertions(+), 11 deletions(-)
> >>
> >> diff --git a/drivers/gpu/drm/i915/gt/sysfs_engines.c b/drivers/gpu/drm/i915/gt/sysfs_engines.c
> >> index 535cc1169e54..36e0c2fcebef 100644
> >> --- a/drivers/gpu/drm/i915/gt/sysfs_engines.c
> >> +++ b/drivers/gpu/drm/i915/gt/sysfs_engines.c
> >> @@ -48,6 +48,79 @@ inst_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf)
> >>   static struct kobj_attribute inst_attr =
> >>   __ATTR(instance, 0444, inst_show, NULL);
> >>   
> >> +static ssize_t repr_trim(char *buf, ssize_t len)
> >> +{
> >> +       /* Trim off the trailing space and replace with a newline */
> >> +       if (len > PAGE_SIZE)
> >> +               len = PAGE_SIZE;
> >> +       if (len > 0)
> >> +               buf[len - 1] = '\n';
> >> +
> >> +       return len;
> >> +}
> >> +
> >> +static const char * const engine_flags[] = {
> >> +       [ilog2(I915_ENGINE_USING_CMD_PARSER)] = "cmdparser",
> >> +       [ilog2(I915_ENGINE_SUPPORTS_STATS)] = "busy_stats",
> >> +       [ilog2(I915_ENGINE_HAS_PREEMPTION)] = "preemption",
> >> +       [ilog2(I915_ENGINE_HAS_SEMAPHORES)] = "semaphores",
> >> +       [ilog2(I915_ENGINE_HAS_TIMESLICES)] = "timeslicing",
> >> +       [ilog2(I915_ENGINE_NEEDS_BREADCRUMB_TASKLET)] = "", /* non-abi */
> >> +       [ilog2(I915_ENGINE_IS_VIRTUAL)] = "", /* non-abi */
> >> +       [ilog2(I915_ENGINE_HAS_RELATIVE_MMIO)] = "relative_mmio",
> >> +       [ilog2(I915_ENGINE_REQUIRES_CMD_PARSER)] = "requires_cmdparser",
> > 
> > s/requires_//; to the user they only should know that there is one.
> > 
> > using/requires should be an internal detail. Probably we should make
> > requires be non-abi and also mark up using-cmd-parser for gen9. (For
> > reporting simplicity.)
> 
> Yeah I did not figure out the difference between "requires" and "using" 
> on a quick glance so that probably means there is scope for improvement.
> 
> > Although we should get around to fleshing out the ability to use
> > timeslicing effectively from userspace :p
> 
> What do you mean by this?

We haven't landed the code to report the global timeslicing scheduler
property yet.
-Chris


More information about the Intel-gfx-trybot mailing list