Skip to contentSkip to conversation

drm/i915: Fix corruption lines on the screen on Gen9 chromebooks

PATCH New Gaurav K Singh 3 participants 3 messages Sep 4, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915: Fix corruption lines on the screen on Gen9 chromebooks

On Gen9 chromebooks, we are seeing the screen shows several
large blue horizontal stripes over the top. Also, corruption happens when we switch from a chrome browser tab to VT2 mode(by pressing Ctrl+Alt+F2) and then back to chrome tab.

As per the display workaround #1200, FBC needs wait for vblank before enabling and before disabling FBC.

---
 drivers/gpu/drm/i915/display/intel_fbc.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/display/intel_fbc.c +6 -1
index 16ed44bfd734..71f2568ea5a3 100644
@@ -1097,6 +1097,8 @@ void intel_fbc_enable(struct intel_crtc *crtc,
 		if (fbc->crtc == crtc) {
 			WARN_ON(!crtc_state->enable_fbc);
 			WARN_ON(fbc->active);
+			if (IS_GEN9(dev_priv))
+				intel_wait_for_vblank(dev_priv, crtc->pipe);
 		}
 		goto out;
 	}
@@ -1137,8 +1139,11 @@ void intel_fbc_disable(struct intel_crtc *crtc)
 		return;
 
 	mutex_lock(&fbc->lock);
-	if (fbc->crtc == crtc)
+	if (fbc->crtc == crtc) {
 		__intel_fbc_disable(dev_priv);
+		if (IS_GEN9(dev_priv))
+			intel_wait_for_vblank(dev_priv, crtc->pipe);
+	}
 	mutex_unlock(&fbc->lock);
 }
 
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

✗ Fi.CI.BUILD: failure for drm/i915: Fix corruption lines on the screen on Gen9 chromebooks

== Series Details ==

== Series Details ==

Series: drm/i915: Fix corruption lines on the screen on Gen9 chromebooks
URL : https://patchwork.freedesktop.org/series/66196/
State : failure

== Summary ==

CALL scripts/checksyscalls.sh
CALL scripts/atomic/check-atomics.sh
DESCEND objtool

  CHK     include/generated/compile.h
  AR      drivers/gpu/drm/i915/built-in.a
  CC [M]  drivers/gpu/drm/i915/display/intel_fbc.o
drivers/gpu/drm/i915/display/intel_fbc.c: In function ‘intel_fbc_enable’:
drivers/gpu/drm/i915/display/intel_fbc.c:1100:8: error: implicit declaration of function ‘IS_GEN9’; did you mean ‘IS_GEN’? [-Werror=implicit-function-declaration]
    if (IS_GEN9(dev_priv))
        ^~~~~~~
        IS_GEN

cc1: all warnings being treated as errors
scripts/Makefile.build:280: recipe for target 'drivers/gpu/drm/i915/display/intel_fbc.o' failed make[4]: *** [drivers/gpu/drm/i915/display/intel_fbc.o] Error 1 scripts/Makefile.build:497: recipe for target 'drivers/gpu/drm/i915' failed make[3]: *** [drivers/gpu/drm/i915] Error 2
scripts/Makefile.build:497: recipe for target 'drivers/gpu/drm' failed
make[2]: *** [drivers/gpu/drm] Error 2
scripts/Makefile.build:497: recipe for target 'drivers/gpu' failed
make[1]: *** [drivers/gpu] Error 2
Makefile:1083: recipe for target 'drivers' failed
make: *** [drivers] Error 2

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#2 lore raw
In reply to Gaurav K Singh
Thank you for the patch! Yet something to improve:

Hi Gaurav,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on drm-intel/for-linux-next]
[cannot apply to v5.3-rc7 next-20190903]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Gaurav-K-Singh/drm-i915-Fix-corruption-lines-on-the-screen-on-Gen9-chromebooks/20190904-151433
base:   git://anongit.freedesktop.org/drm-intel for-linux-next
config: i386-defconfig (attached as .config)
compiler: gcc-7 (Debian 7.4.0-11) 7.4.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

If you fix the issue, kindly add following tag

All errors (new ones prefixed by >>):

drivers/gpu/drm/i915/display/intel_fbc.c: In function 'intel_fbc_enable':

>> drivers/gpu/drm/i915/display/intel_fbc.c:1100:8: error: implicit declaration of function 'IS_GEN9'; did you mean 'IS_GEN'? [-Werror=implicit-function-declaration]
       if (IS_GEN9(dev_priv))
           ^~~~~~~
           IS_GEN

cc1: some warnings being treated as errors

vim +1100 drivers/gpu/drm/i915/display/intel_fbc.c

1071
1072 /**
1073 * intel_fbc_enable: tries to enable FBC on the CRTC
1074 * @crtc: the CRTC
1075 * @crtc_state: corresponding &drm_crtc_state for @crtc
1076 * @plane_state: corresponding &drm_plane_state for the primary plane of @crtc
1077 *
1078 * This function checks if the given CRTC was chosen for FBC, then enables it if
1079 * possible. Notice that it doesn't activate FBC. It is valid to call
1080 * intel_fbc_enable multiple times for the same pipe without an
1081 * intel_fbc_disable in the middle, as long as it is deactivated.
1082 */
1083 void intel_fbc_enable(struct intel_crtc *crtc,
1084 struct intel_crtc_state *crtc_state,
1085 struct intel_plane_state *plane_state)
1086 {
1087 struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
1088 struct intel_fbc *fbc = &dev_priv->fbc;
1089
1090 if (!fbc_supported(dev_priv))
1091 return;
1092
1093 mutex_lock(&fbc->lock);
1094
1095 if (fbc->enabled) {
1096 WARN_ON(fbc->crtc == NULL);
1097 if (fbc->crtc == crtc) {
1098 WARN_ON(!crtc_state->enable_fbc);
1099 WARN_ON(fbc->active);

> 1100				if (IS_GEN9(dev_priv))

1101 intel_wait_for_vblank(dev_priv, crtc->pipe);
1102 }
1103 goto out;
1104 }
1105
1106 if (!crtc_state->enable_fbc)
1107 goto out;
1108
1109 WARN_ON(fbc->active);
1110 WARN_ON(fbc->crtc != NULL);
1111
1112 intel_fbc_update_state_cache(crtc, crtc_state, plane_state);
1113 if (intel_fbc_alloc_cfb(crtc)) {
1114 fbc->no_fbc_reason = "not enough stolen memory";
1115 goto out;
1116 }
1117
1118 DRM_DEBUG_KMS("Enabling FBC on pipe %c\n", pipe_name(crtc->pipe));
1119 fbc->no_fbc_reason = "FBC enabled but not active yet\n";
1120
1121 fbc->enabled = true;
1122 fbc->crtc = crtc;
1123 out:
1124 mutex_unlock(&fbc->lock);
1125 }
1126

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx