All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
	Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v3] drm/i915: Do not use ggtt_view with (aliasing) PPGTT
Date: Mon, 16 Mar 2015 14:50:57 +0000	[thread overview]
Message-ID: <5506EDD1.3080508@linux.intel.com> (raw)
In-Reply-To: <1426517323.14030.6.camel@jlahtine-mobl1>


On 03/16/2015 02:48 PM, Joonas Lahtinen wrote:
> Hi,
>
> Regression testing completed without problems for BYT, HSW and BDW
> already.
>
> On ma, 2015-03-16 at 13:26 +0000, Tvrtko Ursulin wrote:
>> Hi,
>>
>> On 03/16/2015 12:11 PM, Joonas Lahtinen wrote:
>>> GGTT views are only applicable when dealing with GGTT. Change the code to
>>> reject ggtt_view where it should not be used and require it when it should
>>> be.
>>>
>>> v2:
>>> - Dropped _ppgtt_ infixes, allow both types to be passed
>>> - Disregard other but normal views when no view is specified
>>> - More checks that valid parameters are passed
>>> - More readable error checking
>>>
>>> v3:
>>> - Prefer WARN_ONCE over BUG_ON when there is code path for failure
>>
>> [snip]
>>
>>> +i915_gem_obj_to_vma(struct drm_i915_gem_object *obj,
>>> +		    struct i915_address_space *vm);
>>> +struct i915_vma *
>>> +i915_gem_obj_to_ggtt_view(struct drm_i915_gem_object *obj,
>>> +			  const struct i915_ggtt_view *view);
>>
>> Would i915_gem_obj_to_ggtt_vma be a better name? At least should have
>> vma in the name I think.
>>
>
> The i915_gem_obj_to_ggtt functions doesn't mention _vma either (and
> would cause a lot of changes all around code to change), so I decided to
> stay with the same convention. In that sense it would add more
> confusion, compared to the current *_view function being the same as
> without _view, but with explicitly specified view.

Yes, I overlooked that.

>>> +struct i915_vma *i915_gem_obj_to_vma(struct drm_i915_gem_object *obj,
>>> +				     struct i915_address_space *vm)
>>>    {
>>>    	struct i915_vma *vma;
>>> -	list_for_each_entry(vma, &obj->vma_list, vma_link)
>>> -		if (vma->vm == vm && vma->ggtt_view.type == view->type)
>>> +	list_for_each_entry(vma, &obj->vma_list, vma_link) {
>>> +		if (i915_is_ggtt(vma->vm) &&
>>> +		    vma->ggtt_view.type != I915_GGTT_VIEW_NORMAL)
>>
>> Since there are 4-5 instances of this check it may make sense to add a
>> helper like i915_is_normal_ggtt_view(vma), but it is not that important
>> for me.
>>
>
> This will be done in following patch that makes the view struct (minus
> implementation parts like the pages sg_table) define the view.

Cool.

>> The rest looks good to me.
>>
>
> Sound like you could R-B this then?

Yes,

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

Regards,

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

  reply	other threads:[~2015-03-16 14:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-16 12:11 [PATCH v3] drm/i915: Do not use ggtt_view with (aliasing) PPGTT Joonas Lahtinen
2015-03-16 13:26 ` Tvrtko Ursulin
2015-03-16 14:48   ` Joonas Lahtinen
2015-03-16 14:50     ` Tvrtko Ursulin [this message]
2015-03-16 14:52 ` shuang.he
2015-03-16 17:50 ` Daniel Vetter
2015-03-17  5:31   ` Joonas Lahtinen
2015-03-17  5:34     ` Lahtinen, Joonas
2015-03-17 14:19 ` Tvrtko Ursulin
2015-03-18  8:22   ` Daniel Vetter

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=5506EDD1.3080508@linux.intel.com \
    --to=tvrtko.ursulin@linux.intel.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=joonas.lahtinen@linux.intel.com \
    /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.