summaryrefslogtreecommitdiffstats
path: root/libgralloc/framebuffer.cpp
diff options
context:
space:
mode:
authorKen Zhang <kenz@codeaurora.org>2013-01-08 15:09:27 -0500
committerNaseer Ahmed <naseer@codeaurora.org>2013-01-11 19:51:47 -0500
commit6e6f9a907ecc2c8f6e48a41d9b378737475be62b (patch)
tree24a9b40cf502020e3c41a5bd21dd8694087da2a9 /libgralloc/framebuffer.cpp
parentd78d153d70130054c169e7bd2fecbfafbceeca2f (diff)
downloadandroid_hardware_qcom_display-6e6f9a907ecc2c8f6e48a41d9b378737475be62b.tar.gz
android_hardware_qcom_display-6e6f9a907ecc2c8f6e48a41d9b378737475be62b.tar.bz2
android_hardware_qcom_display-6e6f9a907ecc2c8f6e48a41d9b378737475be62b.zip
display: use metadata ioctl to get panel frame rate
Get rid of using reserved fields Change-Id: Ia3ada294427812e8382f744964f475403f6fb73a
Diffstat (limited to 'libgralloc/framebuffer.cpp')
-rw-r--r--libgralloc/framebuffer.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/libgralloc/framebuffer.cpp b/libgralloc/framebuffer.cpp
index 1193a2746..5293ca9b2 100644
--- a/libgralloc/framebuffer.cpp
+++ b/libgralloc/framebuffer.cpp
@@ -267,9 +267,20 @@ int mapFrameBufferLocked(struct private_module_t* module)
float xdpi = (info.xres * 25.4f) / info.width;
float ydpi = (info.yres * 25.4f) / info.height;
+#ifdef MSMFB_METADATA_GET
+ struct msmfb_metadata metadata;
+ memset(&metadata, 0 , sizeof(metadata));
+ metadata.op = metadata_op_frame_rate;
+ if (ioctl(fd, MSMFB_METADATA_GET, &metadata) == -1) {
+ ALOGE("Error retrieving panel frame rate");
+ return -errno;
+ }
+ float fps = metadata.data.panel_frame_rate;
+#else
+ //XXX: Remove reserved field usage on all baselines
//The reserved[3] field is used to store FPS by the driver.
float fps = info.reserved[3] & 0xFF;
-
+#endif
ALOGI("using (fd=%d)\n"
"id = %s\n"
"xres = %d px\n"