drm_hwcomposer: Move GetCtm to Properties
Move the handling of the sysprop for how to handle CTM to the Properties class. Change-Id: I049c8a726fc68576e884b2a7a618a23521d5ed2b
This commit is contained in:
parent
51d588a99e
commit
0f9eae2291
4 changed files with 32 additions and 18 deletions
|
|
@ -15,9 +15,13 @@
|
|||
*/
|
||||
|
||||
#include "properties.h"
|
||||
#include <android-base/properties.h>
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <android-base/properties.h>
|
||||
|
||||
#include "utils/log.h"
|
||||
|
||||
namespace android {
|
||||
|
||||
/**
|
||||
|
|
@ -52,4 +56,22 @@ auto Properties::EnableVirtualDisplay() -> bool {
|
|||
return (property_get_bool("vendor.hwc.drm.enable_virtual_display", 0) != 0);
|
||||
}
|
||||
|
||||
auto Properties::GetCtmHandling() -> CtmHandling {
|
||||
char proptext[PROPERTY_VALUE_MAX];
|
||||
constexpr char kDrmOrGpu[] = "DRM_OR_GPU";
|
||||
constexpr char kDrmOrIgnore[] = "DRM_OR_IGNORE";
|
||||
property_get("vendor.hwc.drm.ctm", proptext, "");
|
||||
if (strncmp(proptext, kDrmOrGpu, sizeof(kDrmOrGpu)) == 0) {
|
||||
return CtmHandling::kDrmOrGpu;
|
||||
}
|
||||
if (strncmp(proptext, kDrmOrIgnore, sizeof(kDrmOrIgnore)) == 0) {
|
||||
return CtmHandling::kDrmOrIgnore;
|
||||
}
|
||||
|
||||
ALOGE_IF(proptext[0] != '\0', "Invalid value for vendor.hwc.drm.ctm: %s",
|
||||
proptext);
|
||||
// Default value.
|
||||
return CtmHandling::kDrmOrGpu;
|
||||
}
|
||||
|
||||
} // namespace android
|
||||
|
|
@ -74,10 +74,16 @@ auto inline property_get_bool(const char *key, int8_t default_value) -> int8_t {
|
|||
|
||||
#endif
|
||||
|
||||
#include <optional>
|
||||
#include <string>
|
||||
|
||||
namespace android {
|
||||
|
||||
enum class CtmHandling {
|
||||
kDrmOrGpu, /* Handled by DRM is possible, otherwise by GPU */
|
||||
kDrmOrIgnore, /* Handled by DRM is possible, otherwise displayed as is */
|
||||
};
|
||||
|
||||
class Properties {
|
||||
public:
|
||||
static auto IsPresentFenceNotReliable() -> bool;
|
||||
|
|
@ -86,6 +92,7 @@ class Properties {
|
|||
static auto UseOverlayPlanes() -> bool;
|
||||
static auto ScaleWithGpu() -> bool;
|
||||
static auto EnableVirtualDisplay() -> bool;
|
||||
static auto GetCtmHandling() -> CtmHandling;
|
||||
};
|
||||
|
||||
} // namespace android
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue