<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    Yes, I would like to avoid having multiple code paths for context
    creation.<br>
    <br>
    Setting it later on should be equally to specifying it on creation
    since we only need it during CS.<br>
    <br>
    Regards,<br>
    Christian.<br>
    <br>
    <div class="moz-cite-prefix">Am 21.03.23 um 14:00 schrieb Sharma,
      Shashank:<br>
    </div>
    <blockquote type="cite"
cite="mid:MW4PR12MB56678ED37B6E498D3405F875F2819@MW4PR12MB5667.namprd12.prod.outlook.com">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <meta name="Generator" content="Microsoft Word 15 (filtered
        medium)">
      <style>@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;}p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}p.msipheaderdf3d92d6, li.msipheaderdf3d92d6, div.msipheaderdf3d92d6
        {mso-style-name:msipheaderdf3d92d6;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}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]-->
      <div class="WordSection1">
        <p class="msipheaderdf3d92d6" style="margin:0cm"><span
style="font-size:10.0pt;font-family:"Arial",sans-serif;color:blue">[AMD
            Official Use Only - General]</span><o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal"><span style="mso-fareast-language:EN-US">When
            we started this patch series, the workload hint was a part
            of the ctx_flag only,
            <o:p></o:p></span></p>
        <p class="MsoNormal"><span style="mso-fareast-language:EN-US">But
            we changed that after the design review, to make it more
            like how we are handling PSTATE.
            <o:p></o:p></span></p>
        <p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="mso-fareast-language:EN-US">Details:
            <o:p></o:p></span></p>
        <p class="MsoNormal"><span style="mso-fareast-language:EN-US"><a
              href="https://patchwork.freedesktop.org/patch/496111/"
              moz-do-not-send="true" class="moz-txt-link-freetext">https://patchwork.freedesktop.org/patch/496111/</a>
            <o:p></o:p></span></p>
        <p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="mso-fareast-language:EN-US">Regards<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="mso-fareast-language:EN-US">Shashank
            <o:p></o:p></span></p>
        <p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
        <div style="border:none;border-top:solid #E1E1E1
          1.0pt;padding:3.0pt 0cm 0cm 0cm">
          <p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span
              lang="EN-US"> Marek Olšák <a class="moz-txt-link-rfc2396E" href="mailto:maraeo@gmail.com"><maraeo@gmail.com></a>
              <br>
              <b>Sent:</b> 21 March 2023 04:05<br>
              <b>To:</b> Sharma, Shashank
              <a class="moz-txt-link-rfc2396E" href="mailto:Shashank.Sharma@amd.com"><Shashank.Sharma@amd.com></a><br>
              <b>Cc:</b> <a class="moz-txt-link-abbreviated" href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a>; Deucher,
              Alexander <a class="moz-txt-link-rfc2396E" href="mailto:Alexander.Deucher@amd.com"><Alexander.Deucher@amd.com></a>; Somalapuram,
              Amaranath <a class="moz-txt-link-rfc2396E" href="mailto:Amaranath.Somalapuram@amd.com"><Amaranath.Somalapuram@amd.com></a>; Koenig,
              Christian <a class="moz-txt-link-rfc2396E" href="mailto:Christian.Koenig@amd.com"><Christian.Koenig@amd.com></a><br>
              <b>Subject:</b> Re: [PATCH v3 1/5] drm/amdgpu: add UAPI
              for workload hints to ctx ioctl<o:p></o:p></span></p>
        </div>
        <p class="MsoNormal"><o:p> </o:p></p>
        <div>
          <div>
            <p class="MsoNormal">I think we should do it differently
              because this interface will be mostly unused by open
              source userspace in its current form.<o:p></o:p></p>
          </div>
          <div>
            <p class="MsoNormal"><o:p> </o:p></p>
          </div>
          <div>
            <p class="MsoNormal">Let's set the workload hint in
              drm_amdgpu_ctx_in::flags, and that will be immutable for
              the lifetime of the context. No other interface is needed.<o:p></o:p></p>
          </div>
          <div>
            <p class="MsoNormal"><o:p> </o:p></p>
          </div>
          <div>
            <p class="MsoNormal">Marek<o:p></o:p></p>
          </div>
        </div>
        <p class="MsoNormal"><o:p> </o:p></p>
        <div>
          <div>
            <p class="MsoNormal">On Mon, Sep 26, 2022 at 5:41 PM
              Shashank Sharma <<a
                href="mailto:shashank.sharma@amd.com"
                moz-do-not-send="true" class="moz-txt-link-freetext">shashank.sharma@amd.com</a>>
              wrote:<o:p></o:p></p>
          </div>
          <blockquote style="border:none;border-left:solid #CCCCCC
            1.0pt;padding:0cm 0cm 0cm
6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
            <p class="MsoNormal" style="margin-bottom:12.0pt">Allow the
              user to specify a workload hint to the kernel.<br>
              We can use these to tweak the dpm heuristics to better
              match<br>
              the workload for improved performance.<br>
              <br>
              V3: Create only set() workload UAPI (Christian)<br>
              <br>
              Signed-off-by: Alex Deucher <<a
                href="mailto:alexander.deucher@amd.com" target="_blank"
                moz-do-not-send="true" class="moz-txt-link-freetext">alexander.deucher@amd.com</a>><br>
              Signed-off-by: Shashank Sharma <<a
                href="mailto:shashank.sharma@amd.com" target="_blank"
                moz-do-not-send="true" class="moz-txt-link-freetext">shashank.sharma@amd.com</a>><br>
              ---<br>
               include/uapi/drm/amdgpu_drm.h | 17 +++++++++++++++++<br>
               1 file changed, 17 insertions(+)<br>
              <br>
              diff --git a/include/uapi/drm/amdgpu_drm.h
              b/include/uapi/drm/amdgpu_drm.h<br>
              index c2c9c674a223..23d354242699 100644<br>
              --- a/include/uapi/drm/amdgpu_drm.h<br>
              +++ b/include/uapi/drm/amdgpu_drm.h<br>
              @@ -212,6 +212,7 @@ union drm_amdgpu_bo_list {<br>
               #define AMDGPU_CTX_OP_QUERY_STATE2     4<br>
               #define AMDGPU_CTX_OP_GET_STABLE_PSTATE        5<br>
               #define AMDGPU_CTX_OP_SET_STABLE_PSTATE        6<br>
              +#define AMDGPU_CTX_OP_SET_WORKLOAD_PROFILE     7<br>
              <br>
               /* GPU reset status */<br>
               #define AMDGPU_CTX_NO_RESET            0<br>
              @@ -252,6 +253,17 @@ union drm_amdgpu_bo_list {<br>
               #define AMDGPU_CTX_STABLE_PSTATE_MIN_MCLK  3<br>
               #define AMDGPU_CTX_STABLE_PSTATE_PEAK  4<br>
              <br>
              +/* GPU workload hints, flag bits 8-15 */<br>
              +#define AMDGPU_CTX_WORKLOAD_HINT_SHIFT     8<br>
              +#define AMDGPU_CTX_WORKLOAD_HINT_MASK      (0xff <<
              AMDGPU_CTX_WORKLOAD_HINT_SHIFT)<br>
              +#define AMDGPU_CTX_WORKLOAD_HINT_NONE      (0 <<
              AMDGPU_CTX_WORKLOAD_HINT_SHIFT)<br>
              +#define AMDGPU_CTX_WORKLOAD_HINT_3D        (1 <<
              AMDGPU_CTX_WORKLOAD_HINT_SHIFT)<br>
              +#define AMDGPU_CTX_WORKLOAD_HINT_VIDEO     (2 <<
              AMDGPU_CTX_WORKLOAD_HINT_SHIFT)<br>
              +#define AMDGPU_CTX_WORKLOAD_HINT_VR        (3 <<
              AMDGPU_CTX_WORKLOAD_HINT_SHIFT)<br>
              +#define AMDGPU_CTX_WORKLOAD_HINT_COMPUTE   (4 <<
              AMDGPU_CTX_WORKLOAD_HINT_SHIFT)<br>
              +#define AMDGPU_CTX_WORKLOAD_HINT_MAX     
              AMDGPU_CTX_WORKLOAD_HINT_COMPUTE<br>
              +#define AMDGPU_CTX_WORKLOAD_INDEX(n)      (n >>
              AMDGPU_CTX_WORKLOAD_HINT_SHIFT)<br>
              +<br>
               struct drm_amdgpu_ctx_in {<br>
                      /** AMDGPU_CTX_OP_* */<br>
                      __u32   op;<br>
              @@ -281,6 +293,11 @@ union drm_amdgpu_ctx_out {<br>
                                      __u32   flags;<br>
                                      __u32   _pad;<br>
                              } pstate;<br>
              +<br>
              +               struct {<br>
              +                       __u32   flags;<br>
              +                       __u32   _pad;<br>
              +               } workload;<br>
               };<br>
              <br>
               union drm_amdgpu_ctx {<br>
              -- <br>
              2.34.1<o:p></o:p></p>
          </blockquote>
        </div>
      </div>
    </blockquote>
    <br>
  </body>
</html>