Skip to content

Commit 151e0e0

Browse files
matt-auldrodrigovivi
authored andcommitted
drm/i915: consider HAS_FLAT_CCS() in needs_ccs_pages
Just move the HAS_FLAT_CCS() check into needs_ccs_pages. This also then fixes i915_ttm_memcpy_allowed() which was incorrectly reporting true on DG1, even though it doesn't have small-BAR or flat-CCS. References: https://gitlab.freedesktop.org/drm/intel/-/issues/6605 Fixes: efeb3ca ("drm/i915/ttm: disallow CPU fallback mode for ccs pages") Signed-off-by: Matthew Auld <[email protected]> Cc: Nirmoy Das <[email protected]> Reviewed-by: Nirmoy Das <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] (cherry picked from commit 873fef8) Signed-off-by: Rodrigo Vivi <[email protected]>
1 parent 672d6ca commit 151e0e0

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

drivers/gpu/drm/i915/gem/i915_gem_object.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -723,6 +723,9 @@ bool i915_gem_object_needs_ccs_pages(struct drm_i915_gem_object *obj)
723723
bool lmem_placement = false;
724724
int i;
725725

726+
if (!HAS_FLAT_CCS(to_i915(obj->base.dev)))
727+
return false;
728+
726729
for (i = 0; i < obj->mm.n_placements; i++) {
727730
/* Compression is not allowed for the objects with smem placement */
728731
if (obj->mm.placements[i]->type == INTEL_MEMORY_SYSTEM)

drivers/gpu/drm/i915/gem/i915_gem_ttm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ static struct ttm_tt *i915_ttm_tt_create(struct ttm_buffer_object *bo,
297297
i915_tt->is_shmem = true;
298298
}
299299

300-
if (HAS_FLAT_CCS(i915) && i915_gem_object_needs_ccs_pages(obj))
300+
if (i915_gem_object_needs_ccs_pages(obj))
301301
ccs_pages = DIV_ROUND_UP(DIV_ROUND_UP(bo->base.size,
302302
NUM_BYTES_PER_CCS_BYTE),
303303
PAGE_SIZE);

0 commit comments

Comments
 (0)