<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body>
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 7/26/2024 10:17 AM, Matt Roper
      wrote:<br>
    </div>
    <blockquote type="cite" cite="mid:20240726171757.2728819-2-matthew.d.roper@intel.com">
      <pre class="moz-quote-pre" wrap="">Although all current Xe2 platforms support FlatCCS, we probably
shouldn't assume that will be universally true forever.  In the past
we've had platforms like PVC that didn't support compression, and the
same could show up again at some point in the future.  Future-proof the
migration code by adding an explicit check for FlatCCS support to the
condition that decides whether to use a compressed PAT index for
migration.

While we're at it, we can drop the IS_DGFX check since it's redundant
with the src_is_vram check (only dGPUs have VRAM).

Cc: Akshata Jahagirdar <a class="moz-txt-link-rfc2396E" href="mailto:akshata.jahagirdar@intel.com"><akshata.jahagirdar@intel.com></a>
Cc: Lucas De Marchi <a class="moz-txt-link-rfc2396E" href="mailto:lucas.demarchi@intel.com"><lucas.demarchi@intel.com></a>
Signed-off-by: Matt Roper <a class="moz-txt-link-rfc2396E" href="mailto:matthew.d.roper@intel.com"><matthew.d.roper@intel.com></a>
---
 drivers/gpu/drm/xe/xe_migrate.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/xe/xe_migrate.c b/drivers/gpu/drm/xe/xe_migrate.c
index c007f68503d4..6f24aaf58252 100644
--- a/drivers/gpu/drm/xe/xe_migrate.c
+++ b/drivers/gpu/drm/xe/xe_migrate.c
@@ -781,7 +781,8 @@ struct dma_fence *xe_migrate_copy(struct xe_migrate *m,
        bool copy_ccs = xe_device_has_flat_ccs(xe) &&
                xe_bo_needs_ccs_pages(src_bo) && xe_bo_needs_ccs_pages(dst_bo);
        bool copy_system_ccs = copy_ccs && (!src_is_vram || !dst_is_vram);
-       bool use_comp_pat = GRAPHICS_VER(xe) >= 20 && IS_DGFX(xe) && src_is_vram && !dst_is_vram;
+       bool use_comp_pat = xe_device_has_flat_ccs(xe) &&
+               GRAPHICS_VER(xe) >= 20 && src_is_vram && !dst_is_vram;
 </pre>
    </blockquote>
    LGTM.<br>
    <p style="margin:0in;font-family:Calibri;font-size:11.0pt">Reviewed-by:
      Akshata
      Jahagirdar <a class="moz-txt-link-rfc2396E" href="mailto:akshata.jahagirdar@intel.com"><akshata.jahagirdar@intel.com></a></p>
    <blockquote type="cite" cite="mid:20240726171757.2728819-2-matthew.d.roper@intel.com">
      <pre class="moz-quote-pre" wrap="">
        /* Copying CCS between two different BOs is not supported yet. */
        if (XE_WARN_ON(copy_ccs && src_bo != dst_bo))
</pre>
    </blockquote>
  </body>
</html>