Skip to content
This repository has been archived by the owner on Oct 8, 2024. It is now read-only.

Added the HDR & WCG support for Android. #665

Open
wants to merge 1 commit into
base: hdr_invest
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions common/core/logicaldisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,4 +249,30 @@ void LogicalDisplay::GetDisplayCapabilities(uint32_t *numCapabilities,
physical_display_->GetDisplayCapabilities(numCapabilities, capabilities);
}

bool LogicalDisplay::GetHdrCapabilities(uint32_t *outNumTypes,
int32_t *outTypes,
float *outMaxLuminance,
float *outMaxAverageLuminance,
float *outMinLuminance) {
return true;
}

bool LogicalDisplay::GetRenderIntents(int32_t mode, uint32_t *outNumIntents,
int32_t *outIntents) {
return true;
}

bool LogicalDisplay::GetPerFrameMetadataKeys(uint32_t *outNumKeys,
int32_t *outKeys) {
return true;
}

bool LogicalDisplay::SetColorMode(int32_t mode) {
return true;
}

bool LogicalDisplay::GetColorModes(uint32_t *num_modes, int32_t *modes) {
return true;
}

} // namespace hwcomposer
13 changes: 13 additions & 0 deletions common/core/logicaldisplay.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,19 @@ class LogicalDisplay : public NativeDisplay {
void GetDisplayCapabilities(uint32_t *numCapabilities,
uint32_t *capabilities) override;

bool GetHdrCapabilities(uint32_t *outNumTypes, int32_t *outTypes,
float *outMaxLuminance, float *outMaxAverageLuminance,
float *outMinLuminance) override;

bool GetPerFrameMetadataKeys(uint32_t *outNumKeys, int32_t *outKeys) override;

bool GetRenderIntents(int32_t mode, uint32_t *outNumIntents,
int32_t *outIntents) override;

bool SetColorMode(int32_t mode) override;

bool GetColorModes(uint32_t *num_modes, int32_t *modes) override;

uint32_t GetXTranslation() override {
return (((physical_display_->Width()) / total_divisions_) * index_);
}
Expand Down
25 changes: 25 additions & 0 deletions common/core/mosaicdisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,31 @@ void MosaicDisplay::GetDisplayCapabilities(uint32_t *numCapabilities,
}
}

bool MosaicDisplay::GetHdrCapabilities(uint32_t *outNumTypes, int32_t *outTypes,
float *outMaxLuminance,
float *outMaxAverageLuminance,
float *outMinLuminance) {
return true;
}

bool MosaicDisplay::SetColorMode(int32_t mode) {
return true;
}

bool MosaicDisplay::GetColorModes(uint32_t *num_modes, int32_t *modes) {
return true;
}

bool MosaicDisplay::GetPerFrameMetadataKeys(uint32_t *outNumKeys,
int32_t *outKeys) {
return true;
}

bool MosaicDisplay::GetRenderIntents(int32_t mode, uint32_t *outNumIntents,
int32_t *outIntents) {
return true;
}

void MosaicDisplay::SetHDCPState(HWCContentProtection state,
HWCContentType content_type) {
uint32_t size = physical_displays_.size();
Expand Down
12 changes: 12 additions & 0 deletions common/core/mosaicdisplay.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,18 @@ class MosaicDisplay : public NativeDisplay {
void GetDisplayCapabilities(uint32_t *numCapabilities,
uint32_t *capabilities) override;

bool GetHdrCapabilities(uint32_t *outNumTypes, int32_t *outTypes,
float *outMaxLuminance, float *outMaxAverageLuminance,
float *outMinLuminance) override;
bool GetPerFrameMetadataKeys(uint32_t *outNumKeys, int32_t *outKeys) override;

bool GetRenderIntents(int32_t mode, uint32_t *outNumIntents,
int32_t *outIntents) override;

bool SetColorMode(int32_t mode) override;

bool GetColorModes(uint32_t *num_modes, int32_t *modes) override;

uint32_t GetXTranslation() override {
return 0;
}
Expand Down
2 changes: 2 additions & 0 deletions common/core/overlaylayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,8 @@ void OverlayLayer::InitializeState(HwcLayer* layer,
dataspace_ = layer->GetDataSpace();
blending_ = layer->GetBlending();
solid_color_ = layer->GetSolidColor();
hdrmetadata = layer->GetHdrMetadata();
color_space = layer->GetColorSpace();
TransformDamage(layer, max_height, max_width);

if (previous_layer && layer->HasZorderChanged()) {
Expand Down
15 changes: 13 additions & 2 deletions common/core/overlaylayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
#define COMMON_CORE_OVERLAYLAYER_H_

#include <hwcdefs.h>
#include <platformdefines.h>

#include <hwclayer.h>
#include <platformdefines.h>
#include <memory>
#include "hdr_metadata_defs.h"

#include "overlaybuffer.h"

Expand Down Expand Up @@ -241,6 +241,14 @@ struct OverlayLayer {
return state_ & kForcePartialClear;
}

struct hdr_metadata GetHdrMetadata() {
return hdrmetadata;
}

uint32_t GetColorSpace() {
return color_space;
}

uint32_t GetSolidColor() {
return solid_color_;
}
Expand Down Expand Up @@ -316,6 +324,9 @@ struct OverlayLayer {
LayerComposition supported_composition_ = kAll;
LayerComposition actual_composition_ = kAll;
HWCLayerType type_ = kLayerNormal;

struct hdr_metadata hdrmetadata;
uint32_t color_space;
};

} // namespace hwcomposer
Expand Down
26 changes: 26 additions & 0 deletions common/display/virtualdisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,32 @@ void VirtualDisplay::GetDisplayCapabilities(uint32_t *numCapabilities,
uint32_t *capabilities) {
}

bool VirtualDisplay::GetHdrCapabilities(uint32_t *outNumTypes,
int32_t *outTypes,
float *outMaxLuminance,
float *outMaxAverageLuminance,
float *outMinLuminance) {
return true;
}

bool VirtualDisplay::GetPerFrameMetadataKeys(uint32_t *outNumKeys,
int32_t *outKeys) {
return true;
}

bool VirtualDisplay::GetRenderIntents(int32_t mode, uint32_t *outNumIntents,
int32_t *outIntents) {
return true;
}

bool VirtualDisplay::SetColorMode(int32_t mode) {
return true;
}

bool VirtualDisplay::GetColorModes(uint32_t *num_modes, int32_t *modes) {
return true;
}

int VirtualDisplay::GetDisplayPipe() {
return -1;
}
Expand Down
12 changes: 12 additions & 0 deletions common/display/virtualdisplay.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,18 @@ class VirtualDisplay : public NativeDisplay {
void GetDisplayCapabilities(uint32_t *numCapabilities,
uint32_t *capabilities) override;

bool GetHdrCapabilities(uint32_t *outNumTypes, int32_t *outTypes,
float *outMaxLuminance, float *outMaxAverageLuminance,
float *outMinLuminance) override;
bool GetPerFrameMetadataKeys(uint32_t *outNumKeys, int32_t *outKeys) override;

bool GetRenderIntents(int32_t mode, uint32_t *outNumIntents,
int32_t *outIntents) override;

bool SetColorMode(int32_t mode) override;

bool GetColorModes(uint32_t *num_modes, int32_t *modes) override;

int GetDisplayPipe() override;

bool SetPowerMode(uint32_t power_mode) override;
Expand Down
28 changes: 28 additions & 0 deletions common/display/virtualpanoramadisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,34 @@ bool VirtualPanoramaDisplay::GetDisplayAttribute(uint32_t /*config*/,
return true;
}

bool VirtualPanoramaDisplay::GetHdrCapabilities(uint32_t *outNumTypes,
int32_t *outTypes,
float *outMaxLuminance,
float *outMaxAverageLuminance,
float *outMinLuminance) {
return true;
}

bool VirtualPanoramaDisplay::GetPerFrameMetadataKeys(uint32_t *outNumKeys,
int32_t *outKeys) {
return true;
}

bool VirtualPanoramaDisplay::GetRenderIntents(int32_t mode,
uint32_t *outNumIntents,
int32_t *outIntents) {
return true;
}

bool VirtualPanoramaDisplay::SetColorMode(int32_t mode) {
return true;
}

bool VirtualPanoramaDisplay::GetColorModes(uint32_t *num_modes,
int32_t *modes) {
return true;
}

bool VirtualPanoramaDisplay::GetDisplayConfigs(uint32_t *num_configs,
uint32_t *configs) {
if (!num_configs)
Expand Down
10 changes: 10 additions & 0 deletions common/display/virtualpanoramadisplay.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,17 @@ class VirtualPanoramaDisplay : public NativeDisplay {
bool GetDisplayName(uint32_t *size, char *name) override;
int GetDisplayPipe() override;

bool GetHdrCapabilities(uint32_t *outNumTypes, int32_t *outTypes,
float *outMaxLuminance, float *outMaxAverageLuminance,
float *outMinLuminance) override;
bool GetPerFrameMetadataKeys(uint32_t *outNumKeys, int32_t *outKeys) override;

bool GetRenderIntents(int32_t mode, uint32_t *outNumIntents,
int32_t *outIntents) override;

bool SetPowerMode(uint32_t power_mode) override;
bool SetColorMode(int32_t mode) override;
bool GetColorModes(uint32_t *num_modes, int32_t *modes) override;

#ifdef HYPER_DMABUF_SHARING
bool SetHyperDmaBufMode(uint32_t mode);
Expand Down
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ AX_COMPILE_CHECK_SIZEOF(size_t, [#include <stdint.h>])
#######################################################################

PKG_CHECK_MODULES(DRM, [libdrm])
PKG_CHECK_MODULES(DRM_INTEL, [libdrm_intel])
PKG_CHECK_MODULES(GBM, [gbm])
PKG_CHECK_MODULES(EGL, [egl])
PKG_CHECK_MODULES(GLES2, [glesv2])
Expand Down
Loading