Bug 13462 - Unused bands in intefb console and smaller 180x56 -> 128x48
Summary: Unused bands in intefb console and smaller 180x56 -> 128x48
Status: CLOSED CODE_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: Video(DRI - non Intel) (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: drivers_video-dri
URL:
Keywords:
Depends on:
Blocks: 13070
  Show dependency tree
 
Reported: 2009-06-05 16:30 UTC by Santi
Modified: 2009-06-28 19:14 UTC (History)
2 users (show)

See Also:
Kernel Version: v2.6.30-rc8-5-gc9fb15f
Subsystem:
Regression: Yes
Bisected commit-id:


Attachments
Xorg.0.log, just in case there is useful info (24.90 KB, text/plain)
2009-06-05 16:30 UTC, Santi
Details

Description Santi 2009-06-05 16:30:04 UTC
Created attachment 21768 [details]
Xorg.0.log, just in case there is useful info

Hello,

  I've tested the code in latest linux-2.6.git (v2.6.30-rc8-13-gb87297f) and I've found a regression. Now I have unused screen in the bottom and the right of the screen, additionally the size of the console also change, 180x56 -> 128x48.

-Console: switching to colour frame buffer device 180x56
+Console: switching to colour frame buffer device 128x48

  I've bisected it down to:

commit c9fb15f60eb517c958dec64dca9357bf62bf2201
Author: Keith Packard <keithp@keithp.com>
Date:   Sun May 31 05:42:28 2009

    drm: Hook up DPMS property handling in drm_crtc.c. Add drm_helper_connector_dpms.
    
    Making the drm_crtc.c code recognize the DPMS property and invoke the
    connector->dpms function doesn't remove any capability from the driver while
    reducing code duplication.
    
    That just highlighted the problem with the existing DPMS functions which
    could turn off the connector, but failed to turn off any relevant crtcs. The
    new drm_helper_connector_dpms function manages all of that, using the
    drm_helper-specific crtc and encoder dpms functions, automatically computing
    the appropriate DPMS level for each object in the system.
    
    This fixes the current troubles in the i915 driver which left PLLs, pipes
    and planes running while in DPMS_OFF mode or even while they were unused.
    
    Signed-off-by: Keith Packard <keithp@keithp.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

Also reverting this commit also fixes the issue. My machine is a Dell Latitude E5400, with an intel card:

00:02.1 Display controller: Intel Corporation Mobile 4 Series Chipset Integrated Graphics Controller (rev 07)

with an LVDS. Some DRM info from dmesg:

DRM Information from dmesg:
[    0.579953] [drm] Initialized drm 1.1.0 20060810
[    0.586016] [drm] MTRR allocation failed.  Graphics performance may suffer.
[    1.423615] [drm] TV-18: set mode NTSC 480i 0
[    1.610925] [drm] LVDS-8: set mode 1440x900 1a
[    1.991910] fb0: inteldrmfb frame buffer device
[    2.017771] [drm] Initialized i915 1.6.0 20080730 for 0000:00:02.0 on minor 0
[   18.757526] [drm] TV-18: set mode NTSC 480i 0
[   18.898089] [drm] TV-18: set mode NTSC 480i 0
[   19.338302] [drm] TV-18: set mode NTSC 480i 0
[   19.478601] [drm] TV-18: set mode NTSC 480i 0
[   32.086362] [drm] TV-18: set mode NTSC 480i 0
[   32.226401] [drm] TV-18: set mode NTSC 480i 0
[   32.654244] [drm] TV-18: set mode NTSC 480i 0
[   32.795055] [drm] TV-18: set mode NTSC 480i 0
[   33.230331] [drm] TV-18: set mode NTSC 480i 0
[   33.370942] [drm] TV-18: set mode NTSC 480i 0

Thanks,
Santi
Comment 1 Keith Packard 2009-06-05 17:00:00 UTC
The problem here appears to be that the TV output is mis-detected, which makes the fb code limit the size to 1024x768.
Comment 2 Keith Packard 2009-06-06 01:23:04 UTC
Ok, I've discovered why this patch has this effect -- the bisected patch changes when crtcs are determined to be 'active'. In the past, a crtc was determined to be active if any encoders were using it, now we also require that said encoders be hooked to some connector.

The intel load detection code wasn't hooking the TV connector to the TV encoder, and so the mode setting operation during load detection wasn't actually turning on the hardware, so the load detection depended on whether the TV was already running.

I've posted the following patch to drm-devel and intel-gfx:

commit 1cdeb72d2dfc0e724b9d150db38e512fc438b13a
Author: Keith Packard <keithp@keithp.com>
Date:   Fri Jun 5 18:16:11 2009 -0700

    drm/i915: Hook connector to encoder during load detection (fixes tv/vga detect)
    
    With the DRM-driven DPMS code, encoders are considered idle unless a
    connector is hooked to them, so mode setting is skipped. This makes load
    detection fail as none of the hardware is enabled.
    
    Signed-off-by: Keith Packard <keithp@keithp.com>

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 220d54d..dcb5e49 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -1676,6 +1676,7 @@ struct drm_crtc *intel_get_load_detect_pipe(struct intel_output *intel_output,
        }
 
        encoder->crtc = crtc;
+       intel_output->base.encoder = encoder;
        intel_output->load_detect_temp = true;
 
        intel_crtc = to_intel_crtc(crtc);
@@ -1711,6 +1712,7 @@ void intel_release_load_detect_pipe(struct intel_output *intel_output, int dpms_
 
        if (intel_output->load_detect_temp) {
                encoder->crtc = NULL;
+               intel_output->base.encoder = NULL;
                intel_output->load_detect_temp = false;
                crtc->enabled = drm_helper_crtc_in_use(crtc);
                drm_helper_disable_unused_functions(dev);
Comment 3 Santi 2009-06-06 08:51:53 UTC
Ok, thanks. This patch fixes the bug.
Comment 4 Rafael J. Wysocki 2009-06-07 09:53:20 UTC
First-Bad-Commit : c9fb15f60eb517c958dec64dca9357bf62bf2201
Handled-By : Keith Packard <keithp@keithp.com>
Patch : http://bugzilla.kernel.org/show_bug.cgi?id=13462#c2

Note You need to log in before you can comment on or make changes to this bug.