summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2013-12-05 12:38:20 -0800
committerThe Android Open Source Project <initial-contribution@android.com>2013-12-05 12:38:20 -0800
commit20ebefd966eed9da545ab645199c2f93ca93af20 (patch)
tree861480695e14cdaaf8a499defcd1c1fc1d78bdca
parent047510b132e33c26607b4b93e806884aa4d13f19 (diff)
parenteed5dceb4a0bc02f50f236ab191d30c49c58f610 (diff)
downloadlibhardware-20ebefd966eed9da545ab645199c2f93ca93af20.tar.gz
Merge commit 'eed5dceb4a0bc02f50f236ab191d30c49c58f610' into HEADidea133
-rw-r--r--include/hardware/hwcomposer.h32
-rw-r--r--tests/camera2/CameraModuleTests.cpp19
2 files changed, 38 insertions, 13 deletions
diff --git a/include/hardware/hwcomposer.h b/include/hardware/hwcomposer.h
index 846bab49..86479d3c 100644
--- a/include/hardware/hwcomposer.h
+++ b/include/hardware/hwcomposer.h
@@ -315,8 +315,8 @@ typedef struct hwc_display_contents_1 {
hwc_surface_t sur;
};
- /* WARNING: These fields are for experimental virtual display support,
- * and are not currently used. */
+ /* These fields are used for virtual displays when the h/w composer
+ * version is at least HWC_DEVICE_VERSION_1_3. */
struct {
/* outbuf is the buffer that receives the composed image for
* virtual displays. Writes to the outbuf must wait until
@@ -324,14 +324,28 @@ typedef struct hwc_display_contents_1 {
* writes to outbuf are complete should be returned in
* retireFenceFd.
*
- * This field will not be updated until after prepare(). If
- * prepare() sets all non-FB layers to OVERLAY or sets all non-FB
- * layers to FRAMEBUFFER, then the FRAMEBUFFER_TARGET buffer and
- * the output buffer may be the same. In mixed OVERLAY/FRAMEBUFFER
- * configurations they will have different buffers so the
- * h/w composer does not have to read and write the same buffer.
+ * This field is set before prepare(), so properties of the buffer
+ * can be used to decide which layers can be handled by h/w
+ * composer.
*
- * For physical displays, outbuf will be NULL.
+ * If prepare() sets all layers to FRAMEBUFFER, then GLES
+ * composition will happen directly to the output buffer. In this
+ * case, both outbuf and the FRAMEBUFFER_TARGET layer's buffer will
+ * be the same, and set() has no work to do besides managing fences.
+ *
+ * If the TARGET_FORCE_HWC_FOR_VIRTUAL_DISPLAYS board config
+ * variable is defined (not the default), then this behavior is
+ * changed: if all layers are marked for FRAMEBUFFER, GLES
+ * composition will take place to a scratch framebuffer, and
+ * h/w composer must copy it to the output buffer. This allows the
+ * h/w composer to do format conversion if there are cases where
+ * that is more desirable than doing it in the GLES driver or at the
+ * virtual display consumer.
+ *
+ * If some or all layers are marked OVERLAY, then the framebuffer
+ * and output buffer will be different. As with physical displays,
+ * the framebuffer handle will not change between frames if all
+ * layers are marked for OVERLAY.
*/
buffer_handle_t outbuf;
diff --git a/tests/camera2/CameraModuleTests.cpp b/tests/camera2/CameraModuleTests.cpp
index ae4267b8..828c56a1 100644
--- a/tests/camera2/CameraModuleTests.cpp
+++ b/tests/camera2/CameraModuleTests.cpp
@@ -64,11 +64,22 @@ TEST_F(CameraModuleTest, LoadModule) {
TEST_EXTENSION_FORKING_INIT;
+ status_t stat;
for (int i = 0; i < mNumberOfCameras; ++i) {
- CreateCamera(i, &mDevice);
- ASSERT_EQ(OK, initializeDevice(i))
- << "Failed to initialize device " << i;
- mDevice.clear();
+ if (isDeviceVersionHal2(i, &stat) && stat == OK) {
+ CreateCamera(i, &mDevice);
+ ASSERT_EQ(OK, initializeDevice(i))
+ << "Failed to initialize device " << i;
+ mDevice.clear();
+ } else {
+ const ::testing::TestInfo* const test_info =
+ ::testing::UnitTest::GetInstance()->current_test_info();
+ std::cerr << "Skipping test "
+ << test_info->test_case_name() << "."
+ << test_info->name()
+ << " because HAL device version is V1"
+ << std::endl;
+ }
}
}