On 11/05/2022 16:37, Nirmoy Das wrote:
Until we enable small-bar, we can't support CCS so error
out gracefully on such platforms.
It's not so much CCS, but any platform that might end up with small-bar,
which is so far only some DG2 boards.
Signed-off-by: Nirmoy Das <nirmoy.das@xxxxxxxxx>
---
drivers/gpu/drm/i915/gt/intel_region_lmem.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/gpu/drm/i915/gt/intel_region_lmem.c b/drivers/gpu/drm/i915/gt/intel_region_lmem.c
index cd105ec10429..43caf8052ffb 100644
--- a/drivers/gpu/drm/i915/gt/intel_region_lmem.c
+++ b/drivers/gpu/drm/i915/gt/intel_region_lmem.c
@@ -111,6 +111,13 @@ static struct intel_memory_region *setup_lmem(struct intel_gt *gt)
flat_ccs_base = intel_gt_read_register(gt, XEHPSDV_FLAT_CCS_BASE_ADDR);
flat_ccs_base = (flat_ccs_base >> XEHPSDV_CCS_BASE_SHIFT) * SZ_64K;
+ /* FIXME: Remove this when we have small-bar enabled */
+ if (pci_resource_len(pdev, 2) < lmem_size) {
+ drm_err(&i915->drm, "CCS isn't supported on platforms with small-bar\n");
+ return ERR_PTR(-EINVAL);
+
Spurious new line here.
For the series,
Reviewed-by: Matthew Auld <matthew.auld@xxxxxxxxx>
+ }
+
if (GEM_WARN_ON(lmem_size < flat_ccs_base))
return ERR_PTR(-EIO);