hardware/msm7k: Add an api to copy bypass buffer.
Add an api to copy bypass buffer. De-couple comp. bypass functions from HDMI feature defines. Change-Id: I743a80518c29a04bcf61e48d189b07636026afc7 CRs-fixed: 288992
This commit is contained in:
parent
16722a86d7
commit
2a93efd233
@ -45,6 +45,10 @@ LOCAL_C_INCLUDES += $(LOCAL_PATH)/../liboverlay
|
||||
LOCAL_SHARED_LIBRARIES += liboverlay
|
||||
endif
|
||||
|
||||
ifeq ($(TARGET_USES_SF_BYPASS),true)
|
||||
LOCAL_CFLAGS += -DSF_BYPASS
|
||||
endif
|
||||
|
||||
ifeq ($(TARGET_GRALLOC_USES_ASHMEM),true)
|
||||
LOCAL_CFLAGS += -DUSE_ASHMEM
|
||||
endif
|
||||
|
@ -505,6 +505,9 @@ static int fb_stopOrigResDisplay(struct framebuffer_device_t* dev) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(SF_BYPASS)
|
||||
static int fb_postBypassBuffer(struct framebuffer_device_t* dev,
|
||||
buffer_handle_t buffer, int w,
|
||||
int h, int format, int orientation, int isHPDON)
|
||||
@ -549,6 +552,18 @@ static int fb_closeBypass(struct framebuffer_device_t* dev)
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
static int fb_copyBypassBuffer(struct framebuffer_device_t* dev)
|
||||
{
|
||||
private_module_t* m = reinterpret_cast<private_module_t*>(
|
||||
dev->common.module);
|
||||
if (m->pobjOverlayUI) {
|
||||
OverlayUI* pobjOverlay = m->pobjOverlayUI;
|
||||
return (pobjOverlay->copyBuffer());
|
||||
}
|
||||
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static int fb_post(struct framebuffer_device_t* dev, buffer_handle_t buffer)
|
||||
@ -946,11 +961,14 @@ int mapFrameBufferLocked(struct private_module_t* module)
|
||||
module->hdmiStateChanged = false;
|
||||
pthread_t hdmiUIThread;
|
||||
pthread_create(&hdmiUIThread, NULL, &hdmi_ui_loop, (void *) module);
|
||||
|
||||
module->pobjOverlayUI = new OverlayUI();
|
||||
module->pOrigResPanel = new OverlayOrigRes<OverlayUI::FB0>();
|
||||
module->pOrigResTV = new OverlayOrigRes<OverlayUI::FB1>();
|
||||
module->isOrigResStarted = false;
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(SF_BYPASS)
|
||||
module->pobjOverlayUI = new OverlayUI();
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
@ -976,12 +994,14 @@ static int fb_close(struct hw_device_t *dev)
|
||||
m->exitHDMIUILoop = true;
|
||||
pthread_cond_signal(&(m->overlayPost));
|
||||
pthread_mutex_unlock(&m->overlayLock);
|
||||
|
||||
delete m->pobjOverlayUI;
|
||||
m->pobjOverlayUI = 0;
|
||||
delete m->pOrigResPanel;
|
||||
delete m->pOrigResTV;
|
||||
#endif
|
||||
|
||||
#if defined(SF_BYPASS)
|
||||
delete m->pobjOverlayUI;
|
||||
m->pobjOverlayUI = 0;
|
||||
#endif
|
||||
if (ctx) {
|
||||
free(ctx);
|
||||
}
|
||||
@ -1016,13 +1036,17 @@ 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.postBypassBuffer = fb_postBypassBuffer;
|
||||
dev->device.closeBypass = fb_closeBypass;
|
||||
dev->device.postOrigResBuffer = fb_postOrigResBuffer;
|
||||
dev->device.startOrigResDisplay = fb_startOrigResDisplay;
|
||||
dev->device.stopOrigResDisplay = fb_stopOrigResDisplay;
|
||||
#endif
|
||||
|
||||
#if defined(SF_BYPASS)
|
||||
dev->device.postBypassBuffer = fb_postBypassBuffer;
|
||||
dev->device.closeBypass = fb_closeBypass;
|
||||
dev->device.copyBypassBuffer = fb_copyBypassBuffer;
|
||||
#endif
|
||||
|
||||
private_module_t* m = (private_module_t*)module;
|
||||
status = mapFrameBuffer(m);
|
||||
if (status >= 0) {
|
||||
|
@ -281,16 +281,18 @@ struct private_module_t {
|
||||
bool hdmiStateChanged;
|
||||
pthread_mutex_t overlayLock;
|
||||
pthread_cond_t overlayPost;
|
||||
OverlayOrigRes<OverlayUI::FB0>* pOrigResPanel;
|
||||
OverlayOrigRes<OverlayUI::FB1>* pOrigResTV;
|
||||
bool isOrigResStarted;
|
||||
ThreadShared ts;
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus) && defined(SF_BYPASS)
|
||||
/*
|
||||
* Comp. bypass specific variables
|
||||
* pobjOverlayUI - UI overlay channel for comp. bypass.
|
||||
*/
|
||||
OverlayUI* pobjOverlayUI;
|
||||
OverlayOrigRes<OverlayUI::FB0>* pOrigResPanel;
|
||||
OverlayOrigRes<OverlayUI::FB1>* pOrigResTV;
|
||||
bool isOrigResStarted;
|
||||
ThreadShared ts;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user