diff mbox series

drm/i915: probe lmem before the stolen portion

Message ID 20230127160321.374350-1-matthew.auld@intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915: probe lmem before the stolen portion | expand

Commit Message

Matthew Auld Jan. 27, 2023, 4:03 p.m. UTC
At the very least, we have some tests that force the BAR size for
testing purposes, which would result in different BAR size with
stolen-lmem vs normal lmem, since the BAR is only resized as part of the
normal lmem probing.

Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Andrzej Hajda <andrzej.hajda@intel.com>
Cc: Nirmoy Das <nirmoy.das@intel.com>
---
 drivers/gpu/drm/i915/i915_driver.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

Comments

Andi Shyti Feb. 8, 2023, 2:28 p.m. UTC | #1
Hi Matt,

On Fri, Jan 27, 2023 at 04:03:21PM +0000, Matthew Auld wrote:
> At the very least, we have some tests that force the BAR size for
> testing purposes, which would result in different BAR size with
> stolen-lmem vs normal lmem, since the BAR is only resized as part of the
> normal lmem probing.
> 
> Signed-off-by: Matthew Auld <matthew.auld@intel.com>
> Cc: Andrzej Hajda <andrzej.hajda@intel.com>
> Cc: Nirmoy Das <nirmoy.das@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_driver.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_driver.c b/drivers/gpu/drm/i915/i915_driver.c
> index cf1c0970ecb4..320a4f861659 100644
> --- a/drivers/gpu/drm/i915/i915_driver.c
> +++ b/drivers/gpu/drm/i915/i915_driver.c
> @@ -489,13 +489,17 @@ 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);
> +	/*
> +	 * Make sure we probe lmem before we probe stolen-lmem. The BAR size
> +	 * might be different due to bar resizing.
> +	 */

uh... right! Good catch!

Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>

Thanks,
Andi

> +	ret = intel_gt_tiles_init(dev_priv);
>  	if (ret)
>  		goto err_ggtt;
>  
> -	ret = intel_gt_tiles_init(dev_priv);
> +	ret = intel_memory_regions_hw_probe(dev_priv);
>  	if (ret)
> -		goto err_mem_regions;
> +		goto err_ggtt;
>  
>  	ret = i915_ggtt_enable_hw(dev_priv);
>  	if (ret) {
> -- 
> 2.39.1
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/i915_driver.c b/drivers/gpu/drm/i915/i915_driver.c
index cf1c0970ecb4..320a4f861659 100644
--- a/drivers/gpu/drm/i915/i915_driver.c
+++ b/drivers/gpu/drm/i915/i915_driver.c
@@ -489,13 +489,17 @@  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);
+	/*
+	 * Make sure we probe lmem before we probe stolen-lmem. The BAR size
+	 * might be different due to bar resizing.
+	 */
+	ret = intel_gt_tiles_init(dev_priv);
 	if (ret)
 		goto err_ggtt;
 
-	ret = intel_gt_tiles_init(dev_priv);
+	ret = intel_memory_regions_hw_probe(dev_priv);
 	if (ret)
-		goto err_mem_regions;
+		goto err_ggtt;
 
 	ret = i915_ggtt_enable_hw(dev_priv);
 	if (ret) {