drm_hwcomposer: Plumb link status BAD to OnHotplugEvent composer callback
This updates the Uevent handler to handle the hotplug events
sent by the kernel for link training failure.
Adds support in hotplug handler in resourcemanager to read connector
properties and read the value of link-status property.
If this is set to DRM_MODE_LINK_STATUS_BAD, then invoke
the OnHotplugEvent() composer callback with the BAD CABLE
DisplayHotplugEvent to notify the Surfaceflinger about link training
failure.
Currently this uses the ERROR_INCOMPATIBLE_CABLE field of the
DisplayHotplugEvent callback. The longer term would be to define
a new field in this enum to indicate MODESET_RETRY and use this
INCOMPATIBLE_CABLE for the terminal link train failure state.
Change-Id: I823d7570dd08e476d0c887e350bce3f8f0069afb
Signed-off-by: Manasi Navare <navaremanasi@chromium.org>
diff --git a/drm/DrmHwc.cpp b/drm/DrmHwc.cpp
index df3eb56..57293c2 100644
--- a/drm/DrmHwc.cpp
+++ b/drm/DrmHwc.cpp
@@ -124,6 +124,16 @@
return true;
}
+void DrmHwc::NotifyDisplayLinkStatus(
+ std::shared_ptr<DrmDisplayPipeline> pipeline) {
+ if (display_handles_.count(pipeline) == 0) {
+ ALOGE("%s, can't find the display, pipeline: %p", __func__, pipeline.get());
+ return;
+ }
+ ScheduleHotplugEvent(display_handles_[pipeline],
+ DisplayStatus::kLinkTrainingFailed);
+}
+
HWC2::Error DrmHwc::CreateVirtualDisplay(
uint32_t width, uint32_t height,
int32_t *format, // NOLINT(readability-non-const-parameter)