Module Name:    src
Committed By:   riastradh
Date:           Sun May 22 21:18:12 UTC 2022

Modified Files:
        src/sys/external/bsd/drm2/dist/drm/i915/display: intel_gmbus.c

Log Message:
i915: Fix sense of conditional for gmbus wait.

This enables i915 to again retrieve EDID data from displays over the
I2C DDC.

Embarrassing.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 \
    src/sys/external/bsd/drm2/dist/drm/i915/display/intel_gmbus.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/i915/display/intel_gmbus.c
diff -u src/sys/external/bsd/drm2/dist/drm/i915/display/intel_gmbus.c:1.6 src/sys/external/bsd/drm2/dist/drm/i915/display/intel_gmbus.c:1.7
--- src/sys/external/bsd/drm2/dist/drm/i915/display/intel_gmbus.c:1.6	Sun May 22 20:35:20 2022
+++ src/sys/external/bsd/drm2/dist/drm/i915/display/intel_gmbus.c	Sun May 22 21:18:12 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: intel_gmbus.c,v 1.6 2022/05/22 20:35:20 riastradh Exp $	*/
+/*	$NetBSD: intel_gmbus.c,v 1.7 2022/05/22 21:18:12 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2006 Dave Airlie <airl...@linux.ie>
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: intel_gmbus.c,v 1.6 2022/05/22 20:35:20 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intel_gmbus.c,v 1.7 2022/05/22 21:18:12 riastradh Exp $");
 
 #include <linux/export.h>
 #include <linux/i2c-algo-bit.h>
@@ -354,8 +354,8 @@ static int gmbus_wait(struct drm_i915_pr
 		unsigned timeout = 50*1000;
 
 		ret = 0;
-		while ((gmbus2 = intel_uncore_read_fw(&dev_priv->uncore,
-			    GMBUS2)) & status) {
+		while (((gmbus2 = intel_uncore_read_fw(&dev_priv->uncore,
+				GMBUS2)) & status) == 0) {
 			if (--timeout == 0) {
 				ret = -ETIMEDOUT;
 				break;
@@ -370,7 +370,7 @@ static int gmbus_wait(struct drm_i915_pr
 		    (((gmbus2 = intel_uncore_read_fw(&dev_priv->uncore,
 				GMBUS2))
 			    & status)
-			== 0));
+			!= 0));
 		/*
 		 * After DRM_SPIN_TIMED_WAIT_NOINTR_UNTIL, ret<0 on
 		 * error (-ERESTARTSYS, interrupt), ret=0 on timeout,

Reply via email to