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

Chris Wilson chris at chris-wilson.co.uk
Fri Aug 17 21:26:41 UTC 2018


Quoting Rodrigo Vivi (2018-08-17 22:13:32)
> 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.
> 
> 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 | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/tests/pm_rpm.c b/tests/pm_rpm.c
> index bbe36e59..24325feb 100644
> --- a/tests/pm_rpm.c
> +++ b/tests/pm_rpm.c
> @@ -693,6 +693,17 @@ static void setup_pc8(void)
>         has_pc8 = true;
>  }
>  
> +static bool dmc_loaded(void)
> +{
> +       char buf[15];
> +
> +       if (igt_sysfs_read(debugfs, "i915_dmc_info", buf, sizeof(buf)) < 0)
> +           return true; /* no CSR support, no DMC requirement */

Hmm, I didn't mention the issue with the missing NUL byte...

char buf[16];
int len;

len = ...read(... sizeof(buf) - 1);
if (len < 0)
	return true; /*...*/

buf[len] = '\0';

Sorry,
-Chris


More information about the igt-dev mailing list