Reallocate GraphicBuffer as long as the protected bit is different.

Previously as long as the usage bit is the superset of the requested usage bit,
we don't reallocate GraphicBuffer. However, this is wrong for protected
contents, the protected usage bit on GraphicBuffer must align with the
protected context. Since we turn off protected context when there's no
protected content, we need to reallocate non-protected GraphicBuffer, otherwise
it's undefined behaviour and will result in crash.

BUG: b/35315015, b/127862411
Test: Verify no kgsl page fault with protected contents.
Change-Id: I789076ba411079364528bd844e6abb5dcbfa77f7
1 file changed