All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v2 2/3] drm/i915: Move the scheduler feature bits into the purview of the engines
Date: Wed, 31 Jan 2018 15:58:17 +0200	[thread overview]
Message-ID: <878tcew2o6.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <20180131094703.3676-2-chris@chris-wilson.co.uk>

Chris Wilson <chris@chris-wilson.co.uk> writes:

> Rather than having the high level ioctl interface guess the underlying
> implementation details, having the implementation declare what
> capabilities it exports. We define an intel_driver_caps, similar to the
> intel_device_info, which instead of trying to describe the HW gives
> details on what the driver itself supports. This is then populated by
> the engine backend for the new scheduler capability field for use
> elsewhere.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Tomasz Lis <tomasz.lis@intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_drv.c          | 8 +-------
>  drivers/gpu/drm/i915/i915_drv.h          | 2 ++
>  drivers/gpu/drm/i915/i915_gem.c          | 3 +++
>  drivers/gpu/drm/i915/i915_gpu_error.c    | 7 +++++--
>  drivers/gpu/drm/i915/intel_device_info.c | 6 ++++++
>  drivers/gpu/drm/i915/intel_device_info.h | 7 +++++++
>  drivers/gpu/drm/i915/intel_lrc.c         | 6 ++++++
>  7 files changed, 30 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index 1ec12add34b2..733f71637914 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -372,13 +372,7 @@ static int i915_getparam(struct drm_device *dev, void *data,
>  		value = i915_gem_mmap_gtt_version();
>  		break;
>  	case I915_PARAM_HAS_SCHEDULER:
> -		value = 0;
> -		if (dev_priv->engine[RCS] && dev_priv->engine[RCS]->schedule) {
> -			value |= I915_SCHEDULER_CAP_ENABLED;
> -			value |= I915_SCHEDULER_CAP_PRIORITY;
> -			if (HAS_LOGICAL_RING_PREEMPTION(dev_priv))
> -				value |= I915_SCHEDULER_CAP_PREEMPTION;
> -		}
> +		value = dev_priv->caps.scheduler;

Use the shiny CAP_PRIORITY instead of rcs->schedule on the
I915_CONTEXT_PARAM_PRIORITY validation?

-Mika

>  		break;
>  
>  	case I915_PARAM_MMAP_VERSION:
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 388b72cccde4..ae434c9d2b4f 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -468,6 +468,7 @@ struct i915_gpu_state {
>  	u32 reset_count;
>  	u32 suspend_count;
>  	struct intel_device_info device_info;
> +	struct intel_driver_caps driver_caps;
>  	struct i915_params params;
>  
>  	struct i915_error_uc {
> @@ -1808,6 +1809,7 @@ struct drm_i915_private {
>  	struct kmem_cache *priorities;
>  
>  	const struct intel_device_info info;
> +	struct intel_driver_caps caps;
>  
>  	/**
>  	 * Data Stolen Memory - aka "i915 stolen memory" gives us the start and
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index 062b21408698..ad7bd0dc57ee 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -3223,8 +3223,11 @@ void i915_gem_set_wedged(struct drm_i915_private *i915)
>  		 * start to complete all requests.
>  		 */
>  		engine->submit_request = nop_complete_submit_request;
> +		engine->schedule = NULL;
>  	}
>  
> +	i915->caps.scheduler = 0;
> +
>  	/*
>  	 * Make sure no request can slip through without getting completed by
>  	 * either this call here to intel_engine_init_global_seqno, or the one
> diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c
> index a81351d9e3a6..a92b0c0377c7 100644
> --- a/drivers/gpu/drm/i915/i915_gpu_error.c
> +++ b/drivers/gpu/drm/i915/i915_gpu_error.c
> @@ -573,11 +573,13 @@ static void print_error_obj(struct drm_i915_error_state_buf *m,
>  }
>  
>  static void err_print_capabilities(struct drm_i915_error_state_buf *m,
> -				   const struct intel_device_info *info)
> +				   const struct intel_device_info *info,
> +				   const struct intel_driver_caps *caps)
>  {
>  	struct drm_printer p = i915_error_printer(m);
>  
>  	intel_device_info_dump_flags(info, &p);
> +	intel_driver_caps_print(caps, &p);
>  }
>  
>  static void err_print_params(struct drm_i915_error_state_buf *m,
> @@ -800,7 +802,7 @@ int i915_error_state_to_str(struct drm_i915_error_state_buf *m,
>  	if (error->display)
>  		intel_display_print_error_state(m, error->display);
>  
> -	err_print_capabilities(m, &error->device_info);
> +	err_print_capabilities(m, &error->device_info, &error->driver_caps);
>  	err_print_params(m, &error->params);
>  	err_print_uc(m, &error->uc);
>  
> @@ -1731,6 +1733,7 @@ static void i915_capture_gen_state(struct drm_i915_private *dev_priv,
>  	memcpy(&error->device_info,
>  	       INTEL_INFO(dev_priv),
>  	       sizeof(error->device_info));
> +	error->driver_caps = dev_priv->caps;
>  }
>  
>  static __always_inline void dup_param(const char *type, void *x)
> diff --git a/drivers/gpu/drm/i915/intel_device_info.c b/drivers/gpu/drm/i915/intel_device_info.c
> index a2c16140169f..298f8996cc54 100644
> --- a/drivers/gpu/drm/i915/intel_device_info.c
> +++ b/drivers/gpu/drm/i915/intel_device_info.c
> @@ -586,3 +586,9 @@ void intel_device_info_runtime_init(struct intel_device_info *info)
>  	/* Initialize command stream timestamp frequency */
>  	info->cs_timestamp_frequency_khz = read_timestamp_frequency(dev_priv);
>  }
> +
> +void intel_driver_caps_print(const struct intel_driver_caps *caps,
> +			     struct drm_printer *p)
> +{
> +	drm_printf(p, "scheduler: %x\n", caps->scheduler);
> +}
> diff --git a/drivers/gpu/drm/i915/intel_device_info.h b/drivers/gpu/drm/i915/intel_device_info.h
> index 9542018d11d0..71fdfb0451ef 100644
> --- a/drivers/gpu/drm/i915/intel_device_info.h
> +++ b/drivers/gpu/drm/i915/intel_device_info.h
> @@ -167,6 +167,10 @@ struct intel_device_info {
>  	} color;
>  };
>  
> +struct intel_driver_caps {
> +	unsigned int scheduler;
> +};
> +
>  static inline unsigned int sseu_subslice_total(const struct sseu_dev_info *sseu)
>  {
>  	return hweight8(sseu->slice_mask) * hweight8(sseu->subslice_mask);
> @@ -182,4 +186,7 @@ void intel_device_info_dump_flags(const struct intel_device_info *info,
>  void intel_device_info_dump_runtime(const struct intel_device_info *info,
>  				    struct drm_printer *p);
>  
> +void intel_driver_caps_print(const struct intel_driver_caps *caps,
> +			     struct drm_printer *p);
> +
>  #endif
> diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
> index 2fa328d512fc..5390894001f0 100644
> --- a/drivers/gpu/drm/i915/intel_lrc.c
> +++ b/drivers/gpu/drm/i915/intel_lrc.c
> @@ -1906,6 +1906,12 @@ static void execlists_set_default_submission(struct intel_engine_cs *engine)
>  	engine->unpark = NULL;
>  
>  	engine->flags |= I915_ENGINE_SUPPORTS_STATS;
> +
> +	engine->i915->caps.scheduler =
> +		I915_SCHEDULER_CAP_ENABLED |
> +		I915_SCHEDULER_CAP_PRIORITY;
> +	if (HAS_LOGICAL_RING_PREEMPTION(engine->i915))
> +		engine->i915->caps.scheduler |= I915_SCHEDULER_CAP_PREEMPTION;
>  }
>  
>  static void
> -- 
> 2.15.1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2018-01-31 13:58 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-31  9:47 [PATCH v2 1/3] drm/i915/guc: Allow preempt-client to be NULL Chris Wilson
2018-01-31  9:47 ` [PATCH v2 2/3] drm/i915: Move the scheduler feature bits into the purview of the engines Chris Wilson
2018-01-31 13:58   ` Mika Kuoppala [this message]
2018-02-01 18:54     ` Chris Wilson
2018-02-01 19:02     ` [PATCH v2] " Chris Wilson
2018-02-02 13:55       ` Mika Kuoppala
2018-02-02 14:06       ` Lis, Tomasz
2018-01-31  9:47 ` [PATCH v2 3/3] drm/i915: Only allocate preempt context when required Chris Wilson
2018-01-31 14:38   ` Mika Kuoppala
2018-01-31 15:25     ` Chris Wilson
2018-02-03 10:40   ` [PATCH v2] " Chris Wilson
2018-01-31 11:01 ` ✗ Fi.CI.BAT: warning for series starting with [v2,1/3] drm/i915/guc: Allow preempt-client to be NULL Patchwork
2018-01-31 11:31 ` [PATCH v2 1/3] " Mika Kuoppala
2018-01-31 11:34   ` Chris Wilson
2018-01-31 12:42     ` Mika Kuoppala
2018-01-31 12:03   ` [PATCH v2] " Chris Wilson
2018-01-31 13:14     ` Mika Kuoppala
2018-01-31 13:00 ` ✓ Fi.CI.BAT: success for series starting with [v2] drm/i915/guc: Allow preempt-client to be NULL (rev2) Patchwork
2018-01-31 16:44 ` ✓ Fi.CI.IGT: " Patchwork
2018-02-01 19:22 ` ✗ Fi.CI.BAT: failure for series starting with [v2] drm/i915/guc: Allow preempt-client to be NULL (rev3) Patchwork
2018-02-03 11:17 ` ✓ Fi.CI.BAT: success for series starting with [v2] drm/i915/guc: Allow preempt-client to be NULL (rev4) Patchwork
2018-02-04  6:51 ` ✗ Fi.CI.IGT: failure " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2018-02-07 21:05 [PATCH v2 1/3] drm/i915/guc: Allow preempt-client to be NULL Chris Wilson
2018-02-07 21:05 ` [PATCH v2 2/3] drm/i915: Move the scheduler feature bits into the purview of the engines Chris Wilson

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=878tcew2o6.fsf@gaia.fi.intel.com \
    --to=mika.kuoppala@linux.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.