diff options
author | Simon Shields <simon@lineageos.org> | 2017-10-26 16:39:01 +1100 |
---|---|---|
committer | Shilin Victor <chrono.monochrome@gmail.com> | 2019-02-23 16:51:46 +0300 |
commit | 03b418413312f4f0baaed44af71778c2d7ef6131 (patch) | |
tree | afff4fd7e73b12722e39a6c78e770f6058aebd02 /exynos4 | |
parent | cfaaa47f2db643ca286c0226f582409d15486f43 (diff) | |
download | hardware_samsung-03b418413312f4f0baaed44af71778c2d7ef6131.tar.gz hardware_samsung-03b418413312f4f0baaed44af71778c2d7ef6131.tar.bz2 hardware_samsung-03b418413312f4f0baaed44af71778c2d7ef6131.zip |
exynos4: libhwc: HWC 1.4
Change-Id: Ib446df60d59ddc304125d4887ac5adea8d72f9e6
Diffstat (limited to 'exynos4')
-rw-r--r-- | exynos4/hal/libhwc/hwcomposer.cpp | 38 |
1 files changed, 33 insertions, 5 deletions
diff --git a/exynos4/hal/libhwc/hwcomposer.cpp b/exynos4/hal/libhwc/hwcomposer.cpp index 1433c58..9e9bfd8 100644 --- a/exynos4/hal/libhwc/hwcomposer.cpp +++ b/exynos4/hal/libhwc/hwcomposer.cpp @@ -1212,24 +1212,50 @@ static int hwc_eventControl(struct hwc_composer_device_1* dev, __unused int dpy, return -EINVAL; } -static int hwc_blank(struct hwc_composer_device_1 *dev, int dpy, int blank) +static int hwc_setPowerMode(struct hwc_composer_device_1 *dev, int dpy, int mode) { struct hwc_context_t* ctx = (struct hwc_context_t*)dev; int fence = 0; + int blank; - ALOGV("%s blank=%d", __FUNCTION__, blank); + ALOGV("%s mode=%d", __FUNCTION__, mode); fence = window_clear(ctx); if (fence != -1) close(fence); - if (ioctl(ctx->fb0_fd, FBIOBLANK, blank ? FB_BLANK_POWERDOWN : FB_BLANK_UNBLANK) < 0) { + + switch (mode) { + case HWC_POWER_MODE_OFF: + blank = FB_BLANK_POWERDOWN; + break; + case HWC_POWER_MODE_NORMAL: + blank = FB_BLANK_UNBLANK; + break; + default: + // FIXME DOZE and DOZE_SUSPEND are unsupported by the fb driver + return -EINVAL; + } + + if (ioctl(ctx->fb0_fd, FBIOBLANK, blank) < 0) { ALOGE("%s Error %s in FBIOBLANK blank=%d", __FUNCTION__, strerror(errno), blank); } return 0; } +static int hwc_getActiveConfig(struct hwc_composer_device_1 *dev, int disp) +{ + // we only support the primary display + return 0; +} + +static int hwc_setActiveConfig(struct hwc_composer_device_1 *dev, int dpy, int idx) +{ + // Only 1 config supported for the primary display + return (idx == 0) ? idx : -EINVAL; +} + static int hwc_query(struct hwc_composer_device_1* dev, int what, int* value) { @@ -1414,19 +1440,21 @@ static int hwc_device_open(const struct hw_module_t* module, const char* name, // initialize the procs dev->device.common.tag = HARDWARE_DEVICE_TAG; - dev->device.common.version = HWC_DEVICE_API_VERSION_1_3; + dev->device.common.version = HWC_DEVICE_API_VERSION_1_4; dev->device.common.module = const_cast<hw_module_t*>(module); dev->device.common.close = hwc_device_close; dev->device.prepare = hwc_prepare; dev->device.set = hwc_set; dev->device.eventControl = hwc_eventControl; - dev->device.blank = hwc_blank; + dev->device.setPowerMode = hwc_setPowerMode; dev->device.query = hwc_query; dev->device.registerProcs = hwc_registerProcs; dev->device.dump = hwc_dump; dev->device.getDisplayConfigs = hwc_getDisplayConfigs; dev->device.getDisplayAttributes = hwc_getDisplayAttributes; + dev->device.getActiveConfig = hwc_getActiveConfig; + dev->device.setActiveConfig = hwc_setActiveConfig; *device = &dev->device.common; |