hwc: Add support for Macro Tile feature

Macro tile is enabled only if all the conditions are met:
  1. GPU hardware should support Macro Tiling.
  2. MDSS hardware should support Macro Tiling.
  3. USAGE flags shouldnt contain GRALLOC_USAGE_SW_READ_OFTEN and
     GRALLOC_USAGE_SW_WRITE_OFTEN.
  4. RGB 16bit and 32bit formats.
  5. persist.hwc.macro_tile_enable flag should be enabled.

PRIV_FLAGS_TILE_RENDERED flag is added to indicate whether the layer
is rendered/composited in Macro Tiling or Linear format.

Change-Id: Ie3139839c84d76c5d1a2300f33910a09eb7336f4
This commit is contained in:
Manoj Kumar AVM
2013-10-10 11:46:06 -07:00
parent 8dad692bcb
commit 8a22081e49
13 changed files with 245 additions and 31 deletions

View File

@@ -331,10 +331,11 @@ int gralloc_perform(struct gralloc_module_t const* module,
int *stride = va_arg(args, int *);
int alignedw = 0, alignedh = 0;
AdrenoMemInfo::getInstance().getAlignedWidthAndHeight(width,
0, format, alignedw, alignedh);
0, format, false, alignedw, alignedh);
*stride = alignedw;
res = 0;
} break;
case GRALLOC_MODULE_PERFORM_GET_CUSTOM_STRIDE_FROM_HANDLE:
{
private_handle_t* hnd = va_arg(args, private_handle_t*);
@@ -350,6 +351,23 @@ int gralloc_perform(struct gralloc_module_t const* module,
}
res = 0;
} break;
case GRALLOC_MODULE_PERFORM_GET_ATTRIBUTES:
{
int width = va_arg(args, int);
int height = va_arg(args, int);
int format = va_arg(args, int);
int usage = va_arg(args, int);
int *alignedWidth = va_arg(args, int *);
int *alignedHeight = va_arg(args, int *);
int *tileEnabled = va_arg(args,int *);
*tileEnabled = isMacroTileEnabled(format, usage);
AdrenoMemInfo::getInstance().getAlignedWidthAndHeight(width,
height, format, *tileEnabled, *alignedWidth,
*alignedHeight);
res = 0;
} break;
default:
break;
}