[Mesa-dev] [PATCH 2/5] i965/gen9: Remove regions overlap check in fast copy blit

Anuj Phogat anuj.phogat at gmail.com
Fri Dec 18 11:56:38 PST 2015


On Fri, Dec 18, 2015 at 1:26 AM, Pohjolainen, Topi
<topi.pohjolainen at intel.com> wrote:
> On Fri, Dec 11, 2015 at 07:14:21PM -0800, Anuj Phogat wrote:
>> Overlapping blits are anyway undefined in OpenGL. So no need
>> of overlap check here.
>
> Does this mean that earlier checks prevent us from getting here or
> are we going to blit here (with undefined results)? If the latter,
> is it always safe, and I'm wondering if we should emit a warning
> for the end user? And if the former, should we leave a debug assert?
>
It's the latter. We already do it in case of glBlitFramebuffer and
glCopyTex{Sub}Image without issuing any warnings. It's an
application's responsibility to avoid the undefined behavior. Keeping
this check will make the driver fallback to slower path which uses
temporary buffer to do the blitting. But, that'll encourage the
incorrect usage of the application. I haven't seen any issues on
SKL with this change.

>>
>> Cc: Chad Versace <chad.versace at intel.com>
>> Signed-off-by: Anuj Phogat <anuj.phogat at gmail.com>
>> ---
>>  src/mesa/drivers/dri/i965/intel_blit.c | 5 -----
>>  1 file changed, 5 deletions(-)
>>
>> diff --git a/src/mesa/drivers/dri/i965/intel_blit.c b/src/mesa/drivers/dri/i965/intel_blit.c
>> index 474a476..d4e25d8 100644
>> --- a/src/mesa/drivers/dri/i965/intel_blit.c
>> +++ b/src/mesa/drivers/dri/i965/intel_blit.c
>> @@ -406,11 +406,6 @@ can_fast_copy_blit(struct brw_context *brw,
>>     if (brw->gen < 9)
>>        return false;
>>
>> -   if (src_buffer->handle == dst_buffer->handle &&
>> -       _mesa_regions_overlap(src_x, src_y, src_x + w, src_y + h,
>> -                             dst_x, dst_y, dst_x + w, dst_y + h))
>> -      return false;
>> -
>>     /* Enable fast copy blit only if the surfaces are Yf/Ys tiled.
>>      * FIXME: Based on performance data, remove this condition later to
>>      * enable for all types of surfaces.
>> --
>> 2.5.0
>>
>> _______________________________________________
>> mesa-dev mailing list
>> mesa-dev at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list