summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike J. Chen <mjchen@google.com>2012-05-21 17:18:20 -0700
committerMike J. Chen <mjchen@google.com>2012-05-21 17:18:20 -0700
commitce768b26571c66e176fa6d10c64ded578da937d9 (patch)
treeb60bc203a699914665c0eef637bd6f95fa4af1e4
parent97160be189cd52b5cb8eecf97fd47ed034b54f5c (diff)
downloadhardware_ti_omap4xxx-ce768b26571c66e176fa6d10c64ded578da937d9.zip
hardware_ti_omap4xxx-ce768b26571c66e176fa6d10c64ded578da937d9.tar.gz
hardware_ti_omap4xxx-ce768b26571c66e176fa6d10c64ded578da937d9.tar.bz2
hwc: Stash hdmi mode resolution in a property
The property can be read by apps like YouTube to choose lower resolution videos if the hdmi mode is < 1080p. Saves bandwidth, latency, and time wasted scaling. Change-Id: Iab46699f4ea2208f1f9475420d57ccf1e16214df Signed-off-by: Mike J. Chen <mjchen@google.com>
-rw-r--r--hwc/hwc.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/hwc/hwc.c b/hwc/hwc.c
index 4a18fc9..49c22f0 100644
--- a/hwc/hwc.c
+++ b/hwc/hwc.c
@@ -1015,8 +1015,23 @@ static int omap4_hwc_set_best_hdmi_mode(omap4_hwc_device_t *hwc_dev, __u32 xres,
sdis.mode = d.dis.modedb[best];
LOGD("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;