<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<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">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size: 12pt; color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif, "EmojiFont", "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;">
<p style="margin-top:0; margin-bottom:0">Series is:<br>
</p>
<p style="margin-top:0; margin-bottom:0">Reviewed-by: Alex Deucher <alexander.deucher@amd.com><br>
</p>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>From:</b> amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Xiangliang Yu <Xiangliang.Yu@amd.com><br>
<b>Sent:</b> Tuesday, September 18, 2018 5:56:03 AM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org<br>
<b>Cc:</b> Yu, Xiangliang; Min, Frank<br>
<b>Subject:</b> [PATCH 1/2] drm/amdgpu: add vega20 sriov capability detection</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt">
<div class="PlainText">From: Frank Min <Frank.Min@amd.com><br>
<br>
Add sriov capability detection for vega20, then can check if device is<br>
virtual device.<br>
<br>
Signed-off-by: Frank Min <Frank.Min@amd.com><br>
Signed-off-by: Xiangliang Yu <Xiangliang.Yu@amd.com><br>
---<br>
drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c | 15 +++++++++++++--<br>
1 file changed, 13 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c b/drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c<br>
index 2e65447..f8cee95 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c<br>
@@ -205,8 +205,19 @@ static const struct nbio_hdp_flush_reg nbio_v7_4_hdp_flush_reg = {<br>
<br>
static void nbio_v7_4_detect_hw_virt(struct amdgpu_device *adev)<br>
{<br>
- if (is_virtual_machine()) /* passthrough mode exclus sriov mod */<br>
- adev->virt.caps |= AMDGPU_PASSTHROUGH_MODE;<br>
+ uint32_t reg;<br>
+<br>
+ reg = RREG32_SOC15(NBIO, 0, mmRCC_IOV_FUNC_IDENTIFIER);<br>
+ if (reg & 1)<br>
+ adev->virt.caps |= AMDGPU_SRIOV_CAPS_IS_VF;<br>
+<br>
+ if (reg & 0x80000000)<br>
+ adev->virt.caps |= AMDGPU_SRIOV_CAPS_ENABLE_IOV;<br>
+<br>
+ if (!reg) {<br>
+ if (is_virtual_machine()) /* passthrough mode exclus sriov mod */<br>
+ adev->virt.caps |= AMDGPU_PASSTHROUGH_MODE;<br>
+ }<br>
}<br>
<br>
static void nbio_v7_4_init_registers(struct amdgpu_device *adev)<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" id="LPlnk885788" class="OWAAutoLink" previewremoved="true">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a>
<div id="LPBorder_GT_15372804152960.8296961064802353" style="margin-bottom: 20px; overflow: auto; width: 100%; text-indent: 0px;">
<table id="LPContainer_15372804152910.20274386836632818" style="width: 90%; background-color: rgb(255, 255, 255); position: relative; overflow: auto; padding-top: 20px; padding-bottom: 20px; margin-top: 20px; border-top: 1px dotted rgb(200, 200, 200); border-bottom: 1px dotted rgb(200, 200, 200);" role="presentation" cellspacing="0">
<tbody>
<tr style="border-spacing: 0px;" valign="top">
<td id="TextCell_15372804152920.9083858010860605" style="vertical-align: top; position: relative; padding: 0px; display: table-cell;" colspan="2">
<div id="LPRemovePreviewContainer_15372804152930.9251240967637734"></div>
<div id="LPTitle_15372804152930.42943841693937224" style="top: 0px; color: rgb(0, 120, 215); font-weight: 400; font-size: 21px; font-family: "wf_segoe-ui_light", "Segoe UI Light", "Segoe WP Light", "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; line-height: 21px;">
<a id="LPUrlAnchor_15372804152940.9187358876714641" style="text-decoration: none;" href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx" target="_blank">amd-gfx Info Page - freedesktop.org</a></div>
<div id="LPMetadata_15372804152940.9460074817537815" style="margin: 10px 0px 16px; color: rgb(102, 102, 102); font-weight: 400; font-family: "wf_segoe-ui_normal", "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; font-size: 14px; line-height: 14px;">
lists.freedesktop.org</div>
<div id="LPDescription_15372804152960.8151952695998103" style="display: block; color: rgb(102, 102, 102); font-weight: 400; font-family: "wf_segoe-ui_normal", "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; font-size: 14px; line-height: 20px; max-height: 100px; overflow: hidden;">
To see the collection of prior postings to the list, visit the amd-gfx Archives.. Using amd-gfx: To post a message to all the list members, send email to amd-gfx@lists.freedesktop.org. You can subscribe to the list, or change your existing subscription, in
the sections below.</div>
</td>
</tr>
</tbody>
</table>
</div>
<br>
</div>
</span></font></div>
</div>
</body>
</html>