Commit bfde49d0 authored by Daniel Nicoara's avatar Daniel Nicoara Committed by Commit Bot

Fix check for PLANE_CTM on legacy

Enable universal planes when initializing the DRM device in the browser
process. This ensures all planes are exposed via DRM.

If DRM reports 0 planes (on legacy this can happen) do not report
support for PLANE_CTM otherwise the display configuration will try to
set hardware CTM.

Bug: 869901
Test: Compiled
Change-Id: I3fd09e3628e198219d8bb0b1400afd156cb4bcbe
Reviewed-on: https://chromium-review.googlesource.com/1167892
Commit-Queue: Daniel Nicoara <dnicoara@chromium.org>
Reviewed-by: default avatarDaniele Castagna <dcastagna@chromium.org>
Cr-Commit-Position: refs/heads/master@{#581911}
parent 910243bc
...@@ -204,7 +204,9 @@ bool HasPerPlaneColorCorrectionMatrix(const int fd, drmModeCrtc* crtc) { ...@@ -204,7 +204,9 @@ bool HasPerPlaneColorCorrectionMatrix(const int fd, drmModeCrtc* crtc) {
if (!FindDrmProperty(fd, plane_props.get(), "PLANE_CTM")) if (!FindDrmProperty(fd, plane_props.get(), "PLANE_CTM"))
return false; return false;
} }
return true;
// On legacy, if no planes are exposed then the property isn't available.
return plane_resources->count_planes > 0;
} }
bool IsDrmModuleName(const int fd, const std::string& name) { bool IsDrmModuleName(const int fd, const std::string& name) {
......
...@@ -69,6 +69,9 @@ bool DrmDeviceHandle::Initialize(const base::FilePath& dev_path, ...@@ -69,6 +69,9 @@ bool DrmDeviceHandle::Initialize(const base::FilePath& dev_path,
struct drm_set_client_cap cap = {DRM_CLIENT_CAP_ATOMIC, 1}; struct drm_set_client_cap cap = {DRM_CLIENT_CAP_ATOMIC, 1};
has_atomic_capabilities_ = has_atomic_capabilities_ =
!drmIoctl(file_.get(), DRM_IOCTL_SET_CLIENT_CAP, &cap); !drmIoctl(file_.get(), DRM_IOCTL_SET_CLIENT_CAP, &cap);
cap = {DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1};
drmIoctl(file_.get(), DRM_IOCTL_SET_CLIENT_CAP, &cap);
break; break;
} }
......
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