[Intel-gfx] [PATCH 03/19] drm/i915: Micro-optimise gen8_ppgtt_insert_entries()

Tvrtko Ursulin tvrtko.ursulin at linux.intel.com
Thu Feb 2 16:39:49 UTC 2017


On 02/02/2017 16:10, Chris Wilson wrote:
> On Thu, Feb 02, 2017 at 03:57:43PM +0000, Tvrtko Ursulin wrote:
>>
>> On 02/02/2017 15:32, Chris Wilson wrote:
>>> On Thu, Feb 02, 2017 at 03:02:32PM +0000, Chris Wilson wrote:
>>>> Improve the sg iteration and in hte process eliminate a bug in
>>>> miscomputing the pml4 length as orig_nents<<PAGE_SHIFT is no longer the
>>>> full length of the sg table.
>>>>
>>>
>>> which fixes a corner case of 0c40ce130e38
>>> Fixes: 0c40ce130e38 ("drm/i915: Trim the object sg table")
>>
>> What do you mean? oring_nents is definitely the full length of the
>> sg table, especially after i915_sg_trim. Before it orig_nents was
>> often larger than the real length of the sg table.
>
> The code is using orig_nents as obj->base.size/vma->size (a page count,
> not the sg count), if I read it correctly as it is computing the address
> range.

Oh right, I was misled by the commit message ("is not longer the full 
length of the sg table"). Nasty. That means it was broken for userptr 
objects as well.

Regards,

Tvrtko


More information about the Intel-gfx mailing list