[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

xserver-xorg-video-intel: Changes to 'upstream-experimental'



Rebased ref, commits from common ancestor:
commit f3b72c59e5000bcdb07cbdf080e09c55b9826eff
Author: Zhenyu Wang <zhenyu.z.wang@intel.com>
Date:   Wed Jul 23 16:02:02 2008 +0800

    Bump version 2.4.0

diff --git a/configure.ac b/configure.ac
index 2dabd4f..6694773 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,7 +22,7 @@
 
 AC_PREREQ(2.57)
 AC_INIT([xf86-video-intel],
-        2.2.0,
+        2.4.0,
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         xf86-video-intel)
 

commit 5c447fa50ecd4fe7f971b1e6deb8908e98afa61b
Author: Zhenyu Wang <zhenyu.z.wang@intel.com>
Date:   Wed Jul 23 15:10:07 2008 +0800

    shut up gcc warning
    (cherry picked from commit 6ac352f146bafe3b4bb5832340eb0ccb730565d2)

diff --git a/src/i965_render.c b/src/i965_render.c
index 1cbfe24..8360be4 100644
--- a/src/i965_render.c
+++ b/src/i965_render.c
@@ -862,7 +862,7 @@ i965_set_picture_surface_state(ScrnInfoPtr pScrn, struct brw_surface_state *ss,
     memset(&local_ss, 0, sizeof(local_ss));
     local_ss.ss0.surface_type = BRW_SURFACE_2D;
     if (is_dst) {
-	uint32_t dst_format;
+	uint32_t dst_format = 0;
 	Bool ret = TRUE;
 
 	ret = i965_get_dest_format(pPicture, &dst_format);

commit e6d0586db95cab1cdf2f8485a1a1a895f18118e4
Author: Zhenyu Wang <zhenyu.z.wang@intel.com>
Date:   Wed Jul 23 15:07:48 2008 +0800

    Fix distcheck for clean doltcompile
    (cherry picked from commit 075cf7fce57da4e51acafb3bfd3d61ba1a8096d5)

diff --git a/Makefile.am b/Makefile.am
index 8cbe4a9..b2398a8 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -22,3 +22,4 @@ AUTOMAKE_OPTIONS = foreign
 SUBDIRS = src man
 
 EXTRA_DIST = README
+DISTCLEANFILES = doltcompile

commit fe9fba38e9c4bdb1b242760b9e565852f717de09
Author: Zhenyu Wang <zhenyu.z.wang@intel.com>
Date:   Wed Jul 23 11:16:14 2008 +0800

    Fix HDMI output number
    
    Output 33 is confusing.
    (cherry picked from commit 29d982c6bf873c6685bd0e395a8b0e5e3b1063e0)

diff --git a/src/i830_hdmi.c b/src/i830_hdmi.c
index b738463..58d1c49 100644
--- a/src/i830_hdmi.c
+++ b/src/i830_hdmi.c
@@ -229,5 +229,5 @@ i830_hdmi_init(ScrnInfoPtr pScrn, int output_reg)
 
     xf86DrvMsg(pScrn->scrnIndex, X_INFO,
 	       "HDMI output %d detected\n",
-	       1 + (output_reg - SDVOB));
+	       (output_reg == SDVOB) ? 1 : 2);
 }

commit 3f5c9bd512907238a2fd6746a41d8703aefe39e9
Author: Eric Anholt <eric@anholt.net>
Date:   Thu Mar 6 13:59:06 2008 -0800

    Add little hotplug detector app.
    (cherry picked from commit b60bbbfd7b7dcf31726ad615a493f34f17cc6309)

diff --git a/src/reg_dumper/hotplug.c b/src/reg_dumper/hotplug.c
new file mode 100644
index 0000000..68fe584
--- /dev/null
+++ b/src/reg_dumper/hotplug.c
@@ -0,0 +1,151 @@
+/*
+ * Copyright © 2007 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Authors:
+ *    Eric Anholt <eric@anholt.net>
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdarg.h>
+#include <pciaccess.h>
+#include <err.h>
+#include <unistd.h>
+
+#include "reg_dumper.h"
+#include "../i810_reg.h"
+
+struct idle_flags {
+    uint32_t instdone_flag;
+    char *name;
+    unsigned int count;
+};
+
+int main(int argc, char **argv)
+{
+    struct pci_device *dev;
+    I830Rec i830;
+    I830Ptr pI830 = &i830;
+    ScrnInfoRec scrn;
+    int err, mmio_bar;
+    void *mmio;
+    int i;
+
+    err = pci_system_init();
+    if (err != 0) {
+	fprintf(stderr, "Couldn't initialize PCI system: %s\n", strerror(err));
+	exit(1);
+    }
+
+    /* Grab the graphics card */
+    dev = pci_device_find_by_slot(0, 0, 2, 0);
+    if (dev == NULL)
+	errx(1, "Couldn't find graphics card");
+
+    err = pci_device_probe(dev);
+    if (err != 0) {
+	fprintf(stderr, "Couldn't probe graphics card: %s\n", strerror(err));
+	exit(1);
+    }
+
+    if (dev->vendor_id != 0x8086)
+	errx(1, "Graphics card is non-intel");
+
+    i830.PciInfo = &i830.pci_info_rec;
+    i830.PciInfo->chipType = dev->device_id;
+
+    i830.pci_dev = dev;
+
+    mmio_bar = IS_I9XX((&i830)) ? 0 : 1;
+
+    err = pci_device_map_range (dev,
+				dev->regions[mmio_bar].base_addr,
+				dev->regions[mmio_bar].size, 
+				PCI_DEV_MAP_FLAG_WRITABLE,
+				&mmio);
+
+    if (err != 0) {
+	fprintf(stderr, "Couldn't map MMIO region: %s\n", strerror(err));
+	exit(1);
+    }
+    i830.mmio = mmio;
+
+    scrn.scrnIndex = 0;
+    scrn.pI830 = &i830;
+
+    OUTREG(SDVOB, (0x0 << 10));
+    OUTREG(SDVOC, (0x0 << 10));
+
+    OUTREG(PORT_HOTPLUG_EN,
+	   (1 << 29) |
+	   (1 << 28) |
+	   (1 << 27) |
+	   SDVOB_HOTPLUG_INT_EN |
+	   SDVOC_HOTPLUG_INT_EN |
+	   (1 << 24) |
+	   CRT_HOTPLUG_INT_EN |
+	   TV_HOTPLUG_INT_EN |
+	   CRT_HOTPLUG_INT_EN);
+
+    for (i = 0;; i++) {
+	OUTREG(PORT_HOTPLUG_STAT,
+	       (1 << 20) |
+	       (1 << 19) |
+	       (1 << 18) |
+	       (1 << 17) |
+	       CRT_HOTPLUG_INT_STATUS |
+	       TV_HOTPLUG_INT_STATUS |
+	       SDVOC_HOTPLUG_INT_STATUS |
+	       SDVOB_HOTPLUG_INT_STATUS);
+	INREG(PORT_HOTPLUG_STAT);
+
+	usleep(500 * 1000);
+
+	printf("%5d: 0x%08x\n", i, INREG(PORT_HOTPLUG_STAT));
+	sleep(1);
+    }
+
+    return 0;
+}
+
+void xf86DrvMsg(int scrnIndex, int severity, const char *format, ...)
+{
+    va_list va;
+
+    switch (severity) {
+    case X_INFO:
+	printf("(II): ");
+	break;
+    case X_WARNING:
+	printf("(WW): ");
+	break;
+    case X_ERROR:
+	printf("(EE): ");
+	break;
+    }
+
+    va_start(va, format);
+    vprintf(format, va);
+    va_end(va);
+}

commit 202811e253be85c4415bba3eaae13508b1e2ce71
Author: Eric Anholt <eric@anholt.net>
Date:   Thu Mar 6 14:00:18 2008 -0800

    Remove VGA regs from debug output.
    (cherry picked from commit 52a414d1158aa7512fb79560dc220e2a78456a2d)

diff --git a/src/i830_debug.c b/src/i830_debug.c
index 856e31a..a7f1683 100644
--- a/src/i830_debug.c
+++ b/src/i830_debug.c
@@ -722,6 +722,7 @@ void i830CompareRegsToSnapshot(ScrnInfoPtr pScrn, char *where)
 }
 #endif /* !REG_DUMPER */
 
+#if 0
 static void i830DumpIndexed (ScrnInfoPtr pScrn, char *name, int id, int val, int min, int max)
 {
     I830Ptr pI830 = I830PTR(pScrn);
@@ -762,6 +763,7 @@ static void i830DumpAR(ScrnInfoPtr pScrn)
     OUTREG8(0x3c0, orig_arx);
     INREG8(st01); /* switch back to index mode */
 }
+#endif
 
 void i830DumpRegs (ScrnInfoPtr pScrn)
 {
@@ -773,8 +775,10 @@ void i830DumpRegs (ScrnInfoPtr pScrn)
     int ref;
     int	dot;
     int phase;
+#if 0
     int msr;
     int crt;
+#endif
 
     xf86DrvMsg (pScrn->scrnIndex, X_INFO, "DumpRegsBegin\n");
     for (i = 0; i < NUM_I830_SNAPSHOTREGS; i++) {
@@ -792,6 +796,7 @@ void i830DumpRegs (ScrnInfoPtr pScrn)
 			i830_snapshot[i].name, (unsigned int)val);
 	}
     }
+#if 0
     i830DumpIndexed (pScrn, "SR", 0x3c4, 0x3c5, 0, 7);
     msr = INREG8(0x3cc);
     xf86DrvMsg (pScrn->scrnIndex, X_INFO, "%20.20s: 0x%02x\n",
@@ -803,6 +808,7 @@ void i830DumpRegs (ScrnInfoPtr pScrn)
     else
 	crt = 0x3b0;
     i830DumpIndexed (pScrn, "CR", crt + 4, crt + 5, 0, 0x24);
+#endif
     for (pipe = 0; pipe <= 1; pipe++)
     {
 	fp = INREG(pipe == 0 ? FPA0 : FPB0);
diff --git a/src/reg_dumper/.gitignore b/src/reg_dumper/.gitignore
index f72a165..b0f9b6f 100644
--- a/src/reg_dumper/.gitignore
+++ b/src/reg_dumper/.gitignore
@@ -1,3 +1,4 @@
+intel_hotplug
 intel_idle
 intel_reg_dumper
 intel_stepping
diff --git a/src/reg_dumper/Makefile.am b/src/reg_dumper/Makefile.am
index b840b24..d49a59b 100644
--- a/src/reg_dumper/Makefile.am
+++ b/src/reg_dumper/Makefile.am
@@ -1,4 +1,4 @@
-noinst_PROGRAMS = intel_reg_dumper intel_idle intel_stepping
+noinst_PROGRAMS = intel_reg_dumper intel_idle intel_stepping intel_hotplug
 
 intel_reg_dumper_SOURCES = \
 	main.c \
@@ -12,9 +12,16 @@ intel_idle_SOURCES = \
 	xprintf.c \
 	../i830_debug.c
 
+intel_hotplug_SOURCES = \
+	hotplug.c \
+	reg_dumper.h \
+	xprintf.c \
+	../i830_debug.c
+
 intel_stepping_SOURCES = \
 	stepping.c
 
+intel_hotplug_LDADD = $(PCIACCESS_LIBS)
 intel_reg_dumper_LDADD = $(PCIACCESS_LIBS)
 intel_idle_LDADD = $(PCIACCESS_LIBS)
 intel_stepping_LDADD = $(PCIACCESS_LIBS)

commit b9250913ab57ecade1c3011415c666e8516fce47
Author: Zhenyu Wang <zhenyu.z.wang@intel.com>
Date:   Tue Jul 22 15:29:34 2008 +0800

    Bug #16801: fix X crash when NoAccel on 965
    (cherry picked from commit fd060ce89d86f6e8ff742d5b287abe8ecea32927)

diff --git a/src/i830_driver.c b/src/i830_driver.c
index 5a06079..4bb9b81 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -3307,7 +3307,7 @@ I830LeaveVT(int scrnIndex, int flags)
    }
 #endif /* XF86DRI_MM */
 
-   if (IS_I965G(pI830))
+   if (pI830->useEXA && IS_I965G(pI830))
       gen4_render_state_cleanup(pScrn);
 
    if (pI830->AccelInfoRec)
@@ -3356,7 +3356,7 @@ I830EnterVT(int scrnIndex, int flags)
    /* Update the screen pixmap in case the buffer moved */
    i830_update_front_offset(pScrn);
 
-   if (IS_I965G(pI830))
+   if (pI830->useEXA && IS_I965G(pI830))
       gen4_render_state_init(pScrn);
 
    if (i830_check_error_state(pScrn)) {

commit 0403234dd1cdf4aa02709c1fbd815f002e1ace63
Author: Zhenyu Wang <zhenyu.z.wang@intel.com>
Date:   Tue Jul 22 15:14:14 2008 +0800

    only check pipe underrun if vtSema is true.
    (cherry picked from commit 577c4d1a0c753fb46d43be05a9781d2e204fac45)

diff --git a/src/i830_driver.c b/src/i830_driver.c
index 390b5e7..5a06079 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -2512,16 +2512,18 @@ I830BlockHandler(int i,
      * (except for mode setting, where it may occur naturally).
      * Check & ack the condition.
      */
-    if (xf86_config->crtc[0]->enabled &&
-	    (INREG(PIPEASTAT) & FIFO_UNDERRUN)) {
+    if (pScrn->vtSema) {
+	if (xf86_config->crtc[0]->enabled &&
+		(INREG(PIPEASTAT) & FIFO_UNDERRUN)) {
 	    xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "underrun on pipe A!\n");
 	    OUTREG(PIPEASTAT, INREG(PIPEASTAT) | FIFO_UNDERRUN);
-    }
-    if (xf86_config->num_crtc > 1 &&
-	    xf86_config->crtc[1]->enabled &&
-	    (INREG(PIPEBSTAT) & FIFO_UNDERRUN)) {
+	}
+	if (xf86_config->num_crtc > 1 &&
+		xf86_config->crtc[1]->enabled &&
+		(INREG(PIPEBSTAT) & FIFO_UNDERRUN)) {
 	    xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "underrun on pipe B!\n");
 	    OUTREG(PIPEBSTAT, INREG(PIPEBSTAT) | FIFO_UNDERRUN);
+	}
     }
 
     I830VideoBlockHandler(i, blockData, pTimeout, pReadmask);

commit e7533a253178a867a9ad37f5fd3789b21ff38162
Author: Zhenyu Wang <zhenyu.z.wang@intel.com>
Date:   Tue Jul 22 15:08:57 2008 +0800

    SSC is LVDS only
    
    Fix regression on my 855GM for VGA output.
    (cherry picked from commit 04bbed2248e3e8f86efd64225abf2db8eb552653)

diff --git a/src/i830_display.c b/src/i830_display.c
index 69bf7f7..6176447 100644
--- a/src/i830_display.c
+++ b/src/i830_display.c
@@ -1249,7 +1249,7 @@ i830_crtc_mode_set(xf86CrtcPtr crtc, DisplayModePtr mode,
 	xf86DrvMsg(pScrn->scrnIndex, X_INFO, "clone detected, disabling SSC\n");
 
     /* Don't use SSC when cloned */
-    if (pI830->lvds_use_ssc && num_outputs < 2) {
+    if (is_lvds && pI830->lvds_use_ssc && num_outputs < 2) {
 	refclk = pI830->lvds_ssc_freq * 1000;
 	xf86DrvMsg(pScrn->scrnIndex, X_INFO,
 		   "using SSC reference clock of %d MHz\n", refclk / 1000);

commit 7f040c63bbfef0b577eeac2052c1951bdbfa3386
Author: Zhenyu Wang <zhenyu.z.wang@intel.com>
Date:   Tue Jul 22 10:51:01 2008 +0800

    Check underrun on enabled pipe
    (cherry picked from commit 7defa4f1f0eba82f39e74f96d2ad7ed2481b537e)

diff --git a/src/i830_driver.c b/src/i830_driver.c
index 84aedba..390b5e7 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -2487,6 +2487,7 @@ I830BlockHandler(int i,
     ScreenPtr pScreen = screenInfo.screens[i];
     ScrnInfoPtr pScrn = xf86Screens[i];
     I830Ptr pI830 = I830PTR(pScrn);
+    xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
 
     pScreen->BlockHandler = pI830->BlockHandler;
 
@@ -2511,11 +2512,14 @@ I830BlockHandler(int i,
      * (except for mode setting, where it may occur naturally).
      * Check & ack the condition.
      */
-    if (INREG(PIPEASTAT) & FIFO_UNDERRUN) {
+    if (xf86_config->crtc[0]->enabled &&
+	    (INREG(PIPEASTAT) & FIFO_UNDERRUN)) {
 	    xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "underrun on pipe A!\n");
 	    OUTREG(PIPEASTAT, INREG(PIPEASTAT) | FIFO_UNDERRUN);
     }
-    if (INREG(PIPEBSTAT) & FIFO_UNDERRUN) {
+    if (xf86_config->num_crtc > 1 &&
+	    xf86_config->crtc[1]->enabled &&
+	    (INREG(PIPEBSTAT) & FIFO_UNDERRUN)) {
 	    xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "underrun on pipe B!\n");
 	    OUTREG(PIPEBSTAT, INREG(PIPEBSTAT) | FIFO_UNDERRUN);
     }

commit 06c5a72a496fabace408fbb8733f299a408d1c7c
Author: Zhenyu Wang <zhenyu.z.wang@intel.com>
Date:   Tue Jul 22 09:51:54 2008 +0800

    Thinkpad R60e TV quirk via DMI info
    (cherry picked from commit b7765b0837af4cc80f1257ba04495140ef5d536e)

diff --git a/src/i830_quirks.c b/src/i830_quirks.c
index 164a70c..5ae2898 100644
--- a/src/i830_quirks.c
+++ b/src/i830_quirks.c
@@ -203,7 +203,8 @@ static void quirk_lenovo_tv_dmi (I830Ptr pI830)
 	ErrorF("Failed to load DMI info, X60 TV quirk not applied.\n");
 	return;
     }
-    if (!strncmp(i830_dmi_data[bios_version], "7B", 2))
+    if (!strncmp(i830_dmi_data[bios_version], "7B", 2) || /* X60, X60s */
+	    !strncmp(i830_dmi_data[bios_version], "7E", 2)) /* R60e */
 	pI830->quirk_flag |= QUIRK_IGNORE_TV;
 }
 

commit 13959ee3984d5f34c976287c8f5406393ceacc30
Author: Jesse Barnes <jbarnes@hobbes.lan>
Date:   Mon Jul 21 11:48:38 2008 -0700

    Add no LVDS quirk for Transtec Senyo 610 mini PC
    
    Fixes FDO #16757.
    (cherry picked from commit ed0fbd016b8fbcf01eddfd17fd25e745e7af2ba4)

diff --git a/src/i830_quirks.c b/src/i830_quirks.c
index 3becf35..164a70c 100644
--- a/src/i830_quirks.c
+++ b/src/i830_quirks.c
@@ -222,6 +222,9 @@ static i830_quirk i830_quirk_list[] = {
     /* Apple Mac mini has no lvds, but macbook pro does */
     { PCI_CHIP_I945_GM, 0x8086, 0x7270, quirk_mac_mini },
 
+    /* Transtec Senyo 610 mini pc */
+    { PCI_CHIP_I965_GM, 0x1509, 0x2f15, quirk_ignore_lvds },
+
     /* Clevo M720R has no tv output */
     { PCI_CHIP_I965_GM, 0x1558, 0x0721, quirk_ignore_tv },
 

commit fe4e1376dbb143665d7d98b04cd9ee2309911b54
Author: Eric Anholt <eric@anholt.net>
Date:   Fri Jul 18 14:50:08 2008 -0700

    Fix distcheck.
    (cherry picked from commit 62a037b0585d6ecb43daac9d4eb0927a4618a367)

diff --git a/src/Makefile.am b/src/Makefile.am
index 1e4ad28..594416d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -139,7 +139,6 @@ INTEL_G4A =				\
 	exa_wm_src_sample_argb.g4a 	\
 	exa_wm_src_sample_a.g4a 	\
 	exa_wm_src_sample_planar.g4a 	\
-	exa_wm_src_data.g4a		\
 	exa_wm_mask_affine.g4a 		\
 	exa_wm_mask_projective.g4a 	\
 	exa_wm_mask_sample_argb.g4a 	\
@@ -148,6 +147,7 @@ INTEL_G4A =				\
 	exa_wm_ca.g4a			\
 	exa_wm_ca_srcalpha.g4a		\
 	exa_wm_write.g4a 		\
+	exa_wm_yuv_rgb.g4a		\
 	exa_wm_xy.g4a
 
 INTEL_G4I =				\
@@ -166,7 +166,6 @@ INTEL_G4B = 				\
 	exa_wm_src_sample_argb.g4b 	\
 	exa_wm_src_sample_a.g4b 	\
 	exa_wm_src_sample_planar.g4b 	\
-	exa_wm_src_data.g4b		\
 	exa_wm_mask_affine.g4b 		\
 	exa_wm_mask_projective.g4b 	\
 	exa_wm_mask_sample_argb.g4b 	\
@@ -175,6 +174,7 @@ INTEL_G4B = 				\
 	exa_wm_ca.g4b			\
 	exa_wm_ca_srcalpha.g4b		\
 	exa_wm_write.g4b 		\
+	exa_wm_yuv_rgb.g4b		\
 	exa_wm_xy.g4b
 	
 EXTRA_DIST = 		\

commit c5df5912025b432476d9c8bcafd669974ec296c7
Author: Eric Anholt <eric@anholt.net>
Date:   Fri Jul 18 14:56:18 2008 -0700

    Fix uninitialized-use warning in i830_debug.c ring dumping.
    (cherry picked from commit 3cbfc6c76bcd2bc9194a944092f6ce0881ff9da2)

diff --git a/src/i830_debug.c b/src/i830_debug.c
index 00f18e5..856e31a 100644
--- a/src/i830_debug.c
+++ b/src/i830_debug.c
@@ -1308,8 +1308,6 @@ i830_valid_command (uint32_t cmd)
 	if (!mi_cmds[opcode])
 	    return -1;
 	break;
-    case 1:
-	break;
     case 2:			    /* 2D */
 	count = (cmd & 0x1f) + 2;
 	opcode = (cmd >> 22) & 0x7f;

commit 139659f722c20525bb24879528dc90e0e09af49f
Author: Eric Anholt <eric@anholt.net>
Date:   Fri Jul 18 14:53:26 2008 -0700

    Get prototype for i830_bios_get_tv().
    (cherry picked from commit 1b1c4975768f63ed0f3933ec384d24c324a383b3)

diff --git a/src/i830_tv.c b/src/i830_tv.c
index 651f77b..1022c46 100644
--- a/src/i830_tv.c
+++ b/src/i830_tv.c
@@ -36,6 +36,7 @@
 #include "xf86.h"
 #include "i830.h"
 #include "i830_display.h"
+#include "i830_bios.h"
 #include "X11/Xatom.h"
 #include <string.h>
 

commit 37848925c4557385f154443ffbb917a8203506f8
Author: Jesse Barnes <jbarnes@nietzche.virtuousgeek.org>
Date:   Thu Jul 17 14:41:51 2008 -0700

    Choose a split for DSPARB based on the configured modes for both planes.
    
    Previously, we were attempting to give both planes equal space in the FIFO
    to be fair.  However, larger modes require more fifo space, so split it based
    on the relative HDisplay of the modes.  This should resolve some fifo underrun
    issues with differently-sized displays, or single large ones.
    
    Bug #16169.
    (cherry picked from commit b8ca1c747a679c931267363639fc0bc690cae2d6)

diff --git a/src/i830_display.c b/src/i830_display.c
index 3967b69..69bf7f7 100644
--- a/src/i830_display.c
+++ b/src/i830_display.c
@@ -1093,6 +1093,79 @@ i830_panel_fitter_pipe(I830Ptr pI830)
 }
 
 /**
+ * Sets up the DSPARB register to split the display fifo appropriately between
+ * the display planes.
+ *
+ * Adjusting this register requires that the planes be off.
+ */
+static void
+i830_update_dsparb(ScrnInfoPtr pScrn)
+{
+   xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
+   I830Ptr pI830 = I830PTR(pScrn);
+   uint32_t dspacntr, dspbcntr;
+   int total_hdisplay = 0, planea_hdisplay = 0, planeb_hdisplay = 0;
+   int fifo_entries = 0, planea_entries = 0, planeb_entries = 0, i;
+
+   dspacntr = INREG(DSPACNTR);
+   dspbcntr = INREG(DSPBCNTR);
+
+   /* Disable planes since DSPARB can only be updated when they're
+    * off.
+    */
+   OUTREG(DSPACNTR, dspacntr & ~DISPLAY_PLANE_ENABLE);
+   OUTREG(DSPBCNTR, dspbcntr & ~DISPLAY_PLANE_ENABLE);
+   i830WaitForVblank(pScrn);
+
+   /*
+    * FIFO entries will be split based on programmed modes
+    */
+   if (IS_I965GM(pI830) || IS_GM45(pI830))
+       fifo_entries = 127;
+   else if (IS_I9XX(pI830))
+       fifo_entries = 95;
+   else if (IS_MOBILE(pI830)) {
+       fifo_entries = 255;
+   } else {
+	/* The 845/865 only have a AEND field.  Though the field size would
+	* allow 128 entries, the 865 rendered the cursor wrong then.
+	* The BIOS set it up for 96.
+	*/
+	fifo_entries = 95;
+   }
+
+   for (i = 0; i < xf86_config->num_crtc; i++) {
+      xf86CrtcPtr crtc = xf86_config->crtc[i];
+      I830CrtcPrivatePtr intel_crtc = crtc->driver_private;
+      if (crtc->enabled) {
+	  total_hdisplay += crtc->mode.HDisplay;
+	  if (intel_crtc->plane == 0)
+	      planea_hdisplay = crtc->mode.HDisplay;
+	  else
+	      planeb_hdisplay = crtc->mode.HDisplay;
+      }
+   }
+
+   planea_entries = fifo_entries * planea_hdisplay / total_hdisplay;
+   planeb_entries = fifo_entries * planeb_hdisplay / total_hdisplay;
+
+   if (IS_I9XX(pI830))
+       OUTREG(DSPARB,
+	      ((planea_entries + planeb_entries) << DSPARB_CSTART_SHIFT) |
+	      (planea_entries << DSPARB_BSTART_SHIFT));
+   else if (IS_MOBILE(pI830))
+       OUTREG(DSPARB,
+	      ((planea_entries + planeb_entries) << DSPARB_BEND_SHIFT) |
+	      (planea_entries << DSPARB_AEND_SHIFT));
+   else
+       OUTREG(DSPARB, planea_entries << DSPARB_AEND_SHIFT);
+
+   OUTREG(DSPACNTR, dspacntr);
+   OUTREG(DSPBCNTR, dspbcntr);
+   i830WaitForVblank(pScrn);
+}
+
+/**
  * Sets up registers for the given mode/adjusted_mode pair.
  *
  * The clocks, CRTCs and outputs attached to this CRTC must be off.
@@ -1437,6 +1510,8 @@ i830_crtc_mode_set(xf86CrtcPtr crtc, DisplayModePtr mode,
     
     i830WaitForVblank(pScrn);
 
+    i830_update_dsparb(pScrn);
+
     /* Clear any FIFO underrun status that may have occurred normally */
     OUTREG(pipestat_reg, INREG(pipestat_reg) | FIFO_UNDERRUN);
 }
diff --git a/src/i830_driver.c b/src/i830_driver.c
index e29dd10..84aedba 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -1954,59 +1954,6 @@ i830_refresh_ring(ScrnInfoPtr pScrn)
    i830MarkSync(pScrn);
 }
 
-/**
- * Sets up the DSPARB register to split the display fifo appropriately between
- * the display planes.
- *
- * Adjusting this register requires that the planes be off, thus as a side
- * effect they are disabled by this function.
- */
-static void
-i830_set_dsparb(ScrnInfoPtr pScrn)
-{
-   xf86CrtcConfigPtr   xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
-   I830Ptr pI830 = I830PTR(pScrn);
-   int i;
-
-   /* Disable outputs & pipes since DSPARB can only be updated when they're
-    * off.
-    */
-   for (i = 0; i < xf86_config->num_output; i++) {
-       xf86OutputPtr   output = xf86_config->output[i];
-       output->funcs->dpms(output, DPMSModeOff);
-   }
-   i830WaitForVblank(pScrn);
-   for (i = 0; i < xf86_config->num_crtc; i++) {
-       xf86CrtcPtr crtc = xf86_config->crtc[i];
-       crtc->funcs->dpms(crtc, DPMSModeOff);
-   }
-   i830WaitForVblank(pScrn);
-
-   /* Fixup FIFO defaults:
-    * we don't use plane C at all so we can allocate all but one of the 96
-    * FIFO RAM entries equally between planes A and B.
-    */
-   if (IS_I9XX(pI830)) {
-       if (IS_I965GM(pI830) || IS_GM45(pI830))
-	   OUTREG(DSPARB, (127 << DSPARB_CSTART_SHIFT) |
-		  (64 << DSPARB_BSTART_SHIFT));
-       else
-	   OUTREG(DSPARB, (95 << DSPARB_CSTART_SHIFT) |
-		  (48 << DSPARB_BSTART_SHIFT));
-   } else {
-       if (IS_MOBILE(pI830)) {
-	   /* The 830 has 288 entries, and the 855 has 256. */
-	   OUTREG(DSPARB, 254 << DSPARB_BEND_SHIFT | 128 << DSPARB_AEND_SHIFT);
-       } else {
-	   /* The 845/865 only have a AEND field.  Though the field size would
-	    * allow 128 entries, the 865 rendered the cursor wrong then.
-	    * The BIOS set it up for 96.
-	    */
-	   OUTREG(DSPARB, 95 << DSPARB_AEND_SHIFT);
-       }
-   }
-}
-
 enum pipe {
     PIPE_A = 0,
     PIPE_B,
@@ -3416,11 +3363,6 @@ I830EnterVT(int scrnIndex, int flags)
    if (!pI830->SWCursor)
       I830InitHWCursor(pScrn);
 
-   /* Set the DSPARB register.  This disables the outputs, which is about to
-    * happen (likely) in xf86SetDesiredModes anyway.
-    */
-   i830_set_dsparb(pScrn);
-
    /* Tell the BIOS that we're in control of mode setting now. */
    i830_init_bios_control(pScrn);
 

commit 91cbb5b8ad1fbc22dd77c0329fc3962b1ca99b9e
Author: Jesse Barnes <jbarnes@hobbes.lan>
Date:   Thu Jul 17 12:30:57 2008 -0700

    Don't disable pipe A on 855 chips
    
    It needs to stay enabled or we may see hangs when trying to re-enable it (say
    at VT switch time).
    
    Fixes FDO bug #15168.
    (cherry picked from commit b37a2a8ca82279468e3806dcf77d5fa7bdd0e874)

diff --git a/src/i830_quirks.c b/src/i830_quirks.c
index 5eb01be..3becf35 100644
--- a/src/i830_quirks.c
+++ b/src/i830_quirks.c
@@ -309,6 +309,9 @@ static i830_quirk i830_quirk_list[] = {
     /* Littlebit Sepia X35 (rebranded Asus Z37E) (See LP: #201257) */
     { PCI_CHIP_I965_GM, 0x1043, 0x8265, quirk_ignore_tv },
 
+    /* 855 & before need to leave pipe A & dpll A up */
+    { PCI_CHIP_I855_GM, SUBSYS_ANY, SUBSYS_ANY, quirk_pipea_force },
+
     { 0, 0, 0, NULL },
 };
 
@@ -325,9 +328,10 @@ void i830_fixup_devices(ScrnInfoPtr scrn)
 
     while (p && p->chipType != 0) {
 	if (DEVICE_ID(pI830->PciInfo) == p->chipType &&
-		SUBVENDOR_ID(pI830->PciInfo) == p->subsysVendor &&
-		(SUBSYS_ID(pI830->PciInfo) == p->subsysCard ||
-		 p->subsysCard == SUBSYS_ANY))
+	    (SUBVENDOR_ID(pI830->PciInfo) == p->subsysVendor ||
+	     p->subsysVendor == SUBSYS_ANY) &&
+	    (SUBSYS_ID(pI830->PciInfo) == p->subsysCard ||
+	     p->subsysCard == SUBSYS_ANY))
 	    p->hook(pI830);
 	++p;
     }

commit a0e7b79b34940d646949512bd24c96372031888d
Author: Zhenyu Wang <zhenyu.z.wang@intel.com>
Date:   Wed Jul 16 10:45:28 2008 +0800

    Only initialize integrated TV encoder for mobile chips
    (cherry picked from commit c4565a9811487402d899d0933cc63e27ffe1ff08)

diff --git a/src/i830_driver.c b/src/i830_driver.c
index c880833..e29dd10 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -940,7 +940,7 @@ I830SetupOutputs(ScrnInfoPtr pScrn)
    } else {
       i830_dvo_init(pScrn);
    }
-   if (IS_I9XX(pI830) && !IS_I915G(pI830))
+   if (IS_I9XX(pI830) && IS_MOBILE(pI830))
       i830_tv_init(pScrn);
    
    for (o = 0; o < config->num_output; o++)

commit a4845dcdcb9b7becf8e47d3a781ecce74527d7c0
Author: Zhenyu Wang <zhenyu.z.wang@intel.com>
Date:   Tue Jul 15 13:35:21 2008 +0800

    xvmc: use vector based structure
    
    This is more clear to read MV components.
    (cherry picked from commit bca316863b79148b2f51a97d58b94e52ba3eae9f)

diff --git a/src/xvmc/i915_xvmc.c b/src/xvmc/i915_xvmc.c
index 27d1380..c32073a 100644
--- a/src/xvmc/i915_xvmc.c
+++ b/src/xvmc/i915_xvmc.c
@@ -39,9 +39,9 @@
                                  SIZE_Y420(surface->width, surface->height))
 
 typedef union {
-    short s[4];
-    uint  u[2];
-} su_t;
+    int16_t component[2];
+    int32_t v;
+} vector_t;
 
 #if 0
 static int findOverlap(unsigned int width, unsigned int height,
@@ -835,10 +835,7 @@ static void i915_mc_mpeg_macroblock_0mv(XvMCContext *context, XvMCMacroBlock *mb
 static void i915_mc_mpeg_macroblock_1fbmv(XvMCContext *context, XvMCMacroBlock *mb)
 {
     struct i915_3dmpeg_macroblock_1fbmv macroblock_1fbmv;
-
-    /* Motion Vectors */
-    su_t fmv;
-    su_t bmv;
+    vector_t mv0[2];
 
     /* 3DMPEG_MACROBLOCK(1fbmv) */
     memset(&macroblock_1fbmv, 0, sizeof(macroblock_1fbmv));
@@ -859,13 +856,13 @@ static void i915_mc_mpeg_macroblock_1fbmv(XvMCContext *context, XvMCMacroBlock *
     macroblock_1fbmv.header.dw1.coded_block_pattern = mb->coded_block_pattern;
     macroblock_1fbmv.header.dw1.skipped_macroblocks = 0;
 
-    fmv.s[0] = mb->PMV[0][0][0];
-    fmv.s[1] = mb->PMV[0][0][1];
-    bmv.s[0] = mb->PMV[0][1][0];
-    bmv.s[1] = mb->PMV[0][1][1];
+    mv0[0].component[0] = mb->PMV[0][0][0];
+    mv0[0].component[1] = mb->PMV[0][0][1];
+    mv0[1].component[0] = mb->PMV[0][1][0];
+    mv0[1].component[1] = mb->PMV[0][1][1];
 
-    macroblock_1fbmv.dw2 = fmv.u[0];
-    macroblock_1fbmv.dw3 = bmv.u[0];
+    macroblock_1fbmv.dw2 = mv0[0].v;
+    macroblock_1fbmv.dw3 = mv0[1].v;
 
     intelBatchbufferData(&macroblock_1fbmv, sizeof(macroblock_1fbmv), 0);
 }
@@ -873,10 +870,8 @@ static void i915_mc_mpeg_macroblock_1fbmv(XvMCContext *context, XvMCMacroBlock *
 static void i915_mc_mpeg_macroblock_2fbmv(XvMCContext *context, XvMCMacroBlock *mb, unsigned int ps)
 {
     struct i915_3dmpeg_macroblock_2fbmv macroblock_2fbmv;
-
-    /* Motion Vectors */
-    su_t fmv;
-    su_t bmv;
+    vector_t mv0[2];
+    vector_t mv1[2];
 
     /* 3DMPEG_MACROBLOCK(2fbmv) */
     memset(&macroblock_2fbmv, 0, sizeof(macroblock_2fbmv));
@@ -897,41 +892,33 @@ static void i915_mc_mpeg_macroblock_2fbmv(XvMCContext *context, XvMCMacroBlock *
     macroblock_2fbmv.header.dw1.coded_block_pattern = mb->coded_block_pattern;
     macroblock_2fbmv.header.dw1.skipped_macroblocks = 0;
 
-    fmv.s[0] = mb->PMV[0][0][0];
-    fmv.s[1] = mb->PMV[0][0][1];
-    fmv.s[2] = mb->PMV[1][0][0];
-    fmv.s[3] = mb->PMV[1][0][1];
-    bmv.s[0] = mb->PMV[0][1][0];
-    bmv.s[1] = mb->PMV[0][1][1];
-    bmv.s[2] = mb->PMV[1][1][0];
-    bmv.s[3] = mb->PMV[1][1][1];
+    mv0[0].component[0] = mb->PMV[0][0][0];
+    mv0[0].component[1] = mb->PMV[0][0][1];
+    mv0[1].component[0] = mb->PMV[0][1][0];
+    mv0[1].component[1] = mb->PMV[0][1][1];
+    mv1[0].component[0] = mb->PMV[1][0][0];
+    mv1[0].component[1] = mb->PMV[1][0][1];
+    mv1[1].component[0] = mb->PMV[1][1][0];
+    mv1[1].component[1] = mb->PMV[1][1][1];
 
     if ((ps & XVMC_FRAME_PICTURE) == XVMC_FRAME_PICTURE) {
         if ((mb->motion_type & 3) == XVMC_PREDICTION_FIELD) {
-            fmv.s[0] = mb->PMV[0][0][0];
-            fmv.s[1] = mb->PMV[0][0][1] >> 1;
-            fmv.s[2] = mb->PMV[1][0][0];
-            fmv.s[3] = mb->PMV[1][0][1] >> 1;
-            bmv.s[0] = mb->PMV[0][1][0];
-            bmv.s[1] = mb->PMV[0][1][1] >> 1;
-            bmv.s[2] = mb->PMV[1][1][0];
-            bmv.s[3] = mb->PMV[1][1][1] >> 1;
+            mv0[0].component[1] = mb->PMV[0][0][1] >> 1;
+            mv0[1].component[1] = mb->PMV[0][1][1] >> 1;
+            mv1[0].component[1] = mb->PMV[1][0][1] >> 1;
+            mv1[1].component[1] = mb->PMV[1][1][1] >> 1;
         } else if ((mb->motion_type & 3) == XVMC_PREDICTION_DUAL_PRIME) {
-            fmv.s[0] = mb->PMV[0][0][0];
-            fmv.s[1] = mb->PMV[0][0][1] >> 1;
-            fmv.s[2] = mb->PMV[0][0][0];
-            fmv.s[3] = mb->PMV[0][0][1] >> 1;  // MPEG2 MV[0][1] isn't used
-            bmv.s[0] = mb->PMV[1][0][0];
-            bmv.s[1] = mb->PMV[1][0][1] >> 1;
-            bmv.s[2] = mb->PMV[1][1][0];
-            bmv.s[3] = mb->PMV[1][1][1] >> 1;
+            mv0[0].component[1] = mb->PMV[0][0][1] >> 1;
+            mv0[1].component[1] = mb->PMV[0][1][1] >> 1;  // MPEG2 MV[0][1] isn't used
+            mv1[0].component[1] = mb->PMV[1][0][1] >> 1;
+            mv1[1].component[1] = mb->PMV[1][1][1] >> 1;
         }
     }
 
-    macroblock_2fbmv.dw2 = fmv.u[0];
-    macroblock_2fbmv.dw3 = bmv.u[0];
-    macroblock_2fbmv.dw4 = fmv.u[1];
-    macroblock_2fbmv.dw5 = bmv.u[1];
+    macroblock_2fbmv.dw2 = mv0[0].v;
+    macroblock_2fbmv.dw3 = mv0[1].v;
+    macroblock_2fbmv.dw4 = mv1[0].v;
+    macroblock_2fbmv.dw5 = mv1[1].v;
 
     intelBatchbufferData(&macroblock_2fbmv, sizeof(macroblock_2fbmv), 0);
 }

commit 607a68a81d28d49ebcb0f6a8b9267f1d85d7bac5
Author: Zhenyu Wang <zhenyu.z.wang@intel.com>
Date:   Tue Jul 15 13:29:33 2008 +0800

    move FBC register dump out of display registers
    
    This makes it easier to read.
    (cherry picked from commit 0c67219d0e6cfc858af2eb375c2f9473d0f6db60)

diff --git a/src/i830_debug.c b/src/i830_debug.c
index 8830050..00f18e5 100644
--- a/src/i830_debug.c
+++ b/src/i830_debug.c
@@ -537,15 +537,6 @@ static struct i830SnapshotRec {
     DEFINEREG2(PIPEASRC, i830_debug_yxminus1),
     DEFINEREG2(PIPEASTAT, i830_debug_pipestat),
 
-    DEFINEREG(FBC_CFB_BASE),
-    DEFINEREG(FBC_LL_BASE),
-    DEFINEREG(FBC_CONTROL),
-    DEFINEREG(FBC_COMMAND),
-    DEFINEREG(FBC_STATUS),
-    DEFINEREG(FBC_CONTROL2),
-    DEFINEREG(FBC_FENCE_OFF),
-    DEFINEREG(FBC_MOD_NUM),
-


Reply to: