<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<meta content="text/html; charset=UTF-8">
<style type="text/css" style="">
<!--
p
{margin-top:0;
margin-bottom:0}
-->
</style>
<div dir="ltr">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Arial,Helvetica,sans-serif">
<p><font size="2"><span style="font-size:10pt">- r = vi_set_ip_blocks(adev);</span></font></p>
<p><font size="2"><span style="font-size:10pt"> detect_sriov(adev);<br>
</span></font></p>
<p><font size="2"><span style="font-size:10pt"> if (amdgpu_sriov_vf(adev))<br>
</span></font></p>
<p><font size="2"><span style="font-size:10pt">+ adev->flags |= AMD_IS_VF;</span></font></p>
<p><font size="2"><span style="font-size:10pt"> if (adev->flags & AMD_IS_VF)<br>
</span></font></p>
<p><font size="2"><span style="font-size:10pt">+ r = amd_xgpu_set_ip_blocks(adev);<br>
+ else<br>
+ r = vi_set_ip_blocks(adev);<br>
if (r)<br>
return r;</span></font><br>
</p>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>发件人:</b> amd-gfx <amd-gfx-bounces@lists.freedesktop.org> 代表 Xiangliang Yu <Xiangliang.Yu@amd.com><br>
<b>发送时间:</b> 2016年12月18日 0:16:31<br>
<b>收件人:</b> amd-gfx@lists.freedesktop.org; dl.SRDC_SW_GPUVirtualization<br>
<b>抄送:</b> Yu, Xiangliang<br>
<b>主题:</b> [PATCH 09/23] drm/amdgpu: enable virtualization feature for FIJI/TONGA</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">According to chip device id to set VF flag, and call virtual<br>
interface to setup all realted IP blocks.<br>
<br>
Signed-off-by: Xiangliang Yu <Xiangliang.Yu@amd.com><br>
---<br>
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 5 ++++-<br>
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 4 ++--<br>
2 files changed, 6 insertions(+), 3 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c<br>
index c4075b7..ab8c8bb5 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c<br>
@@ -1285,7 +1285,10 @@ static int amdgpu_early_init(struct amdgpu_device *adev)<br>
else<br>
adev->family = AMDGPU_FAMILY_VI;<br>
<br>
- r = vi_set_ip_blocks(adev);<br>
+ if (adev->flags & AMD_IS_VF)<br>
+ r = amd_xgpu_set_ip_blocks(adev);<br>
+ else<br>
+ r = vi_set_ip_blocks(adev);<br>
if (r)<br>
return r;<br>
break;<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c<br>
index 93c4704..5a18111 100755<br>
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c<br>
@@ -385,13 +385,13 @@ static const struct pci_device_id pciidlist[] = {<br>
{0x1002, 0x6928, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TONGA},<br>
{0x1002, 0x6929, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TONGA},<br>
{0x1002, 0x692B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TONGA},<br>
- {0x1002, 0x692F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TONGA},<br>
+ {0x1002, 0x692F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TONGA | AMD_IS_VF},<br>
{0x1002, 0x6930, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TONGA},<br>
{0x1002, 0x6938, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TONGA},<br>
{0x1002, 0x6939, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TONGA},<br>
/* fiji */<br>
{0x1002, 0x7300, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_FIJI},<br>
- {0x1002, 0x730F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_FIJI},<br>
+ {0x1002, 0x730F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_FIJI | AMD_IS_VF},<br>
/* carrizo */<br>
{0x1002, 0x9870, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CARRIZO|AMD_IS_APU},<br>
{0x1002, 0x9874, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CARRIZO|AMD_IS_APU},<br>
-- <br>
2.7.4<br>
<br>
_______________________________________________<br>
amd-gfx mailing list<br>
amd-gfx@lists.freedesktop.org<br>
<a href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a><br>
</div>
</span></font>
</body>
</html>