[Intel-gfx] [PATCH] drm/i915: Probe system memory regions before enabling HW

Matthew Auld matthew.auld at intel.com
Thu Feb 11 12:27:56 UTC 2021


On 11/02/2021 11:20, Chris Wilson wrote:
> If we want to track system/stolen as memory regions, we need to setup
> our bookkeeping *before* we want to start allocating and reserving
> objects in those regions. In particular, in setup up the GGTT we will
> try to preallocate stolen regions configured by the BIOS, and so should
> prepare the system-stolen memory region beforehand.
> 
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> Cc: Matthew Auld <matthew.auld at intel.com>
> ---
>   drivers/gpu/drm/i915/i915_drv.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index b708517d3972..139cea4443fd 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -557,6 +557,10 @@ static int i915_driver_hw_probe(struct drm_i915_private *dev_priv)
>   
>   	i915_perf_init(dev_priv);
>   
> +	ret = intel_memory_regions_hw_probe(dev_priv);
> +	if (ret)
> +		goto err_ggtt;

Hmmm, adjust_stolen is also peeking at ggtt_total_entries(ggtt) on some 
old platforms.

> +
>   	ret = i915_ggtt_probe_hw(dev_priv);
>   	if (ret)
>   		goto err_perf;
> @@ -569,10 +573,6 @@ static int i915_driver_hw_probe(struct drm_i915_private *dev_priv)
>   	if (ret)
>   		goto err_ggtt;
>   
> -	ret = intel_memory_regions_hw_probe(dev_priv);
> -	if (ret)
> -		goto err_ggtt;
> -
>   	intel_gt_init_hw_early(&dev_priv->gt, &dev_priv->ggtt);
>   
>   	ret = intel_gt_probe_lmem(&dev_priv->gt);
> 


More information about the Intel-gfx mailing list