<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=us-ascii">
<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:"Calibri Light";
panose-1:2 15 3 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
h2
{mso-style-priority:9;
mso-style-link:"Heading 2 Char";
margin-top:2.0pt;
margin-right:0in;
margin-bottom:0in;
margin-left:0in;
page-break-after:avoid;
font-size:13.0pt;
font-family:"Calibri Light",sans-serif;
color:#2F5496;
font-weight:normal;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.Heading2Char
{mso-style-name:"Heading 2 Char";
mso-style-priority:9;
mso-style-link:"Heading 2";
font-family:"Calibri Light",sans-serif;
color:#2F5496;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:2084910109;
mso-list-type:hybrid;
mso-list-template-ids:147113766 -1 -1 -1 -1 -1 -1 -1 -1 -1;}
@list l0:level1
{mso-level-text:"%1\)";
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level2
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level3
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l0:level4
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level5
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level6
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l0:level7
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level8
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level9
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
ol
{margin-bottom:0in;}
ul
{margin-bottom:0in;}
--></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-US" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">Hello mesa-dev community,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">We are starting to work on adding support for D3D12 Video acceleration in the mesa gallium D3D12 driver so that mesa frontends such as VA, VDPAU, etc can leverage HW acceleration in those environments.
<o:p></o:p></p>
<p class="MsoNormal">To begin with we are working <a href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitlab.freedesktop.org%2Fsivileri%2Fmesa%2F-%2Fcommits%2Fuser%2Fsivileri%2Fmesa_d3d12_video_driver_1%2F&data=04%7C01%7CSilvio.Vilerino%40microsoft.com%7C05685c59e1214a5452b008d9aa1afa74%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637727855121787525%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=0SqJ10OJ8Pvvpk0z7v8T9GX1OS%2FfhCGCoa6RHuSElpk%3D&reserved=0">
in a mesa fork project</a> on a simple video decoder prototype that implements the pipe_video_codec and pipe_video_buffer interfaces with a D3D12 backend.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">We have a couple of questions and would appreciate your input and feedback.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<h2>Wayland/Software screen creation in VA_DRIVER_INIT_FUNC <o:p></o:p></h2>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">In our d3d12 gallium driver, we rely on the EGL/GLX and the DRI frontend to handle the pure swrast screen creation as our virtualized environment doesn’t have devices listed under /dev/dri/*.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">The default for gstreamer/vainfo initialization code in WSL seems to be to create a Wayland display and pass it to VAInitialize. If we go ahead and create a pure software wayland d3d12_screen in VA_DRIVER_INIT_FUNC(VADriverContextP ctx)
we hit <a href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitlab.freedesktop.org%2Fmesa%2Fmesa%2F-%2Fissues%2F587&data=04%7C01%7CSilvio.Vilerino%40microsoft.com%7C05685c59e1214a5452b008d9aa1afa74%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637727855121797520%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=IYMZ3LSXUy%2BhMkmkh1DW%2FdkJ7M2GOu29CJFAESeQWCg%3D&reserved=0">
vaGetSurfaceBufferWl() is not implemented at VAAPI Gallium state tracker (#587) · Issues · Mesa / mesa · GitLab</a> when trying to run a simple gstreamer pipeline that decodes with VAAPI (and d3d12 video backend) and presents to screen in a display sink.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">From <a href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitlab.freedesktop.org%2Fmesa%2Fmesa%2F-%2Fissues%2F587&data=04%7C01%7CSilvio.Vilerino%40microsoft.com%7C05685c59e1214a5452b008d9aa1afa74%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637727855121797520%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=IYMZ3LSXUy%2BhMkmkh1DW%2FdkJ7M2GOu29CJFAESeQWCg%3D&reserved=0">
vaGetSurfaceBufferWl() is not implemented at VAAPI Gallium state tracker (#587) · Issues · Mesa / mesa · GitLab</a> discussion, it looks like “<i><a href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitlab.freedesktop.org%2Fmesa%2Fmesa%2F-%2Fcommit%2F2f90d11d86e476c679abbc0420ea22bd14b53ef7&data=04%7C01%7CSilvio.Vilerino%40microsoft.com%7C05685c59e1214a5452b008d9aa1afa74%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637727855121807515%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=9CkVhU5eCy7bvPx6nmmA43Fw9Vev%2BB5U2O5V7wuL9sU%3D&reserved=0">the
change removing</a> "NOT_IMPLEMENTED" is wayland display should be opened with DRM code path, and it's already implemented. the code here is not general switch to turn on the wayland support on vaapi, it's just one of the steps to complete that support and
which has been implemented</i>.”<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<ol style="margin-top:0in" start="1" type="1">
<li class="MsoListParagraph" style="margin-left:0in;mso-list:l0 level1 lfo1">Could you please provide some details on the high level design of how wayland supports for libva and gallium video drivers ?<o:p></o:p></li><li class="MsoListParagraph" style="margin-left:0in;mso-list:l0 level1 lfo1">Which of the currently implemented paths in mesa is currently recommended in general for video driver implementors: Wayland with DRM fd device or X DRI/DR3?<o:p></o:p></li><li class="MsoListParagraph" style="margin-left:0in;mso-list:l0 level1 lfo1">What’d be a recommended way of supporting pure swrast screens like d3d12 for libva in VA_DRIVER_INIT_FUNC?<o:p></o:p></li><ol style="margin-top:0in" start="1" type="a">
<li class="MsoListParagraph" style="margin-left:0in;mso-list:l0 level2 lfo1">Are there any objections to having a pure sw (no DRM devices) screen ?<o:p></o:p></li><li class="MsoListParagraph" style="margin-left:0in;mso-list:l0 level2 lfo1">Another alternative we discussed was to enable VGEM in the WSL kernel and create a wayland swrast screen using a kms_dri_create_winsys with the virtual DRM device FD but that’d still
require more work to support wayland presentation to screen code paths (see next section below).<o:p></o:p></li></ol>
</ol>
<p class="MsoNormal"><o:p> </o:p></p>
<h2>Recommended present path<o:p></o:p></h2>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Assuming we create a wayland screen (pure software or using VGEM + DRM) in VA_DRIVER_INIT_FUNC, once
<i>end_frame()</i> finishes execution and we have the decoded image in <i>pipe_video_buffer *target,
</i>what are the supported and recommended paths for presenting to screen?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Looks like both VDPAU (vlVdpPresentationQueueDisplay) and VAAPI (vlVaPutSurface) call texture_from_drawable() to pass the associated pipe_resource texture to flush_frontbuffer(), but the texture_from_drawable() function seems only implemented
on X backends (vl_winsys_dri3/vl_winsys_dri.c) and not for vl_winsys_swrast/vl_winsys_drm. As it’s mentioned that there’s support for wayland on vaapi, we’d like to get some clarity on how the presentation path is designed here.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks,<o:p></o:p></p>
<p class="MsoNormal">Sil Vilerino<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>