@@ -200,6 +200,9 @@ i915_param_named_unsafe(fake_lmem_start, ulong, 0400,
i915_param_named_unsafe(enable_eviction, bool, 0600,
"Enable memcpy based eviction which does not rely on DMA resv refactoring)");
+i915_param_named_unsafe(lmem_size, uint, 0400,
+ "Change lmem size for each region. (default: 0, all memory)");
+
static __always_inline void _print_param(struct drm_printer *p,
const char *name,
const char *type,
@@ -71,6 +71,7 @@ struct drm_printer;
param(int, enable_dpcd_backlight, -1, 0600) \
param(char *, force_probe, CONFIG_DRM_I915_FORCE_PROBE, 0400) \
param(unsigned long, fake_lmem_start, 0, 0400) \
+ param(unsigned int, lmem_size, 0, 0400) \
/* leave bools at the end to not create holes */ \
param(bool, enable_eviction, true, 0600) \
param(bool, enable_hangcheck, true, 0600) \
@@ -196,6 +196,10 @@ setup_lmem(struct drm_i915_private *dev_priv)
io_start = pci_resource_start(pdev, 2);
+ if (dev_priv->params.lmem_size > 0)
+ lmem_size = min_t(resource_size_t, lmem_size,
+ mul_u32_u32(dev_priv->params.lmem_size, SZ_1M));
+
mem = intel_memory_region_create(dev_priv,
0,
lmem_size,