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

Add the check special flag #148

Open
wants to merge 1 commit into
base: celadon/u/mr0/master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions cros_gralloc/cros_gralloc_driver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,9 @@ bool cros_gralloc_driver::get_resolved_format_and_use_flags(
return true;
}

if ((descriptor->use_flags & BO_USE_PRIVATE_1)) {
ALOGI("prop set, sepeical flag BO_USE_PRIVATE_1\n");
}
drv_resolve_format_and_use_flags(drv, descriptor->drm_format, descriptor->use_flags,
&resolved_format, &resolved_use_flags);

Expand Down
4 changes: 4 additions & 0 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_1 (1 << 29)

const char *drmFormat2Str(int drm_format)
{
static char buf[5];
Expand Down Expand Up @@ -160,6 +163,7 @@ uint64_t cros_gralloc_convert_usage(uint64_t usage)
BO_USE_SENSOR_DIRECT_DATA);
handle_usage(&usage, BUFFER_USAGE_GPU_DATA_BUFFER, &use_flags, BO_USE_GPU_DATA_BUFFER);
handle_usage(&usage, BUFFER_USAGE_FRONT_RENDERING_MASK, &use_flags, BO_USE_FRONT_RENDERING);
handle_usage(&usage, GRALLOC_USAGE_PRIVATE_1, &use_flags, BO_USE_PRIVATE_1);

if (usage) {
ALOGE("Unhandled gralloc usage: %llx", (unsigned long long)usage);
Expand Down
1 change: 1 addition & 0 deletions drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ extern "C" {
#define BO_USE_RENDERSCRIPT (1ull << 17)
#define BO_USE_GPU_DATA_BUFFER (1ull << 18)
#define BO_USE_SENSOR_DIRECT_DATA (1ull << 19)
#define BO_USE_PRIVATE_1 (1ull << 29)

#define BO_USE_ARC_SCREEN_CAP_PROBED (1ull << 63)

Expand Down
2 changes: 1 addition & 1 deletion i915.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ static int i915_add_combinations(struct driver *drv)
{
struct i915_device *i915 = drv->priv;

const uint64_t scanout_and_render = BO_USE_RENDER_MASK | BO_USE_SCANOUT;
const uint64_t scanout_and_render = BO_USE_RENDER_MASK | BO_USE_SCANOUT | BO_USE_PRIVATE_1;
const uint64_t render = BO_USE_RENDER_MASK;
const uint64_t texture_only = BO_USE_TEXTURE_MASK;
uint64_t render_flags = BO_USE_RENDER_MASK;
Expand Down