summaryrefslogtreecommitdiff
path: root/hwc
diff options
context:
space:
mode:
authorSunita Nadampalli <sunitan@ti.com>2011-10-19 13:40:39 -0500
committerIliyan Malchev <malchev@google.com>2011-10-19 12:25:21 -0700
commit4ce532200f33ca2c77cd66de924c83decaf7fa30 (patch)
tree65fa76a4ba9bdd1d018a8464c7e12b02dbbb9068 /hwc
parent2facbeb345500d62f74eac01ebb49a069fe034c1 (diff)
downloadomap4-aah-4ce532200f33ca2c77cd66de924c83decaf7fa30.tar.gz
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>
Diffstat (limited to 'hwc')
-rw-r--r--hwc/hwc.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/hwc/hwc.c b/hwc/hwc.c
index f4386d3..f13f53b 100644
--- a/hwc/hwc.c
+++ b/hwc/hwc.c
@@ -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;
}
}