[Intel-gfx] [PATCH 66/70] drm/i915: Remove obj->pin_mappable

Tvrtko Ursulin tvrtko.ursulin at linux.intel.com
Mon Apr 13 04:35:53 PDT 2015


On 04/07/2015 05:28 PM, Chris Wilson wrote:
> The obj->pin_mappable flag only exists for debug purposes and is a
> hindrance that is mistreated with rotated GGTT views. For debug
> purposes, it suffices to mark objects with pin_display as being of note.
>
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> ---
>   drivers/gpu/drm/i915/i915_debugfs.c | 6 +++---
>   drivers/gpu/drm/i915/i915_drv.h     | 1 -
>   drivers/gpu/drm/i915/i915_gem.c     | 6 +-----
>   3 files changed, 4 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index 2e851c6a310c..6508eec3cf60 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -166,9 +166,9 @@ describe_obj(struct seq_file *m, struct drm_i915_gem_object *obj)
>   	}
>   	if (obj->stolen)
>   		seq_printf(m, " (stolen: %08llx)", obj->stolen->start);
> -	if (obj->pin_mappable || obj->fault_mappable) {
> +	if (obj->pin_display || obj->fault_mappable) {
>   		char s[3], *t = s;
> -		if (obj->pin_mappable)
> +		if (obj->pin_display)
>   			*t++ = 'p';
>   		if (obj->fault_mappable)
>   			*t++ = 'f';
> @@ -464,7 +464,7 @@ static int i915_gem_object_info(struct seq_file *m, void* data)
>   			size += i915_gem_obj_ggtt_size(obj);
>   			++count;
>   		}
> -		if (obj->pin_mappable) {
> +		if (obj->pin_display) {
>   			mappable_size += i915_gem_obj_ggtt_size(obj);
>   			++mappable_count;
>   		}
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index eeffefa10612..2c72ee0214b5 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -1980,7 +1980,6 @@ struct drm_i915_gem_object {
>   	 * accurate mappable working set.
>   	 */
>   	unsigned int fault_mappable:1;
> -	unsigned int pin_mappable:1;
>   	unsigned int pin_display:1;
>
>   	/*
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index bd60bb552920..3d4463930267 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -4445,9 +4445,6 @@ i915_gem_object_do_pin(struct drm_i915_gem_object *obj,
>   	WARN_ON(flags & PIN_MAPPABLE && !obj->map_and_fenceable);
>
>   	vma->pin_count++;
> -	if (flags & PIN_MAPPABLE)
> -		obj->pin_mappable |= true;
> -
>   	return 0;
>   }
>
> @@ -4487,8 +4484,7 @@ i915_gem_object_ggtt_unpin_view(struct drm_i915_gem_object *obj,
>   	WARN_ON(vma->pin_count == 0);
>   	WARN_ON(!i915_gem_obj_ggtt_bound_view(obj, view));
>
> -	if (--vma->pin_count == 0 && view->type == I915_GGTT_VIEW_NORMAL)
> -		obj->pin_mappable = false;
> +	--vma->pin_count;
>   }
>
>   bool
>

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>

Regards,

Tvrtko


More information about the Intel-gfx mailing list