Re: [PATCH v2 2/5] drm/xe/mmio: Cast to u64 when printing

2024-01-17 Thread Matt Roper
On Tue, Jan 16, 2024 at 09:40:47AM -0800, Lucas De Marchi wrote:
> resource_size_t uses %pa format in printk since the size varies
> depending on build options. However to keep the io_size/physical_size
> addition in the same call we can't pass the address without adding yet
> another variable in these function. Simply cast it to u64 and keep using
> %llx.
> 
> Fixes: 286089ce6929 ("drm/xe: Improve vram info debug printing")
> Cc: Oak Zeng 
> Cc: Michael J. Ruhl 
> Cc: Matthew Brost 
> Cc: Rodrigo Vivi 
> Signed-off-by: Lucas De Marchi 

Reviewed-by: Matt Roper 

> ---
>  drivers/gpu/drm/xe/xe_mmio.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_mmio.c b/drivers/gpu/drm/xe/xe_mmio.c
> index c8c5d74b6e90..5f6b53ea5528 100644
> --- a/drivers/gpu/drm/xe/xe_mmio.c
> +++ b/drivers/gpu/drm/xe/xe_mmio.c
> @@ -272,8 +272,8 @@ int xe_mmio_probe_vram(struct xe_device *xe)
>   drm_info(>drm, "VRAM[%u, %u]: Actual physical size %pa, 
> usable size exclude stolen %pa, CPU accessible size %pa\n", id,
>tile->id, >mem.vram.actual_physical_size, 
> >mem.vram.usable_size, >mem.vram.io_size);
>   drm_info(>drm, "VRAM[%u, %u]: DPA range: [%pa-%llx], io 
> range: [%pa-%llx]\n", id, tile->id,
> -  >mem.vram.dpa_base, tile->mem.vram.dpa_base + 
> tile->mem.vram.actual_physical_size,
> -  >mem.vram.io_start, tile->mem.vram.io_start + 
> tile->mem.vram.io_size);
> +  >mem.vram.dpa_base, tile->mem.vram.dpa_base + 
> (u64)tile->mem.vram.actual_physical_size,
> +  >mem.vram.io_start, tile->mem.vram.io_start + 
> (u64)tile->mem.vram.io_size);
>  
>   /* calculate total size using tile size to get the correct HW 
> sizing */
>   total_size += tile_size;
> -- 
> 2.40.1
> 

-- 
Matt Roper
Graphics Software Engineer
Linux GPU Platform Enablement
Intel Corporation


[PATCH v2 2/5] drm/xe/mmio: Cast to u64 when printing

2024-01-16 Thread Lucas De Marchi
resource_size_t uses %pa format in printk since the size varies
depending on build options. However to keep the io_size/physical_size
addition in the same call we can't pass the address without adding yet
another variable in these function. Simply cast it to u64 and keep using
%llx.

Fixes: 286089ce6929 ("drm/xe: Improve vram info debug printing")
Cc: Oak Zeng 
Cc: Michael J. Ruhl 
Cc: Matthew Brost 
Cc: Rodrigo Vivi 
Signed-off-by: Lucas De Marchi 
---
 drivers/gpu/drm/xe/xe_mmio.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_mmio.c b/drivers/gpu/drm/xe/xe_mmio.c
index c8c5d74b6e90..5f6b53ea5528 100644
--- a/drivers/gpu/drm/xe/xe_mmio.c
+++ b/drivers/gpu/drm/xe/xe_mmio.c
@@ -272,8 +272,8 @@ int xe_mmio_probe_vram(struct xe_device *xe)
drm_info(>drm, "VRAM[%u, %u]: Actual physical size %pa, 
usable size exclude stolen %pa, CPU accessible size %pa\n", id,
 tile->id, >mem.vram.actual_physical_size, 
>mem.vram.usable_size, >mem.vram.io_size);
drm_info(>drm, "VRAM[%u, %u]: DPA range: [%pa-%llx], io 
range: [%pa-%llx]\n", id, tile->id,
->mem.vram.dpa_base, tile->mem.vram.dpa_base + 
tile->mem.vram.actual_physical_size,
->mem.vram.io_start, tile->mem.vram.io_start + 
tile->mem.vram.io_size);
+>mem.vram.dpa_base, tile->mem.vram.dpa_base + 
(u64)tile->mem.vram.actual_physical_size,
+>mem.vram.io_start, tile->mem.vram.io_start + 
(u64)tile->mem.vram.io_size);
 
/* calculate total size using tile size to get the correct HW 
sizing */
total_size += tile_size;
-- 
2.40.1