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

Conversation

@yuanzhel
Copy link
Contributor

@yuanzhel yuanzhel commented Aug 31, 2020

Copy link
Contributor

@shuangwan01 shuangwan01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM


if (display_state_ & kNeedsModeset) {
/* KK: Put to check only if input layer is a hdr */
for (const DisplayPlaneState &comp_plane : composition_planes) {
Copy link
Contributor

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

Copy link
Contributor

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

return false;
}

if (!ApplyPendingHdr(pset.get(), &color_state)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

Copy link
Contributor

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

target->hdr_md_blob_id) < 0 ||
drmModeAtomicAddProperty(property_set, connector_, colorspace_op_prop_,
to_kernel_colorspace(color_state.o_cs)) < 0;
if (ret) {
Copy link
Contributor

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.

*outMinLuminance = float(outminluminance);
}

return true;
Copy link
Contributor

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.

float *outMaxLuminance,
float *outMaxAverageLuminance,
float *outMinLuminance) {
return true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

default shall be false.

float *outMaxLuminance,
float *outMaxAverageLuminance,
float *outMinLuminance) {
return true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

default shall be false.

float *outMaxLuminance,
float *outMaxAverageLuminance,
float *outMinLuminance) {
return true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

default shall be false.

Copy link
Contributor

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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

default shall be false.

Copy link
Contributor

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

return;
}

display_hdrMd = (struct drm_edid_hdr_metadata_static *)malloc(
Copy link
Contributor

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?

bool GetDisplayIdentificationData(uint8_t *outPort, uint32_t *outDataSize,
uint8_t *outData) override;

void GetDisplayCapabilities(uint32_t *numCapabilities,
Copy link
Contributor

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.

LayerComposition actual_composition_ = kAll;
HWCLayerType type_ = kLayerNormal;

struct hdr_metadata hdrmetadata;
Copy link
Contributor

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hdr_metadata_
color_space_

float *outMaxLuminance,
float *outMaxAverageLuminance,
float *outMinLuminance) {
return true;
Copy link
Contributor

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

bool GetDisplayIdentificationData(uint8_t *outPort, uint32_t *outDataSize,
uint8_t *outData) override;

void GetDisplayCapabilities(uint32_t *numCapabilities,
Copy link
Contributor

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;
Copy link
Contributor

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

#include <hwcdefs.h>

#include <platformdefines.h>
#include "hdr_metadata_defs.h"
Copy link
Contributor

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>

uint32_t solid_color_ = 0xff;
bool use_for_mosaic_ = false;

struct hdr_metadata hdr_mdata;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hdr_mdata_
colorspace_

Copy link
Contributor

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

@@ -0,0 +1,657 @@
/*
Copy link
Contributor

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?

*/

#include "drmdisplay.h"
#include "hdr_metadata_defs.h"
Copy link
Contributor

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 <>

#include "displayplanemanager.h"
#include "displayqueue.h"
#include "drmdisplaymanager.h"
#include "hdr_metadata_defs.h"
Copy link
Contributor

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?


bool DrmDisplay::GetPerFrameMetadataKeys(uint32_t *outNumKeys,
int32_t *outKeys) {
*outNumKeys = KEY_NUM_PER_FRAME_METADATA_KEYS;
Copy link
Contributor

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

return true;
for (int i = 0; i < KEY_NUM_PER_FRAME_METADATA_KEYS; i++) {
*(outKeys + i) = i;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

outKey[i] = i;

@Shao-Feng
Copy link
Contributor

In original coding style, we use "_" in parameter name, instead of Upcase

uint32_t prefer_display_mode_ = 0;
uint32_t perf_display_mode_ = 0;
std::string display_name_ = "";
std::string display_name_;
Copy link
Contributor

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_

std::vector<int32_t> current_color_mode_ = {HAL_COLOR_MODE_NATIVE};

/* Display's static HDR metadata */
struct drm_edid_hdr_metadata_static *display_hdrMd;
Copy link
Contributor

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 <yuanzhe.liu@intel.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants