From 9c9680462db5ea9de3fa7740f6eff4c173735253 Mon Sep 17 00:00:00 2001 From: Saurabh Shah Date: Thu, 28 Apr 2011 15:08:36 -0700 Subject: [PATCH] Simplify call flow for action safe parameters. Observed overscan in case of videos and UI This change fixes all the paths and eliminates overscan Adds a class to save user specified action safe parameters Change-Id: I8c65b1142b086f5ff0d568c5f5c87fcde9642d5b CRs-fixed: 285165 --- framebuffer.cpp | 26 +++----------------------- gralloc_priv.h | 2 -- 2 files changed, 3 insertions(+), 25 deletions(-) diff --git a/framebuffer.cpp b/framebuffer.cpp index f03e56c..4965856 100644 --- a/framebuffer.cpp +++ b/framebuffer.cpp @@ -62,6 +62,7 @@ #define HEIGHT_480P 480 #define EVEN_OUT(x) if (x & 0x0001) {x--;} using overlay::Overlay; +using overlay::ActionSafe; /** min of int a, b */ static inline int min(int a, int b) { return (aoverlayLock); return NULL; } - float asWidthRatio = m->actionsafeWidthRatio/100.0f; - float asHeightRatio = m->actionsafeHeightRatio/100.0f; + float asWidthRatio = ActionSafe::getWidthRatio() / 100.0f; + float asHeightRatio = ActionSafe::getHeightRatio() / 100.0f; if (m->pobjOverlay) { Overlay* pTemp = m->pobjOverlay; @@ -381,25 +382,6 @@ static int fb_enableHDMIOutput(struct framebuffer_device_t* dev, int enable) return 0; } -static int fb_setActionSafeWidthRatio(struct framebuffer_device_t* dev, float asWidthRatio) -{ - private_module_t* m = reinterpret_cast( - dev->common.module); - pthread_mutex_lock(&m->overlayLock); - m->actionsafeWidthRatio = asWidthRatio; - pthread_mutex_unlock(&m->overlayLock); - return 0; -} - -static int fb_setActionSafeHeightRatio(struct framebuffer_device_t* dev, float asHeightRatio) -{ - private_module_t* m = reinterpret_cast( - dev->common.module); - pthread_mutex_lock(&m->overlayLock); - m->actionsafeHeightRatio = asHeightRatio; - pthread_mutex_unlock(&m->overlayLock); - return 0; -} static int fb_orientationChanged(struct framebuffer_device_t* dev, int orientation) { private_module_t* m = reinterpret_cast( @@ -954,8 +936,6 @@ int fb_device_open(hw_module_t const* module, const char* name, dev->device.orientationChanged = fb_orientationChanged; dev->device.videoOverlayStarted = fb_videoOverlayStarted; dev->device.enableHDMIOutput = fb_enableHDMIOutput; - dev->device.setActionSafeWidthRatio = fb_setActionSafeWidthRatio; - dev->device.setActionSafeHeightRatio = fb_setActionSafeHeightRatio; dev->device.postBypassBuffer = fb_postBypassBuffer; dev->device.closeBypass = fb_closeBypass; #endif diff --git a/gralloc_priv.h b/gralloc_priv.h index 6e781aa..03f0e8f 100644 --- a/gralloc_priv.h +++ b/gralloc_priv.h @@ -228,8 +228,6 @@ struct private_module_t { uint32_t currentOffset; bool enableHDMIOutput; bool exitHDMIUILoop; - float actionsafeWidthRatio; - float actionsafeHeightRatio; bool hdmiStateChanged; pthread_mutex_t overlayLock; pthread_cond_t overlayPost;