libhwcomposer: Implement register_proc in HWC

register_proc in HWC is used by SurfaceFlinger to register
callback functions with HWC. This can be used by HWC to invoke
SurfaceFlinger functions. Currently invalidate is the only function
registerd and can be used by HWC to trigger a screen re-draw.

CRs-Fixed: 342060
(cherry picked from commit 03a5cf4b9c52da2bfbd9706e85fddae63110ee9b)

Change-Id: I464370ebf63b93e0ce238395b5c165647d777575
This commit is contained in:
Jeykumar Sankaran 2012-03-19 17:52:40 -07:00 committed by andrew.boren
parent 3853e4180a
commit beb7795769

View File

@ -912,6 +912,20 @@ static void handleHDMIStateChange(hwc_composer_device_t *dev, int externaltype)
#endif
}
/*
* Save callback functions registered to HWC
*/
static void hwc_registerProcs(struct hwc_composer_device* dev, hwc_procs_t const* procs) {
hwc_context_t* ctx = (hwc_context_t*)(dev);
if(!ctx) {
LOGE("%s: Invalid context", __FUNCTION__);
return;
}
ctx->device.reserved_proc[0] = (void*)procs;
}
/*
* function to set the status of external display in hwc
* Just mark flags and do stuff after eglSwapBuffers
@ -1819,6 +1833,7 @@ static int hwc_device_open(const struct hw_module_t* module, const char* name,
dev->device.prepare = hwc_prepare;
dev->device.set = hwc_set;
dev->device.registerProcs = hwc_registerProcs;
dev->device.enableHDMIOutput = hwc_enableHDMIOutput;
*device = &dev->device.common;