hwc: vds: Add support to dump layers, FB and WB output buffer

1. Add hook to dump the layers going to VDS based virtual display.

2. Furthermore, add utility function to dump the frame buffer and
   WB output buffer. This will be enabled via a system property

   debug.hwc.enable_vds_dump

   Once dumping is enabled, the dumps can be extracted from

   /data/vds.fb.FORMAT.XRESxYRES.raw
   /data/vds.wb.FORMAT.XRESxYRES.raw

   e.g. vds.fb.MDP_RGBA_8888.1152x1920.raw

Change-Id: I2435c5507961a52929411206892c005492d5c193
This commit is contained in:
Tatenda Chipeperekwa
2014-05-29 14:58:39 -07:00
parent 8f4e1a68ba
commit 523eac5717
4 changed files with 54 additions and 1 deletions

View File

@@ -2080,6 +2080,24 @@ bool canUseMDPforVirtualDisplay(hwc_context_t* ctx,
return true;
}
void dumpBuffer(private_handle_t *ohnd, char *bufferName) {
if (ohnd != NULL && ohnd->base) {
char dumpFilename[PATH_MAX];
bool bResult = false;
snprintf(dumpFilename, sizeof(dumpFilename), "/data/%s.%s.%dx%d.raw",
bufferName,
overlay::utils::getFormatString(utils::getMdpFormat(ohnd->format)),
getWidth(ohnd), getHeight(ohnd));
FILE* fp = fopen(dumpFilename, "w+");
if (NULL != fp) {
bResult = (bool) fwrite((void*)ohnd->base, ohnd->size, 1, fp);
fclose(fp);
}
ALOGD("Buffer[%s] Dump to %s: %s",
bufferName, dumpFilename, bResult ? "Success" : "Fail");
}
}
bool isGLESComp(hwc_context_t *ctx,
hwc_display_contents_1_t* list) {
int numAppLayers = ctx->listStats[HWC_DISPLAY_PRIMARY].numAppLayers;