Re: [PATCH 3/3] drm/i915/debugfs: Print remap info for DPT VMAs as well

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2021-05-24 at 20:27 +0300, Imre Deak wrote:
> Similarly to GGTT VMAs, DPT VMAs can be also a remapped or rotated view
> of the mapped object, so make sure we debug print the details for these
> views as well besides the normal view.
> 
> While at it also fix the debug print for the VMA type of DPT VMAs.

Reviewed-by: José Roberto de Souza <jose.souza@xxxxxxxxx>

> 
> Signed-off-by: Imre Deak <imre.deak@xxxxxxxxx>
> ---
>  drivers/gpu/drm/i915/i915_debugfs.c | 17 ++++++++++++++---
>  drivers/gpu/drm/i915/i915_vma.h     |  5 +++++
>  2 files changed, 19 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index 8dd3746911021..6d5c6ea02fab5 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -124,6 +124,17 @@ stringify_page_sizes(unsigned int page_sizes, char *buf, size_t len)
>  	}
>  }
>  
> +static const char *stringify_vma_type(const struct i915_vma *vma)
> +{
> +	if (i915_vma_is_ggtt(vma))
> +	       return "ggtt";
> +
> +	if (i915_vma_is_dpt(vma))
> +		return "dpt";
> +
> +	return "ppgtt";
> +}
> +
>  void
>  i915_debugfs_describe_obj(struct seq_file *m, struct drm_i915_gem_object *obj)
>  {
> @@ -156,11 +167,11 @@ i915_debugfs_describe_obj(struct seq_file *m, struct drm_i915_gem_object *obj)
>  		if (i915_vma_is_pinned(vma))
>  			pin_count++;
>  
> -		seq_printf(m, " (%sgtt offset: %08llx, size: %08llx, pages: %s",
> -			   i915_vma_is_ggtt(vma) ? "g" : "pp",
> +		seq_printf(m, " (%s offset: %08llx, size: %08llx, pages: %s",
> +			   stringify_vma_type(vma),
>  			   vma->node.start, vma->node.size,
>  			   stringify_page_sizes(vma->page_sizes.gtt, NULL, 0));
> -		if (i915_vma_is_ggtt(vma)) {
> +		if (i915_vma_is_ggtt(vma) || i915_vma_is_dpt(vma)) {
>  			switch (vma->ggtt_view.type) {
>  			case I915_GGTT_VIEW_NORMAL:
>  				seq_puts(m, ", normal");
> diff --git a/drivers/gpu/drm/i915/i915_vma.h b/drivers/gpu/drm/i915/i915_vma.h
> index 2a108e66cd495..dc6926d896266 100644
> --- a/drivers/gpu/drm/i915/i915_vma.h
> +++ b/drivers/gpu/drm/i915/i915_vma.h
> @@ -68,6 +68,11 @@ static inline bool i915_vma_is_ggtt(const struct i915_vma *vma)
>  	return test_bit(I915_VMA_GGTT_BIT, __i915_vma_flags(vma));
>  }
>  
> +static inline bool i915_vma_is_dpt(const struct i915_vma *vma)
> +{
> +	return i915_is_dpt(vma->vm);
> +}
> +
>  static inline bool i915_vma_has_ggtt_write(const struct i915_vma *vma)
>  {
>  	return test_bit(I915_VMA_GGTT_WRITE_BIT, __i915_vma_flags(vma));

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux