set_format_(gralloc1_dvc, temp->gralloc1_buffer_descriptor_t_, pixel_format);
#ifdef ENABLE_RBC
+ uint64_t modifier = 0;
if (set_modifier_) {
- uint64_t modifier = 0;
if (preferred_modifier != -1) {
modifier = preferred_modifier;
- } else {
- modifier = choose_drm_modifier(format);
}
-
set_modifier_(gralloc1_dvc, temp->gralloc1_buffer_descriptor_t_, modifier);
}
- if (modifier_used) {
+ if (modifier_used && modifier != DRM_FORMAT_MOD_NONE) {
*modifier_used = true;
}
#else
usage |= GRALLOC1_CONSUMER_USAGE_HWCOMPOSER |
GRALLOC1_PRODUCER_USAGE_GPU_RENDER_TARGET |
GRALLOC1_CONSUMER_USAGE_GPU_TEXTURE;
- } else if (layer_type == hwcomposer::kLayerVideo) {
+ layer_type = hwcomposer::kLayerNormal;
+ } else if (layer_type == hwcomposer::kLayerVideo ||
+ layer_type == hwcomposer::kLayerProtected) {
switch (pixel_format) {
case HAL_PIXEL_FORMAT_YCbCr_422_I:
case HAL_PIXEL_FORMAT_Y8:
}
temp->hwc_buffer_ = true;
+ temp->meta_data_.usage_ = (hwcomposer::HWCLayerType)layer_type;
*handle = temp;
return true;
}
bool Gralloc1BufferHandler::GetInterlace(HWCNativeHandle handle) const {
- if (((struct cros_gralloc_handle *)handle->handle_)->is_interlaced > 0)
+ if (((const struct cros_gralloc_handle *)handle->handle_)->is_interlaced > 0)
return true;
else
return false;