Skip to content

Commit

Permalink
Only set scanout flag for display buffer
Browse files Browse the repository at this point in the history
Tracked-On: OAM-125304
Signed-off-by: He, Yue <yue.he@intel.com>
  • Loading branch information
yhe39 committed Sep 29, 2024
1 parent 650e7fc commit c75a755
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 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_1. */
#define GRALLOC_USAGE_PRIVATE_1 (1 << 29)

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_PRIVATE_1, &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
2 changes: 1 addition & 1 deletion i915.c
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ static int i915_add_combinations(struct driver *drv)

if (i915_has_tile4(i915)) {
// in dual gpu case, only alloc x-tiling for dgpu for render
if ((drv->gpu_grp_type & GPU_TYPE_DUAL_IGPU_DGPU) && (i915->graphics_version >= 125))
if ((drv->gpu_grp_type & GPU_TYPE_DUAL_IGPU_DGPU) && (GEN_VERSION_X10(i915) >= 125))
return 0;

struct format_metadata metadata_4_tiled = { .tiling = I915_TILING_4,
Expand Down

0 comments on commit c75a755

Please sign in to comment.