Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] drm/i915: Fix HAS_REGION() usage in intel_gt_probe_lmem()
@ 2024-05-02 12:14 Ville Syrjala
  2024-05-02 12:14 ` [PATCH 2/3] drm/i915: Pass the region ID rather than a bitmask to HAS_REGION() Ville Syrjala
                   ` (6 more replies)
  0 siblings, 7 replies; 10+ messages in thread
From: Ville Syrjala @ 2024-05-02 12:14 UTC (permalink / raw)
  To: intel-gfx

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

HAS_REGION() takes a bitmask, not the region ID. This causes the
GEM_BUG_ON() to assert that the SMEM region is available rather
than the intended LMEM region. No real harm since SMEM is always
available, but also not checking what was intended.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/gt/intel_gt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/gt/intel_gt.c b/drivers/gpu/drm/i915/gt/intel_gt.c
index 626b166e67ef..5a7ecf823ae6 100644
--- a/drivers/gpu/drm/i915/gt/intel_gt.c
+++ b/drivers/gpu/drm/i915/gt/intel_gt.c
@@ -105,7 +105,7 @@ static int intel_gt_probe_lmem(struct intel_gt *gt)
 
 	intel_memory_region_set_name(mem, "local%u", mem->instance);
 
-	GEM_BUG_ON(!HAS_REGION(i915, id));
+	GEM_BUG_ON(!HAS_REGION(i915, BIT(id)));
 	GEM_BUG_ON(i915->mm.regions[id]);
 	i915->mm.regions[id] = mem;
 
-- 
2.43.2


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2024-05-03  0:11 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-02 12:14 [PATCH 1/3] drm/i915: Fix HAS_REGION() usage in intel_gt_probe_lmem() Ville Syrjala
2024-05-02 12:14 ` [PATCH 2/3] drm/i915: Pass the region ID rather than a bitmask to HAS_REGION() Ville Syrjala
2024-05-02 12:54   ` Rodrigo Vivi
2024-05-02 12:14 ` [PATCH 3/3] drm/i915: Remove counter productive REGION_* wrappers Ville Syrjala
2024-05-02 12:54   ` Rodrigo Vivi
2024-05-02 12:52 ` [PATCH 1/3] drm/i915: Fix HAS_REGION() usage in intel_gt_probe_lmem() Rodrigo Vivi
2024-05-02 12:59 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/3] " Patchwork
2024-05-02 12:59 ` ✗ Fi.CI.SPARSE: " Patchwork
2024-05-02 13:06 ` ✓ Fi.CI.BAT: success " Patchwork
2024-05-03  0:11 ` ✗ Fi.CI.IGT: failure " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox