diff options
author | Mike J. Chen <mjchen@google.com> | 2012-05-21 19:26:45 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2012-05-21 19:26:45 -0700 |
commit | 9f184c3c874e43af8174a9fd888f8c926866daab (patch) | |
tree | f0d1e3e6aad0e9814cbbc2457149b75b57a9970b | |
parent | 886e290da36f55c64a1d1aee5f1749c44807a9ff (diff) | |
parent | ce768b26571c66e176fa6d10c64ded578da937d9 (diff) | |
download | hardware_ti_omap4xxx-9f184c3c874e43af8174a9fd888f8c926866daab.zip hardware_ti_omap4xxx-9f184c3c874e43af8174a9fd888f8c926866daab.tar.gz hardware_ti_omap4xxx-9f184c3c874e43af8174a9fd888f8c926866daab.tar.bz2 |
am ce768b26: hwc: Stash hdmi mode resolution in a property
* commit 'ce768b26571c66e176fa6d10c64ded578da937d9':
hwc: Stash hdmi mode resolution in a property
-rw-r--r-- | hwc/hwc.c | 17 |
1 files changed, 16 insertions, 1 deletions
@@ -920,8 +920,23 @@ static int omap4_hwc_set_best_hdmi_mode(omap4_hwc_device_t *hwc_dev, __u32 xres, sdis.mode = d.dis.modedb[best]; ALOGD("picking #%d", best); /* only reconfigure on change */ - if (ext->last_mode != ~best) + if (ext->last_mode != ~best) { + /* set a property that apps that care (e.g. YouTube) can use + * to determine whether or not to stream lower resolution + * videos when the hdmi mode is < 1080p. + * otherwise, they'd give us 1080p and we'd just scale it + * down to the hdmi mode res. UI apps are always going + * to draw at 1080p and we'll scale down because the + * system can't support dynamic dpi changes. + */ + char display[PROPERTY_VALUE_MAX]; + snprintf(display, sizeof(display), "%dx%d", + d.modedb[best].xres, d.modedb[best].yres); + LOGD("setting property sys.display-size to %s", display); + property_set("sys.display-size", display); + ioctl(hwc_dev->dsscomp_fd, DSSCIOC_SETUP_DISPLAY, &sdis); + } ext->last_mode = ~best; } else { __u32 ext_width = d.dis.width_in_mm; |