<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Aptos;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:12.0pt;
        font-family:"Aptos",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        font-size:10.0pt;
        font-family:"Courier New";}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;}
span.EmailStyle21
        {mso-style-type:personal-reply;
        font-family:"Aptos",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;
        mso-ligatures:none;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-IN" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif"> Belgaumkar, Vinay <vinay.belgaumkar@intel.com>
<br>
<b>Sent:</b> Tuesday, January 14, 2025 6:46 AM<br>
<b>To:</b> Upadhyay, Tejas <tejas.upadhyay@intel.com>; intel-xe@lists.freedesktop.org<br>
<b>Cc:</b> dri-devel@lists.freedesktop.org; Nilawar, Badal <badal.nilawar@intel.com>; Mrozek, Michal <michal.mrozek@intel.com>; Morek, Szymon <szymon.morek@intel.com>; Souza, Jose <jose.souza@intel.com>; De Marchi, Lucas <lucas.demarchi@intel.com><br>
<b>Subject:</b> Re: [RFC PATCH V3] drm/xe/guc: Use exec queue hints for GT frequency<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p><o:p> </o:p></p>
<div>
<p class="MsoNormal">On 1/10/2025 6:41 AM, Tejas Upadhyay wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>Allow user to provide a low latency hint per exec queue. When set,<o:p></o:p></pre>
<pre>KMD sends a hint to GuC which results in special handling for this<o:p></o:p></pre>
<pre>exec queue. SLPC will ramp the GT frequency aggressively every time<o:p></o:p></pre>
<pre>it switches to this exec queue.<o:p></o:p></pre>
</blockquote>
<p class="MsoNormal">We can remove the RFC tag. Also, s/exec queue/context here in the desc so that it is clearer.<br>
<br>
<o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">yes<o:p></o:p></span></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre><o:p> </o:p></pre>
<pre><o:p> </o:p></pre>
<pre>We need to enable the use of SLPC Compute strategy during init, but<o:p></o:p></pre>
<pre>it will apply only to exec queues that set this bit during exec queue<o:p></o:p></pre>
<pre>creation.<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>Improvement with this approach as below:<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>Before,<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>:~$ NEOReadDebugKeys=1 EnableDirectSubmission=0 clpeak --kernel-latency<o:p></o:p></pre>
<pre>Platform: Intel(R) OpenCL Graphics<o:p></o:p></pre>
<pre>  Device: Intel(R) Graphics [0xe20b]<o:p></o:p></pre>
<pre>    Driver version  : 24.52.0 (Linux x64)<o:p></o:p></pre>
<pre>    Compute units   : 160<o:p></o:p></pre>
<pre>    Clock frequency : 2850 MHz<o:p></o:p></pre>
<pre>    Kernel launch latency : 283.16 us<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>After,<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>:~$ NEOReadDebugKeys=1 EnableDirectSubmission=0 clpeak --kernel-latency<o:p></o:p></pre>
<pre>Platform: Intel(R) OpenCL Graphics<o:p></o:p></pre>
<pre>  Device: Intel(R) Graphics [0xe20b]<o:p></o:p></pre>
<pre>    Driver version  : 24.52.0 (Linux x64)<o:p></o:p></pre>
<pre>    Compute units   : 160<o:p></o:p></pre>
<pre>    Clock frequency : 2850 MHz<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>    Kernel launch latency : 63.38 us<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>UMD will indicate low latency hint with flag as mentioned below,<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>*     struct drm_xe_exec_queue_create exec_queue_create = {<o:p></o:p></pre>
<pre>*          .flags = DRM_XE_EXEC_QUEUE_LOW_LATENCY_HINT or 0<o:p></o:p></pre>
<pre>*          .extensions = 0,<o:p></o:p></pre>
<pre>*          .vm_id = vm,<o:p></o:p></pre>
<pre>*          .num_bb_per_exec = 1,<o:p></o:p></pre>
<pre>*          .num_eng_per_bb = 1,<o:p></o:p></pre>
<pre>*          .instances = to_user_pointer(&instance),<o:p></o:p></pre>
<pre>*     };<o:p></o:p></pre>
<pre>*     ioctl(fd, DRM_IOCTL_XE_EXEC_QUEUE_CREATE, &exec_queue_create);<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>Link to UMD PR : <a href="https://github.com/intel/compute-runtime/pull/794">https://github.com/intel/compute-runtime/pull/794</a><o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>Note: There is outstanding issue on guc side to be not able to switch to max<o:p></o:p></pre>
<pre>frequency as per strategy indicated by KMD, so for experminet/test result<o:p></o:p></pre>
<pre>hardcoding apporch was taken and passed to guc as policy. Effort on debugging<o:p></o:p></pre>
<pre>from guc side is going on in parallel.<o:p></o:p></pre>
</blockquote>
<p class="MsoNormal">This issue has been resolved, no need for this note.<br>
<br>
<o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Sure<o:p></o:p></span></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre><o:p> </o:p></pre>
<pre><o:p> </o:p></pre>
<pre>V3:<o:p></o:p></pre>
<pre>  - Conver user flag to kernel internal flag and use (Oak)<o:p></o:p></pre>
<pre>  - Support query config for use to check kernel support (Jose)<o:p></o:p></pre>
<pre>  - Dont need to take runtime pm (Vinay)<o:p></o:p></pre>
<pre>V2:<o:p></o:p></pre>
<pre>  - DRM_XE_EXEC_QUEUE_LOW_LATENCY_HINT 1 is already planned for other hint(Szymon)<o:p></o:p></pre>
<pre>  - Add motivation to description (Lucas)<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>Signed-off-by: Tejas Upadhyay <a href="mailto:tejas.upadhyay@intel.com"><tejas.upadhyay@intel.com></a><o:p></o:p></pre>
<pre>---<o:p></o:p></pre>
<pre> drivers/gpu/drm/xe/abi/guc_actions_slpc_abi.h |  3 +++<o:p></o:p></pre>
<pre> drivers/gpu/drm/xe/xe_exec_queue.c            | 11 ++++++++---<o:p></o:p></pre>
<pre> drivers/gpu/drm/xe/xe_exec_queue_types.h      |  3 ++-<o:p></o:p></pre>
<pre> drivers/gpu/drm/xe/xe_guc_pc.c                | 16 ++++++++++++++++<o:p></o:p></pre>
<pre> drivers/gpu/drm/xe/xe_guc_submit.c            |  7 +++++++<o:p></o:p></pre>
<pre> drivers/gpu/drm/xe/xe_query.c                 |  3 ++-<o:p></o:p></pre>
<pre> include/uapi/drm/xe_drm.h                     |  6 +++++-<o:p></o:p></pre>
<pre> 7 files changed, 43 insertions(+), 6 deletions(-)<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>diff --git a/drivers/gpu/drm/xe/abi/guc_actions_slpc_abi.h b/drivers/gpu/drm/xe/abi/guc_actions_slpc_abi.h<o:p></o:p></pre>
<pre>index 85abe4f09ae2..c50075b8270f 100644<o:p></o:p></pre>
<pre>--- a/drivers/gpu/drm/xe/abi/guc_actions_slpc_abi.h<o:p></o:p></pre>
<pre>+++ b/drivers/gpu/drm/xe/abi/guc_actions_slpc_abi.h<o:p></o:p></pre>
<pre>@@ -174,6 +174,9 @@ struct slpc_task_state_data {<o:p></o:p></pre>
<pre>        };<o:p></o:p></pre>
<pre> } __packed;<o:p></o:p></pre>
<pre> <o:p></o:p></pre>
<pre>+#define SLPC_EXEC_QUEUE_FREQ_REQ_IS_COMPUTE   REG_BIT(28)<o:p></o:p></pre>
<pre>+#define SLPC_OPTIMIZED_STRATEGY_COMPUTE              REG_BIT(0)<o:p></o:p></pre>
<pre>+<o:p></o:p></pre>
<pre> struct slpc_shared_data_header {<o:p></o:p></pre>
<pre>        /* Total size in bytes of this shared buffer. */<o:p></o:p></pre>
<pre>        u32 size;<o:p></o:p></pre>
<pre>diff --git a/drivers/gpu/drm/xe/xe_exec_queue.c b/drivers/gpu/drm/xe/xe_exec_queue.c<o:p></o:p></pre>
<pre>index 8948f50ee58f..bd33fb318677 100644<o:p></o:p></pre>
<pre>--- a/drivers/gpu/drm/xe/xe_exec_queue.c<o:p></o:p></pre>
<pre>+++ b/drivers/gpu/drm/xe/xe_exec_queue.c<o:p></o:p></pre>
<pre>@@ -544,6 +544,7 @@ int xe_exec_queue_create_ioctl(struct drm_device *dev, void *data,<o:p></o:p></pre>
<pre>        struct drm_xe_engine_class_instance __user *user_eci =<o:p></o:p></pre>
<pre>                u64_to_user_ptr(args->instances);<o:p></o:p></pre>
<pre>        struct xe_hw_engine *hwe;<o:p></o:p></pre>
<pre>+       unsigned long flags;<o:p></o:p></pre>
<pre>        struct xe_vm *vm;<o:p></o:p></pre>
<pre>        struct xe_gt *gt;<o:p></o:p></pre>
<pre>        struct xe_tile *tile;<o:p></o:p></pre>
<pre>@@ -553,7 +554,8 @@ int xe_exec_queue_create_ioctl(struct drm_device *dev, void *data,<o:p></o:p></pre>
<pre>        u32 len;<o:p></o:p></pre>
<pre>        int err;<o:p></o:p></pre>
<pre> <o:p></o:p></pre>
<pre>-       if (XE_IOCTL_DBG(xe, args->flags) ||<o:p></o:p></pre>
<pre>+       if (XE_IOCTL_DBG(xe, args->flags &&<o:p></o:p></pre>
<pre>+                        !(args->flags & DRM_XE_EXEC_QUEUE_LOW_LATENCY_HINT)) ||<o:p></o:p></pre>
<pre>            XE_IOCTL_DBG(xe, args->reserved[0] || args->reserved[1]))<o:p></o:p></pre>
<pre>                return -EINVAL;<o:p></o:p></pre>
<pre> <o:p></o:p></pre>
<pre>@@ -570,6 +572,9 @@ int xe_exec_queue_create_ioctl(struct drm_device *dev, void *data,<o:p></o:p></pre>
<pre>        if (XE_IOCTL_DBG(xe, eci[0].gt_id >= xe->info.gt_count))<o:p></o:p></pre>
<pre>                return -EINVAL;<o:p></o:p></pre>
<pre> <o:p></o:p></pre>
<pre>+       if (args->flags & DRM_XE_EXEC_QUEUE_LOW_LATENCY_HINT)<o:p></o:p></pre>
<pre>+               flags |= EXEC_QUEUE_FLAG_LOW_LATENCY;<o:p></o:p></pre>
<pre>+<o:p></o:p></pre>
<pre>        if (eci[0].engine_class == DRM_XE_ENGINE_CLASS_VM_BIND) {<o:p></o:p></pre>
<pre>                if (XE_IOCTL_DBG(xe, args->width != 1) ||<o:p></o:p></pre>
<pre>                    XE_IOCTL_DBG(xe, args->num_placements != 1) ||<o:p></o:p></pre>
<pre>@@ -578,8 +583,8 @@ int xe_exec_queue_create_ioctl(struct drm_device *dev, void *data,<o:p></o:p></pre>
<pre> <o:p></o:p></pre>
<pre>                for_each_tile(tile, xe, id) {<o:p></o:p></pre>
<pre>                        struct xe_exec_queue *new;<o:p></o:p></pre>
<pre>-                       u32 flags = EXEC_QUEUE_FLAG_VM;<o:p></o:p></pre>
<pre> <o:p></o:p></pre>
<pre>+                       flags |= EXEC_QUEUE_FLAG_VM;<o:p></o:p></pre>
<pre>                        if (id)<o:p></o:p></pre>
<pre>                               flags |= EXEC_QUEUE_FLAG_BIND_ENGINE_CHILD;<o:p></o:p></pre>
<pre> <o:p></o:p></pre>
<pre>@@ -626,7 +631,7 @@ int xe_exec_queue_create_ioctl(struct drm_device *dev, void *data,<o:p></o:p></pre>
<pre>                }<o:p></o:p></pre>
<pre> <o:p></o:p></pre>
<pre>                q = xe_exec_queue_create(xe, vm, logical_mask,<o:p></o:p></pre>
<pre>-                                       args->width, hwe, 0,<o:p></o:p></pre>
<pre>+                                       args->width, hwe, flags,<o:p></o:p></pre>
<pre>                                        args->extensions);<o:p></o:p></pre>
<pre>                up_read(&vm->lock);<o:p></o:p></pre>
<pre>                xe_vm_put(vm);<o:p></o:p></pre>
<pre>diff --git a/drivers/gpu/drm/xe/xe_exec_queue_types.h b/drivers/gpu/drm/xe/xe_exec_queue_types.h<o:p></o:p></pre>
<pre>index 5af5419cec7a..30dc129a6b09 100644<o:p></o:p></pre>
<pre>--- a/drivers/gpu/drm/xe/xe_exec_queue_types.h<o:p></o:p></pre>
<pre>+++ b/drivers/gpu/drm/xe/xe_exec_queue_types.h<o:p></o:p></pre>
<pre>@@ -85,7 +85,8 @@ struct xe_exec_queue {<o:p></o:p></pre>
<pre> #define EXEC_QUEUE_FLAG_BIND_ENGINE_CHILD     BIT(3)<o:p></o:p></pre>
<pre> /* kernel exec_queue only, set priority to highest level */<o:p></o:p></pre>
<pre> #define EXEC_QUEUE_FLAG_HIGH_PRIORITY         BIT(4)<o:p></o:p></pre>
<pre>-<o:p></o:p></pre>
<pre>+/* flag to indicate low latency hint to guc */<o:p></o:p></pre>
<pre>+#define EXEC_QUEUE_FLAG_LOW_LATENCY           BIT(5)<o:p></o:p></pre>
<pre>        /**<o:p></o:p></pre>
<pre>         * @flags: flags for this exec queue, should statically setup aside from ban<o:p></o:p></pre>
<pre>         * bit<o:p></o:p></pre>
<pre>diff --git a/drivers/gpu/drm/xe/xe_guc_pc.c b/drivers/gpu/drm/xe/xe_guc_pc.c<o:p></o:p></pre>
<pre>index df7f130fb663..4efa3485fffc 100644<o:p></o:p></pre>
<pre>--- a/drivers/gpu/drm/xe/xe_guc_pc.c<o:p></o:p></pre>
<pre>+++ b/drivers/gpu/drm/xe/xe_guc_pc.c<o:p></o:p></pre>
<pre>@@ -992,6 +992,17 @@ static int pc_init_freqs(struct xe_guc_pc *pc)<o:p></o:p></pre>
<pre>        return ret;<o:p></o:p></pre>
<pre> }<o:p></o:p></pre>
<pre> <o:p></o:p></pre>
<pre>+static int xe_guc_pc_set_strategy(struct xe_guc_pc *pc, u32 val)<o:p></o:p></pre>
</blockquote>
<p class="MsoNormal">s/xe_guc_pc_set_strategy/pc_action_set_strategy() <o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">sure<o:p></o:p></span></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre><o:p> </o:p></pre>
<pre>+{<o:p></o:p></pre>
<pre>+       int ret = 0;<o:p></o:p></pre>
<pre>+<o:p></o:p></pre>
<pre>+       ret = pc_action_set_param(pc,<o:p></o:p></pre>
<pre>+                                SLPC_PARAM_STRATEGIES,<o:p></o:p></pre>
<pre>+                                val);<o:p></o:p></pre>
</blockquote>
<p class="MsoNormal">Might be worth printing an error here if one occurs.<o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal">pc_action_set_param is already dumping error print it seems.<o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><br>
<br>
<o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre><o:p> </o:p></pre>
<pre>+<o:p></o:p></pre>
<pre>+       return ret;<o:p></o:p></pre>
<pre>+}<o:p></o:p></pre>
<pre>+<o:p></o:p></pre>
<pre> /**<o:p></o:p></pre>
<pre>  * xe_guc_pc_start - Start GuC's Power Conservation component<o:p></o:p></pre>
<pre>  * @pc: Xe_GuC_PC instance<o:p></o:p></pre>
<pre>@@ -1051,6 +1062,11 @@ int xe_guc_pc_start(struct xe_guc_pc *pc)<o:p></o:p></pre>
<pre>        }<o:p></o:p></pre>
<pre> <o:p></o:p></pre>
<pre>        ret = pc_action_setup_gucrc(pc, GUCRC_FIRMWARE_CONTROL);<o:p></o:p></pre>
<pre>+       if (ret)<o:p></o:p></pre>
<pre>+               goto out;<o:p></o:p></pre>
<pre>+<o:p></o:p></pre>
<pre>+       /* Enable SLPC Optimized Strategy for compute */<o:p></o:p></pre>
<pre>+       ret = xe_guc_pc_set_strategy(pc, SLPC_OPTIMIZED_STRATEGY_COMPUTE);<o:p></o:p></pre>
<pre> <o:p></o:p></pre>
<pre> out:<o:p></o:p></pre>
<pre>        xe_force_wake_put(gt_to_fw(gt), fw_ref);<o:p></o:p></pre>
<pre>diff --git a/drivers/gpu/drm/xe/xe_guc_submit.c b/drivers/gpu/drm/xe/xe_guc_submit.c<o:p></o:p></pre>
<pre>index 913c74d6e2ae..4c8f69427421 100644<o:p></o:p></pre>
<pre>--- a/drivers/gpu/drm/xe/xe_guc_submit.c<o:p></o:p></pre>
<pre>+++ b/drivers/gpu/drm/xe/xe_guc_submit.c<o:p></o:p></pre>
<pre>@@ -15,6 +15,7 @@<o:p></o:p></pre>
<pre> #include <drm/drm_managed.h><o:p></o:p></pre>
<pre> <o:p></o:p></pre>
<pre> #include "abi/guc_actions_abi.h"<o:p></o:p></pre>
<pre>+#include "abi/guc_actions_slpc_abi.h"<o:p></o:p></pre>
<pre> #include "abi/guc_klvs_abi.h"<o:p></o:p></pre>
<pre> #include "regs/xe_lrc_layout.h"<o:p></o:p></pre>
<pre> #include "xe_assert.h"<o:p></o:p></pre>
<pre>@@ -400,6 +401,7 @@ static void __guc_exec_queue_policy_add_##func(struct exec_queue_policy *policy,<o:p></o:p></pre>
<pre> MAKE_EXEC_QUEUE_POLICY_ADD(execution_quantum, EXECUTION_QUANTUM)<o:p></o:p></pre>
<pre> MAKE_EXEC_QUEUE_POLICY_ADD(preemption_timeout, PREEMPTION_TIMEOUT)<o:p></o:p></pre>
<pre> MAKE_EXEC_QUEUE_POLICY_ADD(priority, SCHEDULING_PRIORITY)<o:p></o:p></pre>
<pre>+MAKE_EXEC_QUEUE_POLICY_ADD(slpc_ctx_freq_req, SLPM_GT_FREQUENCY)<o:p></o:p></pre>
<pre> #undef MAKE_EXEC_QUEUE_POLICY_ADD<o:p></o:p></pre>
<pre> <o:p></o:p></pre>
<pre> static const int xe_exec_queue_prio_to_guc[] = {<o:p></o:p></pre>
<pre>@@ -414,14 +416,19 @@ static void init_policies(struct xe_guc *guc, struct xe_exec_queue *q)<o:p></o:p></pre>
<pre>        struct exec_queue_policy policy;<o:p></o:p></pre>
<pre>        enum xe_exec_queue_priority prio = q->sched_props.priority;<o:p></o:p></pre>
<pre>        u32 timeslice_us = q->sched_props.timeslice_us;<o:p></o:p></pre>
<pre>+       u32 slpc_ctx_freq_req = 0;<o:p></o:p></pre>
</blockquote>
<p class="MsoNormal">s/ctx/exec_queue  - Since that has been used everywhere<br>
<br>
<o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">ok<o:p></o:p></span></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre><o:p> </o:p></pre>
<pre>        u32 preempt_timeout_us = q->sched_props.preempt_timeout_us;<o:p></o:p></pre>
<pre> <o:p></o:p></pre>
<pre>        xe_gt_assert(guc_to_gt(guc), exec_queue_registered(q));<o:p></o:p></pre>
<pre> <o:p></o:p></pre>
<pre>+       if (q->flags & EXEC_QUEUE_FLAG_LOW_LATENCY)<o:p></o:p></pre>
<pre>+               slpc_ctx_freq_req |= SLPC_EXEC_QUEUE_FREQ_REQ_IS_COMPUTE;<o:p></o:p></pre>
<pre>+<o:p></o:p></pre>
<pre>        __guc_exec_queue_policy_start_klv(&policy, q->guc->id);<o:p></o:p></pre>
<pre>        __guc_exec_queue_policy_add_priority(&policy, xe_exec_queue_prio_to_guc[prio]);<o:p></o:p></pre>
<pre>        __guc_exec_queue_policy_add_execution_quantum(&policy, timeslice_us);<o:p></o:p></pre>
<pre>        __guc_exec_queue_policy_add_preemption_timeout(&policy, preempt_timeout_us);<o:p></o:p></pre>
<pre>+       __guc_exec_queue_policy_add_slpc_ctx_freq_req(&policy, slpc_ctx_freq_req);<o:p></o:p></pre>
<pre> <o:p></o:p></pre>
<pre>        xe_guc_ct_send(&guc->ct, (u32 *)&policy.h2g,<o:p></o:p></pre>
<pre>                       __guc_exec_queue_policy_action_size(&policy), 0, 0);<o:p></o:p></pre>
<pre>diff --git a/drivers/gpu/drm/xe/xe_query.c b/drivers/gpu/drm/xe/xe_query.c<o:p></o:p></pre>
<pre>index c059639613f7..aeea017198f2 100644<o:p></o:p></pre>
<pre>--- a/drivers/gpu/drm/xe/xe_query.c<o:p></o:p></pre>
<pre>+++ b/drivers/gpu/drm/xe/xe_query.c<o:p></o:p></pre>
<pre>@@ -334,7 +334,8 @@ static int query_config(struct xe_device *xe, struct drm_xe_device_query *query)<o:p></o:p></pre>
<pre>                xe->info.devid | (xe->info.revid << 16);<o:p></o:p></pre>
<pre>        if (xe_device_get_root_tile(xe)->mem.vram.usable_size)<o:p></o:p></pre>
<pre>                config->info[DRM_XE_QUERY_CONFIG_FLAGS] =<o:p></o:p></pre>
<pre>-                       DRM_XE_QUERY_CONFIG_FLAG_HAS_VRAM;<o:p></o:p></pre>
<pre>+                       DRM_XE_QUERY_CONFIG_FLAG_HAS_VRAM |<o:p></o:p></pre>
<pre>+                       DRM_XE_QUERY_CONFIG_FLAG_EQUEUE_HAS_LOW_LATENCY;<o:p></o:p></pre>
<pre>        config->info[DRM_XE_QUERY_CONFIG_MIN_ALIGNMENT] =<o:p></o:p></pre>
<pre>                xe->info.vram_flags & XE_VRAM_FLAGS_NEED64K ? SZ_64K : SZ_4K;<o:p></o:p></pre>
<pre>        config->info[DRM_XE_QUERY_CONFIG_VA_BITS] = xe->info.va_bits;<o:p></o:p></pre>
<pre>diff --git a/include/uapi/drm/xe_drm.h b/include/uapi/drm/xe_drm.h<o:p></o:p></pre>
<pre>index f62689ca861a..fd8755f7de78 100644<o:p></o:p></pre>
<pre>--- a/include/uapi/drm/xe_drm.h<o:p></o:p></pre>
<pre>+++ b/include/uapi/drm/xe_drm.h<o:p></o:p></pre>
<pre>@@ -393,6 +393,8 @@ struct drm_xe_query_mem_regions {<o:p></o:p></pre>
<pre>  *<o:p></o:p></pre>
<pre>  *    - %DRM_XE_QUERY_CONFIG_FLAG_HAS_VRAM - Flag is set if the device<o:p></o:p></pre>
<pre>  *      has usable VRAM<o:p></o:p></pre>
<pre>+ *    - %DRM_XE_QUERY_CONFIG_FLAG_HAS_VRAM - Flag is set if the device<o:p></o:p></pre>
<pre>+ *      has usable VRAM<o:p></o:p></pre>
</blockquote>
<p class="MsoNormal">HAS_LOW_LATENCY? <br>
<br>
<o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Yes<o:p></o:p></span></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre><o:p> </o:p></pre>
<pre>  *  - %DRM_XE_QUERY_CONFIG_MIN_ALIGNMENT - Minimal memory alignment<o:p></o:p></pre>
<pre>  *    required by this device, typically SZ_4K or SZ_64K<o:p></o:p></pre>
<pre>  *  - %DRM_XE_QUERY_CONFIG_VA_BITS - Maximum bits of a virtual address<o:p></o:p></pre>
<pre>@@ -409,6 +411,7 @@ struct drm_xe_query_config {<o:p></o:p></pre>
<pre> #define DRM_XE_QUERY_CONFIG_REV_AND_DEVICE_ID 0<o:p></o:p></pre>
<pre> #define DRM_XE_QUERY_CONFIG_FLAGS                    1<o:p></o:p></pre>
<pre>        #define DRM_XE_QUERY_CONFIG_FLAG_HAS_VRAM     (1 << 0)<o:p></o:p></pre>
<pre>+       #define DRM_XE_QUERY_CONFIG_FLAG_EQUEUE_HAS_LOW_LATENCY      (1 << 1)<o:p></o:p></pre>
<pre> #define DRM_XE_QUERY_CONFIG_MIN_ALIGNMENT            2<o:p></o:p></pre>
<pre> #define DRM_XE_QUERY_CONFIG_VA_BITS                  3<o:p></o:p></pre>
<pre> #define DRM_XE_QUERY_CONFIG_MAX_EXEC_QUEUE_PRIORITY  4<o:p></o:p></pre>
<pre>@@ -1097,6 +1100,7 @@ struct drm_xe_vm_bind {<o:p></o:p></pre>
<pre>  *         .engine_class = DRM_XE_ENGINE_CLASS_RENDER,<o:p></o:p></pre>
<pre>  *     };<o:p></o:p></pre>
<pre>  *     struct drm_xe_exec_queue_create exec_queue_create = {<o:p></o:p></pre>
<pre>+ *          .flags = DRM_XE_EXEC_QUEUE_LOW_LATENCY_HINT or 0<o:p></o:p></pre>
<pre>  *          .extensions = 0,<o:p></o:p></pre>
<pre>  *          .vm_id = vm,<o:p></o:p></pre>
<pre>  *          .num_bb_per_exec = 1,<o:p></o:p></pre>
<pre>@@ -1110,7 +1114,6 @@ struct drm_xe_exec_queue_create {<o:p></o:p></pre>
<pre> #define DRM_XE_EXEC_QUEUE_EXTENSION_SET_PROPERTY             0<o:p></o:p></pre>
<pre> #define   DRM_XE_EXEC_QUEUE_SET_PROPERTY_PRIORITY            0<o:p></o:p></pre>
<pre> #define   DRM_XE_EXEC_QUEUE_SET_PROPERTY_TIMESLICE           1<o:p></o:p></pre>
<pre>-<o:p></o:p></pre>
</blockquote>
<p>Extra delete? <o:p></o:p></p>
<p><span style="font-size:11.0pt">Yes thanks for pointing this out.<o:p></o:p></span></p>
<p><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p><span style="font-size:11.0pt">Thanks,<o:p></o:p></span></p>
<p><span style="font-size:11.0pt">Tejas<o:p></o:p></span></p>
<p>Thanks,<o:p></o:p></p>
<p>Vinay.<o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre><o:p> </o:p></pre>
<pre>        /** @extensions: Pointer to the first extension struct, if any */<o:p></o:p></pre>
<pre>        __u64 extensions;<o:p></o:p></pre>
<pre> <o:p></o:p></pre>
<pre>@@ -1123,6 +1126,7 @@ struct drm_xe_exec_queue_create {<o:p></o:p></pre>
<pre>        /** @vm_id: VM to use for this exec queue */<o:p></o:p></pre>
<pre>        __u32 vm_id;<o:p></o:p></pre>
<pre> <o:p></o:p></pre>
<pre>+#define DRM_XE_EXEC_QUEUE_LOW_LATENCY_HINT    (0x1 << 1)<o:p></o:p></pre>
<pre>        /** @flags: MBZ */<o:p></o:p></pre>
<pre>        __u32 flags;<o:p></o:p></pre>
<pre> <o:p></o:p></pre>
</blockquote>
</div>
</div>
</body>
</html>