cec: attempt to get the edid from nvidia's driver on linux via /proc/acpi/video/NGFX...
[deb_libcec.git] / src / lib / adapter / USBCECAdapterCommunication.cpp
index 1940e88aaba12fb5e34964efb5deb913347369b1..bc451676280cadf7388ca1d373cfa331127e0179 100644 (file)
@@ -38,6 +38,7 @@
 #include "../platform/util/util.h"
 #include "../platform/util/edid.h"
 #include "../platform/adl/adl-edid.h"
+#include "../platform/nvidia/nv-edid.h"
 #include "../LibCEC.h"
 #include "../CECProcessor.h"
 
@@ -576,6 +577,17 @@ uint16_t CUSBCECAdapterCommunication::GetPhysicalAddress(void)
   }
 #endif
 
+  // try to get the PA from the nvidia driver
+#if defined(HAS_NVIDIA_EDID_PARSER)
+  if (iPA == 0)
+  {
+    LIB_CEC->AddLog(CEC_LOG_DEBUG, "%s - trying to get the physical address via nvidia driver", __FUNCTION__);
+    CNVEdidParser nv;
+    iPA = nv.GetPhysicalAddress();
+    LIB_CEC->AddLog(CEC_LOG_DEBUG, "%s - nvidia driver returned physical address %04x", __FUNCTION__, iPA);
+  }
+#endif
+
   // try to get the PA from the OS
   if (iPA == 0)
   {