From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 71CF4C3DA4A for ; Thu, 11 Jul 2024 12:09:46 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4191B10EA49; Thu, 11 Jul 2024 12:09:46 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="Bd8IfOPG"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8E39E10EA49 for ; Thu, 11 Jul 2024 12:09:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1720699785; x=1752235785; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=I0m6whyfEIQcRgTPqEtEukRPCxrrSpwpGQRDhJuSO7c=; b=Bd8IfOPGq8B2wbu00d94Vm2Y6qkl0z89aydXo1uhbngnvkd5WZvmhT1C nWJU6BU2OAlnYzTUQ8trKPf37oq1yM0iy/VKGCiVuPhkdsWWKIrpy2E5B mp5X+4R6Um4a7tYSEfqB0Wf6flHI4MyHWdakhzJppj3ojeYuANca7xLfB j+P2ErpEZ6ztdRBXnfjMD3WbbQkIlDiYxz455uoEWf9ENe6pKwnGjQ+s/ YzB9ZToRrTvG5M5LfiajowCsbPdqRr+TMTV5vPhypGQmPnT5YD/nRKAxT pa98h8TGvimCcsvxBzujrsD7xEkXNsP5ka86NZzCsQCLTZBlmxmW/PmZV Q==; X-CSE-ConnectionGUID: S/5c/7EpTQSBuuoHdsGttA== X-CSE-MsgGUID: r59Nz0OgR/GQmnofFYADNQ== X-IronPort-AV: E=McAfee;i="6700,10204,11129"; a="17940094" X-IronPort-AV: E=Sophos;i="6.09,200,1716274800"; d="scan'208";a="17940094" Received: from fmviesa005.fm.intel.com ([10.60.135.145]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jul 2024 05:09:44 -0700 X-CSE-ConnectionGUID: ATtk7DAeRJmbqTQZ0Pma0A== X-CSE-MsgGUID: 2vagfyp8Sw681m/Mn9WBDQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,200,1716274800"; d="scan'208";a="52922252" Received: from fpallare-mobl3.ger.corp.intel.com (HELO [10.245.245.34]) ([10.245.245.34]) by fmviesa005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jul 2024 05:09:43 -0700 Message-ID: <26effdad-d3f2-4db6-a75d-899f03639666@intel.com> Date: Thu, 11 Jul 2024 13:09:40 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/6] drm/xe/migrate: Handle clear ccs logic for xe2 dgfx To: Akshata Jahagirdar , intel-xe@lists.freedesktop.org Cc: matthew.d.roper@intel.com, himal.prasad.ghimiray@intel.com, lucas.demarchi@intel.com References: <2b3532ca86b91da122154e56bd4ae95c2dafc04a.1720689220.git.akshata.jahagirdar@intel.com> Content-Language: en-GB From: Matthew Auld In-Reply-To: <2b3532ca86b91da122154e56bd4ae95c2dafc04a.1720689220.git.akshata.jahagirdar@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: intel-xe@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Xe graphics driver List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-xe-bounces@lists.freedesktop.org Sender: "Intel-xe" On 11/07/2024 10:18, Akshata Jahagirdar wrote: > For Xe2 dGPU, we clear the bo by modifying the VRAM using an > uncompressed pat index which then indirectly updates the > compression status as uncompressed i.e zeroed CCS. > So xe_migrate_clear() should be updated for BMG to not > emit CCS surf copy commands. > > Signed-off-by: Akshata Jahagirdar > --- > drivers/gpu/drm/xe/xe_device.h | 5 +++++ > drivers/gpu/drm/xe/xe_migrate.c | 6 +++--- > 2 files changed, 8 insertions(+), 3 deletions(-) > > diff --git a/drivers/gpu/drm/xe/xe_device.h b/drivers/gpu/drm/xe/xe_device.h > index 0a2a3e7fd402..c3093506c28c 100644 > --- a/drivers/gpu/drm/xe/xe_device.h > +++ b/drivers/gpu/drm/xe/xe_device.h > @@ -144,6 +144,11 @@ static inline bool xe_device_has_flat_ccs(struct xe_device *xe) > return xe->info.has_flat_ccs; > } > > +static inline bool xe_device_needs_ccs_emit(struct xe_device *xe) > +{ > + return xe_device_has_flat_ccs(xe) && !(GRAPHICS_VER(xe) >= 20 && IS_DGFX(xe)); > +} > + This should in theory be hyper specific to the migration code implementation. I think best keep in xe_migrate.c, instead of exporting (if possible). With that, Reviewed-by: Matthew Auld > static inline bool xe_device_has_sriov(struct xe_device *xe) > { > return xe->info.has_sriov; > diff --git a/drivers/gpu/drm/xe/xe_migrate.c b/drivers/gpu/drm/xe/xe_migrate.c > index fa23a7e7ec43..2fc2cf375b1e 100644 > --- a/drivers/gpu/drm/xe/xe_migrate.c > +++ b/drivers/gpu/drm/xe/xe_migrate.c > @@ -420,7 +420,7 @@ struct xe_migrate *xe_migrate_init(struct xe_tile *tile) > return ERR_PTR(err); > > if (IS_DGFX(xe)) { > - if (xe_device_has_flat_ccs(xe)) > + if (xe_device_needs_ccs_emit(xe)) > /* min chunk size corresponds to 4K of CCS Metadata */ > m->min_chunk_size = SZ_4K * SZ_64K / > xe_device_ccs_bytes(xe, SZ_64K); > @@ -1034,7 +1034,7 @@ struct dma_fence *xe_migrate_clear(struct xe_migrate *m, > clear_system_ccs ? 0 : emit_clear_cmd_len(gt), 0, > avail_pts); > > - if (xe_device_has_flat_ccs(xe)) > + if (xe_device_needs_ccs_emit(xe)) > batch_size += EMIT_COPY_CCS_DW; > > /* Clear commands */ > @@ -1062,7 +1062,7 @@ struct dma_fence *xe_migrate_clear(struct xe_migrate *m, > if (!clear_system_ccs) > emit_clear(gt, bb, clear_L0_ofs, clear_L0, XE_PAGE_SIZE, clear_vram); > > - if (xe_device_has_flat_ccs(xe)) { > + if (xe_device_needs_ccs_emit(xe)) { > emit_copy_ccs(gt, bb, clear_L0_ofs, true, > m->cleared_mem_ofs, false, clear_L0); > flush_flags = MI_FLUSH_DW_CCS;