diff options
author | Jesse Hall <jessehall@google.com> | 2013-08-16 11:13:36 -0700 |
---|---|---|
committer | Jesse Hall <jessehall@google.com> | 2013-08-16 11:13:36 -0700 |
commit | fc0ff2a8700eb11aef7a961b279d846c8a1c04c5 (patch) | |
tree | fe5cfd6a2594c7abb5c51afd460ef3307974693d | |
parent | b98448119351df9ec7453e0ae92ea408b02294db (diff) | |
download | hardware_libhardware-fc0ff2a8700eb11aef7a961b279d846c8a1c04c5.zip hardware_libhardware-fc0ff2a8700eb11aef7a961b279d846c8a1c04c5.tar.gz hardware_libhardware-fc0ff2a8700eb11aef7a961b279d846c8a1c04c5.tar.bz2 |
Add HWC_DISPLAY_VIRTUAL and adjust display count constants
Both surfaceflinger and HWC implementations have been defining these
themselves, making future changes more difficult. Better to define
them centrally, where they can be updated easily.
Change-Id: I793158b858c84b2470b05f9ea77cc5a0c7e247f1
-rw-r--r-- | include/hardware/hwcomposer.h | 20 | ||||
-rw-r--r-- | include/hardware/hwcomposer_defs.h | 6 | ||||
-rw-r--r-- | tests/hwc/cnativewindow.c | 6 |
3 files changed, 18 insertions, 14 deletions
diff --git a/include/hardware/hwcomposer.h b/include/hardware/hwcomposer.h index 9492d3a..846bab4 100644 --- a/include/hardware/hwcomposer.h +++ b/include/hardware/hwcomposer.h @@ -449,12 +449,12 @@ typedef struct hwc_composer_device_1 { * For HWC 1.0, numDisplays will always be one, and displays[0] will be * non-NULL. * - * For HWC 1.1, numDisplays will always be HWC_NUM_DISPLAY_TYPES. Entries - * for unsupported or disabled/disconnected display types will be NULL. + * For HWC 1.1, numDisplays will always be HWC_NUM_PHYSICAL_DISPLAY_TYPES. + * Entries for unsupported or disabled/disconnected display types will be + * NULL. * - * In a future version, numDisplays may be larger than - * HWC_NUM_DISPLAY_TYPES. The extra entries correspond to enabled virtual - * displays, and will be non-NULL. + * In HWC 1.3, numDisplays may be up to HWC_NUM_DISPLAY_TYPES. The extra + * entries correspond to enabled virtual displays, and will be non-NULL. * * returns: 0 on success. An negative error code on error. If an error is * returned, SurfaceFlinger will assume that none of the layer will be @@ -482,12 +482,12 @@ typedef struct hwc_composer_device_1 { * For HWC 1.0, numDisplays will always be one, and displays[0] will be * non-NULL. * - * For HWC 1.1, numDisplays will always be HWC_NUM_DISPLAY_TYPES. Entries - * for unsupported or disabled/disconnected display types will be NULL. + * For HWC 1.1, numDisplays will always be HWC_NUM_PHYSICAL_DISPLAY_TYPES. + * Entries for unsupported or disabled/disconnected display types will be + * NULL. * - * In a future version, numDisplays may be larger than - * HWC_NUM_DISPLAY_TYPES. The extra entries correspond to enabled virtual - * displays, and will be non-NULL. + * In HWC 1.3, numDisplays may be up to HWC_NUM_DISPLAY_TYPES. The extra + * entries correspond to enabled virtual displays, and will be non-NULL. * * IMPORTANT NOTE: There is an implicit layer containing opaque black * pixels behind all the layers in the list. It is the responsibility of diff --git a/include/hardware/hwcomposer_defs.h b/include/hardware/hwcomposer_defs.h index ce4723c..c69a4bc 100644 --- a/include/hardware/hwcomposer_defs.h +++ b/include/hardware/hwcomposer_defs.h @@ -182,12 +182,16 @@ enum { enum { HWC_DISPLAY_PRIMARY = 0, HWC_DISPLAY_EXTERNAL = 1, // HDMI, DP, etc. - HWC_NUM_DISPLAY_TYPES + HWC_DISPLAY_VIRTUAL = 2, + + HWC_NUM_PHYSICAL_DISPLAY_TYPES = 2, + HWC_NUM_DISPLAY_TYPES = 3, }; enum { HWC_DISPLAY_PRIMARY_BIT = 1 << HWC_DISPLAY_PRIMARY, HWC_DISPLAY_EXTERNAL_BIT = 1 << HWC_DISPLAY_EXTERNAL, + HWC_DISPLAY_VIRTUAL_BIT = 1 << HWC_DISPLAY_VIRTUAL, }; /*****************************************************************************/ diff --git a/tests/hwc/cnativewindow.c b/tests/hwc/cnativewindow.c index 474ceec..76f4564 100644 --- a/tests/hwc/cnativewindow.c +++ b/tests/hwc/cnativewindow.c @@ -74,7 +74,7 @@ typedef struct CNativeWindow { unsigned ydpi; unsigned format; - hwc_display_contents_1_t *dclist[HWC_NUM_DISPLAY_TYPES]; + hwc_display_contents_1_t *dclist[HWC_NUM_PHYSICAL_DISPLAY_TYPES]; hwc_display_contents_1_t dc; hwc_layer_1_t layer[4]; @@ -200,7 +200,7 @@ static void hwc_post(CNativeWindow *win, aBuffer *buf, int ffd) { dc->numHwLayers++; } - r = hwc->prepare(hwc, HWC_NUM_DISPLAY_TYPES, win->dclist); + r = hwc->prepare(hwc, HWC_NUM_PHYSICAL_DISPLAY_TYPES, win->dclist); if (r) { ERROR("hwc->prepare failed r=%d\n",r); return; @@ -210,7 +210,7 @@ static void hwc_post(CNativeWindow *win, aBuffer *buf, int ffd) { // LOG("dl[%d] ctype=0x%08x hints=0x%08x flags=0x%08x\n", i, // dl[i].compositionType, dl[0].hints, dl[0].flags); - r = hwc->set(hwc, HWC_NUM_DISPLAY_TYPES, win->dclist); + r = hwc->set(hwc, HWC_NUM_PHYSICAL_DISPLAY_TYPES, win->dclist); if (r) { ERROR("hwc->set failed, r=%d\n", r); return; |