Re: [Mesa-dev] Android: apps crashed on Intel Gen9 GPU

2016-05-14 Thread Chih-Wei Huang
2016-05-13 15:30 GMT+08:00 Pohjolainen, Topi :
> On Thu, May 12, 2016 at 12:25:25AM +0800, Chih-Wei Huang wrote:
>> Testing android-x86 with mesa 11.2.2,
>> I found the Google Play crashed forever on
>> a device with Intel Gen9 GPU (e.g., Skylake).
>>
>> After analyzing, the i965 driver seems to assume
>> irb->mt is not null. For example in
>> brw_meta_fast_clear of brw_meta_fast_clear.c:
>>
>>   struct intel_renderbuffer *irb = intel_renderbuffer(rb);
>>   ...
>>   if (brw->gen >= 9 &&
>>   brw_format_for_mesa_format(irb->mt->format) !=
>> ^ => crashing
>>   brw->render_target_format[irb->mt->format])
>>  clear_type = REP_CLEAR;
>>
>> If I added null checking to irb->mt, it fixes this crashing.
>> However, the app still crashed at other place that
>> accesses irb->mt similarly.
>> (brw_draw.c line 399, gen8_surface_state.c line 432, etc)
>>
>> Please comment how to fix it correctly.
>> Why irb->mt is null but the code assumes it's not?
>
> As far as I understand something has gone wrong before - having an
> intel_renderbuffer without a miptree shouldn't be a reachable state at all.

Thank you for the reply.
When/where should the miptree be set?
How can I debug it?


-- 
Chih-Wei
Android-x86 project
http://www.android-x86.org
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] Android: apps crashed on Intel Gen9 GPU

2016-05-13 Thread Pohjolainen, Topi
On Thu, May 12, 2016 at 12:25:25AM +0800, Chih-Wei Huang wrote:
> Testing android-x86 with mesa 11.2.2,
> I found the Google Play crashed forever on
> a device with Intel Gen9 GPU (e.g., Skylake).
> 
> After analyzing, the i965 driver seems to assume
> irb->mt is not null. For example in
> brw_meta_fast_clear of brw_meta_fast_clear.c:
> 
>   struct intel_renderbuffer *irb = intel_renderbuffer(rb);
>   ...
>   if (brw->gen >= 9 &&
>   brw_format_for_mesa_format(irb->mt->format) !=
> ^ => crashing
>   brw->render_target_format[irb->mt->format])
>  clear_type = REP_CLEAR;
> 
> If I added null checking to irb->mt, it fixes this crashing.
> However, the app still crashed at other place that
> accesses irb->mt similarly.
> (brw_draw.c line 399, gen8_surface_state.c line 432, etc)
> 
> Please comment how to fix it correctly.
> Why irb->mt is null but the code assumes it's not?

As far as I understand something has gone wrong before - having an
intel_renderbuffer without a miptree shouldn't be a reachable state at all.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev