All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: Xiaolin Zhang <xiaolin.zhang@intel.com>,
	intel-gfx@lists.freedesktop.org,
	intel-gvt-dev@lists.freedesktop.org
Cc: zhenyu.z.wang@intel.com, hang.yuan@intel.com, zhiyuan.lv@intel.com
Subject: Re: [PATCH v4 4/8] drm/i915: vgpu context submission pv optimization
Date: Fri, 29 Mar 2019 15:40:05 +0000	[thread overview]
Message-ID: <155387400537.24691.10910151885848243897@skylake-alporthouse-com> (raw)
In-Reply-To: <1553866364-111114-5-git-send-email-xiaolin.zhang@intel.com>

Quoting Xiaolin Zhang (2019-03-29 13:32:40)
> diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
> index 2f78829..28e8ee0 100644
> --- a/drivers/gpu/drm/i915/i915_irq.c
> +++ b/drivers/gpu/drm/i915/i915_irq.c
> @@ -37,6 +37,7 @@
>  #include "i915_drv.h"
>  #include "i915_trace.h"
>  #include "intel_drv.h"
> +#include "i915_vgpu.h"
>  
>  /**
>   * DOC: interrupt handling
> @@ -1470,6 +1471,7 @@ gen8_cs_irq_handler(struct intel_engine_cs *engine, u32 iir)
>         if (iir & GT_RENDER_USER_INTERRUPT) {
>                 intel_engine_breadcrumbs_irq(engine);
>                 tasklet |= USES_GUC_SUBMISSION(engine->i915);
> +               tasklet |= USES_PV_SUBMISSION(engine->i915);

We should move this to an engine->flag.

>         }
>  
>         if (tasklet)
> +static void vgpu_pv_set_default_submission(struct intel_engine_cs *engine)
> +{
> +       /*
> +        * We inherit a bunch of functions from execlists that we'd like
> +        * to keep using:
> +        *
> +        *    engine->submit_request = execlists_submit_request;
> +        *    engine->cancel_requests = execlists_cancel_requests;
> +        *    engine->schedule = execlists_schedule;
> +        *
> +        * But we need to override the actual submission backend in order
> +        * to talk to the GVT with PV notification message.
> +        */
> +       intel_execlists_set_default_submission(engine);
> +
> +       engine->execlists.tasklet.func = vgpu_pv_submission_tasklet;

You need to pin the breadcrumbs irq, or it will not fire on every
request.

I'd push for this to live in intel_pv_submission.c or
intel_vgpu_submission.c

> @@ -401,6 +551,12 @@ void intel_vgpu_config_pv_caps(struct drm_i915_private *dev_priv,
>                 ppgtt->vm.insert_entries = gen8_ppgtt_insert_4lvl_pv;
>                 ppgtt->vm.clear_range = gen8_ppgtt_clear_4lvl_pv;
>         }
> +
> +       if (cap == PV_SUBMISSION) {
> +               engine = (struct intel_engine_cs *)data;
> +               engine->set_default_submission = vgpu_pv_set_default_submission;
> +               engine->set_default_submission(engine);
> +       }
>  }

> diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
> index c1b9780..0a66714 100644
> --- a/drivers/gpu/drm/i915/intel_lrc.c
> +++ b/drivers/gpu/drm/i915/intel_lrc.c
> @@ -2352,6 +2352,9 @@ logical_ring_default_vfuncs(struct intel_engine_cs *engine)
>                  */
>         }
>         engine->emit_bb_start = gen8_emit_bb_start;
> +
> +       if (intel_vgpu_active(engine->i915))
> +               intel_vgpu_config_pv_caps(engine->i915, PV_SUBMISSION, engine);

That pair is ugly. Should clean up the engine initialisation so that it
doesn't involve placing a chunk of code in a foreign class.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2019-03-29 15:40 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-29 13:32 [PATCH v4 0/8] i915 vgpu PV to improve vgpu performance Xiaolin Zhang
2019-03-29  5:00 ` ✗ Fi.CI.BAT: failure for " Patchwork
2019-03-29 13:32 ` [PATCH v4 1/8] drm/i915: introduced vgpu pv capability Xiaolin Zhang
2019-03-29 13:32 ` [PATCH v4 2/8] drm/i915: vgpu shared memory setup for pv optimization Xiaolin Zhang
2019-03-29 13:32 ` [PATCH v4 3/8] drm/i915: vgpu ppgtt update " Xiaolin Zhang
2019-03-29 13:32 ` [PATCH v4 4/8] drm/i915: vgpu context submission " Xiaolin Zhang
2019-03-29  7:15   ` Chris Wilson
2019-03-29 15:40   ` Chris Wilson [this message]
2019-04-11  5:46     ` Zhang, Xiaolin
2019-03-29 19:14   ` Chris Wilson
2019-04-11  5:49     ` Zhang, Xiaolin
2019-03-29 13:32 ` [PATCH v4 5/8] drm/i915/gvt: GVTg handle pv_caps PVINFO register Xiaolin Zhang
2019-03-29 13:32 ` [PATCH v4 6/8] drm/i915/gvt: GVTg handle shared_page setup Xiaolin Zhang
2019-03-29 13:32 ` [PATCH v4 7/8] drm/i915/gvt: GVTg support ppgtt pv optimization Xiaolin Zhang
2019-03-29 13:32 ` [PATCH v4 8/8] drm/i915/gvt: GVTg support context submission " Xiaolin Zhang
2019-03-29 16:05 ` [PATCH v4 0/8] i915 vgpu PV to improve vgpu performance Chris Wilson
2019-04-11  5:54   ` Zhang, Xiaolin

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=155387400537.24691.10910151885848243897@skylake-alporthouse-com \
    --to=chris@chris-wilson.co.uk \
    --cc=hang.yuan@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-gvt-dev@lists.freedesktop.org \
    --cc=xiaolin.zhang@intel.com \
    --cc=zhenyu.z.wang@intel.com \
    --cc=zhiyuan.lv@intel.com \
    /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.