<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:Consolas;
        panose-1:2 11 6 9 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;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></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">Hi Tejas,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="background:lime;mso-highlight:lime">[mjruhl] comments inline</span><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></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="MsoNormal"><b>From:</b> Upadhyay, Tejas <tejas.upadhyay@intel.com> <br>
<b>Sent:</b> Friday, April 28, 2023 7:05 AM<br>
<b>To:</b> Ruhl, Michael J <michael.j.ruhl@intel.com><br>
<b>Cc:</b> intel-xe@lists.freedesktop.org<br>
<b>Subject:</b> [2/3] drm/xe: Size GT device memory correctly<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Few comments inline over email as I have not yet got subscription :<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">First of all I could  not apply patch, it looks like some patch landed yesterday which needs you patch to respin.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="background:lime;mso-highlight:lime">[mjruhl] Hmmm, not sure why… I will make sure to rebase</span><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:solid #CCCCCC 1.0pt;padding:12.0pt 12.0pt 12.0pt 12.0pt">
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:seagreen;mso-fareast-language:EN-IN">diff --git a/drivers/gpu/drm/xe/regs/xe_gt_regs.h b/drivers/gpu/drm/xe/regs/xe_gt_regs.h</span></b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:seagreen;mso-fareast-language:EN-IN">index 05a03129dc54..dac24b99f526 100644</span></b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:seagreen;mso-fareast-language:EN-IN">--- a/drivers/gpu/drm/xe/regs/xe_gt_regs.h</span></b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:seagreen;mso-fareast-language:EN-IN">+++ b/drivers/gpu/drm/xe/regs/xe_gt_regs.h</span></b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:brown;mso-fareast-language:EN-IN">@@ -75,7 +75,8 @@</span></b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">
<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"> #define GEN12_VE1_AUX_NV                         _MMIO(0x42b8)<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">#define   AUX_INV                                REG_BIT(0)<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">-#define XEHP_TILE0_ADDR_RANGE                    MCR_REG(0x4900)</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+#define XEHP_TILE_ADDR_RANGE(_idx)               MCR_REG(0x4900 + (_idx) * 4)</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">#define XEHP_FLAT_CCS_BASE_ADDR                  MCR_REG(0x4910)<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"> #define CHICKEN_RASTER_1                         MCR_REG(0x6204)<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:seagreen;mso-fareast-language:EN-IN">diff --git a/drivers/gpu/drm/xe/xe_device_types.h b/drivers/gpu/drm/xe/xe_device_types.h</span></b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:seagreen;mso-fareast-language:EN-IN">index 24dc5d2e9e05..ebd297ff6fcd 100644</span></b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:seagreen;mso-fareast-language:EN-IN">--- a/drivers/gpu/drm/xe/xe_device_types.h</span></b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:seagreen;mso-fareast-language:EN-IN">+++ b/drivers/gpu/drm/xe/xe_device_types.h</span></b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:brown;mso-fareast-language:EN-IN">@@ -1,6 +1,6 @@</span></b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">
<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"> /* SPDX-License-Identifier: MIT */<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">/*<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">- * Copyright © 2022 Intel Corporation</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+ * Copyright © 2022-2023 Intel Corporation</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">  */<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"> #ifndef _XE_DEVICE_TYPES_H_<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:brown;mso-fareast-language:EN-IN">@@ -202,6 +202,8 @@</span></b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">
</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#A020F0;mso-fareast-language:EN-IN"> struct xe_device {</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">                         * known as small-bar.<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">                         */<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">                        resource_size_t io_size;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+                        /** @base: Offset to apply for Device Physical Address control */</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+                        resource_size_t base;</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">                        /** @mapping: pointer to VRAM mappable space */<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">                        void *__iomem mapping;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">                } vram;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:seagreen;mso-fareast-language:EN-IN">diff --git a/drivers/gpu/drm/xe/xe_gt_types.h b/drivers/gpu/drm/xe/xe_gt_types.h</span></b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:seagreen;mso-fareast-language:EN-IN">index 7c47d67aa8be..a2417cc2f696 100644</span></b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:seagreen;mso-fareast-language:EN-IN">--- a/drivers/gpu/drm/xe/xe_gt_types.h</span></b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:seagreen;mso-fareast-language:EN-IN">+++ b/drivers/gpu/drm/xe/xe_gt_types.h</span></b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:brown;mso-fareast-language:EN-IN">@@ -1,6 +1,6 @@</span></b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">
<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"> /* SPDX-License-Identifier: MIT */<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">/*<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">- * Copyright © 2022 Intel Corporation</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+ * Copyright © 2022-2023 Intel Corporation</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">  */<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"> #ifndef _XE_GT_TYPES_H_<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:brown;mso-fareast-language:EN-IN">@@ -149,12 +149,14 @@</span></b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">
</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#A020F0;mso-fareast-language:EN-IN"> struct xe_gt {</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">                         * @io_size: IO size of this VRAM instance<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">                         *<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">                         * This represents how much of this VRAM we can access<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">-                        * via the CPU through the VRAM BAR. This can be smaller</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">-                        * than @size, in which case only part of VRAM is CPU</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">-                        * accessible (typically the first 256M). This</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">-                        * configuration is known as small-bar.</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+                        * via the CPU through the VRAM BAR.</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+                        * This can be smaller than the actual @size, in which</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+                        * case only part of VRAM is CPU accessible (typically</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+                        * the first 256M). This configuration is known as small-bar.</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">                         */<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">                        resource_size_t io_size;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+                        /** @base: offset of VRAM starting base */</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+                        resource_size_t base;</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">                        /** @size: size of VRAM. */<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">                        resource_size_t size;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">                        /** @mapping: pointer to VRAM mappable space */<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:seagreen;mso-fareast-language:EN-IN">diff --git a/drivers/gpu/drm/xe/xe_mmio.c b/drivers/gpu/drm/xe/xe_mmio.c</span></b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:seagreen;mso-fareast-language:EN-IN">index 6c1591a4f43e..60c1b92a87f7 100644</span></b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:seagreen;mso-fareast-language:EN-IN">--- a/drivers/gpu/drm/xe/xe_mmio.c</span></b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:seagreen;mso-fareast-language:EN-IN">+++ b/drivers/gpu/drm/xe/xe_mmio.c</span></b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:brown;mso-fareast-language:EN-IN">@@ -3,6 +3,8 @@</span></b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">
<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">  * Copyright © 2021-2023 Intel Corporation<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">  */<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+#include <linux/minmax.h></span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">#include "xe_mmio.h"<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"> #include <drm/drm_managed.h><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:brown;mso-fareast-language:EN-IN">@@ -184,32 +186,83 @@</span></b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">
</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#A020F0;mso-fareast-language:EN-IN"> int xe_determine_lmem_bar_size(struct xe_device *xe)</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">       if (!xe->mem.vram.io_size)<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">                return -EIO;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+       xe->mem.vram.base = 0; /* DPA offset */</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">       /* set up a map to the total memory area. */<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">       xe->mem.vram.mapping = ioremap_wc(xe->mem.vram.io_start, xe->mem.vram.io_size);<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">        return 0;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">}<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+/*</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+ * 4 possible sizes:</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+ * - io size (from pci_resource_len of LMEM bar)</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+ * - TILEx size</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+ * - GSMBASE offset (TILEx - "stolen")</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+ * - CSSBASE offset (TILEx - CSS space necessary)</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+ *</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+ * NOTE: CSSBASE is always lower/smaller offset then GSMBASE.</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+ *</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+ * The actual available size of memory is to the CCS or GSM base.</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+ * NOTE: multi-tile bases will include the tile offset.</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+ */</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+int xe_mmio_vram_tile_size(struct xe_gt *gt, u64 *vram_size, u64 *tile_size, u64 *tile_offset)</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+{</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+       u64 offset;</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+       int err;</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+       u32 reg;</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+       err = xe_force_wake_get(gt_to_fw(gt), XE_FW_GT);</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+       if (err)</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+                return err;</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+       if (gt->xe->info.has_flat_ccs) {</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+                reg = xe_gt_mcr_unicast_read_any(gt, XEHP_FLAT_CCS_BASE_ADDR);</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+                offset = (u64)REG_FIELD_GET(GENMASK(31, 8), reg) * SZ_64K;</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+       } else {</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+                offset = xe_mmio_read64(gt, GEN12_GSMBASE.reg);</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+       }</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+       if (unlikely(gt->xe->info.platform == XE_DG1)) {</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+                *tile_size = offset;</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+                *tile_offset = 0;</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+       } else {</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+                reg = xe_gt_mcr_unicast_read_any(gt, XEHP_TILE_ADDR_RANGE(gt->info.id));</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+                *tile_size = (u64)REG_FIELD_GET(GENMASK(14, 8), reg) * SZ_1G;</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+                *tile_offset = (u64)REG_FIELD_GET(GENMASK(7, 1), reg) * SZ_1G;</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+       }</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+       /* remove the tile offset so we have just the available size */</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+       *vram_size = offset - *tile_offset;</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+       return xe_force_wake_put(gt_to_fw(gt), XE_FW_GT);</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+}</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">int xe_mmio_probe_vram(struct xe_device *xe)<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">{<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+       resource_size_t io_size;</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+       u64 available_size = 0;</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+       u64 total_size = 0;</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">       struct xe_gt *gt;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+       u64 tile_offset;</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+       u64 tile_size;</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+       u64 vram_size;</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">       int err;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">       u8 id;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">        if (!IS_DGFX(xe)) {<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">-                xe->mem.vram.mapping = 0;</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">-                xe->mem.vram.io_start = 0;</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">-                xe->mem.vram.io_size = 0;</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">-</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">-                for_each_gt(gt, xe, id) {</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">-                        gt->mem.vram.mapping = 0;</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">-                        gt->mem.vram.size = 0;</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">-                        gt->mem.vram.io_start = 0;</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">-                        gt->mem.vram.io_size = 0;</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">-                }</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+                memset(&xe->mem.vram, 0, sizeof(xe->mem.vram));</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+                for_each_gt(gt, xe, id)</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+                        memset(&gt->mem.vram, 0, sizeof(gt->mem.vram));</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">               return 0;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">       }<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+       /* Get the size of the gt0 vram for later accessibility comparison */</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+       gt = xe_device_get_gt(xe, 0);</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+       err = xe_mmio_vram_tile_size(gt, &vram_size, &tile_size, &tile_offset);</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+       if (err)</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+                return err;</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">       err = xe_determine_lmem_bar_size(xe);<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">       if (err)<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">                return err;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:brown;mso-fareast-language:EN-IN">@@ -217,57 +270,53 @@</span></b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">
</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#A020F0;mso-fareast-language:EN-IN"> int xe_mmio_probe_vram(struct xe_device *xe)</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">       drm_info(&xe->drm, "VISIBLE VRAM: %pa, %pa\n", &xe->mem.vram.io_start,<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">                 &xe->mem.vram.io_size);<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">-       /* FIXME: Assuming equally partitioned VRAM, incorrect */</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">-       if (xe->info.tile_count > 1) {</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">-                u8 adj_tile_count = xe->info.tile_count;</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">-                resource_size_t size, io_start, io_size;</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+       /* small bar issues will only cover gt0 sizes */</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+       if (xe->mem.vram.io_size < vram_size)</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+                drm_warn(&xe->drm, "Restricting VRAM size to PCI resource size (0x%llx->0x%llx)\n",</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+                        vram_size, (u64)xe->mem.vram.io_size);</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">-                for_each_gt(gt, xe, id)</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">-                        if (xe_gt_is_media_type(gt))</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">-                                --adj_tile_count;</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+       io_size = xe->mem.vram.io_size;</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">-                XE_BUG_ON(!adj_tile_count);</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+       /* gt specific ranges */</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+       for_each_gt(gt, xe, id) {</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+                if (xe_gt_is_media_type(gt))</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+                        continue;</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">-                size = xe->mem.vram.io_size / adj_tile_count;</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">-                io_start = xe->mem.vram.io_start;</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">-               io_size = xe->mem.vram.io_size;</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+                err = xe_mmio_vram_tile_size(gt, &vram_size, &tile_size, &tile_offset);</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+                if (err)</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+                        return err;</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">-                for_each_gt(gt, xe, id) {</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">-                        if (id && !xe_gt_is_media_type(gt)) {</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">-                                io_size -= min(io_size, size);</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">-                                io_start += io_size;</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">-                        }</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+                gt->mem.vram.io_start = xe->mem.vram.io_start + tile_offset;</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">-                        gt->mem.vram.size = size;</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">-</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">-                        /*</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">-                        * XXX: multi-tile small-bar might be wild. Hopefully</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">-                        * full tile without any mappable vram is not something</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">-                        * we care about.</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">-                        */</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">-</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">-                        gt->mem.vram.io_size = min(size, io_size);</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">-                        if (io_size) {</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">-                                gt->mem.vram.io_start = io_start;</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">-                                gt->mem.vram.mapping = xe->mem.vram.mapping +</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">-                                         (io_start - xe->mem.vram.io_start);</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">-                        } else {</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">-                                drm_err(&xe->drm, "Tile without any CPU visible VRAM. Aborting.\n");</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">-                                return -ENODEV;</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">-                        }</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+                /* io_size "could be 0" for small-bar systems, so no CPU access */</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+                gt->mem.vram.io_size = min_t(u64, vram_size, io_size);</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+                gt->mem.vram.base = xe->mem.vram.base + tile_offset;</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+                gt->mem.vram.size = vram_size;</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+                gt->mem.vram.mapping = xe->mem.vram.mapping + tile_offset;</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+                drm_info(&xe->drm, "VRAM[%u, %u]: %pa, %pa\n", id, gt->info.vram_id,</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+                        &gt->mem.vram.io_start, &gt->mem.vram.size);</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+                if (gt->mem.vram.io_size < gt->mem.vram.size)</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+                        drm_info(&xe->drm, "VRAM[%u, %u]: CPU access limited to %pa\n", id,</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+                                gt->info.vram_id, &gt->mem.vram.io_size);</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+                /* calculate total size using tile size to get the correct HW sizing */</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+                total_size += tile_size;</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+                available_size += vram_size;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#C55A11;mso-fareast-language:EN-IN">I think you can make this available_size = vram_size; instead as last GT for which this loop runs,<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#C55A11;mso-fareast-language:EN-IN">Will get total available size. Otherwise you may get more size than actual available. For example,<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#C55A11;mso-fareast-language:EN-IN">10 bytes for tile0, 10 bytes for tile1, 20 bytes for tile2 should return total 40b, but I think with<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#C55A11;mso-fareast-language:EN-IN">Above logic you will get 10 + 20 + 40. I am assuming offset is incremental per tile. If you can give
<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#C55A11;mso-fareast-language:EN-IN">Memory offset overall snapshot, that might help in case I am wrong.<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;mso-line-height-alt:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="mso-fareast-language:EN-IN"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;mso-line-height-alt:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="color:black;background:lime;mso-highlight:lime;mso-fareast-language:EN-IN">[mjruhl] vram_size, tile_size, and tile_offset are accessed for each gt. so vram_size is the “tile size – any stolen” portion.  So</span><span lang="EN-IN" style="background:lime;mso-highlight:lime;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;mso-line-height-alt:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="color:black;background:lime;mso-highlight:lime;mso-fareast-language:EN-IN">vram should be the “available memory for the specific tile”, not an accumulation of tiles.  So the addition should be 10 + 10 + 20.</span><span lang="EN-IN" style="background:lime;mso-highlight:lime;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;mso-line-height-alt:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="color:black;background:lime;mso-highlight:lime;mso-fareast-language:EN-IN">I will double check my logic.</span><span lang="EN-IN" style="color:black;mso-fareast-language:EN-IN">
</span><span lang="EN-IN" style="background:lime;mso-highlight:lime;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;mso-line-height-alt:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="mso-fareast-language:EN-IN"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">-                        drm_info(&xe->drm, "VRAM[%u, %u]: %pa, %pa\n",</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">-                                id, gt->info.vram_id, &gt->mem.vram.io_start,</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">-                                &gt->mem.vram.size);</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+                if (total_size > xe->mem.vram.io_size) {</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+                        drm_warn(&xe->drm, "VRAM: %pa is larger than resource %pa\n",</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+                                &total_size, &xe->mem.vram.io_size);<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">                }<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">-       } else {</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">-                gt->mem.vram.size = xe->mem.vram.io_size;</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">-                gt->mem.vram.io_start = xe->mem.vram.io_start;</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">-                gt->mem.vram.io_size = xe->mem.vram.io_size;</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">-                gt->mem.vram.mapping = xe->mem.vram.mapping;</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">-                drm_info(&xe->drm, "VRAM: %pa\n", &gt->mem.vram.size);</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+                io_size -= min_t(u64, tile_size, io_size);</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">       }<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+       drm_info(&xe->drm, "Available VRAM: %pa, %pa\n", &xe->mem.vram.io_start,</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+                &available_size);</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#C55A11;mso-fareast-language:EN-IN">Here it can be little more readable, but its my opinion, up to you :<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#C55A11;mso-fareast-language:EN-IN">drm_info(&xe->drm, "Available VRAM: start addr: %pa, size: %pa\n", &xe->mem.vram.io_start,<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#C55A11;mso-fareast-language:EN-IN">                 &available_size);<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:black;background:lime;mso-highlight:lime;mso-fareast-language:EN-IN">[mjruhl] Yeah waffled on adding the start/addr info.  Will add.</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;mso-line-height-alt:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="mso-fareast-language:EN-IN"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">       return 0;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">}<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:brown;mso-fareast-language:EN-IN">@@ -287,9 +336,6 @@</span></b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">
</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#A020F0;mso-fareast-language:EN-IN"> static void xe_mmio_probe_tiles(struct xe_device *xe)</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">       if (xe->info.media_verx100 >= 1300)<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">                xe->info.tile_count *= 2;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">-       drm_info(&xe->drm, "tile_count: %d, adj_tile_count %d\n",</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">-                xe->info.tile_count, adj_tile_count);</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">-</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">       if (xe->info.tile_count > 1) {<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">                const int mmio_bar = 0;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">                size_t size;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:seagreen;mso-fareast-language:EN-IN">diff --git a/drivers/gpu/drm/xe/xe_mmio.h b/drivers/gpu/drm/xe/xe_mmio.h</span></b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:seagreen;mso-fareast-language:EN-IN">index 1a32e0f52261..1c588db0b074 100644</span></b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:seagreen;mso-fareast-language:EN-IN">--- a/drivers/gpu/drm/xe/xe_mmio.h</span></b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:seagreen;mso-fareast-language:EN-IN">+++ b/drivers/gpu/drm/xe/xe_mmio.h</span></b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:brown;mso-fareast-language:EN-IN">@@ -1,6 +1,6 @@</span></b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">
<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"> /* SPDX-License-Identifier: MIT */<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">/*<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">- * Copyright © 2021 Intel Corporation</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+ * Copyright © 2021-2023 Intel Corporation</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">  */<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"> #ifndef _XE_MMIO_H_<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:brown;mso-fareast-language:EN-IN">@@ -120,6 +120,6 @@</span></b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">
</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#A020F0;mso-fareast-language:EN-IN"> static inline bool xe_mmio_in_range(const struct xe_mmio_range *range, u32 reg)</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">}<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"> int xe_mmio_probe_vram(struct xe_device *xe);<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">-int xe_mmio_total_vram_size(struct xe_device *xe, u64 *vram_size, u64 *flat_ccs_base);</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+int xe_mmio_vram_tile_size(struct xe_gt *gt, u64 *vram_size, u64 *tile_size, u64 *tile_offset);</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"> #endif<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:seagreen;mso-fareast-language:EN-IN">diff --git a/drivers/gpu/drm/xe/xe_ttm_stolen_mgr.c b/drivers/gpu/drm/xe/xe_ttm_stolen_mgr.c</span></b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:seagreen;mso-fareast-language:EN-IN">index 9136c035db0e..acc11f580db4 100644</span></b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:seagreen;mso-fareast-language:EN-IN">--- a/drivers/gpu/drm/xe/xe_ttm_stolen_mgr.c</span></b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:seagreen;mso-fareast-language:EN-IN">+++ b/drivers/gpu/drm/xe/xe_ttm_stolen_mgr.c</span></b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:brown;mso-fareast-language:EN-IN">@@ -12,9 +12,11 @@</span></b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">
<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"> #include <drm/ttm/ttm_range_manager.h><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"> #include "regs/xe_regs.h"<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+#include "regs/xe_gt_regs.h"</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">#include "xe_bo.h"<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">#include "xe_device.h"<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">#include "xe_gt.h"<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+#include "xe_gt_mcr.h"</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">#include "xe_mmio.h"<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">#include "xe_res_cursor.h"<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">#include "xe_ttm_stolen_mgr.h"<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:brown;mso-fareast-language:EN-IN">@@ -51,21 +53,26 @@</span></b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">
</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#A020F0;mso-fareast-language:EN-IN"> bool xe_ttm_stolen_cpu_access_needs_ggtt(struct xe_device *xe)</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">       return GRAPHICS_VERx100(xe) < 1270 && !IS_DGFX(xe);<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">}<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">-static s64 detect_bar2_dgfx(struct xe_device *xe, struct xe_ttm_stolen_mgr *mgr)</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+static s64 detect_bar2_dgfx(struct xe_gt *gt, struct xe_ttm_stolen_mgr *mgr)</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">{<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">-       u64 vram_size, stolen_size;</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+       u64 stolen_size;</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+       u64 tile_offset;</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+       u64 tile_size;</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+       u64 vram_size;</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">-       vram_size = xe->mem.vram.io_size;</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+       if (drm_WARN_ON(&gt->xe->drm,</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+                        xe_mmio_vram_tile_size(gt, &vram_size, &tile_size, &tile_offset)) < 0)</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+                return 0;</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">        /* Use DSM base address instead for stolen memory */<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">-       mgr->stolen_base = xe_mmio_read64(to_gt(xe), GEN12_DSMBASE.reg) & GEN12_BDSM_MASK;</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">-       if (drm_WARN_ON(&xe->drm, vram_size < mgr->stolen_base))</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+       mgr->stolen_base = (xe_mmio_read64(gt, GEN12_DSMBASE.reg) & GEN12_BDSM_MASK) - tile_offset;</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+       if (drm_WARN_ON(&gt->xe->drm, tile_size < mgr->stolen_base))</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">                return 0;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">-       stolen_size = vram_size - mgr->stolen_base;</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+       stolen_size = tile_size - mgr->stolen_base;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#C55A11;mso-fareast-language:EN-IN">Should it be tile_offset instead,<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#C55A11;mso-fareast-language:EN-IN">stolen_size = tile_offset - mgr->stolen_base;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;mso-line-height-alt:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="color:black;background:lime;mso-highlight:lime;mso-fareast-language:EN-IN">[mjruhl] The DSMBASE value (register)will be the offset to the DSM plus the tile offset.  So I need to subtract the tile_offset</span><span lang="EN-IN" style="background:lime;mso-highlight:lime;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;mso-line-height-alt:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="color:black;background:lime;mso-highlight:lime;mso-fareast-language:EN-IN">from the register value to get the base.  Once we get the base, the size is calculated with the above tile_size value.</span><span lang="EN-IN" style="background:lime;mso-highlight:lime;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;mso-line-height-alt:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="color:black;background:lime;mso-highlight:lime;mso-fareast-language:EN-IN">Thank you for your comments!</span><span lang="EN-IN" style="background:lime;mso-highlight:lime;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;mso-line-height-alt:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="color:black;background:lime;mso-highlight:lime;mso-fareast-language:EN-IN">M</span><span lang="EN-IN" style="mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;mso-line-height-alt:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="mso-fareast-language:EN-IN"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#C55A11;mso-fareast-language:EN-IN">Thanks,<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#C55A11;mso-fareast-language:EN-IN">Tejas<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">-       if (mgr->stolen_base + stolen_size <= vram_size)</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">-                mgr->io_base = xe->mem.vram.io_start + mgr->stolen_base;</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+       if (mgr->stolen_base + stolen_size <= tile_size)</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+                mgr->io_base = gt->mem.vram.io_start + mgr->stolen_base;</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">        /*<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">        * There may be few KB of platform dependent reserved memory at the end<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:brown;mso-fareast-language:EN-IN">@@ -133,7 +140,7 @@</span></b><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">
</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#A020F0;mso-fareast-language:EN-IN"> void xe_ttm_stolen_mgr_init(struct xe_device *xe)</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">       int err;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">        if (IS_DGFX(xe))<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:slateblue;mso-fareast-language:EN-IN">-                stolen_size = detect_bar2_dgfx(xe, mgr);</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:darkcyan;mso-fareast-language:EN-IN">+                stolen_size = detect_bar2_dgfx(to_gt(xe), mgr);</span><span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">       else if (GRAPHICS_VERx100(xe) >= 1270)<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">                stolen_size = detect_bar2_integrated(xe, mgr);<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:7.5pt;line-height:10.75pt;background:white;word-break:break-all">
<span lang="EN-IN" style="font-size:10.0pt;font-family:Consolas;color:#333333;mso-fareast-language:EN-IN">       else<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</body>
</html>