Bug 65593

Summary: [IVB] Banding after EFI boot (broken gamma table?)
Product: DRI Reporter: Thomas Hebb <tommyhebb>
Component: DRM/IntelAssignee: Intel GFX Bugs mailing list <intel-gfx-bugs>
Status: CLOSED FIXED QA Contact: Intel GFX Bugs mailing list <intel-gfx-bugs>
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
Photo of banding effect
none
Xorg.0.log
none
intel_reg_dumper output (before suspend/resume)
none
intel_reg_dumper output (after suspend/resume)
none
dmesg none

Description Thomas Hebb 2013-06-10 05:40:50 UTC
Created attachment 80593 [details]
Photo of banding effect

Bug description:
After a cold boot of my MacBook Pro 9,2 using EFI (the problem does not appear using BIOS emulation), there is a disjoint (band) between lighter and darker colors (see attached photo). The problem disappears after suspending and resuming the system.

System environment:
-- chipset: Intel(R) Ivybridge Mobile (GT2)
-- system architecture: 64-bit
-- xf86-video-intel: 2.21.9
-- xserver: 1.14.1
-- mesa: 9.1.3
-- libdrm: 2.4.45
-- kernel: 3.9.5
-- Linux distribution: Arch Linux (with [testing])
-- Machine or mobo model: MacBookPro9,2
-- Display connector: FPD-Link (Internal display)

Reproducing steps:
-- Boot Linux on a MacBook Pro 9,2 using any UEFI bootloader.
-- Display a gradient on the screen using any method.

Additional info:
When the issue is present, gamma adjustments I make using xgamma only apply to the darker colors. At a gamma of 1.1, the band disappears (photo is of gamma 1.0). After a suspend and resume, gamma adjustments apply to the entire screen.

The issue appears both inside and outside of X.
Comment 1 Thomas Hebb 2013-06-10 05:54:53 UTC
Created attachment 80594 [details]
Xorg.0.log
Comment 2 Thomas Hebb 2013-06-10 06:01:35 UTC
Created attachment 80595 [details]
intel_reg_dumper output (before suspend/resume)
Comment 3 Thomas Hebb 2013-06-10 06:02:07 UTC
Created attachment 80596 [details]
intel_reg_dumper output (after suspend/resume)
Comment 4 Thomas Hebb 2013-06-10 06:07:59 UTC
Created attachment 80597 [details]
dmesg
Comment 5 Chris Wilson 2013-06-10 08:00:35 UTC
-PIPEACONF: 0xc1000050 (enabled, active, pf-pd, rotate 0, 6bpc)
+PIPEACONF: 0xc0000050 (enabled, active, pf-pd, rotate 0, 6bpc)

-TRANSACONF: 0xc0000400 (enable, active, progressive)
+TRANSACONF: 0xc0000000 (enable, active, progressive)
Comment 6 Daniel Vetter 2013-06-10 08:25:55 UTC
Do I get a price for guessing the right bug without even checking the register dump?

The below hack should help, please test:

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 56746dc..992e0b4 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -5136,7 +5136,7 @@ static void ironlake_set_pipeconf(struct drm_crtc *crtc,
        int pipe = intel_crtc->pipe;
        uint32_t val;
 
-       val = I915_READ(PIPECONF(pipe));
+       val = 0;
 
        val &= ~PIPECONF_BPC_MASK;
        switch (intel_crtc->config.pipe_bpp) {
Comment 7 Chris Wilson 2013-06-10 08:43:16 UTC
That bit in PIPECONF selects the 10-bit gamma ramp, we only supply an 8-bit ramp...
Comment 8 Thomas Hebb 2013-06-10 10:10:23 UTC
Daniel: You're right. The banding does not occur with that patch. xgamma works correctly both before and after suspend/resume as well.
Comment 9 Chris Wilson 2013-06-12 10:38:37 UTC
Daniel: *poke*. I presume you are going to submit a patch to compute pipeconf from scratch and remove all the rmw sequences...
Comment 10 Daniel Vetter 2013-06-13 09:59:22 UTC
Patch merged to -next as

commit 2638cf2a81964ad7d6555c88cbc8be33857356a3
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Thu Jun 13 00:54:59 2013 +0200

    drm/i915: explicitly set up PIPECONF (and gamma table) on haswell

Will get backported once 3.11-rc1 comes out to stable kernels. The patch bears some regression risk, hence the extended testing time.
Comment 11 David Spreen 2013-07-27 11:12:27 UTC
Is there any news on this? Is there any currently released (stable or rc) kernel that includes this patch?
Comment 12 Chris Wilson 2013-07-27 11:24:14 UTC
It was included in v3.11-rc1, but not tagged for immediate inclusion into stable.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.