<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0">My personal preference is still to plumb this through to mesa rather than forcing it in the kernel.<br>
</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">Alex<br>
</p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Li, Samuel <Samuel.Li@amd.com><br>
<b>Sent:</b> Monday, March 19, 2018 3:50:34 PM<br>
<b>To:</b> Koenig, Christian; Marek Olšák<br>
<b>Cc:</b> Alex Deucher; Michel Dänzer; amd-gfx list<br>
<b>Subject:</b> RE: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support</font>
<div> </div>
</div>
<style>
<!--
@font-face
{font-family:SimSun}
@font-face
{font-family:"Cambria Math"}
@font-face
{font-family:Calibri}
@font-face
{font-family:Consolas}
@font-face
{}
p.x_MsoNormal, li.x_MsoNormal, div.x_MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman",serif;
color:black}
a:x_link, span.x_MsoHyperlink
{color:blue;
text-decoration:underline}
a:x_visited, span.x_MsoHyperlinkFollowed
{color:purple;
text-decoration:underline}
pre
{margin:0in;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";
color:black}
span.x_HTMLPreformattedChar
{font-family:Consolas;
color:black}
span.x_EmailStyle19
{font-family:"Calibri",sans-serif;
color:#2F5496}
span.x_EmailStyle20
{font-family:"Calibri",sans-serif;
color:#2F5496}
.x_MsoChpDefault
{font-size:10.0pt}
@page WordSection1
{margin:1.0in 1.0in 1.0in 1.0in}
div.x_WordSection1
{}
-->
</style>
<div lang="EN-US" link="blue" vlink="purple" style="background-color:white">
<div class="x_WordSection1">
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:#2F5496">Christian,</span></p>
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:#2F5496"> </span></p>
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:#2F5496">You misunderstood Alex’s comments,</span></p>
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:#2F5496"> </span></p>
<pre>>Regardless of which scenarios we need to support, I think we also need</pre>
<pre>>to really plumb this through to mesa however since user space is who</pre>
<pre>>ultimately requests the location. Overriding it in the kernel gets</pre>
<pre>>tricky and can lead to ping-ponging as others have noted. Better to</pre>
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:#2F5496"> </span></p>
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:#2F5496">Here Alex mentioned the scenarios is 1)VRAM, 2)GTT, 3)VRAM/GTT.</span></p>
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:#2F5496">His concern is this might cause ping-pong, not about preferred domain. Since preferred domain can solve the ping-pong issue, it shall address his concern
here.</span></p>
<div>
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:#2F5496"> </span></p>
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:#2F5496">Regards,</span></p>
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:#2F5496">Samuel Li</span></p>
</div>
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:#2F5496"> </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="x_MsoNormal"><b><span style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:windowtext">From:</span></b><span style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:windowtext"> Christian König [mailto:ckoenig.leichtzumerken@gmail.com]
<br>
<b>Sent:</b> Monday, March 19, 2018 3:45 PM<br>
<b>To:</b> Li, Samuel <Samuel.Li@amd.com>; Marek Olšák <maraeo@gmail.com>; Koenig, Christian <Christian.Koenig@amd.com><br>
<b>Cc:</b> Alex Deucher <alexdeucher@gmail.com>; Michel Dänzer <michel@daenzer.net>; amd-gfx list <amd-gfx@lists.freedesktop.org><br>
<b>Subject:</b> Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support</span></p>
</div>
</div>
<p class="x_MsoNormal"> </p>
<div>
<p class="x_MsoNormal">Quoting Alex:<br>
<br>
</p>
<blockquote style="margin-top:5.0pt; margin-bottom:5.0pt">
<pre>Regardless of which scenarios we need to support, I think we also need</pre>
<pre>to really plumb this through to mesa however since user space is who</pre>
<pre>ultimately requests the location. Overriding it in the kernel gets</pre>
<pre>tricky and can lead to ping-ponging as others have noted. Better to</pre>
<pre>have user space know what chips support it or not and request display</pre>
<pre>buffers in GTT or VRAM from the start.</pre>
</blockquote>
<p class="x_MsoNormal">And I completely agree with Alex here. So overriding the domain in the kernel is a serious NAK from my side as well.<br>
<br>
Please implement the necessary bits in Mesa, shouldn't be more than a few lines of code anyway.<br>
<br>
Regards,<br>
Christian.<br>
<br>
Am 19.03.2018 um 20:42 schrieb Li, Samuel:</p>
</div>
<blockquote style="margin-top:5.0pt; margin-bottom:5.0pt">
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:#2F5496">Agreed.</span></p>
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:#2F5496"> </span></p>
<p class="x_MsoNormal">>I think that the consensus with Alex and me is that we should avoid exactly that.<br>
Christian, Alex’s concern is about ping-pong, not about the preferred domain. <br>
<br>
<br>
</p>
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:#2F5496">Regards,</span></p>
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:#2F5496">Samuel Li</span></p>
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:#2F5496"> </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="x_MsoNormal"><b><span style="font-size:11.0pt; font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt; font-family:"Calibri",sans-serif"> Marek Olšák [<a href="mailto:maraeo@gmail.com">mailto:maraeo@gmail.com</a>]
<br>
<b>Sent:</b> Monday, March 19, 2018 3:39 PM<br>
<b>To:</b> Koenig, Christian <a href="mailto:Christian.Koenig@amd.com"><Christian.Koenig@amd.com></a><br>
<b>Cc:</b> Li, Samuel <a href="mailto:Samuel.Li@amd.com"><Samuel.Li@amd.com></a>; Michel Dänzer
<a href="mailto:michel@daenzer.net"><michel@daenzer.net></a>; Alex Deucher <a href="mailto:alexdeucher@gmail.com">
<alexdeucher@gmail.com></a>; amd-gfx list <a href="mailto:amd-gfx@lists.freedesktop.org">
<amd-gfx@lists.freedesktop.org></a><br>
<b>Subject:</b> Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support</span></p>
</div>
</div>
<p class="x_MsoNormal"> </p>
<div>
<div>
<div>
<p class="x_MsoNormal">On Mon, Mar 19, 2018 at 3:27 PM, Christian König <<a href="mailto:christian.koenig@amd.com" target="_blank">christian.koenig@amd.com</a>> wrote:</p>
<blockquote style="border:none; border-left:solid #CCCCCC 1.0pt; padding:0in 0in 0in 6.0pt; margin-left:4.8pt; margin-top:5.0pt; margin-right:0in; margin-bottom:5.0pt">
<p class="x_MsoNormal">I think that the consensus with Alex and me is that we should avoid exactly that.<br>
<br>
Overriding the preferred domain in the kernel is a no-go for that patch set, so please implement the discussed changes in Mesa.</p>
</blockquote>
<div>
<p class="x_MsoNormal"> </p>
</div>
<div>
<p class="x_MsoNormal">I don't see how Mesa can make a smarter decision than the kernel. If you overwrite the preferred domain of the buffer in the kernel, there will be no ping-ponging between domains. Mesa never changes the initial preferred domain.</p>
</div>
<div>
<p class="x_MsoNormal"> </p>
</div>
<div>
<p class="x_MsoNormal">Marek</p>
</div>
<div>
<p class="x_MsoNormal"> </p>
</div>
<div>
<p class="x_MsoNormal"> </p>
</div>
<blockquote style="border:none; border-left:solid #CCCCCC 1.0pt; padding:0in 0in 0in 6.0pt; margin-left:4.8pt; margin-top:5.0pt; margin-right:0in; margin-bottom:5.0pt">
<p class="x_MsoNormal"><br>
Regards,<br>
Christian.</p>
<div>
<div>
<p class="x_MsoNormal"><br>
<br>
Am 19.03.2018 um 20:22 schrieb Li, Samuel:</p>
<blockquote style="border:none; border-left:solid #CCCCCC 1.0pt; padding:0in 0in 0in 6.0pt; margin-left:4.8pt; margin-top:5.0pt; margin-right:0in; margin-bottom:5.0pt">
<p class="x_MsoNormal" style="margin-bottom:12.0pt">I agree with Marek/Michel: since kernel sets the domain before scanning out, it shall update the preferred domain here too.<br>
<br>
Regards,<br>
Samuel Li<br>
<br>
<br>
</p>
<blockquote style="border:none; border-left:solid #CCCCCC 1.0pt; padding:0in 0in 0in 6.0pt; margin-left:4.8pt; margin-top:5.0pt; margin-right:0in; margin-bottom:5.0pt">
<p class="x_MsoNormal">-----Original Message-----<br>
From: Koenig, Christian<br>
Sent: Thursday, March 08, 2018 4:07 AM<br>
To: Michel Dänzer <<a href="mailto:michel@daenzer.net" target="_blank">michel@daenzer.net</a>>; Li, Samuel<br>
<<a href="mailto:Samuel.Li@amd.com" target="_blank">Samuel.Li@amd.com</a>>; Alex Deucher <<a href="mailto:alexdeucher@gmail.com" target="_blank">alexdeucher@gmail.com</a>><br>
Cc: amd-gfx list <<a href="mailto:amd-gfx@lists.freedesktop.org" target="_blank">amd-gfx@lists.freedesktop.org</a>><br>
Subject: Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support<br>
<br>
Am 08.03.2018 um 09:35 schrieb Michel Dänzer:</p>
<blockquote style="border:none; border-left:solid #CCCCCC 1.0pt; padding:0in 0in 0in 6.0pt; margin-left:4.8pt; margin-top:5.0pt; margin-right:0in; margin-bottom:5.0pt">
<p class="x_MsoNormal">On 2018-03-07 10:47 AM, Christian König wrote:</p>
<blockquote style="border:none; border-left:solid #CCCCCC 1.0pt; padding:0in 0in 0in 6.0pt; margin-left:4.8pt; margin-top:5.0pt; margin-right:0in; margin-bottom:5.0pt">
<p class="x_MsoNormal">Am 07.03.2018 um 09:42 schrieb Michel Dänzer:</p>
<blockquote style="border:none; border-left:solid #CCCCCC 1.0pt; padding:0in 0in 0in 6.0pt; margin-left:4.8pt; margin-top:5.0pt; margin-right:0in; margin-bottom:5.0pt">
<p class="x_MsoNormal" style="margin-bottom:12.0pt">On 2018-03-06 07:23 PM, Christian König wrote:</p>
<blockquote style="border:none; border-left:solid #CCCCCC 1.0pt; padding:0in 0in 0in 6.0pt; margin-left:4.8pt; margin-top:5.0pt; margin-right:0in; margin-bottom:5.0pt">
<p class="x_MsoNormal">E.g. the last time I tested it placing things into GTT still<br>
resulted in quite a performance penalty for rendering.</p>
</blockquote>
<p class="x_MsoNormal">FWIW, I think the penalty is most likely IOMMU related. Last time I<br>
tested, I couldn't measure a big difference with IOMMU disabled.</p>
</blockquote>
<p class="x_MsoNormal">No, the penalty I'm talking about came from the ping/pong we did with<br>
the scanout buffers.<br>
<br>
See when I tested this the DDX and Mesa where unmodified, so both<br>
still assumed VRAM as placement for scanout BOs, but the kernel<br>
forced scanout BOs into GTT for testing.<br>
<br>
So what happened was that on scanout we moved the VRAM BO to GTT</p>
</blockquote>
</blockquote>
<p class="x_MsoNormal">and</p>
<blockquote style="border:none; border-left:solid #CCCCCC 1.0pt; padding:0in 0in 0in 6.0pt; margin-left:4.8pt; margin-top:5.0pt; margin-right:0in; margin-bottom:5.0pt">
<blockquote style="border:none; border-left:solid #CCCCCC 1.0pt; padding:0in 0in 0in 6.0pt; margin-left:4.8pt; margin-top:5.0pt; margin-right:0in; margin-bottom:5.0pt">
<p class="x_MsoNormal">after unpinning it on the first command submission which used the BO<br>
we moved it back to VRAM again.</p>
</blockquote>
<p class="x_MsoNormal">In the meantime, I've had the same idea as Marek: Can't the kernel<br>
driver simply change the BO's preferred domain to GTT when scanning<br>
out from it? Then it won't move back to VRAM.</p>
</blockquote>
<p class="x_MsoNormal">Yes, I've considered this as well.<br>
<br>
But I think making the decision in Mesa is the cleaner approach.<br>
<br>
E.g. so far we only override the placement decision of userspace for two<br>
reasons:<br>
1. We where running out of memory in VRAM.<br>
2. We have a hardware restriction which makes VRAM usage mandatory.<br>
<br>
And even then we never adjust the placement permanently, we just<br>
temporary moved the buffer where it was needed and moved it back after<br>
the operation completed.<br>
<br>
Additional to that Mesa might want to set even more flags and/or changes<br>
it's behavior. E.g. use a tilling mode which both importer and export in an<br>
A+A laptop understands etc...<br>
<br>
Regards,<br>
Christian.</p>
</blockquote>
</blockquote>
<p class="x_MsoNormal"><br>
_______________________________________________<br>
amd-gfx mailing list<br>
<a href="mailto:amd-gfx@lists.freedesktop.org" target="_blank">amd-gfx@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx" target="_blank">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a></p>
</div>
</div>
</blockquote>
</div>
<p class="x_MsoNormal"> </p>
</div>
</div>
</div>
<p class="x_MsoNormal"><br>
<br>
<br>
</p>
<pre>_______________________________________________</pre>
<pre>amd-gfx mailing list</pre>
<pre><a href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a></pre>
<pre><a href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a></pre>
</blockquote>
<p class="x_MsoNormal"> </p>
</div>
</div>
</div>
</body>
</html>