Commit 98a0070b authored by Daniele Castagna's avatar Daniele Castagna Committed by Commit Bot

drm: Read and propagate panel orientation

On some new chromebooks the panel is mounted with a rotation
in respect to the natural orientation of the device.

KMS already exposes a property on the connector that can be used
to determine the orientation of the panel.

This CL reads the property and passes it around that it can be
read anywhere where we use DisplaySnapshots.

Bug: b/139500237 b/133207693
Change-Id: I4c75221051d30f23ae5203fdf0115a10713fa3f3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1758428Reviewed-by: default avatarRobert Sesek <rsesek@chromium.org>
Reviewed-by: default avatarTed Choc <tedchoc@chromium.org>
Reviewed-by: default avatarDaniel Nicoara <dnicoara@chromium.org>
Commit-Queue: Daniele Castagna <dcastagna@chromium.org>
Cr-Commit-Position: refs/heads/master@{#688232}
parent c6c27a48
...@@ -34,6 +34,7 @@ std::unique_ptr<display::DisplaySnapshot> CreateTestDisplaySnapshot( ...@@ -34,6 +34,7 @@ std::unique_ptr<display::DisplaySnapshot> CreateTestDisplaySnapshot(
gfx::ColorSpace() /* color_space */, std::string() /* display_name */, gfx::ColorSpace() /* color_space */, std::string() /* display_name */,
base::FilePath() /* sys_path */, base::FilePath() /* sys_path */,
display::DisplaySnapshot::DisplayModeList() /* modes */, display::DisplaySnapshot::DisplayModeList() /* modes */,
display::PanelOrientation::kNormal /* panel_orientation */,
std::vector<uint8_t>() /* edid */, nullptr /* current_mode */, std::vector<uint8_t>() /* edid */, nullptr /* current_mode */,
nullptr /* native_mode */, 0 /* product_id */, nullptr /* native_mode */, 0 /* product_id */,
display::kInvalidYearOfManufacture, display::kInvalidYearOfManufacture,
......
...@@ -311,6 +311,7 @@ FakeDisplaySnapshot::FakeDisplaySnapshot(int64_t display_id, ...@@ -311,6 +311,7 @@ FakeDisplaySnapshot::FakeDisplaySnapshot(int64_t display_id,
display_name, display_name,
base::FilePath(), base::FilePath(),
std::move(modes), std::move(modes),
display::PanelOrientation::kNormal,
std::vector<uint8_t>(), std::vector<uint8_t>(),
current_mode, current_mode,
native_mode, native_mode,
......
...@@ -21,4 +21,13 @@ enum HDCPState { ...@@ -21,4 +21,13 @@ enum HDCPState {
HDCP_STATE_UNDESIRED, HDCP_STATE_UNDESIRED,
HDCP_STATE_DESIRED, HDCP_STATE_DESIRED,
HDCP_STATE_ENABLED, HDCP_STATE_ENABLED,
}; };
\ No newline at end of file
// Corresponds to display::PanelOrientation.
enum PanelOrientation {
NORMAL = 0,
BOTTOM_UP = 1,
LEFT_UP = 2,
RIGHT_UP = 3
};
...@@ -108,4 +108,43 @@ bool EnumTraits<display::mojom::HDCPState, display::HDCPState>::FromMojom( ...@@ -108,4 +108,43 @@ bool EnumTraits<display::mojom::HDCPState, display::HDCPState>::FromMojom(
return false; return false;
} }
// static
display::mojom::PanelOrientation EnumTraits<
display::mojom::PanelOrientation,
display::PanelOrientation>::ToMojom(display::PanelOrientation rotation) {
switch (rotation) {
case display::PanelOrientation::kNormal:
return display::mojom::PanelOrientation::NORMAL;
case display::PanelOrientation::kBottomUp:
return display::mojom::PanelOrientation::BOTTOM_UP;
case display::PanelOrientation::kLeftUp:
return display::mojom::PanelOrientation::LEFT_UP;
case display::PanelOrientation::kRightUp:
return display::mojom::PanelOrientation::RIGHT_UP;
}
NOTREACHED();
return display::mojom::PanelOrientation::NORMAL;
}
// static
bool EnumTraits<display::mojom::PanelOrientation, display::PanelOrientation>::
FromMojom(display::mojom::PanelOrientation rotation,
display::PanelOrientation* out) {
switch (rotation) {
case display::mojom::PanelOrientation::NORMAL:
*out = display::PanelOrientation::kNormal;
return true;
case display::mojom::PanelOrientation::BOTTOM_UP:
*out = display::PanelOrientation::kBottomUp;
return true;
case display::mojom::PanelOrientation::LEFT_UP:
*out = display::PanelOrientation::kLeftUp;
return true;
case display::mojom::PanelOrientation::RIGHT_UP:
*out = display::PanelOrientation::kRightUp;
return true;
}
return false;
}
} // namespace mojo } // namespace mojo
...@@ -26,6 +26,14 @@ struct EnumTraits<display::mojom::HDCPState, display::HDCPState> { ...@@ -26,6 +26,14 @@ struct EnumTraits<display::mojom::HDCPState, display::HDCPState> {
display::HDCPState* out); display::HDCPState* out);
}; };
template <>
struct EnumTraits<display::mojom::PanelOrientation, display::PanelOrientation> {
static display::mojom::PanelOrientation ToMojom(
display::PanelOrientation type);
static bool FromMojom(display::mojom::PanelOrientation type,
display::PanelOrientation* out);
};
} // namespace mojo } // namespace mojo
#endif // UI_DISPLAY_MOJOM_DISPLAY_CONSTANTS_MOJOM_TRAITS_H_ #endif // UI_DISPLAY_MOJOM_DISPLAY_CONSTANTS_MOJOM_TRAITS_H_
...@@ -94,6 +94,7 @@ void CheckDisplaySnapShotMojoEqual(const DisplaySnapshot& input, ...@@ -94,6 +94,7 @@ void CheckDisplaySnapShotMojoEqual(const DisplaySnapshot& input,
for (size_t i = 0; i < input.modes().size(); i++) for (size_t i = 0; i < input.modes().size(); i++)
CheckDisplayModesEqual(input.modes()[i].get(), output.modes()[i].get()); CheckDisplayModesEqual(input.modes()[i].get(), output.modes()[i].get());
EXPECT_EQ(input.panel_orientation(), output.panel_orientation());
EXPECT_EQ(input.edid(), output.edid()); EXPECT_EQ(input.edid(), output.edid());
CheckDisplayModesEqual(input.current_mode(), output.current_mode()); CheckDisplayModesEqual(input.current_mode(), output.current_mode());
...@@ -275,8 +276,9 @@ TEST(DisplayStructTraitsTest, DisplaySnapshotCurrentAndNativeModesNull) { ...@@ -275,8 +276,9 @@ TEST(DisplayStructTraitsTest, DisplaySnapshotCurrentAndNativeModesNull) {
display_id, origin, physical_size, type, is_aspect_preserving_scaling, display_id, origin, physical_size, type, is_aspect_preserving_scaling,
has_overscan, has_color_correction_matrix, has_overscan, has_color_correction_matrix,
color_correction_in_linear_space, display_color_space, display_name, color_correction_in_linear_space, display_color_space, display_name,
sys_path, std::move(modes), edid, current_mode, native_mode, product_code, sys_path, std::move(modes), display::PanelOrientation::kNormal, edid,
year_of_manufacture, maximum_cursor_size); current_mode, native_mode, product_code, year_of_manufacture,
maximum_cursor_size);
std::unique_ptr<DisplaySnapshot> output; std::unique_ptr<DisplaySnapshot> output;
SerializeAndDeserialize<mojom::DisplaySnapshot>(input->Clone(), &output); SerializeAndDeserialize<mojom::DisplaySnapshot>(input->Clone(), &output);
...@@ -315,8 +317,9 @@ TEST(DisplayStructTraitsTest, DisplaySnapshotCurrentModeNull) { ...@@ -315,8 +317,9 @@ TEST(DisplayStructTraitsTest, DisplaySnapshotCurrentModeNull) {
display_id, origin, physical_size, type, is_aspect_preserving_scaling, display_id, origin, physical_size, type, is_aspect_preserving_scaling,
has_overscan, has_color_correction_matrix, has_overscan, has_color_correction_matrix,
color_correction_in_linear_space, display_color_space, display_name, color_correction_in_linear_space, display_color_space, display_name,
sys_path, std::move(modes), edid, current_mode, native_mode, product_code, sys_path, std::move(modes), display::PanelOrientation::kNormal, edid,
year_of_manufacture, maximum_cursor_size); current_mode, native_mode, product_code, year_of_manufacture,
maximum_cursor_size);
std::unique_ptr<DisplaySnapshot> output; std::unique_ptr<DisplaySnapshot> output;
SerializeAndDeserialize<mojom::DisplaySnapshot>(input->Clone(), &output); SerializeAndDeserialize<mojom::DisplaySnapshot>(input->Clone(), &output);
...@@ -359,8 +362,9 @@ TEST(DisplayStructTraitsTest, DisplaySnapshotExternal) { ...@@ -359,8 +362,9 @@ TEST(DisplayStructTraitsTest, DisplaySnapshotExternal) {
display_id, origin, physical_size, type, is_aspect_preserving_scaling, display_id, origin, physical_size, type, is_aspect_preserving_scaling,
has_overscan, has_color_correction_matrix, has_overscan, has_color_correction_matrix,
color_correction_in_linear_space, display_color_space, display_name, color_correction_in_linear_space, display_color_space, display_name,
sys_path, std::move(modes), edid, current_mode, native_mode, product_code, sys_path, std::move(modes), display::PanelOrientation::kLeftUp, edid,
year_of_manufacture, maximum_cursor_size); current_mode, native_mode, product_code, year_of_manufacture,
maximum_cursor_size);
std::unique_ptr<DisplaySnapshot> output; std::unique_ptr<DisplaySnapshot> output;
SerializeAndDeserialize<mojom::DisplaySnapshot>(input->Clone(), &output); SerializeAndDeserialize<mojom::DisplaySnapshot>(input->Clone(), &output);
...@@ -399,8 +403,9 @@ TEST(DisplayStructTraitsTest, DisplaySnapshotInternal) { ...@@ -399,8 +403,9 @@ TEST(DisplayStructTraitsTest, DisplaySnapshotInternal) {
display_id, origin, physical_size, type, is_aspect_preserving_scaling, display_id, origin, physical_size, type, is_aspect_preserving_scaling,
has_overscan, has_color_correction_matrix, has_overscan, has_color_correction_matrix,
color_correction_in_linear_space, display_color_space, display_name, color_correction_in_linear_space, display_color_space, display_name,
sys_path, std::move(modes), edid, current_mode, native_mode, product_code, sys_path, std::move(modes), display::PanelOrientation::kRightUp, edid,
year_of_manufacture, maximum_cursor_size); current_mode, native_mode, product_code, year_of_manufacture,
maximum_cursor_size);
std::unique_ptr<DisplaySnapshot> output; std::unique_ptr<DisplaySnapshot> output;
SerializeAndDeserialize<mojom::DisplaySnapshot>(input->Clone(), &output); SerializeAndDeserialize<mojom::DisplaySnapshot>(input->Clone(), &output);
......
...@@ -24,6 +24,7 @@ struct DisplaySnapshot { ...@@ -24,6 +24,7 @@ struct DisplaySnapshot {
string display_name; string display_name;
mojo_base.mojom.FilePath sys_path; mojo_base.mojom.FilePath sys_path;
array<display.mojom.DisplayMode> modes; array<display.mojom.DisplayMode> modes;
display.mojom.PanelOrientation panel_orientation;
array<uint8> edid; array<uint8> edid;
uint64 current_mode_index; uint64 current_mode_index;
bool has_current_mode; bool has_current_mode;
......
...@@ -81,6 +81,10 @@ bool StructTraits<display::mojom::DisplaySnapshotDataView, ...@@ -81,6 +81,10 @@ bool StructTraits<display::mojom::DisplaySnapshotDataView,
if (!data.ReadType(&type)) if (!data.ReadType(&type))
return false; return false;
display::PanelOrientation panel_orientation;
if (!data.ReadPanelOrientation(&panel_orientation))
return false;
gfx::ColorSpace color_space; gfx::ColorSpace color_space;
if (!data.ReadColorSpace(&color_space)) if (!data.ReadColorSpace(&color_space))
return false; return false;
...@@ -134,8 +138,9 @@ bool StructTraits<display::mojom::DisplaySnapshotDataView, ...@@ -134,8 +138,9 @@ bool StructTraits<display::mojom::DisplaySnapshotDataView,
data.is_aspect_preserving_scaling(), data.has_overscan(), data.is_aspect_preserving_scaling(), data.has_overscan(),
data.has_color_correction_matrix(), data.has_color_correction_matrix(),
data.color_correction_in_linear_space(), color_space, display_name, data.color_correction_in_linear_space(), color_space, display_name,
file_path, std::move(modes), std::move(edid), current_mode, native_mode, file_path, std::move(modes), panel_orientation, std::move(edid),
data.product_code(), data.year_of_manufacture(), maximum_cursor_size); current_mode, native_mode, data.product_code(),
data.year_of_manufacture(), maximum_cursor_size);
return true; return true;
} }
......
...@@ -39,6 +39,11 @@ struct StructTraits<display::mojom::DisplaySnapshotDataView, ...@@ -39,6 +39,11 @@ struct StructTraits<display::mojom::DisplaySnapshotDataView,
return snapshot->type(); return snapshot->type();
} }
static display::PanelOrientation panel_orientation(
const std::unique_ptr<display::DisplaySnapshot>& snapshot) {
return snapshot->panel_orientation();
}
static bool is_aspect_preserving_scaling( static bool is_aspect_preserving_scaling(
const std::unique_ptr<display::DisplaySnapshot>& snapshot) { const std::unique_ptr<display::DisplaySnapshot>& snapshot) {
return snapshot->is_aspect_preserving_scaling(); return snapshot->is_aspect_preserving_scaling();
......
...@@ -63,6 +63,15 @@ enum HDCPState { ...@@ -63,6 +63,15 @@ enum HDCPState {
HDCP_STATE_LAST = HDCP_STATE_ENABLED HDCP_STATE_LAST = HDCP_STATE_ENABLED
}; };
// The orientation of the panel in respect to the natural device orientation.
enum PanelOrientation {
kNormal = 0,
kBottomUp = 1,
kLeftUp = 2,
kRightUp = 3,
kLast = kRightUp
};
} // namespace display } // namespace display
#endif // UI_DISPLAY_TYPES_DISPLAY_CONSTANTS_H_ #endif // UI_DISPLAY_TYPES_DISPLAY_CONSTANTS_H_
...@@ -72,6 +72,7 @@ DisplaySnapshot::DisplaySnapshot(int64_t display_id, ...@@ -72,6 +72,7 @@ DisplaySnapshot::DisplaySnapshot(int64_t display_id,
std::string display_name, std::string display_name,
const base::FilePath& sys_path, const base::FilePath& sys_path,
DisplayModeList modes, DisplayModeList modes,
PanelOrientation panel_orientation,
const std::vector<uint8_t>& edid, const std::vector<uint8_t>& edid,
const DisplayMode* current_mode, const DisplayMode* current_mode,
const DisplayMode* native_mode, const DisplayMode* native_mode,
...@@ -90,6 +91,7 @@ DisplaySnapshot::DisplaySnapshot(int64_t display_id, ...@@ -90,6 +91,7 @@ DisplaySnapshot::DisplaySnapshot(int64_t display_id,
display_name_(display_name), display_name_(display_name),
sys_path_(sys_path), sys_path_(sys_path),
modes_(std::move(modes)), modes_(std::move(modes)),
panel_orientation_(panel_orientation),
edid_(edid), edid_(edid),
current_mode_(current_mode), current_mode_(current_mode),
native_mode_(native_mode), native_mode_(native_mode),
...@@ -125,21 +127,23 @@ std::unique_ptr<DisplaySnapshot> DisplaySnapshot::Clone() { ...@@ -125,21 +127,23 @@ std::unique_ptr<DisplaySnapshot> DisplaySnapshot::Clone() {
display_id_, origin_, physical_size_, type_, display_id_, origin_, physical_size_, type_,
is_aspect_preserving_scaling_, has_overscan_, is_aspect_preserving_scaling_, has_overscan_,
has_color_correction_matrix_, color_correction_in_linear_space_, has_color_correction_matrix_, color_correction_in_linear_space_,
color_space_, display_name_, sys_path_, std::move(clone_modes), edid_, color_space_, display_name_, sys_path_, std::move(clone_modes),
cloned_current_mode, cloned_native_mode, product_code_, panel_orientation_, edid_, cloned_current_mode, cloned_native_mode,
year_of_manufacture_, maximum_cursor_size_); product_code_, year_of_manufacture_, maximum_cursor_size_);
} }
std::string DisplaySnapshot::ToString() const { std::string DisplaySnapshot::ToString() const {
return base::StringPrintf( return base::StringPrintf(
"id=%" PRId64 "id=%" PRId64
" current_mode=%s native_mode=%s origin=%s" " current_mode=%s native_mode=%s origin=%s"
" panel_orientation=%d"
" physical_size=%s, type=%s name=\"%s\" (year:%d) " " physical_size=%s, type=%s name=\"%s\" (year:%d) "
"modes=(%s)", "modes=(%s)",
display_id_, display_id_,
current_mode_ ? current_mode_->ToString().c_str() : "nullptr", current_mode_ ? current_mode_->ToString().c_str() : "nullptr",
native_mode_ ? native_mode_->ToString().c_str() : "nullptr", native_mode_ ? native_mode_->ToString().c_str() : "nullptr",
origin_.ToString().c_str(), physical_size_.ToString().c_str(), origin_.ToString().c_str(), panel_orientation_,
physical_size_.ToString().c_str(),
DisplayConnectionTypeString(type_).c_str(), display_name_.c_str(), DisplayConnectionTypeString(type_).c_str(), display_name_.c_str(),
year_of_manufacture_, ModeListString(modes_).c_str()); year_of_manufacture_, ModeListString(modes_).c_str());
} }
......
...@@ -41,6 +41,7 @@ class DISPLAY_TYPES_EXPORT DisplaySnapshot { ...@@ -41,6 +41,7 @@ class DISPLAY_TYPES_EXPORT DisplaySnapshot {
std::string display_name, std::string display_name,
const base::FilePath& sys_path, const base::FilePath& sys_path,
DisplayModeList modes, DisplayModeList modes,
PanelOrientation panel_orientation,
const std::vector<uint8_t>& edid, const std::vector<uint8_t>& edid,
const DisplayMode* current_mode, const DisplayMode* current_mode,
const DisplayMode* native_mode, const DisplayMode* native_mode,
...@@ -69,6 +70,7 @@ class DISPLAY_TYPES_EXPORT DisplaySnapshot { ...@@ -69,6 +70,7 @@ class DISPLAY_TYPES_EXPORT DisplaySnapshot {
const std::string& display_name() const { return display_name_; } const std::string& display_name() const { return display_name_; }
const base::FilePath& sys_path() const { return sys_path_; } const base::FilePath& sys_path() const { return sys_path_; }
const DisplayModeList& modes() const { return modes_; } const DisplayModeList& modes() const { return modes_; }
PanelOrientation panel_orientation() const { return panel_orientation_; }
const std::vector<uint8_t>& edid() const { return edid_; } const std::vector<uint8_t>& edid() const { return edid_; }
const DisplayMode* current_mode() const { return current_mode_; } const DisplayMode* current_mode() const { return current_mode_; }
void set_current_mode(const DisplayMode* mode) { current_mode_ = mode; } void set_current_mode(const DisplayMode* mode) { current_mode_ = mode; }
...@@ -120,6 +122,9 @@ class DISPLAY_TYPES_EXPORT DisplaySnapshot { ...@@ -120,6 +122,9 @@ class DISPLAY_TYPES_EXPORT DisplaySnapshot {
DisplayModeList modes_; DisplayModeList modes_;
// The orientation of the panel in respect to the natural device orientation.
PanelOrientation panel_orientation_;
// The display's EDID. It can be empty if nothing extracted such as in the // The display's EDID. It can be empty if nothing extracted such as in the
// case of a virtual display. // case of a virtual display.
std::vector<uint8_t> edid_; std::vector<uint8_t> edid_;
......
...@@ -49,6 +49,8 @@ struct DisplaySnapshot_Params { ...@@ -49,6 +49,8 @@ struct DisplaySnapshot_Params {
std::string display_name; std::string display_name;
base::FilePath sys_path; base::FilePath sys_path;
std::vector<DisplayMode_Params> modes; std::vector<DisplayMode_Params> modes;
display::PanelOrientation panel_orientation =
display::PanelOrientation::kNormal;
std::vector<uint8_t> edid; std::vector<uint8_t> edid;
bool has_current_mode = false; bool has_current_mode = false;
DisplayMode_Params current_mode; DisplayMode_Params current_mode;
......
...@@ -35,6 +35,9 @@ IPC_ENUM_TRAITS_MAX_VALUE(display::DisplayConnectionType, ...@@ -35,6 +35,9 @@ IPC_ENUM_TRAITS_MAX_VALUE(display::DisplayConnectionType,
IPC_ENUM_TRAITS_MAX_VALUE(display::HDCPState, display::HDCP_STATE_LAST) IPC_ENUM_TRAITS_MAX_VALUE(display::HDCPState, display::HDCP_STATE_LAST)
IPC_ENUM_TRAITS_MAX_VALUE(display::PanelOrientation,
display::PanelOrientation::kLast)
IPC_ENUM_TRAITS_MAX_VALUE(gfx::OverlayTransform, gfx::OVERLAY_TRANSFORM_LAST) IPC_ENUM_TRAITS_MAX_VALUE(gfx::OverlayTransform, gfx::OVERLAY_TRANSFORM_LAST)
IPC_ENUM_TRAITS_MAX_VALUE(ui::OverlayStatus, ui::OVERLAY_STATUS_LAST) IPC_ENUM_TRAITS_MAX_VALUE(ui::OverlayStatus, ui::OVERLAY_STATUS_LAST)
...@@ -59,6 +62,7 @@ IPC_STRUCT_TRAITS_BEGIN(ui::DisplaySnapshot_Params) ...@@ -59,6 +62,7 @@ IPC_STRUCT_TRAITS_BEGIN(ui::DisplaySnapshot_Params)
IPC_STRUCT_TRAITS_MEMBER(display_name) IPC_STRUCT_TRAITS_MEMBER(display_name)
IPC_STRUCT_TRAITS_MEMBER(sys_path) IPC_STRUCT_TRAITS_MEMBER(sys_path)
IPC_STRUCT_TRAITS_MEMBER(modes) IPC_STRUCT_TRAITS_MEMBER(modes)
IPC_STRUCT_TRAITS_MEMBER(panel_orientation)
IPC_STRUCT_TRAITS_MEMBER(edid) IPC_STRUCT_TRAITS_MEMBER(edid)
IPC_STRUCT_TRAITS_MEMBER(has_current_mode) IPC_STRUCT_TRAITS_MEMBER(has_current_mode)
IPC_STRUCT_TRAITS_MEMBER(current_mode) IPC_STRUCT_TRAITS_MEMBER(current_mode)
......
...@@ -189,6 +189,16 @@ bool IsAspectPreserving(int fd, drmModeConnector* connector) { ...@@ -189,6 +189,16 @@ bool IsAspectPreserving(int fd, drmModeConnector* connector) {
"Full aspect"); "Full aspect");
} }
display::PanelOrientation GetPanelOrientation(int fd,
drmModeConnector* connector) {
ScopedDrmPropertyPtr property;
int index = GetDrmProperty(fd, connector, "panel orientation", &property);
if (index < 0)
return display::PanelOrientation::kNormal;
DCHECK_LT(connector->prop_values[index], display::PanelOrientation::kLast);
return static_cast<display::PanelOrientation>(connector->prop_values[index]);
}
int ConnectorIndex(int device_index, int display_index) { int ConnectorIndex(int device_index, int display_index) {
DCHECK_LT(device_index, 16); DCHECK_LT(device_index, 16);
DCHECK_LT(display_index, 16); DCHECK_LT(display_index, 16);
...@@ -427,6 +437,8 @@ std::unique_ptr<display::DisplaySnapshot> CreateDisplaySnapshot( ...@@ -427,6 +437,8 @@ std::unique_ptr<display::DisplaySnapshot> CreateDisplaySnapshot(
const display::DisplayConnectionType type = GetDisplayType(info->connector()); const display::DisplayConnectionType type = GetDisplayType(info->connector());
const bool is_aspect_preserving_scaling = const bool is_aspect_preserving_scaling =
IsAspectPreserving(fd, info->connector()); IsAspectPreserving(fd, info->connector());
const display::PanelOrientation panel_orientation =
GetPanelOrientation(fd, info->connector());
const bool has_color_correction_matrix = const bool has_color_correction_matrix =
HasColorCorrectionMatrix(fd, info->crtc()) || HasColorCorrectionMatrix(fd, info->crtc()) ||
HasPerPlaneColorCorrectionMatrix(fd, info->crtc()); HasPerPlaneColorCorrectionMatrix(fd, info->crtc());
...@@ -478,8 +490,8 @@ std::unique_ptr<display::DisplaySnapshot> CreateDisplaySnapshot( ...@@ -478,8 +490,8 @@ std::unique_ptr<display::DisplaySnapshot> CreateDisplaySnapshot(
display_id, origin, physical_size, type, is_aspect_preserving_scaling, display_id, origin, physical_size, type, is_aspect_preserving_scaling,
has_overscan, has_color_correction_matrix, has_overscan, has_color_correction_matrix,
color_correction_in_linear_space, display_color_space, display_name, color_correction_in_linear_space, display_color_space, display_name,
sys_path, std::move(modes), edid, current_mode, native_mode, product_code, sys_path, std::move(modes), panel_orientation, edid, current_mode,
year_of_manufacture, maximum_cursor_size); native_mode, product_code, year_of_manufacture, maximum_cursor_size);
} }
// TODO(rjkroege): Remove in a subsequent CL once Mojo IPC is used everywhere. // TODO(rjkroege): Remove in a subsequent CL once Mojo IPC is used everywhere.
...@@ -506,6 +518,7 @@ std::vector<DisplaySnapshot_Params> CreateDisplaySnapshotParams( ...@@ -506,6 +518,7 @@ std::vector<DisplaySnapshot_Params> CreateDisplaySnapshotParams(
mode_params.push_back(GetDisplayModeParams(*m)); mode_params.push_back(GetDisplayModeParams(*m));
} }
p.modes = mode_params; p.modes = mode_params;
p.panel_orientation = d->panel_orientation();
p.edid = d->edid(); p.edid = d->edid();
p.has_current_mode = d->current_mode(); p.has_current_mode = d->current_mode();
...@@ -543,9 +556,10 @@ std::unique_ptr<display::DisplaySnapshot> CreateDisplaySnapshot( ...@@ -543,9 +556,10 @@ std::unique_ptr<display::DisplaySnapshot> CreateDisplaySnapshot(
params.is_aspect_preserving_scaling, params.has_overscan, params.is_aspect_preserving_scaling, params.has_overscan,
params.has_color_correction_matrix, params.has_color_correction_matrix,
params.color_correction_in_linear_space, params.color_space, params.color_correction_in_linear_space, params.color_space,
params.display_name, params.sys_path, std::move(modes), params.edid, params.display_name, params.sys_path, std::move(modes),
current_mode, native_mode, params.product_code, params.panel_orientation, params.edid, current_mode, native_mode,
params.year_of_manufacture, params.maximum_cursor_size); params.product_code, params.year_of_manufacture,
params.maximum_cursor_size);
} }
int GetFourCCFormatForOpaqueFramebuffer(gfx::BufferFormat format) { int GetFourCCFormatForOpaqueFramebuffer(gfx::BufferFormat format) {
......
...@@ -41,7 +41,8 @@ void HeadlessNativeDisplayDelegate::Initialize() { ...@@ -41,7 +41,8 @@ void HeadlessNativeDisplayDelegate::Initialize() {
next_display_id(), gfx::Point(0, 0), kDefaultWindowSize, next_display_id(), gfx::Point(0, 0), kDefaultWindowSize,
display::DisplayConnectionType::DISPLAY_CONNECTION_TYPE_NONE, false, display::DisplayConnectionType::DISPLAY_CONNECTION_TYPE_NONE, false,
false, false, false, gfx::ColorSpace(), "", base::FilePath(), false, false, false, gfx::ColorSpace(), "", base::FilePath(),
std::move(modes), std::vector<uint8_t>(), mode, mode, 0, 0, gfx::Size()); std::move(modes), display::PanelOrientation::kNormal,
std::vector<uint8_t>(), mode, mode, 0, 0, gfx::Size());
for (display::NativeDisplayObserver& observer : observers_) for (display::NativeDisplayObserver& observer : observers_)
observer.OnConfigurationChanged(); observer.OnConfigurationChanged();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment