[Intel-gfx] [PATCH 4/5] drm/i915: Tidy workaround batch buffer emission

Tvrtko Ursulin tvrtko.ursulin at linux.intel.com
Thu Feb 16 13:47:16 UTC 2017


On 16/02/2017 13:28, Chris Wilson wrote:
> On Thu, Feb 16, 2017 at 01:23:51PM +0000, Tvrtko Ursulin wrote:
>>
>> On 16/02/2017 13:20, Chris Wilson wrote:
>>> On Thu, Feb 16, 2017 at 12:23:24PM +0000, Tvrtko Ursulin wrote:
>>>> +	/*
>>>> +	 * Emit the two workaround batch buffers, recording the offset from the
>>>> +	 * start of the workaround batch buffer object for each and their
>>>> +	 * respective sizes.
>>>> +	 */
>>>> +	for (i = 0; i < ARRAY_SIZE(wa_bb_fn); i++) {
>>>> +		wa_bb[i]->offset = ALIGN(batch_ptr - batch, CACHELINE_BYTES);
>>>> +		batch_ptr = wa_bb_fn[i](engine, batch_ptr);
>>>> +		wa_bb[i]->size = batch_ptr - batch + wa_bb[i]->offset;
>>>
>>> wa_bb[i]->size = batch_ptr - (batch + wa_bb[i]->offset);
>>> ?
>
> Also should it be
>
> batch_ptr = wa_bb_fn[i](engine, batch + wa_bb[i]->offset);

No but you made me realize it should already be aligned by contract 
expected from the vfunc which emits the indirect bb. I'll add a WARN and 
abort if it is not.

Regards,

Tvrtko



More information about the Intel-gfx mailing list