[PATCH v3 10/16] drm/i915: s/phys_base/dma_addr/

Paz Zcharya pazz at chromium.org
Tue Jan 30 23:22:59 UTC 2024


On Tue, Jan 16, 2024 at 09:56:30AM +0200, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala at linux.intel.com>
> 
> The address we read from the PTE is a dma address, not a physical
> address. Rename the variable to say so.
> 
> Cc: Paz Zcharya <pazz at chromium.org>
> Reviewed-by: Andrzej Hajda <andrzej.hajda at intel.com>
> Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>

Hi Ville,

Thank you so much for this incredible series.
It solves the issue regarding MTL initial plane readout
that Andrzej Hajda and I worked on in
https://patchwork.freedesktop.org/patch/570811/?series=127130&rev=2
In addition, it solved the issue with the new GOP.

I tested it on two different devices with Meteor Lake and it worked perfectly:
no i915 errors, no flickers or observable issues.

Tested-by: Paz Zcharya <pazz at chromium.org>

> ---
>  .../gpu/drm/i915/display/intel_plane_initial.c    | 15 ++++++++-------
>  1 file changed, 8 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_plane_initial.c b/drivers/gpu/drm/i915/display/intel_plane_initial.c
> index c72d4cacf631..48b74319f45c 100644
> --- a/drivers/gpu/drm/i915/display/intel_plane_initial.c
> +++ b/drivers/gpu/drm/i915/display/intel_plane_initial.c
> @@ -61,6 +61,7 @@ initial_plane_vma(struct drm_i915_private *i915,
>  	base = round_down(plane_config->base, I915_GTT_MIN_ALIGNMENT);
>  	if (IS_DGFX(i915) || HAS_LMEMBAR_SMEM_STOLEN(i915)) {
>  		gen8_pte_t __iomem *gte = to_gt(i915)->ggtt->gsm;
> +		dma_addr_t dma_addr;
>  		gen8_pte_t pte;
>  
>  		gte += base / I915_GTT_PAGE_SIZE;
> @@ -72,7 +73,7 @@ initial_plane_vma(struct drm_i915_private *i915,
>  			return NULL;
>  		}
>  
> -		phys_base = pte & GEN12_GGTT_PTE_ADDR_MASK;
> +		dma_addr = pte & GEN12_GGTT_PTE_ADDR_MASK;
>  
>  		if (IS_DGFX(i915))
>  			mem = i915->mm.regions[INTEL_REGION_LMEM_0];
> @@ -88,18 +89,18 @@ initial_plane_vma(struct drm_i915_private *i915,
>  		 * On lmem we don't currently expect this to
>  		 * ever be placed in the stolen portion.
>  		 */
> -		if (phys_base < mem->region.start || phys_base > mem->region.end) {
> +		if (dma_addr < mem->region.start || dma_addr > mem->region.end) {
>  			drm_err(&i915->drm,
> -				"Initial plane programming using invalid range, phys_base=%pa (%s [%pa-%pa])\n",
> -				&phys_base, mem->region.name, &mem->region.start, &mem->region.end);
> +				"Initial plane programming using invalid range, dma_addr=%pa (%s [%pa-%pa])\n",
> +				&dma_addr, mem->region.name, &mem->region.start, &mem->region.end);
>  			return NULL;
>  		}
>  
>  		drm_dbg(&i915->drm,
> -			"Using phys_base=%pa, based on initial plane programming\n",
> -			&phys_base);
> +			"Using dma_addr=%pa, based on initial plane programming\n",
> +			&dma_addr);
>  
> -		phys_base -= mem->region.start;
> +		phys_base = dma_addr - mem->region.start;
>  	} else {
>  		phys_base = base;
>  		mem = i915->mm.stolen_region;
> -- 
> 2.41.0
> 


More information about the Intel-gfx mailing list