[Intel-gfx] [PATCH] drm/i915/selftests: Fix selftest_mocs for DGFX

Chris Wilson chris at chris-wilson.co.uk
Fri Feb 14 18:37:54 UTC 2020


Quoting Chris Wilson (2020-02-14 18:29:31)
> +static bool has_l3cc(struct drm_i915_private *i915)
> +{
> +       return true;
> +}
> +
> +static bool has_mocs(struct drm_i915_private *i915)
> +{
> +       return !IS_DGFX(i915);
> +}
> +
>  static int live_mocs_init(struct live_mocs *arg, struct intel_gt *gt)
>  {
> +       struct drm_i915_mocs_table table;
>         int err;
> 
> -       if (!get_mocs_settings(gt->i915, &arg->table))
> +       memset(arg, 0, sizeof(*arg));
> +
> +       if (!get_mocs_settings(gt->i915, &table))
>                 return -EINVAL;

On top of that, if we did something like return a mask from
get_mocs_settings() for HAS_L3CC | HAS_MOCS (or put it into table) we
can share the init with the main code and reduce potential drift.
-Chris


More information about the Intel-gfx mailing list