diff options
author | Gowtham Tammana <g-tammana@ti.com> | 2017-02-24 13:45:30 -0600 |
---|---|---|
committer | Gowtham Tammana <g-tammana@ti.com> | 2017-02-24 13:45:30 -0600 |
commit | d7b48ea8e86b074f109b53c88dcea432b4897c05 (patch) | |
tree | 03c814aacfb0895268cb1428b32ab85b5287872d | |
parent | 39511d082acdcb0fe65d3239646e17fa2d0b034f (diff) | |
download | dra7xx-d7b48ea8e86b074f109b53c88dcea432b4897c05.tar.gz |
hwc: Check validity of layer during set
Check if the fb target layer is a valid one before updating the
display. Empty layer handle was noticed for the first few frames on
external display connect.
Change-Id: I86550d3996367a0936836741c75e1b549753c83d
Signed-off-by: Gowtham Tammana <g-tammana@ti.com>
-rw-r--r-- | hwcomposer/hwc.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/hwcomposer/hwc.c b/hwcomposer/hwc.c index 9e99c1d..b7a788b 100644 --- a/hwcomposer/hwc.c +++ b/hwcomposer/hwc.c @@ -357,6 +357,11 @@ static int hwc_set_for_display(omap_hwc_device_t *hwc_dev, int disp, hwc_display } list->retireFenceFd = -1; + if (!comp->plane_info[0].layer || !comp->plane_info[0].layer->handle) { + ALOGE("Got empty handle, nothing we can do here"); + goto clear_acquire_fences; + } + if (disp == HWC_DISPLAY_PRIMARY) { if (comp->use_blitter) { @@ -388,6 +393,7 @@ static int hwc_set_for_display(omap_hwc_device_t *hwc_dev, int disp, hwc_display if (disp == HWC_DISPLAY_PRIMARY) showfps(); +clear_acquire_fences: /* hwc is exiting, clear any pending acquire fences */ for (i = 0; i < list->numHwLayers; i++) { hwc_layer_1_t *layer = &list->hwLayers[i]; |