Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a6c1f926 authored by Mark Urbanus's avatar Mark Urbanus
Browse files

Enable Universal Bandwidth Compression for textures

We removed texture compression for VR display surfaces, which introduced memory
bandwidth issues on some QC platforms.

This patch reintroduces texture compression for QC devices compatible with
both gralloc0/gralloc1 implementations.

Bug: 36370337
Test: Validate VR comes up
Change-Id: Ieaaa56f67522c85913476ed0d8da04f8eedbce63
parent 88615059
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@
#include <private/dvr/sensor_constants.h>
#include <private/dvr/video_mesh_surface_client.h>
#include <private/dvr/vsync_client.h>
#include <private/dvr/platform_defines.h>

#include <android/native_window.h>

@@ -43,8 +44,10 @@ using android::dvr::DisplaySurfaceAttributeValue;

namespace {

// TODO(urbanus): revisit once we have per-platform usage config in place.
constexpr int kDefaultDisplaySurfaceUsage =
    GRALLOC_USAGE_HW_RENDER | GRALLOC_USAGE_HW_TEXTURE;
    GRALLOC_USAGE_HW_RENDER | GRALLOC_USAGE_HW_TEXTURE |
    GRALLOC_USAGE_QCOM_FRAMEBUFFER_COMPRESSION;
constexpr int kDefaultDisplaySurfaceFormat = HAL_PIXEL_FORMAT_RGBA_8888;
// TODO(alexst): revisit this count when HW encode is available for casting.
constexpr int kDefaultBufferCount = 4;
+3 −2
Original line number Diff line number Diff line
#ifndef ANDROID_DVR_PLATFORM_DEFINES_H_
#define ANDROID_DVR_PLATFORM_DEFINES_H_

#include <hardware/gralloc1.h>
// Platform-specific macros and defines.

// QCOM's GRALLOC_USAGE_PRIVATE_ALLOC_UBWC usage bit.
#define GRALLOC_USAGE_QCOM_FRAMEBUFFER_COMPRESSION GRALLOC_USAGE_PRIVATE_1
// QCOM's GRALLOC_USAGE_PRIVATE_ALLOC_UBWC usage bits.
#define GRALLOC_USAGE_QCOM_FRAMEBUFFER_COMPRESSION GRALLOC_USAGE_PRIVATE_1 | GRALLOC1_PRODUCER_USAGE_PRIVATE_0

// QCOM bit to use the ADSP heap. This carveout heap is accessible to Linux,
// Hexagon DSPs, and the GPU.