<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body>
    <div class="moz-cite-prefix">Hi Ashutosh,</div>
    <div class="moz-cite-prefix"><br>
    </div>
    <div class="moz-cite-prefix">I just noticed this change in the uAPI
      : <br>
    </div>
    <div class="moz-cite-prefix"><br>
    </div>
    <div class="moz-cite-prefix">
      <pre class="content" style="box-sizing: border-box; overflow: auto; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 13px; display: block; padding: 1em; margin: 0px 0px 10px; line-height: 14.3px; color: rgb(51, 51, 51); word-break: break-all; overflow-wrap: break-word; background-color: white; border: 1px solid rgb(204, 204, 204); border-radius: 0px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><span class="p_chunk" style="box-sizing: border-box; color: rgb(165, 42, 42); font-weight: bold;">@@ -298,6 +305,7 @@</span> <span class="p_context" style="box-sizing: border-box; color: rgb(160, 32, 240);"> struct drm_xe_query_gts {</span>
                __u64 native_mem_regions;       /* bit mask of instances from drm_xe_query_mem_usage */
                __u64 slow_mem_regions;         /* bit mask of instances from drm_xe_query_mem_usage */
                __u64 inaccessible_mem_regions; /* bit mask of instances from drm_xe_query_mem_usage */
<span class="p_add" style="box-sizing: border-box; color: rgb(0, 139, 139);">+                __u64 oa_timestamp_freq;</span>
                __u64 reserved[8];
        } gts[];
 };
</pre>
      <br class="Apple-interchange-newline">
    </div>
    <div class="moz-cite-prefix">I think you need to remove one item
      from the reserved field so that the structure size doesn't change.</div>
    <div class="moz-cite-prefix"><br>
    </div>
    <div class="moz-cite-prefix">-Lionel<br>
    </div>
    <div class="moz-cite-prefix"><br>
    </div>
    <div class="moz-cite-prefix">On 08/08/2023 05:41, Dixit, Ashutosh
      wrote:<br>
    </div>
    <blockquote type="cite" cite="mid:87jzu6xnlr.wl-ashutosh.dixit@intel.com">
      <pre class="moz-quote-pre" wrap="">On Mon, 07 Aug 2023 18:31:49 -0700, Ashutosh Dixit wrote:
</pre>
      <blockquote type="cite">
        <pre class="moz-quote-pre" wrap="">
</pre>
      </blockquote>
      <pre class="moz-quote-pre" wrap="">
Hi Umesh/Lionel,

</pre>
      <blockquote type="cite">
        <pre class="moz-quote-pre" wrap="">This patchset is the initial port of i915 perf/OA functionality to the Xe
driver. It has been tested against the following IGT patch:

<a class="moz-txt-link-freetext" href="https://patchwork.freedesktop.org/series/121082/">https://patchwork.freedesktop.org/series/121082/</a>

The following features in i915 have not been ported and will be added (as
new patches) if/as they are needed:

* Inline batch submission on stream exec_queue/hw_engine
* NOA wait
</pre>
      </blockquote>
      <pre class="moz-quote-pre" wrap="">
About these two in the "not-yet-ported" feature list for Xe: In
i915 when a stream engine is specified, requests are submitted "inline" to
that engine whenever the OA stream is opened or reconfigured. This feature
is at present not ported to Xe (see xe_oa_submit_bb()).

I have a couple of questions about this "inline submission":

* Is inline submission a hard requirement? That is, in Xe can UMD's say
  (completely outside OA uapi) fence till a segment of the workload
  completes, then open/reconfigure the OA stream and then continue? If
  UMD's are able to do this we don't need inline submission in Xe. If UMD's
  cannot do this please explain why not.

* If inline submission is indeed required, can we do away with NOA wait (as
  implemented in daed3e44396d ("drm/i915/perf: implement active wait for
  noa configurations")) or implement NOA wait differently in Xe? E.g. can
  we expose a fence in the OA uapi and UMD's would be required to wait on
  this fence/sync-object before continuing workload submissions after any
  OA stream open/reconfiguration.

The reason I am brining this up is because in i915 there are a couple of
scary bugs around this which are still unresolved. E.g.:

        <a class="moz-txt-link-freetext" href="https://gitlab.freedesktop.org/drm/intel/-/issues/8746">https://gitlab.freedesktop.org/drm/intel/-/issues/8746</a>
        <a class="moz-txt-link-freetext" href="https://gitlab.freedesktop.org/drm/intel/-/issues/8190">https://gitlab.freedesktop.org/drm/intel/-/issues/8190</a>

There is therefore reason to think if this functionality can be done
differently in Xe (not to say these bugs will be carried over to Xe).

Thanks.
--
Ashutosh

</pre>
      <blockquote type="cite">
        <pre class="moz-quote-pre" wrap="">* GuC ctx id (guc_sw_ctx_id)
* CTX_R_PWR_CLK_STATE/GEN8_R_PWR_CLK_STATE
* hold_preemption (DRM_XE_OA_PROP_HOLD_PREEMPTION)
* sseu_config (DRM_XE_OA_PROP_GLOBAL_SSEU)
* Override gucrc (override_gucrc_mode)
* MTL bios_c6_setup
* ratelimits
* compat ioctl

I am providing the following additional HAX patch (not part of this series)
to help review these patches:

<a class="moz-txt-link-freetext" href="https://patchwork.freedesktop.org/patch/551683/?series=120100&rev=4">https://patchwork.freedesktop.org/patch/551683/?series=120100&rev=4</a>

The commit message in the above patch explains how it can be useful for
reviewing this series.

Test-with: <a class="moz-txt-link-abbreviated" href="mailto:20230808010017.37819-1-ashutosh.dixit@intel.com">20230808010017.37819-1-ashutosh.dixit@intel.com</a>

v2: Fix build
v3: Rebase, due to s/xe_engine/xe_exec_queue/

Ashutosh Dixit (10):
  drm/xe/oa: Introduce OA uapi
  drm/xe/oa: Add OA types
  drm/xe/oa: Add registers and GPU commands used by OA
  drm/xe/oa: Module init/exit and probe/remove
  drm/xe/oa: Add/remove config ioctl's
  drm/xe/oa: Start implementing OA stream open ioctl
  drm/xe/oa: OA stream initialization
  drm/xe/oa: Expose OA stream fd
  drm/xe/oa: Read file_operation
  drm/xe/oa: Implement queries

 drivers/gpu/drm/xe/Makefile               |    1 +
 drivers/gpu/drm/xe/regs/xe_engine_regs.h  |    5 +
 drivers/gpu/drm/xe/regs/xe_gpu_commands.h |   27 +
 drivers/gpu/drm/xe/regs/xe_oa_regs.h      |  173 ++
 drivers/gpu/drm/xe/xe_device.c            |   16 +
 drivers/gpu/drm/xe/xe_device_types.h      |    4 +
 drivers/gpu/drm/xe/xe_gt_types.h          |    4 +
 drivers/gpu/drm/xe/xe_hw_engine_types.h   |    2 +
 drivers/gpu/drm/xe/xe_module.c            |    5 +
 drivers/gpu/drm/xe/xe_oa.c                | 2356 +++++++++++++++++++++
 drivers/gpu/drm/xe/xe_oa.h                |   28 +
 drivers/gpu/drm/xe/xe_oa_types.h          |  295 +++
 drivers/gpu/drm/xe/xe_query.c             |    5 +-
 include/uapi/drm/xe_drm.h                 |  257 ++-
 14 files changed, 3176 insertions(+), 2 deletions(-)
 create mode 100644 drivers/gpu/drm/xe/regs/xe_oa_regs.h
 create mode 100644 drivers/gpu/drm/xe/xe_oa.c
 create mode 100644 drivers/gpu/drm/xe/xe_oa.h
 create mode 100644 drivers/gpu/drm/xe/xe_oa_types.h

--
2.41.0

</pre>
      </blockquote>
    </blockquote>
    <p><br>
    </p>
  </body>
</html>