File 0001-fix-freezes-on-laptops.patch of Package ddcutil

From 2b0c9b956e6913f82a8937aca5b073fdb86ba961 Mon Sep 17 00:00:00 2001
From: Shawn W Dunn <sfalken@opensuse.org>
Date: Sun, 15 Feb 2026 08:40:19 -0800
Subject: [PATCH] fix freezes on laptops

Reverts 642ddd5 and 316fcb9
https://github.com/rockowitz/ddcutil/issues/581
backport patch from upstream, should be fixed in 2.2.6
---
 src/dw/dw_main.c | 42 ------------------------------------------
 1 file changed, 42 deletions(-)

diff --git a/src/dw/dw_main.c b/src/dw/dw_main.c
index ccc8c59..99d279e 100644
--- a/src/dw/dw_main.c
+++ b/src/dw/dw_main.c
@@ -38,7 +38,6 @@
 #include "sysfs/sysfs_base.h"
 
 #include "i2c/i2c_bus_core.h"
-#include "i2c/i2c_edid.h"
 
 #include "ddc/ddc_displays.h"
 #include "ddc/ddc_display_ref_reports.h"
@@ -171,39 +170,6 @@ resolve_watch_mode(DDC_Watch_Mode initial_mode) {
    return resolved_watch_mode;
 }
 
-bool all_edids_readable_using_i2c() {
-   bool debug = true;
-   DBGTRC_STARTING(debug, DDCA_TRC_NONE, "");
-   bool result = true;
-   for (int ndx = 0; ndx < all_display_refs->len; ndx++) {
-      Display_Ref * dref = g_ptr_array_index(all_display_refs, ndx);
-      if (dref->io_path.io_mode != DDCA_IO_I2C) {
-         result = false;
-         break;
-      }
-      I2C_Bus_Info * businfo =  dref->detail;
-      if (businfo->flags & I2C_BUS_SYSFS_EDID) {
-         // try reading bus using I2C
-         int fd;
-         Error_Info * err = i2c_open_bus_basic_by_busno(businfo->busno, CALLOPT_NONE, &fd);
-         if (err) {
-            result = false;
-            break;
-         }
-         Buffer * edidbuf = buffer_new(256,  "");
-         Status_Errno_DDC rc = i2c_get_raw_edid_by_fd(fd, edidbuf);
-         if (rc != 0) {
-            result = false;
-            break;
-         }
-         buffer_free(edidbuf, "");
-      }
-   }
-   DBGTRC_RET_BOOL(debug, DDCA_TRC_NONE,result, "");
-   return result;
-}
-
-
 /** Starts thread that watches for changes in display connection status.
  *
  *  @param  event_classes  types of events to watch for
@@ -230,13 +196,6 @@ dw_start_watch_displays(DDCA_Display_Event_Class event_classes) {
       goto bye;
    }
 
-   if (!all_edids_readable_using_i2c()) {
-      MSG_W_SYSLOG(DDCA_SYSLOG_WARNING,
-            "EDID readable from /sys but not using I2C. Display change detection unreliable.");
-      // err = ERRINFO_NEW(DDCRC_INVALID_OPERATION, "Requires EDIDs readable using I2C");
-      // goto bye;
-   }
-
    DDC_Watch_Mode resolved_watch_mode = resolve_watch_mode(watch_displays_mode);
 #ifdef USE_X11
    XEvent_Data * xevdata  = NULL;
@@ -526,6 +485,5 @@ void init_dw_main() {
    RTTI_ADD_FUNC(is_watch_mode_udev_available);
    RTTI_ADD_FUNC(is_watch_mode_x11_available);
    RTTI_ADD_FUNC(resolve_watch_mode);
-   RTTI_ADD_FUNC(all_edids_readable_using_i2c);
 }
 
-- 
2.52.0

openSUSE Build Service is sponsored by