From 1e2be7b5b082456aa7a5810de18f76eafe792309 Mon Sep 17 00:00:00 2001 From: Saurabh Shah Date: Tue, 17 Apr 2012 15:36:11 -0700 Subject: [PATCH] hardware/qcom/display: Add events for secure session setup Change-Id: I0c0b5b7ae70d7ea8b341285479cd92750e1f6274 Conflicts: libgralloc/framebuffer.cpp libqcomui/qcom_ui.h --- libgralloc/framebuffer.cpp | 60 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/libgralloc/framebuffer.cpp b/libgralloc/framebuffer.cpp index 9b0b1f1..dd8994e 100644 --- a/libgralloc/framebuffer.cpp +++ b/libgralloc/framebuffer.cpp @@ -405,6 +405,54 @@ static int fb_orientationChanged(struct framebuffer_device_t* dev, int orientati pthread_mutex_unlock(&m->overlayLock); return 0; } + +static int handle_open_secure_start(private_module_t* m) { + pthread_mutex_lock(&m->overlayLock); + m->hdmiMirroringState = HDMI_NO_MIRRORING; + m->secureVideoOverlay = true; + closeHDMIChannel(m); + pthread_mutex_unlock(&m->overlayLock); + return 0; +} + +static int handle_open_secure_end(private_module_t* m) { + pthread_mutex_lock(&m->overlayLock); + if (m->enableHDMIOutput) { + if (m->trueMirrorSupport) { + m->hdmiMirroringState = HDMI_UI_MIRRORING; + } else if(!m->videoOverlay) { + m->hdmiMirroringState = HDMI_UI_MIRRORING; + } + m->hdmiStateChanged = true; + pthread_cond_signal(&(m->overlayPost)); + } + pthread_mutex_unlock(&m->overlayLock); + return 0; +} + +static int handle_close_secure_start(private_module_t* m) { + pthread_mutex_lock(&m->overlayLock); + m->hdmiMirroringState = HDMI_NO_MIRRORING; + m->secureVideoOverlay = false; + closeHDMIChannel(m); + pthread_mutex_unlock(&m->overlayLock); + return 0; +} + +static int handle_close_secure_end(private_module_t* m) { + pthread_mutex_lock(&m->overlayLock); + if (m->enableHDMIOutput) { + if (m->trueMirrorSupport) { + m->hdmiMirroringState = HDMI_UI_MIRRORING; + } else if(!m->videoOverlay) { + m->hdmiMirroringState = HDMI_UI_MIRRORING; + } + m->hdmiStateChanged = true; + pthread_cond_signal(&(m->overlayPost)); + } + pthread_mutex_unlock(&m->overlayLock); + return 0; +} #endif //Wait until framebuffer content is displayed. @@ -450,6 +498,18 @@ static int fb_perform(struct framebuffer_device_t* dev, int event, int value) case EVENT_ORIENTATION_CHANGE: fb_orientationChanged(dev, value); break; + case EVENT_OPEN_SECURE_START: + handle_open_secure_start(m); + break; + case EVENT_OPEN_SECURE_END: + handle_open_secure_end(m); + break; + case EVENT_CLOSE_SECURE_START: + handle_close_secure_start(m); + break; + case EVENT_CLOSE_SECURE_END: + handle_close_secure_end(m); + break; #endif case EVENT_RESET_POSTBUFFER: fb_resetBufferPostStatus(dev);