All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andi Shyti <andi.shyti@intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 2/3] drm/i915/selftests: Distinguish mock device from no wakeref
Date: Sat, 28 Sep 2019 00:49:38 +0300	[thread overview]
Message-ID: <20190927214938.GD2902@intel.intel> (raw)
In-Reply-To: <20190927211749.2181-2-chris@chris-wilson.co.uk>

On Fri, Sep 27, 2019 at 10:17:48PM +0100, Chris Wilson wrote:
> On systems that have no runtime-pm, we mark the wakeref as being -1. We
> therefore cannot use that value for the mock-gt indicator, so opt for
> -ENODEV instead. The wakeref should never be an error value -- one
> hopes!

-1 (EPERM) is an error value as well, -ENODEV looks cleaner and
more appropriate, in any case:

Reviewed-by: Andi Shyti <andi.shyti@intel.com>

Thanks,
Andi


> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Andi Shyti <andi.shyti@intel.com>
> ---
>  drivers/gpu/drm/i915/gt/intel_gt_pm.h            | 2 +-
>  drivers/gpu/drm/i915/selftests/mock_gem_device.c | 3 +--
>  2 files changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/gt/intel_gt_pm.h b/drivers/gpu/drm/i915/gt/intel_gt_pm.h
> index ab794e853356..997770d3a968 100644
> --- a/drivers/gpu/drm/i915/gt/intel_gt_pm.h
> +++ b/drivers/gpu/drm/i915/gt/intel_gt_pm.h
> @@ -57,7 +57,7 @@ int intel_gt_runtime_resume(struct intel_gt *gt);
>  
>  static inline bool is_mock_gt(const struct intel_gt *gt)
>  {
> -	return I915_SELFTEST_ONLY(gt->awake == -1);
> +	return I915_SELFTEST_ONLY(gt->awake == -ENODEV);
>  }
>  
>  #endif /* INTEL_GT_PM_H */
> diff --git a/drivers/gpu/drm/i915/selftests/mock_gem_device.c b/drivers/gpu/drm/i915/selftests/mock_gem_device.c
> index 91f15fa728cd..2448067822af 100644
> --- a/drivers/gpu/drm/i915/selftests/mock_gem_device.c
> +++ b/drivers/gpu/drm/i915/selftests/mock_gem_device.c
> @@ -182,6 +182,7 @@ struct drm_i915_private *mock_gem_device(void)
>  	i915_gem_init__mm(i915);
>  	intel_gt_init_early(&i915->gt, i915);
>  	atomic_inc(&i915->gt.wakeref.count); /* disable; no hw support */
> +	i915->gt.awake = -ENODEV;
>  
>  	i915->wq = alloc_ordered_workqueue("mock", 0);
>  	if (!i915->wq)
> @@ -192,8 +193,6 @@ struct drm_i915_private *mock_gem_device(void)
>  	INIT_DELAYED_WORK(&i915->gem.retire_work, mock_retire_work_handler);
>  	INIT_WORK(&i915->gem.idle_work, mock_idle_work_handler);
>  
> -	i915->gt.awake = -1;
> -
>  	intel_timelines_init(i915);
>  
>  	mutex_lock(&i915->drm.struct_mutex);
> -- 
> 2.23.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2019-09-27 21:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-27 21:17 [PATCH 1/3] drm/i915: Pass intel_gt to has-reset? Chris Wilson
2019-09-27 21:17 ` [PATCH 2/3] drm/i915/selftests: Distinguish mock device from no wakeref Chris Wilson
2019-09-27 21:49   ` Andi Shyti [this message]
2019-09-27 21:17 ` [PATCH 3/3] drm/i915/selftests: Provide a mock GPU reset routine Chris Wilson
2019-09-27 21:50   ` Andi Shyti
2019-09-27 21:46 ` [PATCH 1/3] drm/i915: Pass intel_gt to has-reset? Andi Shyti
2019-09-27 22:20 ` ✓ Fi.CI.BAT: success for series starting with [1/3] " Patchwork
2019-09-28 14:03 ` ✓ Fi.CI.IGT: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190927214938.GD2902@intel.intel \
    --to=andi.shyti@intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.