diff options
author | Amit Pundir <amit.pundir@linaro.org> | 2022-10-06 21:24:07 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2022-10-06 21:24:07 +0000 |
commit | cdc4ed6c83e4349e8195dc7c9eb79f557a2d7ee7 (patch) | |
tree | 202bce01b6b7ce65c46f95b5730ea45833e3b656 | |
parent | c98eee1cd4abf1a084e1c1312ff8d6154eea4670 (diff) | |
parent | a393df4bcfdf37fbe7b1714dc3610505a41618a9 (diff) | |
download | drm_hwcomposer-cdc4ed6c83e4349e8195dc7c9eb79f557a2d7ee7.tar.gz |
drm_hwcomposer: Merge 'aosp/upstream-main' into HEAD am: a393df4bcf
Original change: https://android-review.googlesource.com/c/platform/external/drm_hwcomposer/+/2238060
Change-Id: Ibfb3376003cc553d7074de65f00d41f5fb3d2fe4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r-- | bufferinfo/legacy/BufferInfoImagination.cpp | 2 | ||||
-rw-r--r-- | drm/DrmDisplayPipeline.cpp | 12 | ||||
-rw-r--r-- | drm/DrmPlane.cpp | 17 |
3 files changed, 24 insertions, 7 deletions
diff --git a/bufferinfo/legacy/BufferInfoImagination.cpp b/bufferinfo/legacy/BufferInfoImagination.cpp index 1858ddb..6d917c2 100644 --- a/bufferinfo/legacy/BufferInfoImagination.cpp +++ b/bufferinfo/legacy/BufferInfoImagination.cpp @@ -51,7 +51,7 @@ auto BufferInfoImagination::GetBoInfo(buffer_handle_t handle) switch (hnd->iFormat) { #ifdef HAL_PIXEL_FORMAT_BGRX_8888 case HAL_PIXEL_FORMAT_BGRX_8888: - bo->format = DRM_FORMAT_XRGB8888; + bi.format = DRM_FORMAT_XRGB8888; break; #endif default: diff --git a/drm/DrmDisplayPipeline.cpp b/drm/DrmDisplayPipeline.cpp index f993d28..e81544d 100644 --- a/drm/DrmDisplayPipeline.cpp +++ b/drm/DrmDisplayPipeline.cpp @@ -86,15 +86,15 @@ static auto TryCreatePipeline(DrmDevice &dev, DrmConnector &connector, return {}; } - if (primary_planes.size() > 1) { - ALOGE("Found more than 1 primary plane for CRTC %d", crtc.GetId()); - return {}; + for (const auto &plane : primary_planes) { + pipe->primary_plane = plane->BindPipeline(pipe.get()); + if (pipe->primary_plane) { + break; + } } - pipe->primary_plane = primary_planes[0]->BindPipeline(pipe.get()); if (!pipe->primary_plane) { - ALOGE("Primary plane %d is already owned. Internal error.", - primary_planes[0]->GetId()); + ALOGE("Failed to bind primary plane"); return {}; } diff --git a/drm/DrmPlane.cpp b/drm/DrmPlane.cpp index 329ef1c..5051d35 100644 --- a/drm/DrmPlane.cpp +++ b/drm/DrmPlane.cpp @@ -148,6 +148,23 @@ int DrmPlane::Init() { } bool DrmPlane::IsCrtcSupported(const DrmCrtc &crtc) const { + unsigned int crtc_property_value = 0; + std::tie(std::ignore, crtc_property_value) = crtc_property_.value(); + if (crtc_property_value != 0 && crtc_property_value != crtc.GetId() && + GetType() == DRM_PLANE_TYPE_PRIMARY) { + // Some DRM driver such as omap_drm allows sharing primary plane between + // CRTCs, but the primay plane could not be shared if it has been used by + // any CRTC already, which is protected by the plane_switching_crtc function + // in the kernel drivers/gpu/drm/drm_atomic.c file. + // The current drm_hwc design is not ready to support such scenario yet, + // so adding the CRTC status check here to workaorund for now. + ALOGW( + "%s: This Plane(id=%d) is activated for Crtc(id=%d), could not be used " + "for Crtc (id=%d)", + __FUNCTION__, GetId(), crtc_property_value, crtc.GetId()); + return false; + } + return ((1 << crtc.GetIndexInResArray()) & plane_->possible_crtcs) != 0; } |