HWC: Set skip to layers with Non Integral Source Crop.
HWC modifies Source Crop to floor and ceil based to LT and RB respectively. This can result in flicker if there is switch in Composition between MDP and GPU. Instead mark the layer as skip. Change-Id: I35d9461d2db44c9d9b4402b17c44a569e1f705c9 Source: I2f7a62fbf5ae2a0c0d13f15118b053afbabf99c8 CRs-Fixed: 2143554
This commit is contained in:
committed by
Gerrit - the friendly Code Review server
parent
5145e9373f
commit
e05694e230
@@ -514,6 +514,7 @@ void HWCDisplay::BuildLayerStack() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool is_secure = false;
|
||||||
const private_handle_t *handle =
|
const private_handle_t *handle =
|
||||||
reinterpret_cast<const private_handle_t *>(layer->input_buffer.buffer_id);
|
reinterpret_cast<const private_handle_t *>(layer->input_buffer.buffer_id);
|
||||||
if (handle) {
|
if (handle) {
|
||||||
@@ -521,21 +522,17 @@ void HWCDisplay::BuildLayerStack() {
|
|||||||
layer_stack_.flags.video_present = true;
|
layer_stack_.flags.video_present = true;
|
||||||
}
|
}
|
||||||
// TZ Protected Buffer - L1
|
// TZ Protected Buffer - L1
|
||||||
if (handle->flags & private_handle_t::PRIV_FLAGS_SECURE_BUFFER) {
|
|
||||||
layer_stack_.flags.secure_present = true;
|
|
||||||
}
|
|
||||||
// Gralloc Usage Protected Buffer - L3 - which needs to be treated as Secure & avoid fallback
|
// Gralloc Usage Protected Buffer - L3 - which needs to be treated as Secure & avoid fallback
|
||||||
if (handle->flags & private_handle_t::PRIV_FLAGS_PROTECTED_BUFFER) {
|
if (handle->flags & private_handle_t::PRIV_FLAGS_PROTECTED_BUFFER ||
|
||||||
|
handle->flags & private_handle_t::PRIV_FLAGS_SECURE_BUFFER) {
|
||||||
layer_stack_.flags.secure_present = true;
|
layer_stack_.flags.secure_present = true;
|
||||||
|
is_secure = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (layer->flags.skip) {
|
|
||||||
layer_stack_.flags.skip_present = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (layer->input_buffer.flags.secure_display) {
|
if (layer->input_buffer.flags.secure_display) {
|
||||||
secure_display_active = true;
|
secure_display_active = true;
|
||||||
|
is_secure = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hwc_layer->IsSingleBuffered() &&
|
if (hwc_layer->IsSingleBuffered() &&
|
||||||
@@ -561,6 +558,14 @@ void HWCDisplay::BuildLayerStack() {
|
|||||||
layer_stack_.flags.hdr_present = true;
|
layer_stack_.flags.hdr_present = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (hwc_layer->IsNonIntegralSourceCrop() && !is_secure && !hdr_layer) {
|
||||||
|
layer->flags.skip = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (layer->flags.skip) {
|
||||||
|
layer_stack_.flags.skip_present = true;
|
||||||
|
}
|
||||||
|
|
||||||
// TODO(user): Move to a getter if this is needed at other places
|
// TODO(user): Move to a getter if this is needed at other places
|
||||||
hwc_rect_t scaled_display_frame = {INT(layer->dst_rect.left), INT(layer->dst_rect.top),
|
hwc_rect_t scaled_display_frame = {INT(layer->dst_rect.left), INT(layer->dst_rect.top),
|
||||||
INT(layer->dst_rect.right), INT(layer->dst_rect.bottom)};
|
INT(layer->dst_rect.right), INT(layer->dst_rect.bottom)};
|
||||||
|
|||||||
@@ -435,6 +435,10 @@ HWC2::Error HWCLayer::SetLayerPlaneAlpha(float alpha) {
|
|||||||
HWC2::Error HWCLayer::SetLayerSourceCrop(hwc_frect_t crop) {
|
HWC2::Error HWCLayer::SetLayerSourceCrop(hwc_frect_t crop) {
|
||||||
LayerRect src_rect = {};
|
LayerRect src_rect = {};
|
||||||
SetRect(crop, &src_rect);
|
SetRect(crop, &src_rect);
|
||||||
|
non_integral_source_crop_ = ((crop.left != roundf(crop.left)) ||
|
||||||
|
(crop.top != roundf(crop.top)) ||
|
||||||
|
(crop.right != roundf(crop.right)) ||
|
||||||
|
(crop.bottom != roundf(crop.bottom)));
|
||||||
if (layer_->src_rect != src_rect) {
|
if (layer_->src_rect != src_rect) {
|
||||||
geometry_changes_ |= kSourceCrop;
|
geometry_changes_ |= kSourceCrop;
|
||||||
layer_->src_rect = src_rect;
|
layer_->src_rect = src_rect;
|
||||||
|
|||||||
@@ -97,6 +97,7 @@ class HWCLayer {
|
|||||||
bool IsSingleBuffered() { return single_buffer_; }
|
bool IsSingleBuffered() { return single_buffer_; }
|
||||||
bool IsScalingPresent();
|
bool IsScalingPresent();
|
||||||
bool IsRotationPresent();
|
bool IsRotationPresent();
|
||||||
|
bool IsNonIntegralSourceCrop() { return non_integral_source_crop_; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Layer *layer_ = nullptr;
|
Layer *layer_ = nullptr;
|
||||||
@@ -112,6 +113,7 @@ class HWCLayer {
|
|||||||
bool needs_validate_ = true;
|
bool needs_validate_ = true;
|
||||||
bool single_buffer_ = false;
|
bool single_buffer_ = false;
|
||||||
int buffer_fd_ = -1;
|
int buffer_fd_ = -1;
|
||||||
|
bool non_integral_source_crop_ = false;
|
||||||
|
|
||||||
// Composition requested by client(SF)
|
// Composition requested by client(SF)
|
||||||
HWC2::Composition client_requested_ = HWC2::Composition::Device;
|
HWC2::Composition client_requested_ = HWC2::Composition::Device;
|
||||||
|
|||||||
Reference in New Issue
Block a user