<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p>Thanks Axel, I find the current GBM already works like you said except</p>
<p>GBM_BACKEND only support one backend. So I just have to make amdgpu-pro</p>
<p>backend create_device return NULL for Intel GPU.</p>
<p><br>
</p>
<p>Many thanks,</p>
<p>Qiang</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> mesa-dev <mesa-dev-bounces@lists.freedesktop.org> on behalf of Axel Davy <axel.davy@ens.fr><br>
<b>Sent:</b> Thursday, May 12, 2016 2:36:34 PM<br>
<b>To:</b> mesa-dev@lists.freedesktop.org<br>
<b>Subject:</b> Re: [Mesa-dev] GBM backend dynamic dispatch method</font>
<div> </div>
</div>
<div>
<div class="moz-cite-prefix">Hi,<br>
<br>
I'm not sure if that answers your need, but to me it looks like<br>
it would be simpler if gbm was trying different backends for the given<br>
device, until it succeeds. You'd pass several backends to <span style="font-size: 12pt;">
GBM_BACKEND (perhaps<br>
rename to GBM_BACKENDS), and in your example it would put amdgpu pro first.<br>
Then when using the amd card, amdgpu pro would be used, else since the loading<br>
would fail, it would use the second backend, which would be mesa.<br>
<br>
That's just a suggestion, and you'd better wait for gbm maintainers to voice theirs.<br>
<br>
Axel<br>
</span><br>
On 12/05/2016 04:45, Yu, Qiang wrote:<br>
</div>
<blockquote cite="mid:DM3PR12MB0844B6788E29BA51C9F9CFE68F730@DM3PR12MB0844.namprd12.prod.outlook.com" type="cite">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
<div id="divtagdefaultwrapper" style="background-color: rgb(255,
255, 255);">
<p style="color: rgb(0, 0, 0); font-family: Calibri, Arial,
Helvetica, sans-serif; font-size: 12pt;">
Hi guys, </p>
<p style="color: rgb(0, 0, 0); font-family: Calibri, Arial,
Helvetica, sans-serif; font-size: 12pt;">
<br>
</p>
<p style="color: rgb(0, 0, 0); font-family: Calibri, Arial,
Helvetica, sans-serif; font-size: 12pt;">
Let me introduce myself. My name is Qiang Yu, I'm a developer of amdgpu-pro driver.</p>
<p style="color: rgb(0, 0, 0); font-family: Calibri, Arial,
Helvetica, sans-serif; font-size: 12pt;">
As you know the amdgpu-pro adopts some open source part like GBM but due to its</p>
<p style="color: rgb(0, 0, 0); font-family: Calibri, Arial,
Helvetica, sans-serif; font-size: 12pt;">
close source OGL part, we implement our<span style="font-size:
12pt;"> own GBM</span><span style="font-size: 12pt;"> backend</span><span style="font-size: 12pt;">. </span></p>
<p style="color: rgb(0, 0, 0); font-family: Calibri, Arial,
Helvetica, sans-serif; font-size: 12pt;">
<br>
</p>
<p style="color: rgb(0, 0, 0); font-family: Calibri, Arial,
Helvetica, sans-serif; font-size: 12pt;">
Currently libgbm only support <span style="font-size: 12pt;">static selection of GBM backend by GBM_BACKEND,</span></p>
<p style="color: rgb(0, 0, 0); font-family: Calibri, Arial,
Helvetica, sans-serif; font-size: 12pt;">
<span style="font-size: 12pt;">so for the hybrid GPU case like Intel iGPU + AMD dGPU and AMD dGPU is drived</span></p>
<p style="color: rgb(0, 0, 0); font-family: Calibri, Arial,
Helvetica, sans-serif; font-size: 12pt;">
<span style="font-size: 12pt;">by amdgpu-pro, it's not convenient for </span><span style="font-size: 12pt;">client to switch backend all the time and even </span></p>
<p><span style="color: rgb(0, 0, 0); font-family: Calibri,
Arial, Helvetica, sans-serif; font-size: 12pt;"></span><span style="color: rgb(0, 0, 0); font-family: Calibri, Arial,
Helvetica, sans-serif; font-size: 12pt;">impossible</span><font face="Calibri, Arial, Helvetica, sans-serif"><span style="font-size: 12pt;"> for </span>applications<span style="font-size: 12pt;"> that
need to deal with both GPUs like the XServer.</span></font></p>
<p><font face="Calibri, Arial, Helvetica, sans-serif"><span style="font-size: 12pt;"><br>
</span></font></p>
<p><font face="Calibri, Arial, Helvetica, sans-serif"><span style="font-size: 12pt;">So I'm wondering a dynamic dispatch method and hope it can go upstream to the </span></font><span style="font-size: 12pt; font-family: Calibri, Arial,
Helvetica, sans-serif;">libgbm</span><span style="font-family: Calibri, Arial, Helvetica, sans-serif;
font-size: 12pt;">:</span></p>
<p><font face="Calibri, Arial, Helvetica, sans-serif"><span style="font-size: 12pt;">1. create a /etc/gbm/xxx.conf for libgbm to read when none default backend needed</span></font></p>
<p><font face="Calibri, Arial, Helvetica, sans-serif"><span style="font-size: 12pt;">2. the content should be like: <kernel driver name>:<gbm backend name></span></font></p>
<p><font face="Calibri, Arial, Helvetica, sans-serif"><span style="font-size: 12pt;"> In the amdgpu-pro case, the content is: amdgpu:gbm_amdgpu.so</span></font></p>
<p><font face="Calibri, Arial, Helvetica, sans-serif"><span style="font-size: 12pt;"><br>
</span></font></p>
<p><font face="Calibri, Arial, Helvetica, sans-serif"><span style="font-size: 12pt;">This method need libgbm use libdrm to determine the FD kernel driver first.</span></font></p>
<p><font face="Calibri, Arial, Helvetica, sans-serif"><span style="font-size: 12pt;">Any feedback on this method and the hope to go upstream?</span></font></p>
<p><font face="Calibri, Arial, Helvetica, sans-serif"><span style="font-size: 12pt;"><br>
</span></font></p>
<p><font face="Calibri, Arial, Helvetica, sans-serif"><span style="font-size: 12pt;">Thanks,</span></font></p>
<p><font face="Calibri, Arial, Helvetica, sans-serif"><span style="font-size: 12pt;">Qiang</span></font></p>
<p><font face="Calibri, Arial, Helvetica, sans-serif"><span style="font-size: 12pt;"><br>
</span></font></p>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset> <br>
<pre wrap="">_______________________________________________
mesa-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a>
<a class="moz-txt-link-freetext" href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a>
</pre>
</blockquote>
<p><br>
</p>
</div>
</body>
</html>