-
Notifications
You must be signed in to change notification settings - Fork 81
HDR enable #701
base: master
Are you sure you want to change the base?
HDR enable #701
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
wsi/drm/drmdisplay.cpp
Outdated
@@ -782,10 +861,29 @@ bool DrmDisplay::Commit( | |||
display_queue_->ResetPlanes(pset.get()); | |||
|
|||
if (display_state_ & kNeedsModeset) { | |||
/* KK: Put to check only if input layer is a hdr */ | |||
for (const DisplayPlaneState &comp_plane : composition_planes) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to check if the layer is HDR layer, otherwise no need to apply HDR drm mode set
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also need check if the display supports HDR here, for example check display_hdrMd
wsi/drm/drmdisplay.cpp
Outdated
if (!ApplyPendingModeset(pset.get())) { | ||
ETRACE("Failed to Modeset."); | ||
return false; | ||
} | ||
|
||
if (!ApplyPendingHdr(pset.get(), &color_state)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
struct hdr_metadata final_hdr_metadata, layer_metadata
wsi/drm/drmdisplay.cpp
Outdated
target->hdr_md_blob_id) < 0 || | ||
drmModeAtomicAddProperty(property_set, connector_, colorspace_op_prop_, | ||
to_kernel_colorspace(color_state.o_cs)) < 0; | ||
if (ret) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
before return, need to call drmModeDestroyPropertyBlob to avoid memory leak.
wsi/drm/drmdisplay.cpp
Outdated
*outMinLuminance = float(outminluminance); | ||
} | ||
|
||
return true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will be always true, no matter if (display_hdrMd), should be wrong.
common/core/logicaldisplay.cpp
Outdated
float *outMaxLuminance, | ||
float *outMaxAverageLuminance, | ||
float *outMinLuminance) { | ||
return true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default shall be false.
common/core/mosaicdisplay.cpp
Outdated
float *outMaxLuminance, | ||
float *outMaxAverageLuminance, | ||
float *outMinLuminance) { | ||
return true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default shall be false.
common/display/virtualdisplay.cpp
Outdated
float *outMaxLuminance, | ||
float *outMaxAverageLuminance, | ||
float *outMinLuminance) { | ||
return true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default shall be false.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same with Mosaic and logic
float *outMaxLuminance, | ||
float *outMaxAverageLuminance, | ||
float *outMinLuminance) { | ||
return true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default shall be false.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same with mosaic and logic
wsi/drm/drmdisplay.cpp
Outdated
return; | ||
} | ||
|
||
display_hdrMd = (struct drm_edid_hdr_metadata_static *)malloc( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
didn't see where display_hdrMd is freed?
common/core/logicaldisplay.h
Outdated
@@ -111,6 +111,19 @@ class LogicalDisplay : public NativeDisplay { | |||
void GetDisplayCapabilities(uint32_t *numCapabilities, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does HDR only work on DrmDisplay?
if yes, no need to add this method into Logic and Mosaic display.
you can add a default method on Native display and return false.
common/core/overlaylayer.h
Outdated
@@ -316,6 +324,9 @@ struct OverlayLayer { | |||
LayerComposition supported_composition_ = kAll; | |||
LayerComposition actual_composition_ = kAll; | |||
HWCLayerType type_ = kLayerNormal; | |||
|
|||
struct hdr_metadata hdrmetadata; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
property should be named with "_" at the end to be different with variable in method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hdr_metadata_
color_space_
common/display/virtualdisplay.cpp
Outdated
float *outMaxLuminance, | ||
float *outMaxAverageLuminance, | ||
float *outMinLuminance) { | ||
return true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same with Mosaic and logic
common/display/virtualdisplay.h
Outdated
@@ -83,6 +83,18 @@ class VirtualDisplay : public NativeDisplay { | |||
void GetDisplayCapabilities(uint32_t *numCapabilities, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same with mosaic and logic
float *outMaxLuminance, | ||
float *outMaxAverageLuminance, | ||
float *outMinLuminance) { | ||
return true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same with mosaic and logic
public/hwclayer.h
Outdated
#include <platformdefines.h> | ||
#include "hdr_metadata_defs.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hdr_metadata_defs.h is also in public folder as same as hwcdefs.h
it is better to use <hdr_metadata_defs.h>
public/hwclayer.h
Outdated
@@ -347,6 +444,9 @@ struct HwcLayer { | |||
uint32_t solid_color_ = 0xff; | |||
bool use_for_mosaic_ = false; | |||
|
|||
struct hdr_metadata hdr_mdata; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hdr_mdata_
colorspace_
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and need to initialize with null and 0
tests/apps/linux_hdr_image_test.cpp
Outdated
@@ -0,0 +1,657 @@ | |||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tests is not updated for a long time, did you ever try to run this test?
wsi/drm/drmdisplay.cpp
Outdated
@@ -15,6 +15,7 @@ | |||
*/ | |||
|
|||
#include "drmdisplay.h" | |||
#include "hdr_metadata_defs.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is a public header file, use <>
wsi/drm/drmdisplay.cpp
Outdated
#include <algorithm> | ||
#include <sstream> | ||
#include <string> | ||
|
||
#include "displayplanemanager.h" | ||
#include "displayqueue.h" | ||
#include "drmdisplaymanager.h" | ||
#include "hdr_metadata_defs.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why it is included twice?
wsi/drm/drmdisplay.cpp
Outdated
|
||
bool DrmDisplay::GetPerFrameMetadataKeys(uint32_t *outNumKeys, | ||
int32_t *outKeys) { | ||
*outNumKeys = KEY_NUM_PER_FRAME_METADATA_KEYS; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
KEY_NUM_PER_FRAME_METADATA_KEYS is a enum, and not assigned with a value explicitly
wsi/drm/drmdisplay.cpp
Outdated
return true; | ||
for (int i = 0; i < KEY_NUM_PER_FRAME_METADATA_KEYS; i++) { | ||
*(outKeys + i) = i; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
outKey[i] = i;
In original coding style, we use "_" in parameter name, instead of Upcase |
wsi/drm/drmdisplay.h
Outdated
@@ -205,7 +307,18 @@ class DrmDisplay : public PhysicalDisplay { | |||
bool first_commit_ = false; | |||
uint32_t prefer_display_mode_ = 0; | |||
uint32_t perf_display_mode_ = 0; | |||
std::string display_name_ = ""; | |||
std::string display_name_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not initialize display_name_
wsi/drm/drmdisplay.h
Outdated
std::vector<int32_t> current_color_mode_ = {HAL_COLOR_MODE_NATIVE}; | ||
|
||
/* Display's static HDR metadata */ | ||
struct drm_edid_hdr_metadata_static *display_hdrMd; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need end with "_" for all propertys
implement vsync2.4 callback, setactiveconfigwithconstraints and getdisplayvsyncperiod. Add an empty SetDisplayBrightness to resolove boot problem Set the ALL_EDID_FLAG_PROPERTY to send SF all available modes. Tracked-On: OAM-92711 Signed-Off-By: Liu, Yuanzhe <[email protected]>
This PR related to projectceladon/device-androidia-mixins#850