mirror of
https://github.com/team-infusion-developers/android_hardware_samsung.git
synced 2024-11-06 21:55:41 +00:00
hwcomposer: smdk4120: Add composition-decision of our old hwc
Change-Id: I2e1919e7abeb78310358ac315f7de2a9223f6fe2
This commit is contained in:
parent
3cacced179
commit
3c86d5e6eb
1 changed files with 64 additions and 0 deletions
|
@ -262,6 +262,69 @@ bool is_offscreen(struct hwc_context_t *ctx, hwc_layer_1_t &layer)
|
|||
layer.displayFrame.bottom < 0;
|
||||
}
|
||||
|
||||
#if 1
|
||||
bool is_overlay_supported(struct hwc_context_t *ctx, hwc_layer_1_t &layer, size_t i)
|
||||
{
|
||||
if(layer.flags & HWC_SKIP_LAYER || !layer.handle) {
|
||||
ALOGV("%s::is_skip_layer %d layer.handle %x ",
|
||||
__func__, layer.flags & HWC_SKIP_LAYER, layer.handle);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool result = false;
|
||||
private_handle_t *prev_handle = (private_handle_t *)(layer.handle);
|
||||
|
||||
if (i == 0) {
|
||||
/* check here....if we have any resolution constraints */
|
||||
if (((layer.sourceCrop.right - layer.sourceCrop.left + 1) < 16) ||
|
||||
((layer.sourceCrop.bottom - layer.sourceCrop.top + 1) < 8))
|
||||
return result;
|
||||
|
||||
if ((layer.transform == HAL_TRANSFORM_ROT_90) ||
|
||||
(layer.transform == HAL_TRANSFORM_ROT_270)) {
|
||||
if (((layer.displayFrame.right - layer.displayFrame.left + 1) < 4) ||
|
||||
((layer.displayFrame.bottom - layer.displayFrame.top + 1) < 8))
|
||||
return result;
|
||||
} else if (((layer.displayFrame.right - layer.displayFrame.left + 1) < 8) ||
|
||||
((layer.displayFrame.bottom - layer.displayFrame.top + 1) < 4)) {
|
||||
return result;
|
||||
}
|
||||
|
||||
switch (prev_handle->format) {
|
||||
case HAL_PIXEL_FORMAT_CUSTOM_YCbCr_420_SP:
|
||||
case HAL_PIXEL_FORMAT_CUSTOM_YCrCb_420_SP:
|
||||
case HAL_PIXEL_FORMAT_CUSTOM_YCbCr_420_SP_TILED:
|
||||
result = true;
|
||||
break;
|
||||
case HAL_PIXEL_FORMAT_YV12: /* YCrCb_420_P */
|
||||
case HAL_PIXEL_FORMAT_YCbCr_420_P:
|
||||
case HAL_PIXEL_FORMAT_YCrCb_420_SP:
|
||||
case HAL_PIXEL_FORMAT_YCbCr_420_SP:
|
||||
if ((prev_handle->usage & GRALLOC_USAGE_HWC_HWOVERLAY) &&
|
||||
(layer.blending == HWC_BLENDING_NONE))
|
||||
result = true;
|
||||
else
|
||||
result = false;
|
||||
break;
|
||||
default:
|
||||
result = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
ALOGV("%s:(%s)=>0:FB,1:OVERLAY \r\n"
|
||||
" format(0x%x),magic(0x%x),flags(%d),size(%d),offset(%d)"
|
||||
"b_addr(0x%x),usage(%d),w(%d),h(%d),bpp(%d)",
|
||||
__func__, result ? "true" : "false",
|
||||
prev_handle->format, prev_handle->magic, prev_handle->flags,
|
||||
prev_handle->size, prev_handle->offset, prev_handle->base,
|
||||
prev_handle->usage, prev_handle->width, prev_handle->height,
|
||||
prev_handle->bpp);
|
||||
|
||||
return result;
|
||||
}
|
||||
#else
|
||||
bool is_overlay_supported(struct hwc_context_t *ctx, hwc_layer_1_t &layer, size_t i)
|
||||
{
|
||||
enum gsc_map_t::mode mode;
|
||||
|
@ -326,6 +389,7 @@ bool is_overlay_supported(struct hwc_context_t *ctx, hwc_layer_1_t &layer, size_
|
|||
ALOGV("%s: return true", __FUNCTION__);
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
void determineSupportedOverlays(hwc_context_t *ctx, hwc_display_contents_1_t *contents)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue