All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: Move ioremap_wc tracking onto VMA
Date: Mon, 18 Apr 2016 16:27:32 +0100	[thread overview]
Message-ID: <5714FCE4.8090803@linux.intel.com> (raw)
In-Reply-To: <20160418152243.GL18964@nuc-i3427.alporthouse.com>


On 18/04/16 16:22, Chris Wilson wrote:
> On Mon, Apr 18, 2016 at 04:08:55PM +0100, Tvrtko Ursulin wrote:
>> On 18/04/16 15:54, Chris Wilson wrote:
>>> @@ -3378,6 +3378,8 @@ static int __i915_vma_unbind(struct i915_vma *vma, bool wait)
>>>   		ret = i915_gem_object_put_fence(obj);
>>>   		if (ret)
>>>   			return ret;
>>> +
>>> +		i915_vma_iounmap(vma);
>>>   	}
>>>
>>>   	trace_i915_vma_unbind(vma);
>>> diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
>>> index b3af2e808b49..e185dff358e1 100644
>>> --- a/drivers/gpu/drm/i915/i915_gem_gtt.c
>>> +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
>>> @@ -3634,3 +3634,29 @@ i915_ggtt_view_size(struct drm_i915_gem_object *obj,
>>>   		return obj->base.size;
>>>   	}
>>>   }
>>> +
>>> +void *i915_vma_pin_iomap(struct i915_vma *vma)
>>> +{
>>> +	void *ptr;
>>
>> Just realized we should mark the pointers with __iomem here.
>
> The problem is that we need to lose the annotation at some point as we
> mix access via ring->virtual_start. For correctness, we should report
> __iomem here and discard it later.
>
>>> +/**
>>> + * i915_vma_iounmap - unmaps the VMA
>>> + * @vma: VMA to unmap
>>> + *
>>> + * Unmaps the previously iomapped VMA using iounmap.
>>> + *
>>> + * Users of i915_vma_pin_iomap() should not manually unmap by calling this
>>> + * function but should call i915_vma_unpin_iomap() instead.
>>> + *
>>> + * Callers must hold the struct_mutex.
>>> + */
>>> +static inline void i915_vma_iounmap(struct i915_vma *vma)
>>> +{
>>> +	lockdep_assert_held(&vma->vm->dev->struct_mutex);
>>> +	GEM_BUG_ON(vma->pin_count);
>>> +
>>> +	if (vma->iomap == NULL)
>>> +		return;
>>> +
>>> +	io_mapping_unmap(vma->iomap);
>>> +	vma->iomap = NULL;
>>> +}
>>
>> It would be best to hide this near the unbind code. Alternatively
>> maybe put a louder warning in the kerneldoc? Just so it is a bit
>> more distinguishable from the GEM exported API for this feature.
>
> I had the same thought, then decided to stick with the
> i915_vma_iounmap() call in i915_vma_unbind(). Maybe __i915_vma_iounmap?

__i915_vma_ionmap in i915_gem_gtt.h or in i915_gem.c ?

Regards,

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

  reply	other threads:[~2016-04-18 15:27 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-18 11:13 [PATCH v2 1/4] drm/i915/overlay: Replace i915_gem_obj_ggtt_offset() with the known flip_addr Chris Wilson
2016-04-18 11:14 ` [PATCH v2 2/4] io-mapping: Specify mapping size for io_mapping_map_wc() Chris Wilson
2016-04-18 11:14   ` Chris Wilson
2016-04-18 11:14   ` Chris Wilson
2016-04-19 12:02   ` Chris Wilson
2016-04-19 12:30     ` Luis R. Rodriguez
2016-04-19 12:34       ` Chris Wilson
2016-04-19 12:34         ` Chris Wilson
2016-04-19 12:34         ` Chris Wilson
     [not found]       ` <1461069238-31539-1-git-send-email-chris@chris-wilson.co.uk>
     [not found]         ` <1461069238-31539-4-git-send-email-chris@chris-wilson.co.uk>
2016-04-20  9:10           ` [PATCH 4/4] drm/i915: Move ioremap_wc tracking onto VMA Luis R. Rodriguez
2016-04-20  9:10             ` Luis R. Rodriguez
2016-04-20  9:10             ` Luis R. Rodriguez
2016-04-20  9:38             ` Chris Wilson
2016-04-20  9:38               ` Chris Wilson
2016-04-20  9:38               ` Chris Wilson
2016-04-20 11:17             ` [Intel-gfx] " Daniel Vetter
2016-04-20 11:17               ` Daniel Vetter
2016-04-20 11:17               ` Daniel Vetter
     [not found]               ` <20160420111730.GL2510-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>
2016-04-20 21:27                 ` Luis R. Rodriguez
2016-04-20 21:27                   ` Luis R. Rodriguez
2016-04-21  7:27                   ` Daniel Vetter
2016-04-21  7:27                     ` Daniel Vetter
2016-04-21  7:27                     ` [Intel-gfx] " Daniel Vetter
2016-04-18 11:14 ` [PATCH v2 3/4] drm/i915: Introduce i915_vm_to_ggtt() Chris Wilson
2016-04-18 12:01   ` Tvrtko Ursulin
2016-04-18 13:37   ` Joonas Lahtinen
2016-04-18 14:02     ` Chris Wilson
2016-04-18 11:14 ` [PATCH v2 4/4] drm/i915: Move ioremap_wc tracking onto VMA Chris Wilson
2016-04-18 11:56   ` Chris Wilson
2016-04-18 12:08     ` Tvrtko Ursulin
2016-04-18 14:54       ` [PATCH] " Chris Wilson
2016-04-18 15:08         ` Tvrtko Ursulin
2016-04-18 15:22           ` Chris Wilson
2016-04-18 15:27             ` Tvrtko Ursulin [this message]
2016-04-19 11:06               ` Chris Wilson
2016-04-19 12:19                 ` Tvrtko Ursulin
2016-04-19 17:33                 ` kbuild test robot
2016-04-18 15:20         ` kbuild test robot
2016-04-18 12:03   ` [PATCH v2 4/4] " Tvrtko Ursulin
2016-04-18 13:26 ` ✗ Fi.CI.BAT: warning for series starting with [v2,1/4] drm/i915/overlay: Replace i915_gem_obj_ggtt_offset() with the known flip_addr Patchwork
2016-04-18 15:29 ` ✗ Fi.CI.BAT: warning for series starting with [v2,1/4] drm/i915/overlay: Replace i915_gem_obj_ggtt_offset() with the known flip_addr (rev2) Patchwork
2016-04-19 11:57 ` ✗ Fi.CI.BAT: failure for series starting with [v2,1/4] drm/i915/overlay: Replace i915_gem_obj_ggtt_offset() with the known flip_addr (rev3) Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2016-04-13 12:44 [PATCH 3/3] drm/i915: Move ioremap_wc tracking onto VMA Chris Wilson
2016-04-13 14:47 ` [PATCH] " Chris Wilson
2016-04-13 15:07   ` kbuild test robot
2016-04-13 15:12   ` Chris Wilson
2016-04-15  9:40     ` Tvrtko Ursulin
2016-04-15 10:00       ` Chris Wilson
2016-04-15 10:19         ` Tvrtko Ursulin
2016-04-15 10:38           ` Chris Wilson
2016-04-15 10:41             ` Tvrtko Ursulin
2016-04-18 10:57             ` Joonas Lahtinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5714FCE4.8090803@linux.intel.com \
    --to=tvrtko.ursulin@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.