All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: Intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: Infrastructure for supporting different GGTT views per object
Date: Mon, 01 Dec 2014 17:24:43 +0000	[thread overview]
Message-ID: <547CA45B.204@linux.intel.com> (raw)
In-Reply-To: <20141201171636.GG32117@phenom.ffwll.local>


On 12/01/2014 05:16 PM, Daniel Vetter wrote:
> On Mon, Dec 01, 2014 at 04:39:36PM +0000, Tvrtko Ursulin wrote:
>>
>> On 12/01/2014 04:01 PM, Daniel Vetter wrote:
>>> On Mon, Dec 01, 2014 at 02:46:29PM +0000, Tvrtko Ursulin wrote:
>>>>
>>>> On 12/01/2014 11:32 AM, Tvrtko Ursulin wrote:
>>>>>>> @@ -5430,9 +5434,12 @@ struct i915_vma *i915_gem_obj_to_ggtt(struct
>>>>>>> drm_i915_gem_object *obj)
>>>>>>>   {
>>>>>>>       struct i915_vma *vma;
>>>>>>>
>>>>>>> -    vma = list_first_entry(&obj->vma_list, typeof(*vma), vma_link);
>>>>>>> -    if (vma->vm != i915_obj_to_ggtt(obj))
>>>>>>> -        return NULL;
>>>>>>> +    list_for_each_entry(vma, &obj->vma_list, vma_link) {
>>>>>>> +        if (vma->vm != i915_obj_to_ggtt(obj))
>>>>>>> +            continue;
>>>>>>> +        if (vma->ggtt_view.type == I915_GGTT_VIEW_NORMAL)
>>>>>>> +            return vma;
>>>>>>> +    }
>>>>>>
>>>>>> We fairly put the ggtt vma into the head of the list. Imo better to keep
>>>>>> the head slot reserved for the ggtt normal view, might be some random
>>>>>> code
>>>>>> relying upon this.
>>>>>
>>>>> Ok.
>>>>
>>>> Although on a second thought - I am not sure this makes sense since
>>>> alternative views can exist without the normal one. Thoughts?
>>>
>>> Yeah, hence we need to put the normal ggtt view at the front and
>>> everything else at the back. I'm just somewhat afraid of something
>>> expecting the normal ggtt view to be the first one and which then
>>> accidentally breaks.
>>
>> No, my point was that we can't guarantee that since the first entry will be
>> an alternative view when it is the only item on the list. So in the light of
>> that does it make sense to bother with this special casing at all?
>>
>>> But if you think this is too much fuzz then please split this change out
>>> into a separate patch (i.e. the change to the lookup loop + no longer
>>> inserting ggtt vmas a the front). That way when any regression bisects to
>>> this patch it's clear what's going on.
>>
>> To double check if I understand what you mean, you lost me with "fuzz":
>
> Hm I guess my understanding of fuzz isn't quite in line with common usage.
> I've meant "hairy work". Oh well ...

Since patch(1) sorts out simple mismatches with "fuzz" to me it is a 
synonym for trivial. :)

>> If you agree with my comment above, then the recommendation is for another
>> prep patch to do what you say here? Ie. remove the special case for GGTT VMA
>> list_add ?
>
> Yes.
>
>> i915_gem_obj_ti_ggtt can remain untouched in that prep patch, in my view,
>> since it will be the only GGTT VMA, no?
>
> If you don't insert the ggtt view any more at the front the current
> obj_to_ggtt won't work any more. So you must change that in the same patch
> (otherwise you break bisectability, which is the entire point of the
> split-out).

Ah yes, I overlooked how the current obj_to_ggtt looks. Or to better say 
I only looked at my version and assumed I only added the view type check.

Regards,

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

  reply	other threads:[~2014-12-01 17:26 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-30 16:39 [RFC 0/5] Preparation for multiple VMA and GGTT views per GEM object Tvrtko Ursulin
2014-10-30 16:39 ` [PATCH 1/5] drm/i915: Move flags describing VMA mappings into the VMA Tvrtko Ursulin
2014-10-30 16:39 ` [RFC 2/5] drm/i915: Prepare for the idea there can be multiple VMA per VM Tvrtko Ursulin
2014-10-30 16:39 ` [RFC 3/5] drm/i915: Infrastructure for supporting different GGTT views per object Tvrtko Ursulin
2014-10-30 16:41   ` Chris Wilson
2014-10-30 16:55     ` Tvrtko Ursulin
2014-11-03 15:58   ` Daniel Vetter
2014-11-03 16:34     ` Tvrtko Ursulin
2014-11-03 16:52       ` Daniel Vetter
2014-11-03 17:20         ` Tvrtko Ursulin
2014-11-03 17:29           ` Daniel Vetter
2014-11-04 11:15             ` Tvrtko Ursulin
2014-11-04 11:23               ` Daniel Vetter
2014-11-03 17:35           ` Daniel Vetter
2014-11-04 10:25             ` Tvrtko Ursulin
2014-10-30 16:39 ` [PATCH 4/5] drm/i915: Make scatter-gather helper available to the driver Tvrtko Ursulin
2014-11-03 16:02   ` Daniel Vetter
2014-11-03 16:18     ` Tvrtko Ursulin
2014-11-03 16:53       ` Daniel Vetter
2014-11-03 16:05   ` Daniel Vetter
2014-11-03 20:30     ` Chris Wilson
2014-11-04 11:56       ` Imre Deak
2014-10-30 16:39 ` [RFC 5/5] drm/i915: Make intel_pin_and_fence_fb_obj take plane and framebuffer Tvrtko Ursulin
2014-11-03 16:18   ` Daniel Vetter
2014-11-06 14:39 ` [RFC] drm/i915: Infrastructure for supporting different GGTT views per object Tvrtko Ursulin
2014-11-12 17:02   ` Daniel Vetter
2014-11-24 12:32     ` Tvrtko Ursulin
2014-11-24 12:36       ` Chris Wilson
2014-11-24 13:57       ` Daniel Vetter
2014-11-27 14:52   ` [PATCH] " Tvrtko Ursulin
2014-11-28  0:59     ` [PATCH] drm/i915: Infrastructure for supporting shuang.he
2014-11-28 17:31     ` [PATCH] drm/i915: Infrastructure for supporting different GGTT views per object Daniel Vetter
2014-12-01 11:32       ` Tvrtko Ursulin
2014-12-01 14:46         ` Tvrtko Ursulin
2014-12-01 16:01           ` Daniel Vetter
2014-12-01 16:39             ` Tvrtko Ursulin
2014-12-01 17:16               ` Daniel Vetter
2014-12-01 17:24                 ` Tvrtko Ursulin [this message]
2014-12-01 16:07         ` Daniel Vetter
2014-12-01 16:34           ` Tvrtko Ursulin
2014-12-01 17:19             ` Daniel Vetter
2014-12-01 17:50               ` Tvrtko Ursulin
2014-12-02  9:12                 ` 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=547CA45B.204@linux.intel.com \
    --to=tvrtko.ursulin@linux.intel.com \
    --cc=Intel-gfx@lists.freedesktop.org \
    --cc=daniel@ffwll.ch \
    /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.