Merge "hwc/overlay: If configRotator fails, mark all pipes as available."

This commit is contained in:
Linux Build Service Account
2013-05-17 04:15:21 -07:00
committed by Gerrit - the friendly Code Review server
3 changed files with 14 additions and 0 deletions

View File

@@ -908,6 +908,7 @@ int configureLowRes(hwc_context_t *ctx, hwc_layer_1_t *layer,
//Configure rotator for pre-rotation
if(configRotator(*rot, whf, crop, mdpFlags, orient, downscale) < 0) {
ALOGE("%s: configRotator failed!", __FUNCTION__);
ctx->mOverlay->clear(dpy);
return -1;
}
whf.format = (*rot)->getDstFormat();
@@ -981,6 +982,7 @@ int configureHighRes(hwc_context_t *ctx, hwc_layer_1_t *layer,
//Configure rotator for pre-rotation
if(configRotator(*rot, whf, crop, mdpFlagsL, orient, downscale) < 0) {
ALOGE("%s: configRotator failed!", __FUNCTION__);
ctx->mOverlay->clear(dpy);
return -1;
}
whf.format = (*rot)->getDstFormat();

View File

@@ -311,6 +311,16 @@ void Overlay::getDump(char *buf, size_t len) {
strncat(buf, str_pipes, strlen(str_pipes));
}
void Overlay::clear(int dpy) {
for(int i = 0; i < PipeBook::NUM_PIPES; i++) {
if (mPipeBook[i].mDisplay == dpy) {
// Mark as available for this round
PipeBook::resetUse(i);
PipeBook::resetAllocation(i);
}
}
}
void Overlay::PipeBook::init() {
mPipe = NULL;
mDisplay = DPY_UNUSED;

View File

@@ -90,6 +90,8 @@ public:
* to populate.
*/
void getDump(char *buf, size_t len);
/* Reset usage and allocation bits on all pipes for given display */
void clear(int dpy);
static void setDMAMode(const int& mode);
static int getDMAMode();