Bug 29057 - [bisected] display corruption under 800x600 on netbook (1024x600) with 'Full Aspect' scaling
Summary: [bisected] display corruption under 800x600 on netbook (1024x600) with 'Full ...
Status: CLOSED FIXED
Alias: None
Product: DRI
Classification: Unclassified
Component: DRM/Intel (show other bugs)
Version: unspecified
Hardware: All Linux (All)
: high major
Assignee: Chris Wilson
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-14 04:59 UTC by fangxun
Modified: 2017-09-04 10:01 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
xorg log (21.92 KB, text/plain)
2010-07-14 04:59 UTC, fangxun
no flags Details
Fix panel fitting regression. (1.11 KB, patch)
2010-07-17 04:46 UTC, Chris Wilson
no flags Details | Splinter Review

Description fangxun 2010-07-14 04:59:35 UTC
Created attachment 37038 [details]
xorg log

Platform:  pineview
Libdrm: (master)2.4.21-13-gb803918f3f77c62edf22e78cb2095be399753423
Mesa:  (master)mesa_7_6_1_rc1-9251-gc4066b78c0aad41c199eb27157538c2ec9ab5bfd
Xserver:(master)xorg-server-1.8.99.904-26-g3209b094a3b1466b579e8020e12a4f3fa78a5f3f
Xf86_video_intel: (master)2.12.0-28-g2267e5928bd90a6997970584462bd97df447e819
Kernel: (for-linus)dd1ea37d9257bdf118693235dc74003901c55204


Bug detailed description:
-------------------------
When running ut2004, screen get messed up. This issue happens on pineview and 945GME. With bisect and find dd1ea37d9257bdf118693235dc74003901c55204 is first bad commit:
commit dd1ea37d9257bdf118693235dc74003901c55204
Author: Jesse Barnes <jbarnes@virtuousgeek.org>
Date:   Thu Jun 24 11:05:10 2010 -0700

    drm/i915: change default panel fitting mode to preserve aspect ratio

    We did this a long time ago in the DDX driver, but now this fix belongs
    in the kernel.

    Preserving the aspect ratio is a nicer default.

    Fixes https://bugs.freedesktop.org/show_bug.cgi?id=18033.

    Tested-by: Josh Triplett <josh@freedesktop.org>
    Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
    Signed-off-by: Eric Anholt <eric@anholt.net>



Reproduce steps:
----------------
1.Start X  
2.run ut2004
Comment 1 Jesse Barnes 2010-07-14 08:29:03 UTC
Does it break before this patch if you change the aspect ratio as well?  If so, our aspect handling is the real bug, this patch just exposed it more readily.
Comment 2 fangxun 2010-07-15 00:44:20 UTC
You are right. It break before this patch if I change the aspect ratio from 'Full' to 'Full Aspect'. When scaling mode is 'Full Aspect', change resolution to 800x600, screen get messed up(after runnig ut2004, resolution changed from 1024x600 to 800x600, so the problem occurs).
Comment 3 Chris Wilson 2010-07-16 17:15:01 UTC
The regression is:

commit 734b4157b367d66405f7dab80085d17c9c8dd3b5
Author: Krzysztof Halasa <khc@pm.waw.pl>
Date:   Tue May 25 18:41:46 2010 +0200

    drm/i915: Add support for interlaced display.
    
    This doesn't change the clock limits (minimums), i.e. it won't make it
    output 720x576 PAL nor 720x480 NTSC, but it will work with modes like
    1080i etc. (including GLX and textured Xvideo, not sure about the
    overlay).
    
    Tested on i915 + analog VGA, it would be worth checking if newer chips
    (and which ones) still support interlaced mode.
    
    Signed-off-by: Krzysztof Halasa <khc@pm.waw.pl>
    Signed-off-by: Eric Anholt <eric@anholt.net>

in particular the stray:

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 36afe94..4c7c151 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -2354,6 +2354,8 @@ static bool intel_crtc_mode_fixup(struct drm_crtc *crtc,
                if (mode->clock * 3 > 27000 * 4)
                        return MODE_CLOCK_HIGH;
        }
+
+       drm_mode_set_crtcinfo(adjusted_mode, 0);
        return true;
 }
Comment 4 Chris Wilson 2010-07-17 04:46:55 UTC
Created attachment 37147 [details] [review]
Fix panel fitting regression.
Comment 5 fangxun 2010-07-19 00:50:32 UTC
It works fine with the patch. Thanks.
Comment 6 Chris Wilson 2010-07-19 07:53:34 UTC
fangxuan, do you mind replying to 1279367168-24108-1-git-send-email-chris@chris-wilson.co.uk on intel-gfx@lists.freedesktop.org with your tested-by? Thanks.
Comment 7 Jesse Barnes 2010-07-19 11:50:18 UTC
Thanks Chris.
Comment 8 Chris Wilson 2010-07-26 13:27:26 UTC
commit 0cc4d4300c28d5c3fc73e5ec91bfd4b0c2c744af
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Sat Jul 17 12:43:20 2010 +0100

    drm/i915: Fix panel fitting regression since 734b4157
    
    The crtc mode fixup is run after the encoders adjust the mode to fit on
    their output, so don't reset the mode!
    
    Fixes:
    
      Bug 29057 - display corruption under 800x600 on netbook
                  (1024x600) with 'Full Aspect' scaling
      https://bugs.freedesktop.org/show_bug.cgi?id=29057
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
    Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
    Tested-by: Xun Fang <xunx.fang@intel.com>
    Signed-off-by: Eric Anholt <eric@anholt.net>

Applied to anholt/for-linus [2.6.35]
Comment 9 fangxun 2010-08-12 01:57:18 UTC
Mark it as verified.
Comment 10 Jari Tahvanainen 2017-09-04 10:01:58 UTC
Closing old verified+fixed.


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.