xf86-video-intel: Branch 'modesetting' - src/i830_display.c

Keith Packard keithp at kemper.freedesktop.org
Wed Feb 21 09:10:11 EET 2007


 src/i830_display.c |   29 ++++++++++++++++++++++++++++-
 1 files changed, 28 insertions(+), 1 deletion(-)

New commits:
diff-tree 3bce8bf0e95e5842399959a5d6f6413e96f03adb (from 5a1a04649c62aa4b1c0617560b813642ce0c67b5)
Author: Keith Packard <keithp at guitar.keithp.com>
Date:   Tue Feb 20 23:10:17 2007 -0800

    Pre-965 hardware had fixed pipe 1 for panel fitter.
    
    The pipe mode setting code needs to disable the panel fitter when using the
    pipe for things other than LVDS output. The driver was checking for panel
    fitter conflicts using bits that the 965 chipset defines for selecting which
    pipe the panel fitter is connected to. However, on pre-965 hardware, the
    panel fitter works only with pipe 1 and those bits returned 0.
    
    The result was that when pipe 1 was using the panel fitter, configuring pipe
    0 would disable the panel fitter.
    
    The fix provided uses a model-specific test for the panel fitter pipe.

diff --git a/src/i830_display.c b/src/i830_display.c
index e7a5605..2e84705 100644
--- a/src/i830_display.c
+++ b/src/i830_display.c
@@ -644,6 +644,33 @@ i830_get_core_clock_speed(ScrnInfoPtr pS
 }
 
 /**
+ * Return the pipe currently connected to the panel fitter,
+ * or -1 if the panel fitter is not present or not in use
+ */
+static int
+i830_panel_fitter_pipe (I830Ptr	pI830)
+{
+    CARD32  pfit_control;
+    
+    /* i830 doesn't have a panel fitter */
+    if (IS_I830(pI830))
+	return -1;
+    
+    pfit_control = INREG(PFIT_CONTROL);
+    
+    /* See if the panel fitter is in use */
+    if ((pfit_control & PFIT_ENABLE) == 0)
+	return -1;
+    
+    /* 965 can place panel fitter on either pipe */
+    if (IS_I965G(pI830))
+	return (pfit_control >> 29) & 0x3;
+
+    /* older chips can only use pipe 1 */
+    return 1;
+}
+
+/**
  * Sets up registers for the given mode/adjusted_mode pair.
  *
  * The clocks, CRTCs and outputs attached to this CRTC must be off.
@@ -830,7 +857,7 @@ i830_crtc_mode_set(xf86CrtcPtr crtc, Dis
     }
     
     /* Disable the panel fitter if it was on our pipe */
-    if (!IS_I830(pI830) && ((INREG(PFIT_CONTROL) >> 29) & 0x3) == pipe)
+    if (i830_panel_fitter_pipe (pI830) == pipe)
 	OUTREG(PFIT_CONTROL, 0);
 
     i830PrintPll("chosen", &clock);



More information about the xorg-commit mailing list