Skip to content

Commit 306f7a5

Browse files
author
Andi Shyti
committed
drm/i915: Replace i915->gt0 with to_gt(i915)
Quite surprised to see that around i915 there are still i915->gt0 references. Replace them with the to_gt() helper. Signed-off-by: Andi Shyti <[email protected]> Reviewed-by: Andrzej Hajda <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 361ecaa commit 306f7a5

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -892,7 +892,7 @@ i915_gem_stolen_lmem_setup(struct drm_i915_private *i915, u16 type,
892892
} else {
893893
resource_size_t lmem_range;
894894

895-
lmem_range = intel_gt_mcr_read_any(&i915->gt0, XEHP_TILE0_ADDR_RANGE) & 0xFFFF;
895+
lmem_range = intel_gt_mcr_read_any(to_gt(i915), XEHP_TILE0_ADDR_RANGE) & 0xFFFF;
896896
lmem_size = lmem_range >> XEHP_TILE_LMEM_RANGE_SHIFT;
897897
lmem_size *= SZ_1G;
898898
}

drivers/gpu/drm/i915/gt/intel_gt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -887,7 +887,7 @@ static int intel_gt_tile_setup(struct intel_gt *gt, phys_addr_t phys_addr)
887887
int intel_gt_probe_all(struct drm_i915_private *i915)
888888
{
889889
struct pci_dev *pdev = to_pci_dev(i915->drm.dev);
890-
struct intel_gt *gt = &i915->gt0;
890+
struct intel_gt *gt = to_gt(i915);
891891
const struct intel_gt_definition *gtdef;
892892
phys_addr_t phys_addr;
893893
unsigned int mmio_bar;

drivers/gpu/drm/i915/gt/intel_region_lmem.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ static struct intel_memory_region *setup_lmem(struct intel_gt *gt)
220220
resource_size_t lmem_range;
221221
u64 tile_stolen, flat_ccs_base;
222222

223-
lmem_range = intel_gt_mcr_read_any(&i915->gt0, XEHP_TILE0_ADDR_RANGE) & 0xFFFF;
223+
lmem_range = intel_gt_mcr_read_any(to_gt(i915), XEHP_TILE0_ADDR_RANGE) & 0xFFFF;
224224
lmem_size = lmem_range >> XEHP_TILE_LMEM_RANGE_SHIFT;
225225
lmem_size *= SZ_1G;
226226

drivers/gpu/drm/i915/pxp/intel_pxp.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,8 @@ static struct intel_gt *find_gt_for_required_teelink(struct drm_i915_private *i9
162162
* for HuC authentication. For now, its limited to DG2.
163163
*/
164164
if (IS_ENABLED(CONFIG_INTEL_MEI_PXP) && IS_ENABLED(CONFIG_INTEL_MEI_GSC) &&
165-
intel_huc_is_loaded_by_gsc(&i915->gt0.uc.huc) && intel_uc_uses_huc(&i915->gt0.uc))
166-
return &i915->gt0;
165+
intel_huc_is_loaded_by_gsc(&to_gt(i915)->uc.huc) && intel_uc_uses_huc(&to_gt(i915)->uc))
166+
return to_gt(i915);
167167

168168
return NULL;
169169
}
@@ -188,8 +188,8 @@ static struct intel_gt *find_gt_for_required_protected_content(struct drm_i915_p
188188
* Else we rely on mei-pxp module but only on legacy platforms
189189
* prior to having separate media GTs and has a valid VDBOX.
190190
*/
191-
if (IS_ENABLED(CONFIG_INTEL_MEI_PXP) && !i915->media_gt && VDBOX_MASK(&i915->gt0))
192-
return &i915->gt0;
191+
if (IS_ENABLED(CONFIG_INTEL_MEI_PXP) && !i915->media_gt && VDBOX_MASK(to_gt(i915)))
192+
return to_gt(i915);
193193

194194
return NULL;
195195
}

drivers/gpu/drm/i915/selftests/mock_gem_device.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ static struct dev_pm_domain pm_domain = {
113113

114114
static void mock_gt_probe(struct drm_i915_private *i915)
115115
{
116-
i915->gt[0] = &i915->gt0;
116+
i915->gt[0] = to_gt(i915);
117117
i915->gt[0]->name = "Mock GT";
118118
}
119119

0 commit comments

Comments
 (0)