Skip to content

Commit

Permalink
drm/i915: move memory_regions to runtime info
Browse files Browse the repository at this point in the history
If it's modified runtime, it's runtime info.

mock_gem_device() is the only one that modifies it. If that could be
fixed, we wouldn't have to do this.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Maarten Lankhort <maarten.lankhorst@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/12aace656c6a6380575767d7f6ccd73c12a627c3.1660910433.git.jani.nikula@intel.com
  • Loading branch information
Jani Nikula committed Aug 24, 2022
1 parent 39a445b commit f81f30b
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/i915/i915_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -1302,7 +1302,7 @@ IS_SUBPLATFORM(const struct drm_i915_private *i915,

#define HAS_IPC(dev_priv) (INTEL_INFO(dev_priv)->display.has_ipc)

#define HAS_REGION(i915, i) (INTEL_INFO(i915)->memory_regions & (i))
#define HAS_REGION(i915, i) (RUNTIME_INFO(i915)->memory_regions & (i))
#define HAS_LMEM(i915) HAS_REGION(i915, REGION_LMEM)

/*
Expand Down
6 changes: 3 additions & 3 deletions drivers/gpu/drm/i915/i915_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@
.__runtime.page_sizes = I915_GTT_PAGE_SIZE_4K

#define GEN_DEFAULT_REGIONS \
.memory_regions = REGION_SMEM | REGION_STOLEN_SMEM
.__runtime.memory_regions = REGION_SMEM | REGION_STOLEN_SMEM

#define I830_FEATURES \
GEN(2), \
Expand Down Expand Up @@ -909,7 +909,7 @@ static const struct intel_device_info rkl_info = {
};

#define DGFX_FEATURES \
.memory_regions = REGION_SMEM | REGION_LMEM | REGION_STOLEN_LMEM, \
.__runtime.memory_regions = REGION_SMEM | REGION_LMEM | REGION_STOLEN_LMEM, \
.has_llc = 0, \
.has_pxp = 0, \
.has_snoop = 1, \
Expand Down Expand Up @@ -1129,7 +1129,7 @@ static const struct intel_device_info mtl_info = {
.display.has_modular_fia = 1,
.has_flat_ccs = 0,
.has_snoop = 1,
.memory_regions = REGION_SMEM | REGION_STOLEN_LMEM,
.__runtime.memory_regions = REGION_SMEM | REGION_STOLEN_LMEM,
.platform_engine_mask = BIT(RCS0) | BIT(BCS0) | BIT(CCS0),
.require_force_probe = 1,
};
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/i915/intel_device_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ void intel_device_info_print(const struct intel_device_info *info,
drm_printf(p, "display version: %u\n", info->display.ver);

drm_printf(p, "gt: %d\n", info->gt);
drm_printf(p, "memory-regions: %x\n", info->memory_regions);
drm_printf(p, "memory-regions: %x\n", runtime->memory_regions);
drm_printf(p, "page-sizes: %x\n", runtime->page_sizes);
drm_printf(p, "platform: %s\n", intel_platform_name(info->platform));
drm_printf(p, "ppgtt-size: %d\n", runtime->ppgtt_size);
Expand Down
4 changes: 2 additions & 2 deletions drivers/gpu/drm/i915/intel_device_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,8 @@ struct intel_runtime_info {
enum intel_ppgtt_type ppgtt_type;
unsigned int ppgtt_size; /* log2, e.g. 31/32/48 bits */

u32 memory_regions; /* regions supported by the HW */

bool has_pooled_eu;

/* display */
Expand All @@ -245,8 +247,6 @@ struct intel_device_info {

unsigned int dma_mask_size; /* available DMA address bits */

u32 memory_regions; /* regions supported by the HW */

u8 gt; /* GT number, 0 if undefined */

#define DEFINE_FLAG(name) u8 name:1
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/i915/selftests/mock_gem_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ struct drm_i915_private *mock_gem_device(void)
I915_GTT_PAGE_SIZE_64K |
I915_GTT_PAGE_SIZE_2M;

mkwrite_device_info(i915)->memory_regions = REGION_SMEM;
RUNTIME_INFO(i915)->memory_regions = REGION_SMEM;
intel_memory_regions_hw_probe(i915);

spin_lock_init(&i915->gpu_error.lock);
Expand Down

0 comments on commit f81f30b

Please sign in to comment.