OSDN Git Service

Fix 5x and 6P crash when using HWC2to1adapter
authorFabien Sanglard <sanglardf@google.com>
Sat, 19 Nov 2016 00:12:31 +0000 (16:12 -0800)
committerFabien Sanglard <sanglardf@google.com>
Tue, 22 Nov 2016 20:55:17 +0000 (12:55 -0800)
commiteb3db61f914a2469fe632c48b46a0ce60c84c9d9
tree68975de2d6bcab07091f1012123c88db7fbce4a9
parent057706f804e17d124f757048856c7374ae1b483c
Fix 5x and 6P crash when using HWC2to1adapter

Angler and Bullhead crash when a SolidColor layer is used in
combination with HWC2to1Adapter. This is due to assumptions in
the HWC1 code (non-null handle field = valid pointer). This
assumption is incorrect with a background layer because it will
set the field backgroundcolor...which occupies the same location
as handle field in hwc_layer_1_t.
This patch detects whether the HWC supports BACKGROUND layer and
sets backgroundcolor/handle accordingly to HWC assumption.

Test: Manual on Angler and Bullhead.

Change-Id: Ic5c3366a4a8989f3a82b6367258bad8af25d3990
services/surfaceflinger/DisplayHardware/HWC2On1Adapter.cpp
services/surfaceflinger/DisplayHardware/HWC2On1Adapter.h