Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

To reduce GPU bandwidth, add RBC(Render Buffer Compression) Support #1404

Open
wants to merge 1 commit into
base: celadon/r/mr0/stable
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
From 6425bc97bde1b8f02a8eb4c02155c715a7ac7330 Mon Sep 17 00:00:00 2001
From: "Li, HaihongX" <[email protected]>
Date: Fri, 1 Apr 2022 11:16:07 +0800
Subject: [PATCH] RBC(Render Buffer Compression) Support

Set bo->prime_fds[1] = handle->data[0] for rbc supporting
if modifier is I915_FORMAT_MOD_Y_TILED_CCSi or
I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS.

Tracked-On: OAM-101691
Signed-off-by: Li, HaihongX <[email protected]>
---
bufferinfo/BufferInfoMapperMetadata.cpp | 6 +++++-
include/drmhwcomposer.h | 1 +
2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/bufferinfo/BufferInfoMapperMetadata.cpp b/bufferinfo/BufferInfoMapperMetadata.cpp
index 23a9072..a251c0d 100644
--- a/bufferinfo/BufferInfoMapperMetadata.cpp
+++ b/bufferinfo/BufferInfoMapperMetadata.cpp
@@ -51,7 +51,11 @@ BufferInfoMapperMetadata::GetFds(buffer_handle_t handle, hwc_drm_bo_t *bo) {

if (num_fds >= 1 && num_fds <= 2) {
if (IsDrmFormatRgb(bo->format)) {
- bo->prime_fds[0] = handle->data[0];
+ if (bo->modifiers[0] == I915_FORMAT_MOD_Y_TILED_CCS ||
+ bo->modifiers[0] == I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS)
+ bo->prime_fds[0] = bo->prime_fds[1] = handle->data[0];
+ else
+ bo->prime_fds[0] = handle->data[0];
} else {
bo->prime_fds[0] = bo->prime_fds[1] = bo->prime_fds[2] = handle->data[0];
}
diff --git a/include/drmhwcomposer.h b/include/drmhwcomposer.h
index 6528f86..181a7a8 100644
--- a/include/drmhwcomposer.h
+++ b/include/drmhwcomposer.h
@@ -29,6 +29,7 @@
#include "utils/UniqueFd.h"

#define DRM_FORMAT_NV12_Y_TILED_INTEL fourcc_code('9', '9', '9', '6')
+#define I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS fourcc_mod_code(INTEL, 6)
namespace android {

class DrmFbIdHandle;
--
2.33.1

Loading