[igt-dev] [PATCH i-g-t] pm_rpm: Require DMC loaded before testing runtime_pm for gen9+

Rodrigo Vivi rodrigo.vivi at intel.com
Fri Aug 17 22:56:30 UTC 2018


On Fri, Aug 17, 2018 at 11:11:54PM +0100, Chris Wilson wrote:
> Quoting Chris Wilson (2018-08-17 22:43:03)
> > Quoting Rodrigo Vivi (2018-08-17 22:35:53)
> > > Since we block runtime PM if DMC is not loaded, let's skip
> > > the test.
> > > 
> > > v2: Use i915_dmc_info presence to detect dmc requirement
> > >     instead of gen check as Chris suggested.
> > > v3: Add missing \0 before using buf. (Chris)
> > > 
> > > Cc: Chris Wilson <chris at chris-wilson.co.uk>
> > > Cc: Imre Deak <imre.deak at intel.com>
> > > Cc: Anusha Srivatsa <anusha.srivatsa at intel.com>
> > > Signed-off-by: Rodrigo Vivi <rodrigo.vivi at intel.com>
> > > ---
> > >  tests/pm_rpm.c | 16 ++++++++++++++++
> > >  1 file changed, 16 insertions(+)
> > > 
> > > diff --git a/tests/pm_rpm.c b/tests/pm_rpm.c
> > > index bbe36e59..fa0d98dc 100644
> > > --- a/tests/pm_rpm.c
> > > +++ b/tests/pm_rpm.c
> > > @@ -693,6 +693,21 @@ static void setup_pc8(void)
> > >         has_pc8 = true;
> > >  }
> > >  
> > > +static bool dmc_loaded(void)
> > > +{
> > > +       char buf[15];
> > > +       int len;
> > > +
> > > +       len = igt_sysfs_read(debugfs, "i915_dmc_info", buf, sizeof(buf));
> > 
> > sizeof(buf) - 1 :)
> > 
> > or else len will be sizeof(buf) and buf[len] not where it belongs.

ops... indeed

> I was debating whether or not having a big red fail was a good idea or
> not, but at the end of the day it is an external failure (e.g. the user
> may purposely not provide the dmc firmware).

yeap... I had same line of thought myself before trying this...

> 
> With the final fix,
> Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>

Thanks for all the fixes

> -Chris
> _______________________________________________
> igt-dev mailing list
> igt-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev


More information about the igt-dev mailing list