<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    Marek and other userspace folks need to decide that.<br>
    <br>
    Basic question here is if Mesa is already accessing sysfs nodes for
    OpenGL or RADV. If that is the case then we should probably expose
    the information there as well.<br>
    <br>
    If that isn't the case (which I think it is) then we should
    implement it as IOCTL.<br>
    <br>
    Regards,<br>
    Christian.<br>
    <br>
    <div class="moz-cite-prefix">Am 10.05.21 um 22:19 schrieb Nieto,
      David M:<br>
    </div>
    <blockquote type="cite"
      cite="mid:447046CE-6FB4-49D7-A74A-2188654F5D5C@amd.com">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <meta name="Generator" content="Microsoft Word 15 (filtered
        medium)">
      <!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]-->
      <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;}@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;}span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}.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="MsoNormal">One of the primary usecases is to add this
          information to the renderer string, I am not sure if there are
          other cases of UMD drivers accessing sysfs nodes, but I think
          if we think permissions, if a client is authenticated and
          opens the render device then it can use the IOCTL, it is
          unclear to me we can make a such an assumption for sysfs
          nodes…<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">I think there is value in having both tbh.<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">Regards,<o:p></o:p></p>
        <p class="MsoNormal">David<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <div style="border:none;border-top:solid #B5C4DF
          1.0pt;padding:3.0pt 0in 0in 0in">
          <p class="MsoNormal"><b><span
                style="font-size:12.0pt;color:black">From: </span></b><span
              style="font-size:12.0pt;color:black">Christian König
              <a class="moz-txt-link-rfc2396E" href="mailto:ckoenig.leichtzumerken@gmail.com"><ckoenig.leichtzumerken@gmail.com></a><br>
              <b>Date: </b>Monday, May 10, 2021 at 6:48 AM<br>
              <b>To: </b>"Nieto, David M" <a class="moz-txt-link-rfc2396E" href="mailto:David.Nieto@amd.com"><David.Nieto@amd.com></a>,
              "Gu, JiaWei (Will)" <a class="moz-txt-link-rfc2396E" href="mailto:JiaWei.Gu@amd.com"><JiaWei.Gu@amd.com></a><br>
              <b>Cc: </b>Alex Deucher <a class="moz-txt-link-rfc2396E" href="mailto:alexdeucher@gmail.com"><alexdeucher@gmail.com></a>,
              "Deng, Emily" <a class="moz-txt-link-rfc2396E" href="mailto:Emily.Deng@amd.com"><Emily.Deng@amd.com></a>, Kees Cook
              <a class="moz-txt-link-rfc2396E" href="mailto:keescook@chromium.org"><keescook@chromium.org></a>, amd-gfx list
              <a class="moz-txt-link-rfc2396E" href="mailto:amd-gfx@lists.freedesktop.org"><amd-gfx@lists.freedesktop.org></a><br>
              <b>Subject: </b>Re: [PATCH] drm/amdgpu: Align serial size
              in drm_amdgpu_info_vbios<o:p></o:p></span></p>
        </div>
        <div>
          <p class="MsoNormal"><o:p> </o:p></p>
        </div>
        <p class="MsoNormal" style="margin-bottom:12.0pt">Well we could
          add both as sysfs file(s).<br>
          <br>
          Question here is rather what is the primary use case of this
          and if the application has the necessary access permissions to
          the sysfs files?<br>
          <br>
          Regards,<br>
          Christian.<o:p></o:p></p>
        <div>
          <p class="MsoNormal">Am 10.05.21 um 15:42 schrieb Nieto, David
            M:<o:p></o:p></p>
        </div>
        <blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
          <div>
            <div>
              <div>
                <p class="MsoNormal" style="background:white"><span
                    style="color:black">Then the application would need
                    to issue the ioctl and then open a sysfs file to get
                    all the information it needs. It makes little sense
                    from a programming perspective to add an incomplete
                    interface in my opinion <o:p></o:p></span></p>
              </div>
            </div>
            <div>
              <p class="MsoNormal"><o:p> </o:p></p>
            </div>
          </div>
          <div class="MsoNormal" style="text-align:center"
            align="center">
            <hr width="100%" size="0" align="center">
          </div>
          <div id="divRplyFwdMsg">
            <p class="MsoNormal"><b><span style="color:black">From:</span></b><span
                style="color:black"> Gu, JiaWei (Will)
                <a href="mailto:JiaWei.Gu@amd.com"
                  moz-do-not-send="true"><JiaWei.Gu@amd.com></a><br>
                <b>Sent:</b> Monday, May 10, 2021 12:13:07 AM<br>
                <b>To:</b> Nieto, David M <a
                  href="mailto:David.Nieto@amd.com"
                  moz-do-not-send="true"><David.Nieto@amd.com></a><br>
                <b>Cc:</b> Alex Deucher <a
                  href="mailto:alexdeucher@gmail.com"
                  moz-do-not-send="true"><alexdeucher@gmail.com></a>;
                amd-gfx list
                <a href="mailto:amd-gfx@lists.freedesktop.org"
                  moz-do-not-send="true"><amd-gfx@lists.freedesktop.org></a>;
                Kees Cook
                <a href="mailto:keescook@chromium.org"
                  moz-do-not-send="true"><keescook@chromium.org></a>;
                Deng, Emily <a href="mailto:Emily.Deng@amd.com"
                  moz-do-not-send="true">
                  <Emily.Deng@amd.com></a><br>
                <b>Subject:</b> RE: [PATCH] drm/amdgpu: Align serial
                size in drm_amdgpu_info_vbios</span>
              <o:p></o:p></p>
            <div>
              <p class="MsoNormal"> <o:p></o:p></p>
            </div>
          </div>
          <div>
            <div>
              <p class="MsoNormal">[AMD Official Use Only - Internal
                Distribution Only]<br>
                <br>
                Hi David,<br>
                <br>
                What I meant is to ONLY delete the serial[16] from
                drm_amdgpu_info_vbios, not the whole struct.<br>
                <br>
                struct drm_amdgpu_info_vbios {<br>
                        __u8 name[64];<br>
                        __u32 dbdf;<br>
                        __u8 vbios_pn[64];<br>
                        __u32 version;<br>
                        __u8 date[32];<br>
                        __u8 serial[16]; // jiawei: shall we delete this<br>
                        __u32 dev_id;<br>
                        __u32 rev_id;<br>
                        __u32 sub_dev_id;<br>
                        __u32 sub_ved_id;<br>
                };<br>
                <br>
                serial[16] in drm_amdgpu_info_vbios  copied from
                adev->serial, but there's already a sysfs named
                serial_number, which exposes it already.<br>
                <br>
                static ssize_t amdgpu_device_get_serial_number(struct
                device *dev,<br>
                                struct device_attribute *attr, char
                *buf)<br>
                {<br>
                        struct drm_device *ddev = dev_get_drvdata(dev);<br>
                        struct amdgpu_device *adev =
                ddev->dev_private;<br>
                <br>
                        return snprintf(buf, PAGE_SIZE, "%s\n",
                adev->serial);<br>
                }<br>
                <br>
                Thanks,<br>
                Jiawei<br>
                <br>
                <br>
                -----Original Message-----<br>
                From: Nieto, David M <a
                  href="mailto:David.Nieto@amd.com"
                  moz-do-not-send="true"><David.Nieto@amd.com></a>
                <br>
                Sent: Monday, May 10, 2021 2:53 PM<br>
                To: Gu, JiaWei (Will) <a
                  href="mailto:JiaWei.Gu@amd.com" moz-do-not-send="true"><JiaWei.Gu@amd.com></a><br>
                Cc: Alex Deucher <a href="mailto:alexdeucher@gmail.com"
                  moz-do-not-send="true"><alexdeucher@gmail.com></a>;
                amd-gfx list
                <a href="mailto:amd-gfx@lists.freedesktop.org"
                  moz-do-not-send="true"><amd-gfx@lists.freedesktop.org></a>;
                Kees Cook
                <a href="mailto:keescook@chromium.org"
                  moz-do-not-send="true"><keescook@chromium.org></a>;
                Deng, Emily <a href="mailto:Emily.Deng@amd.com"
                  moz-do-not-send="true">
                  <Emily.Deng@amd.com></a><br>
                Subject: Re: [PATCH] drm/amdgpu: Align serial size in
                drm_amdgpu_info_vbios<br>
                <br>
                No, this structure contains all the details of the
                vbios: date, serial number, name, etc.<br>
                <br>
                The sysfs node only contains the vbios name string<br>
                <br>
                > On May 9, 2021, at 23:33, Gu, JiaWei (Will) <a
                  href="mailto:JiaWei.Gu@amd.com" moz-do-not-send="true">
                  <JiaWei.Gu@amd.com></a> wrote:<br>
                > <br>
                > [AMD Official Use Only - Internal Distribution
                Only]<br>
                > <br>
                > With a second thought,<br>
                > __u8 serial[16] in drm_amdgpu_info_vbios is a bit
                redundant, sysfs serial_number already exposes it.<br>
                > <br>
                > Is it fine to abandon it from drm_amdgpu_info_vbios
                struct? @Alex <br>
                > Deucher @Nieto, David M<br>
                > <br>
                > Best regards,<br>
                > Jiawei<br>
                > <br>
                > -----Original Message-----<br>
                > From: Alex Deucher <a
                  href="mailto:alexdeucher@gmail.com"
                  moz-do-not-send="true"><alexdeucher@gmail.com></a><br>
                > Sent: Sunday, May 9, 2021 11:59 PM<br>
                > To: Gu, JiaWei (Will) <a
                  href="mailto:JiaWei.Gu@amd.com" moz-do-not-send="true"><JiaWei.Gu@amd.com></a><br>
                > Cc: amd-gfx list <a
                  href="mailto:amd-gfx@lists.freedesktop.org"
                  moz-do-not-send="true"><amd-gfx@lists.freedesktop.org></a>;
                Kees Cook
                <br>
                > <a href="mailto:keescook@chromium.org"
                  moz-do-not-send="true"><keescook@chromium.org></a><br>
                > Subject: Re: [PATCH] drm/amdgpu: Align serial size
                in <br>
                > drm_amdgpu_info_vbios<br>
                > <br>
                >> On Sat, May 8, 2021 at 2:48 AM Jiawei Gu <a
                  href="mailto:Jiawei.Gu@amd.com" moz-do-not-send="true"><Jiawei.Gu@amd.com></a>
                wrote:<br>
                >> <br>
                >> 20 should be serial char size now instead of
                16.<br>
                >> <br>
                >> Signed-off-by: Jiawei Gu <a
                  href="mailto:Jiawei.Gu@amd.com" moz-do-not-send="true"><Jiawei.Gu@amd.com></a><br>
                > <br>
                > Please make sure this keeps proper 64 bit alignment
                in the structure.<br>
                > <br>
                > Alex<br>
                > <br>
                > <br>
                >> ---<br>
                >> include/uapi/drm/amdgpu_drm.h | 2 +-<br>
                >> 1 file changed, 1 insertion(+), 1 deletion(-)<br>
                >> <br>
                >> diff --git a/include/uapi/drm/amdgpu_drm.h <br>
                >> b/include/uapi/drm/amdgpu_drm.h index
                2b487a8d2727..1c20721f90da<br>
                >> 100644<br>
                >> --- a/include/uapi/drm/amdgpu_drm.h<br>
                >> +++ b/include/uapi/drm/amdgpu_drm.h<br>
                >> @@ -957,7 +957,7 @@ struct
                drm_amdgpu_info_vbios {<br>
                >>        __u8 vbios_pn[64];<br>
                >>        __u32 version;<br>
                >>        __u8 date[32];<br>
                >> -       __u8 serial[16];<br>
                >> +       __u8 serial[20];<br>
                >>        __u32 dev_id;<br>
                >>        __u32 rev_id;<br>
                >>        __u32 sub_dev_id;<br>
                >> --<br>
                >> 2.17.1<br>
                >> <br>
                >> _______________________________________________<br>
                >> amd-gfx mailing list<br>
                >> <a href="mailto:amd-gfx@lists.freedesktop.org"
                  moz-do-not-send="true">amd-gfx@lists.freedesktop.org</a><br>
                >> <a
href="https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flis"
                  moz-do-not-send="true">
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flis</a><br>
                >> t <br>
                >>
s.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=04%7C01%7CJ<br>
                >> i<br>
                >>
                awei.Gu%40amd.com%7Ccea31833184c41e8574508d9130360cc%7C3dd8961fe4884e<br>
                >> 6 <br>
                >>
                08e11a82d994e183d%7C0%7C0%7C637561727523880356%7CUnknown%7CTWFpbGZsb3<br>
                >> d <br>
                >>
                8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7<br>
                >> C <br>
                >>
1000&amp;sdata=kAJiC6WoJUTeExwk6ftrLfMoY2OTAwg9X7mGgJT3kLk%3D&amp;res<br>
                >> e<br>
                >> rved=0<o:p></o:p></p>
            </div>
          </div>
          <p class="MsoNormal"><br>
            <br>
            <o:p></o:p></p>
          <pre>_______________________________________________<o:p></o:p></pre>
          <pre>amd-gfx mailing list<o:p></o:p></pre>
          <pre><a href="mailto:amd-gfx@lists.freedesktop.org" moz-do-not-send="true">amd-gfx@lists.freedesktop.org</a><o:p></o:p></pre>
          <pre><a href="https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7CDavid.Nieto%40amd.com%7C3c0071a8a2a74127027408d913ba53e4%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637562513264718308%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=g11aunC78b48N19Q%2FFXJBK%2B2Z0PZBWdqp%2FzhsPiqQ8Q%3D&reserved=0" moz-do-not-send="true">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a><o:p></o:p></pre>
        </blockquote>
        <p class="MsoNormal"><br>
          <br>
          <o:p></o:p></p>
      </div>
    </blockquote>
    <br>
  </body>
</html>