diff options
author | Linux Build Service Account <lnxbuild@localhost> | 2021-09-14 03:08:09 -0700 |
---|---|---|
committer | Linux Build Service Account <lnxbuild@localhost> | 2021-09-14 03:08:09 -0700 |
commit | ab3d9090a646071d6c07d2c083de2026983d4214 (patch) | |
tree | 2e58e74f982d3ea37d60210870ed1f1ff63c16f6 | |
parent | 5b8c0838a1301bf35e1b2174d6a20f6bffc7b6e0 (diff) | |
parent | 56fb1052841d19f3619289f6e0ae12c6424c2018 (diff) |
Merge 56fb1052841d19f3619289f6e0ae12c6424c2018 on remote branch
Change-Id: I2ef2a93e26a924a0e1683a5fbc52777efced86b7
-rw-r--r-- | composer/hwc_display.cpp | 14 | ||||
-rw-r--r-- | init/init.qti.display_boot.sh | 24 | ||||
-rw-r--r-- | libdrmutils/drm_master.cpp | 5 | ||||
-rw-r--r-- | liblight/lights.c | 75 | ||||
-rw-r--r-- | sdm/include/core/layer_stack.h | 11 |
5 files changed, 95 insertions, 34 deletions
diff --git a/composer/hwc_display.cpp b/composer/hwc_display.cpp index 4df0665d..e0074945 100644 --- a/composer/hwc_display.cpp +++ b/composer/hwc_display.cpp @@ -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; diff --git a/init/init.qti.display_boot.sh b/init/init.qti.display_boot.sh index 8e57c068..917dea1d 100644 --- a/init/init.qti.display_boot.sh +++ b/init/init.qti.display_boot.sh @@ -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 diff --git a/libdrmutils/drm_master.cpp b/libdrmutils/drm_master.cpp index f0d14b1b..6b27db9c 100644 --- a/libdrmutils/drm_master.cpp +++ b/libdrmutils/drm_master.cpp @@ -1,5 +1,5 @@ /* -* Copyright (c) 2017 - 2018, The Linux Foundation. All rights reserved. +* Copyright (c) 2017 - 2018, 2021, The Linux Foundation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -37,6 +37,9 @@ // that doesn't use keyword "virtual" for a variable name. Not doing so leads to the kernel version // of drm.h being included causing compilation to fail #include <drm/msm_drm.h> +#ifdef KERNEL_5_4 +#include <drm/sde_drm.h> +#endif #include <algorithm> #include <iterator> diff --git a/liblight/lights.c b/liblight/lights.c index f74fb542..9dabafe9 100644 --- a/liblight/lights.c +++ b/liblight/lights.c @@ -1,5 +1,6 @@ /* - * Copyright (C) 2014, 2017-2018 The Linux Foundation. All rights reserved. + * Copyright (C) 2014, 2017-2018, 2020-2021, The Linux Foundation. + * All rights reserved. * Not a contribution * Copyright (C) 2008 The Android Open Source Project * @@ -81,6 +82,21 @@ void init_globals(void) pthread_mutex_init(&g_lock, NULL); } +static int write_str(char const* path, char const* str) +{ + int fd; + + fd = open(path, O_RDWR); + if (fd >= 0) { + ssize_t amt = write(fd, str, strlen(str)); + close(fd); + return amt == -1 ? -errno : 0; + } + + ALOGE("write_str failed to open %s, errno = %d\n", path, errno); + return -errno; +} + static int write_int(char const* path, int value) { int fd; @@ -176,30 +192,59 @@ set_light_backlight(struct light_device_t* dev, static int set_rgb_led_brightness(enum rgb_led led, int brightness) { char file[48]; + int rc; + + snprintf(file, sizeof(file), "/sys/class/leds/%s/trigger", led_names[led]); + rc = write_str(file, "none"); + if (rc < 0) { + ALOGD("%s failed to set trigger to none\n", led_names[led]); + return rc; + } snprintf(file, sizeof(file), "/sys/class/leds/%s/brightness", led_names[led]); - return write_int(file, brightness); + rc = write_int(file, brightness); + if (rc < 0) + return rc; + + return rc; } static int set_rgb_led_timer_trigger(enum rgb_led led, int onMS, int offMS) { - char file[48]; + char file_on[48]; + char file_off[48]; int rc; + int retries = 20; - snprintf(file, sizeof(file), "/sys/class/leds/%s/delay_off", led_names[led]); - rc = write_int(file, offMS); - if (rc < 0) - goto out; + snprintf(file_on, sizeof(file_on), "/sys/class/leds/%s/trigger", led_names[led]); + rc = write_str(file_on, "timer"); + if (rc < 0) { + ALOGD("%s doesn't support timer trigger\n", led_names[led]); + return rc; + } - snprintf(file, sizeof(file), "/sys/class/leds/%s/delay_on", led_names[led]); - rc = write_int(file, onMS); - if (rc < 0) - goto out; + snprintf(file_off, sizeof(file_off), "/sys/class/leds/%s/delay_off", led_names[led]); + snprintf(file_on, sizeof(file_on), "/sys/class/leds/%s/delay_on", led_names[led]); + + while(retries--) { + ALOGD("retry %d set delay_off and delay_on\n", retries); + usleep(2000); + + rc = write_int(file_off, offMS); + if (rc < 0) + continue; + + rc = write_int(file_on, onMS); + if (!rc) + break; + } + + if (rc < 0) { + ALOGE("Error in writing to delay_on/off for %s\n", led_names[led]); + return rc; + } return 0; -out: - ALOGD("%s doesn't support timer trigger\n", led_names[led]); - return rc; } static int set_rgb_led_hw_blink(enum rgb_led led, int blink) @@ -208,7 +253,7 @@ static int set_rgb_led_hw_blink(enum rgb_led led, int blink) snprintf(file, sizeof(file), "/sys/class/leds/%s/breath", led_names[led]); if (!file_exists(file)) - snprintf(file, sizeof(file), "/sys/class/leds/%s/blink", led_names[led]); + return -1; return write_int(file, blink); } diff --git a/sdm/include/core/layer_stack.h b/sdm/include/core/layer_stack.h index 0c9841f3..e927a5e6 100644 --- a/sdm/include/core/layer_stack.h +++ b/sdm/include/core/layer_stack.h @@ -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. @@ -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 @@ -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 |