Merge "hwc: Add dynamic fps support for PPP"
This commit is contained in:
committed by
Gerrit - the friendly Code Review server
commit
c0103cbac5
@@ -64,6 +64,7 @@ struct copybit_context_t {
|
|||||||
int relFence;
|
int relFence;
|
||||||
struct mdp_buf_sync sync;
|
struct mdp_buf_sync sync;
|
||||||
struct blitReq list;
|
struct blitReq list;
|
||||||
|
uint8_t dynamic_fps;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -227,6 +228,7 @@ static void set_infos(struct copybit_context_t *dev,
|
|||||||
struct mdp_blit_req *req, int flags)
|
struct mdp_blit_req *req, int flags)
|
||||||
{
|
{
|
||||||
req->alpha = dev->mAlpha;
|
req->alpha = dev->mAlpha;
|
||||||
|
req->fps = dev->dynamic_fps;
|
||||||
req->transp_mask = MDP_TRANSP_NOP;
|
req->transp_mask = MDP_TRANSP_NOP;
|
||||||
req->flags = dev->mFlags | flags;
|
req->flags = dev->mFlags | flags;
|
||||||
// check if we are blitting to f/b
|
// check if we are blitting to f/b
|
||||||
@@ -258,7 +260,7 @@ static int msm_copybit(struct copybit_context_t *dev, void const *list)
|
|||||||
for (unsigned int i=0 ; i<l->count ; i++) {
|
for (unsigned int i=0 ; i<l->count ; i++) {
|
||||||
ALOGE("%d: src={w=%d, h=%d, f=%d, rect={%d,%d,%d,%d}}\n"
|
ALOGE("%d: src={w=%d, h=%d, f=%d, rect={%d,%d,%d,%d}}\n"
|
||||||
" dst={w=%d, h=%d, f=%d, rect={%d,%d,%d,%d}}\n"
|
" dst={w=%d, h=%d, f=%d, rect={%d,%d,%d,%d}}\n"
|
||||||
" flags=%08x"
|
" flags=%08x, fps=%d"
|
||||||
,
|
,
|
||||||
i,
|
i,
|
||||||
l->req[i].src.width,
|
l->req[i].src.width,
|
||||||
@@ -275,7 +277,8 @@ static int msm_copybit(struct copybit_context_t *dev, void const *list)
|
|||||||
l->req[i].dst_rect.y,
|
l->req[i].dst_rect.y,
|
||||||
l->req[i].dst_rect.w,
|
l->req[i].dst_rect.w,
|
||||||
l->req[i].dst_rect.h,
|
l->req[i].dst_rect.h,
|
||||||
l->req[i].flags
|
l->req[i].flags,
|
||||||
|
l->req[i].fps
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -323,6 +326,9 @@ static int set_parameter_copybit(
|
|||||||
if (value >= 256) value = 255;
|
if (value >= 256) value = 255;
|
||||||
ctx->mAlpha = (uint8_t)value;
|
ctx->mAlpha = (uint8_t)value;
|
||||||
break;
|
break;
|
||||||
|
case COPYBIT_DYNAMIC_FPS:
|
||||||
|
ctx->dynamic_fps = (uint8_t)value;
|
||||||
|
break;
|
||||||
case COPYBIT_DITHER:
|
case COPYBIT_DITHER:
|
||||||
if (value == COPYBIT_ENABLE) {
|
if (value == COPYBIT_ENABLE) {
|
||||||
ctx->mFlags |= MDP_DITHER;
|
ctx->mFlags |= MDP_DITHER;
|
||||||
@@ -756,6 +762,9 @@ static int open_copybit(const struct hw_module_t* module, const char* name,
|
|||||||
ctx->device.flush_get_fence = flush_get_fence;
|
ctx->device.flush_get_fence = flush_get_fence;
|
||||||
ctx->device.clear = clear_copybit;
|
ctx->device.clear = clear_copybit;
|
||||||
ctx->mAlpha = MDP_ALPHA_NOP;
|
ctx->mAlpha = MDP_ALPHA_NOP;
|
||||||
|
//dynamic_fps is zero means default
|
||||||
|
//panel refresh rate for driver.
|
||||||
|
ctx->dynamic_fps = 0;
|
||||||
ctx->mFlags = 0;
|
ctx->mFlags = 0;
|
||||||
ctx->sync.flags = 0;
|
ctx->sync.flags = 0;
|
||||||
ctx->relFence = -1;
|
ctx->relFence = -1;
|
||||||
|
|||||||
@@ -79,6 +79,7 @@ enum {
|
|||||||
/* FB height */
|
/* FB height */
|
||||||
COPYBIT_FRAMEBUFFER_HEIGHT = 8,
|
COPYBIT_FRAMEBUFFER_HEIGHT = 8,
|
||||||
COPYBIT_FG_LAYER = 9,
|
COPYBIT_FG_LAYER = 9,
|
||||||
|
COPYBIT_DYNAMIC_FPS = 10,
|
||||||
};
|
};
|
||||||
|
|
||||||
/* values for copybit_set_parameter(COPYBIT_TRANSFORM) */
|
/* values for copybit_set_parameter(COPYBIT_TRANSFORM) */
|
||||||
|
|||||||
@@ -818,7 +818,13 @@ int CopyBit::drawLayerUsingCopybit(hwc_context_t *dev, hwc_layer_1_t *layer,
|
|||||||
ALOGE("%s: Framebuffer handle is NULL", __FUNCTION__);
|
ALOGE("%s: Framebuffer handle is NULL", __FUNCTION__);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
uint32_t dynamic_fps = 0;
|
||||||
|
#ifdef DYNAMIC_FPS
|
||||||
|
MetaData_t *mdata = hnd ? (MetaData_t *)hnd->base_metadata : NULL;
|
||||||
|
if (mdata && (mdata->operation & UPDATE_REFRESH_RATE)) {
|
||||||
|
dynamic_fps = roundOff(mdata->refreshrate);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
// Set the copybit source:
|
// Set the copybit source:
|
||||||
copybit_image_t src;
|
copybit_image_t src;
|
||||||
src.w = getWidth(hnd);
|
src.w = getWidth(hnd);
|
||||||
@@ -1033,6 +1039,7 @@ int CopyBit::drawLayerUsingCopybit(hwc_context_t *dev, hwc_layer_1_t *layer,
|
|||||||
layerTransform);
|
layerTransform);
|
||||||
//TODO: once, we are able to read layer alpha, update this
|
//TODO: once, we are able to read layer alpha, update this
|
||||||
copybit->set_parameter(copybit, COPYBIT_PLANE_ALPHA, 255);
|
copybit->set_parameter(copybit, COPYBIT_PLANE_ALPHA, 255);
|
||||||
|
copybit->set_parameter(copybit, COPYBIT_DYNAMIC_FPS, dynamic_fps);
|
||||||
copybit->set_parameter(copybit, COPYBIT_BLEND_MODE,
|
copybit->set_parameter(copybit, COPYBIT_BLEND_MODE,
|
||||||
layer->blending);
|
layer->blending);
|
||||||
copybit->set_parameter(copybit, COPYBIT_DITHER,
|
copybit->set_parameter(copybit, COPYBIT_DITHER,
|
||||||
|
|||||||
Reference in New Issue
Block a user