Skip to content

Commit

Permalink
Allocate tiling for layer buffer, linear for frame buffer
Browse files Browse the repository at this point in the history
Only set scanout flag when have COMPOSER_CLIENT_TARGET and
GRALLOC_USAGE_PRIVATE_0 flag.

Tracked-On: OAM-119803
Signed-off-by: HeYue <[email protected]>
  • Loading branch information
yhe39 committed May 30, 2024
1 parent 837ee48 commit 6d38757
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cros_gralloc/cros_gralloc_helpers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
/* Define to match AIDL PixelFormat::R_8. */
#define HAL_PIXEL_FORMAT_R8 0x38

/* Define to match BufferUsage::GRALLOC_USAGE_PRIVATE_0. */
#define GRALLOC_USAGE_PRIVATE_0 (1 << 28)

const char *drmFormat2Str(int drm_format)
{
static char buf[5];
Expand Down Expand Up @@ -138,8 +141,8 @@ uint64_t cros_gralloc_convert_usage(uint64_t usage)
handle_usage(&usage, GRALLOC_USAGE_HW_RENDER, &use_flags, BO_USE_RENDERING);
handle_usage(&usage, GRALLOC_USAGE_HW_2D, &use_flags, BO_USE_RENDERING);
/* HWC wants to use display hardware, but can defer to OpenGL. */
handle_usage(&usage, GRALLOC_USAGE_HW_COMPOSER, &use_flags,
BO_USE_SCANOUT | BO_USE_TEXTURE);
handle_usage(&usage, GRALLOC_USAGE_HW_COMPOSER, &use_flags, BO_USE_TEXTURE);
handle_usage(&usage, (GRALLOC_USAGE_HW_FB |GRALLOC_USAGE_PRIVATE_0), &use_flags, BO_USE_SCANOUT);
handle_usage(&usage, GRALLOC_USAGE_HW_FB, &use_flags, BO_USE_NONE);
/*
* This flag potentially covers external display for the normal drivers (i915/rockchip) and
Expand Down

0 comments on commit 6d38757

Please sign in to comment.