lmem_size = intel_uncore_read64(&i915->uncore, GEN12_GSMBASE);
        }
 
+       if (i915->params.lmem_size > 0) {
+               lmem_size = min_t(resource_size_t, lmem_size,
+                                 mul_u32_u32(i915->params.lmem_size, SZ_1M));
+       }
 
        io_start = pci_resource_start(pdev, 2);
        io_size = min(pci_resource_len(pdev, 2), lmem_size);
 
                        "Default request/fence/batch buffer expiration timeout.");
 #endif
 
+i915_param_named_unsafe(lmem_size, uint, 0400,
+                       "Set the lmem size(in MiB) for each region. (default: 0, all memory)");
+
 static __always_inline void _print_param(struct drm_printer *p,
                                         const char *name,
                                         const char *type,
 
        param(int, enable_dpcd_backlight, -1, 0600) \
        param(char *, force_probe, CONFIG_DRM_I915_FORCE_PROBE, 0400) \
        param(unsigned int, request_timeout_ms, CONFIG_DRM_I915_REQUEST_TIMEOUT, CONFIG_DRM_I915_REQUEST_TIMEOUT ? 0600 : 0) \
+       param(unsigned int, lmem_size, 0, 0400) \
        /* leave bools at the end to not create holes */ \
        param(bool, enable_hangcheck, true, 0600) \
        param(bool, load_detect_test, false, 0600) \