Skip to content

Commit

Permalink
hwc: Add layer request flag for format and color metadata.
Browse files Browse the repository at this point in the history
Change-Id: I2345d71cfc211f386d5dd97fb8c2d21cc4a82f86
  • Loading branch information
Devanshi Bansal authored and Gerrit - the friendly Code Review server committed Aug 18, 2021
1 parent 9cc7717 commit fe32771
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 18 deletions.
14 changes: 7 additions & 7 deletions composer/hwc_display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2802,25 +2802,25 @@ int HWCDisplay::GetActiveConfigIndex() {

HWC2::Error HWCDisplay::GetClientTargetProperty(ClientTargetProperty *out_client_target_property) {

Layer *client_target_layer = client_target_->GetSDMLayer();
if (!client_target_layer->request.flags.update_format) {
Layer *client_layer = client_target_->GetSDMLayer();
if (!client_layer->request.flags.update_format) {
return HWC2::Error::None;
}
int32_t format = 0;
uint64_t flags = 0;
auto err = buffer_allocator_->SetBufferInfo(client_target_layer->request.format, &format,
auto err = buffer_allocator_->SetBufferInfo(client_layer->request.format, &format,
&flags);
if (err) {
DLOGE("Invalid format: %s requested", GetFormatString(client_target_layer->request.format));
DLOGE("Invalid format: %s requested", GetFormatString(client_layer->request.format));
return HWC2::Error::BadParameter;
}
Dataspace dataspace;
DisplayError error = ColorMetadataToDataspace(layer_stack_.gpu_target_color_metadata,
DisplayError error = ColorMetadataToDataspace(client_layer->request.color_metadata,
&dataspace);
if (error != kErrorNone) {
DLOGE("Invalid Dataspace requested: Primaries = %d Transfer = %d ds = %d",
layer_stack_.gpu_target_color_metadata.colorPrimaries,
layer_stack_.gpu_target_color_metadata.transfer, dataspace);
client_layer->request.color_metadata.colorPrimaries,
client_layer->request.color_metadata.transfer, dataspace);
return HWC2::Error::BadParameter;
}
out_client_target_property->dataspace = dataspace;
Expand Down
24 changes: 17 additions & 7 deletions init/init.qti.display_boot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,23 @@ case "$target" in
# Set property to differentiate bengal and khaje
# Soc Id for khaje is 518
case "$soc_hwid" in
518)
# Set property for khaje
setprop vendor.display.disable_layer_stitch 1
setprop vendor.display.enable_rounded_corner 1
setprop vendor.display.disable_rounded_corner_thread 0
setprop vendor.display.enable_rc_support 1
setprop vendor.display.enable_perf_hint_large_comp_cycle 1
518)
# Set property for khaje
setprop vendor.display.disable_layer_stitch 1
setprop vendor.display.enable_rounded_corner 1
setprop vendor.display.disable_rounded_corner_thread 0
setprop vendor.display.enable_rc_support 1
setprop vendor.display.enable_perf_hint_large_comp_cycle 1
;;
esac
;;
"lito")
# Set property to differentiate lito and lagoon
case "$soc_hwid" in
434|459)
#Set property for lagoon
setprop vendor.display.enable_hdr10_gpu_target 1
;;
esac
;;
esac
11 changes: 7 additions & 4 deletions sdm/include/core/layer_stack.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,9 @@ struct LayerRequestFlags {
uint32_t rc: 1; //!< This flag will be set by SDM when the layer is drawn by RC HW.
uint32_t update_format: 1; //!< This flag will be set by SDM when layer format is updated
//!< The buffer format is mentioned in the LayerRequest Format
uint32_t update_color_metadata: 1; //!< This flag will be set by SDM when layer color
//!< metadata is updated. The color metadata is
//!< mentioned in the LayerRequest Format
};
uint32_t request_flags = 0; //!< For initialization purpose only.
//!< Shall not be refered directly.
Expand All @@ -222,6 +225,10 @@ struct LayerRequest {
LayerRequestFlags flags; // Flags associated with this request
LayerBufferFormat format = kFormatRGBA8888; // Requested format - Used with tone_map and
// update_format flags
ColorMetaData color_metadata = { .colorPrimaries = ColorPrimaries_BT709_5,
.range = Range_Full,
.transfer = Transfer_sRGB };
// Requested color metadata
uint32_t width = 0; // Requested unaligned width.
// Used with tone_map flag
uint32_t height = 0; // Requested unalighed height
Expand Down Expand Up @@ -462,10 +469,6 @@ struct LayerStack {

uint64_t elapse_timestamp = 0; //!< system time until which display commit needs to be held

ColorMetaData gpu_target_color_metadata = { .colorPrimaries = ColorPrimaries_BT709_5,
.range = Range_Full,
.transfer = Transfer_sRGB };
//!< o/p - from SDM, applies to the Frame
};

} // namespace sdm
Expand Down

0 comments on commit fe32771

Please sign in to comment.