diff options
author | Sunita Nadampalli <sunitan@ti.com> | 2011-10-19 13:40:39 -0500 |
---|---|---|
committer | Iliyan Malchev <malchev@google.com> | 2011-10-19 12:25:21 -0700 |
commit | cfdffd5b9adc409370099fb5cfb47f1197f3edfe (patch) | |
tree | 5c674087db463e46571defdedc1dee3ccbe7a8c9 | |
parent | 6377f8fb662ca0a3848fa74368bebefb7a616b29 (diff) | |
download | hardware_ti_omap4-cfdffd5b9adc409370099fb5cfb47f1197f3edfe.zip hardware_ti_omap4-cfdffd5b9adc409370099fb5cfb47f1197f3edfe.tar.gz hardware_ti_omap4-cfdffd5b9adc409370099fb5cfb47f1197f3edfe.tar.bz2 |
HWC: Disable SGX force usage if protected layer is detected.
Fixes b/5475085
In secure playback mode, SGX does not have access to protected buffers and a
forced SGX usage results in an invalid frame to be rendered and displayed. This
patch disables SGX force usage if any of the layers is protected.
Change-Id: I188cf1639050687a96df42b310c12875fec383f7
Signed-off-by: Sunita Nadampalli <sunitan@ti.com>
Signed-off-by: Iliyan Malchev <malchev@google.com>
-rw-r--r-- | hwc/hwc.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -222,6 +222,13 @@ static int scaled(hwc_layer_t *layer) return WIDTH(layer->displayFrame) != w || HEIGHT(layer->displayFrame) != h; } +static int isprotected(hwc_layer_t *layer) +{ + IMG_native_handle_t *handle = (IMG_native_handle_t *)layer->handle; + + return (handle->usage & GRALLOC_USAGE_PROTECTED); +} + static int sync_id = 0; #define is_BLENDED(blending) ((blending) != HWC_BLENDING_NONE) @@ -944,6 +951,12 @@ static int omap4_hwc_prepare(struct hwc_composer_device *dev, hwc_layer_list_t* num.dockable++; num.mem += mem1d(handle); + + /* Check if any of the layers are protected. + * if so, disable the SGX force usage + */ + if (hwc_dev->force_sgx && isprotected(layer)) + hwc_dev->force_sgx = 0; } } |