diff mbox series

[3/3] drm/i915: error out on platform with small-bar and CCS

Message ID 20220511153746.14142-3-nirmoy.das@intel.com (mailing list archive)
State New, archived
Headers show
Series [1/3] drm/i915: return -EIO on lmem setup failure | expand

Commit Message

Nirmoy Das May 11, 2022, 3:37 p.m. UTC
Until we enable small-bar, we can't support CCS so error
out gracefully on such platforms.

Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>
---
 drivers/gpu/drm/i915/gt/intel_region_lmem.c | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Matthew Auld May 11, 2022, 4 p.m. UTC | #1
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@intel.com>
> ---
>   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@intel.com>

> +		}
> +
>   		if (GEM_WARN_ON(lmem_size < flat_ccs_base))
>   			return ERR_PTR(-EIO);
>
diff mbox series

Patch

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);
+
+		}
+
 		if (GEM_WARN_ON(lmem_size < flat_ccs_base))
 			return ERR_PTR(-EIO);