Conversation
wsi/drm/drmdisplay.cpp
Outdated
|
|
||
| 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.
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.
also need check if the display supports HDR here, for example check display_hdrMd
wsi/drm/drmdisplay.cpp
Outdated
| return false; | ||
| } | ||
|
|
||
| if (!ApplyPendingHdr(pset.get(), &color_state)) { |
There was a problem hiding this comment.
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.
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.
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.
default shall be false.
common/core/mosaicdisplay.cpp
Outdated
| float *outMaxLuminance, | ||
| float *outMaxAverageLuminance, | ||
| float *outMinLuminance) { | ||
| return true; |
There was a problem hiding this comment.
default shall be false.
common/display/virtualdisplay.cpp
Outdated
| float *outMaxLuminance, | ||
| float *outMaxAverageLuminance, | ||
| float *outMinLuminance) { | ||
| return true; |
There was a problem hiding this comment.
default shall be false.
There was a problem hiding this comment.
same with Mosaic and logic
| float *outMaxLuminance, | ||
| float *outMaxAverageLuminance, | ||
| float *outMinLuminance) { | ||
| return true; |
There was a problem hiding this comment.
default shall be false.
There was a problem hiding this comment.
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.
didn't see where display_hdrMd is freed?
| @@ -111,6 +111,19 @@ class LogicalDisplay : public NativeDisplay { | |||
| void GetDisplayCapabilities(uint32_t *numCapabilities, | |||
There was a problem hiding this comment.
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
| LayerComposition actual_composition_ = kAll; | ||
| HWCLayerType type_ = kLayerNormal; | ||
|
|
||
| struct hdr_metadata hdrmetadata; |
There was a problem hiding this comment.
property should be named with "_" at the end to be different with variable in method
There was a problem hiding this comment.
hdr_metadata_
color_space_
common/display/virtualdisplay.cpp
Outdated
| float *outMaxLuminance, | ||
| float *outMaxAverageLuminance, | ||
| float *outMinLuminance) { | ||
| return true; |
There was a problem hiding this comment.
same with Mosaic and logic
| @@ -83,6 +83,18 @@ class VirtualDisplay : public NativeDisplay { | |||
| void GetDisplayCapabilities(uint32_t *numCapabilities, | |||
There was a problem hiding this comment.
same with mosaic and logic
| float *outMaxLuminance, | ||
| float *outMaxAverageLuminance, | ||
| float *outMinLuminance) { | ||
| return true; |
There was a problem hiding this comment.
same with mosaic and logic
public/hwclayer.h
Outdated
| #include <hwcdefs.h> | ||
|
|
||
| #include <platformdefines.h> | ||
| #include "hdr_metadata_defs.h" |
There was a problem hiding this comment.
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
| uint32_t solid_color_ = 0xff; | ||
| bool use_for_mosaic_ = false; | ||
|
|
||
| struct hdr_metadata hdr_mdata; |
There was a problem hiding this comment.
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.
tests is not updated for a long time, did you ever try to run this test?
wsi/drm/drmdisplay.cpp
Outdated
| */ | ||
|
|
||
| #include "drmdisplay.h" | ||
| #include "hdr_metadata_defs.h" |
There was a problem hiding this comment.
it is a public header file, use <>
wsi/drm/drmdisplay.cpp
Outdated
| #include "displayplanemanager.h" | ||
| #include "displayqueue.h" | ||
| #include "drmdisplaymanager.h" | ||
| #include "hdr_metadata_defs.h" |
There was a problem hiding this comment.
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.
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; | ||
| } |
|
In original coding style, we use "_" in parameter name, instead of Upcase |
wsi/drm/drmdisplay.h
Outdated
| 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.
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.
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 <yuanzhe.liu@intel.com>
This PR related to projectceladon/device-androidia-mixins#850