[PATCH] drm/i915: Generate event on throttle request

Hiatt, Don don.hiatt at intel.com
Tue May 19 15:05:33 UTC 2020


Hi Chris,

> -----Original Message-----
> From: Chris Wilson <chris at chris-wilson.co.uk>
> Sent: Tuesday, May 19, 2020 7:55 AM
> To: Hiatt, Don <don.hiatt at intel.com>; intel-gfx-trybot at lists.freedesktop.org
> Cc: Hiatt, Don <don.hiatt at intel.com>
> Subject: Re: [PATCH] drm/i915: Generate event on throttle request
> 
> Quoting don.hiatt at intel.com (2020-05-19 16:05:12)
> > From: Don Hiatt <don.hiatt at intel.com>
> >
> > Like the I915_RESET_UEVENT which generates an event prior to
> > resetting the GPU, we would like an I915_THROTTLE_UEVENT to
> > to generate an event on successfull GPU frequency throttling.
> >
> > Signed-off-by: Don Hiatt <don.hiatt at intel.com>
> > ---
> >  drivers/gpu/drm/i915/gt/intel_rps.c | 9 +++++++++
> >  include/uapi/drm/i915_drm.h         | 3 +++
> >  2 files changed, 12 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/i915/gt/intel_rps.c
> b/drivers/gpu/drm/i915/gt/intel_rps.c
> > index 2f59fc6df3c2..6f451a69c4a7 100644
> > --- a/drivers/gpu/drm/i915/gt/intel_rps.c
> > +++ b/drivers/gpu/drm/i915/gt/intel_rps.c
> > @@ -1616,6 +1616,8 @@ static void rps_work(struct work_struct *work)
> >         struct intel_rps *rps = container_of(work, typeof(*rps), work);
> >         struct intel_gt *gt = rps_to_gt(rps);
> >         struct drm_i915_private *i915 = rps_to_i915(rps);
> > +       struct kobject *kobj = &i915->drm.primary->kdev->kobj;
> > +       char *throttle_event[4];
> >         bool client_boost = false;
> >         int new_freq, adj, min, max;
> >         u32 pm_iir = 0;
> > @@ -1693,6 +1695,13 @@ static void rps_work(struct work_struct *work)
> >         }
> >         rps->last_adj = adj;
> >
> > +       throttle_event[0] = I915_THROTTLE_UEVENT "=1";
> > +       throttle_event[1] = "COMPONENT=GT";
> > +       throttle_event[2] = kasprintf(GFP_KERNEL, "NEW_FREQ=%d", new_freq);
> > +       throttle_event[3] = NULL;
> > +       kobject_uevent_env(kobj, KOBJ_CHANGE, throttle_event);
> > +       kfree(throttle_event[2]);
> 
> This is nothing to do with throttling. And may be sent every jiffy.
> More if other event sources are active.
> -Chris

Sorry, I thought the rps_worker is what was responding to the punit throttle request and setting the new frequency. Can you point me to just where would be the correct place to generate such an event?

Thank you.

don



More information about the Intel-gfx-trybot mailing list