xserver-xorg-video-intel: Changes to 'upstream-unstable'
Rebased ref, commits from common ancestor:
commit 4a2b0f340357c4ca58dc9586fad1337b83966362
Author: Jesse Barnes <jbarnes@hobbes.virtuousgeek.org>
Date: Thu Nov 15 18:36:54 2007 -0800
Fix typo in 1920x1080 resolution entry
diff --git a/src/i830_tv.c b/src/i830_tv.c
index 524a0d3..14f4089 100644
--- a/src/i830_tv.c
+++ b/src/i830_tv.c
@@ -1398,7 +1398,7 @@ static struct input_res {
{"1280x1024", 1280, 1024},
{"848x480", 848, 480},
{"1280x720", 1280, 720},
- {"1920x108", 1920, 1080},
+ {"1920x1080", 1920, 1080},
};
/**
commit 04b60b6d3436fb57163c23acf335364f0ea2f79c
Author: Jesse Barnes <jbarnes@hobbes.virtuousgeek.org>
Date: Thu Nov 15 11:49:53 2007 -0800
Bump version to 2.2.0
diff --git a/configure.ac b/configure.ac
index b79aac8..20aebb4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,7 +22,7 @@
AC_PREREQ(2.57)
AC_INIT([xf86-video-intel],
- 2.1.99,
+ 2.2.0,
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
xf86-video-intel)
commit 6eecef4fed8a21dfdabef42eb69fd150b96167b2
Author: Jesse Barnes <jbarnes@hobbes.virtuousgeek.org>
Date: Thu Nov 15 10:10:59 2007 -0800
Adjust default TV out paramaters
According to several users, a default brightness of 0 results in much better TV
output. Improved control of these parameters will be provided by Randr1.3,
which will standardize several output properties across various chips.
diff --git a/src/i830_tv.c b/src/i830_tv.c
index e54786a..524a0d3 100644
--- a/src/i830_tv.c
+++ b/src/i830_tv.c
@@ -1178,7 +1178,7 @@ i830_tv_mode_set(xf86OutputPtr output, DisplayModePtr mode,
(i830_float_to_csc(color_conversion->bv) << 16) |
(i830_float_to_luma(color_conversion->av)));
- OUTREG(TV_CLR_KNOBS, 0x10606000);
+ OUTREG(TV_CLR_KNOBS, 0x00606000);
OUTREG(TV_CLR_LEVEL, ((video_levels->black << TV_BLACK_LEVEL_SHIFT) |
(video_levels->blank << TV_BLANK_LEVEL_SHIFT)));
{
commit 7552d80e367fe38bbc594fe94abd649917fe54d5
Author: Jesse Barnes <jbarnes@hobbes.virtuousgeek.org>
Date: Thu Nov 15 10:07:34 2007 -0800
Add 1920x1080 mode to TV out
Allows users to use 1080p modes on TV out, see bug #13034.
diff --git a/src/i830_tv.c b/src/i830_tv.c
index ee2538a..e54786a 100644
--- a/src/i830_tv.c
+++ b/src/i830_tv.c
@@ -1398,6 +1398,7 @@ static struct input_res {
{"1280x1024", 1280, 1024},
{"848x480", 848, 480},
{"1280x720", 1280, 720},
+ {"1920x108", 1920, 1080},
};
/**
commit e56c166ceb8c1ceddd5020e8de2d0b9d51f535a4
Author: Zhenyu Wang <zhenyu.z.wang@intel.com>
Date: Thu Nov 15 18:34:18 2007 +0800
remove unnecessary i830_reg.h includes
i830_reg.h only contains 3d engine cmds for 8XX chips.
diff --git a/src/i830_display.c b/src/i830_display.c
index 223a6aa..0e42624 100644
--- a/src/i830_display.c
+++ b/src/i830_display.c
@@ -38,7 +38,6 @@
#include "xf86.h"
#include "i830.h"
-#include "i830_reg.h"
#include "i830_bios.h"
#include "i830_display.h"
#include "i830_debug.h"
diff --git a/src/i830_driver.c b/src/i830_driver.c
index 5d56104..7818ee4 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -194,7 +194,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "vbe.h"
#include "shadow.h"
#include "i830.h"
-#include "i830_reg.h"
#include "i830_display.h"
#include "i830_debug.h"
#include "i830_bios.h"
diff --git a/src/i830_exa.c b/src/i830_exa.c
index 56bc15e..32c55dd 100644
--- a/src/i830_exa.c
+++ b/src/i830_exa.c
@@ -35,7 +35,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "xaarop.h"
#include "i830.h"
#include "i810_reg.h"
-#include "i830_reg.h"
#include <string.h>
#ifdef I830DEBUG
diff --git a/src/i830_memory.c b/src/i830_memory.c
index 1ad4438..85b6528 100644
--- a/src/i830_memory.c
+++ b/src/i830_memory.c
@@ -106,7 +106,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "i830.h"
#include "i810_reg.h"
-#include "i830_reg.h"
#define ALIGN(i,m) (((i) + (m) - 1) & ~((m) - 1))
commit 6f3de19159cd7a2d73ed212add909edb3aedce9c
Author: Zhenyu Wang <zhenyu.z.wang@intel.com>
Date: Thu Nov 15 18:33:27 2007 +0800
Move fb compression reg definition into i810_reg.h
where we put MMIO control reg in, and shared with intel_reg_dump
program.
diff --git a/src/i810_reg.h b/src/i810_reg.h
index 598fc8c..a6663a4 100644
--- a/src/i810_reg.h
+++ b/src/i810_reg.h
@@ -2596,4 +2596,37 @@ typedef enum {
#define PALETTE_A 0x0a000
#define PALETTE_B 0x0a800
+/* Framebuffer compression */
+#define FBC_CFB_BASE 0x03200 /* 4k page aligned */
+#define FBC_LL_BASE 0x03204 /* 4k page aligned */
+#define FBC_CONTROL 0x03208
+#define FBC_CTL_EN (1<<31)
+#define FBC_CTL_PERIODIC (1<<30)
+#define FBC_CTL_INTERVAL_SHIFT (16)
+#define FBC_CTL_UNCOMPRESSIBLE (1<<14)
+#define FBC_CTL_STRIDE_SHIFT (5)
+#define FBC_CTL_FENCENO (1<<0)
+#define FBC_COMMAND 0x0320c
+#define FBC_CMD_COMPRESS (1<<0)
+#define FBC_STATUS 0x03210
+#define FBC_STAT_COMPRESSING (1<<31)
+#define FBC_STAT_COMPRESSED (1<<30)
+#define FBC_STAT_MODIFIED (1<<29)
+#define FBC_STAT_CURRENT_LINE (1<<0)
+#define FBC_CONTROL2 0x03214
+#define FBC_CTL_FENCE_DBL (0<<4)
+#define FBC_CTL_IDLE_IMM (0<<2)
+#define FBC_CTL_IDLE_FULL (1<<2)
+#define FBC_CTL_IDLE_LINE (2<<2)
+#define FBC_CTL_IDLE_DEBUG (3<<2)
+#define FBC_CTL_CPU_FENCE (1<<1)
+#define FBC_CTL_PLANEA (0<<0)
+#define FBC_CTL_PLANEB (1<<0)
+#define FBC_FENCE_OFF 0x0321b
+#define FBC_MOD_NUM 0x03220
+#define FBC_TAG_DEBUG 0x03300
+
+#define FBC_LL_SIZE (1536)
+#define FBC_LL_PAD (32)
+
#endif /* _I810_REG_H */
diff --git a/src/i830_debug.c b/src/i830_debug.c
index 6963c89..8f8ef9b 100644
--- a/src/i830_debug.c
+++ b/src/i830_debug.c
@@ -36,7 +36,6 @@
#include "xf86.h"
#include "i830.h"
-#include "i830_reg.h"
#include "i830_debug.h"
#include <strings.h>
diff --git a/src/i830_reg.h b/src/i830_reg.h
index 4d7736a..7a8df9f 100644
--- a/src/i830_reg.h
+++ b/src/i830_reg.h
@@ -29,39 +29,6 @@
#ifndef _I830_REG_H_
#define _I830_REG_H_
-/* Framebuffer compression */
-#define FBC_CFB_BASE 0x03200 /* 4k page aligned */
-#define FBC_LL_BASE 0x03204 /* 4k page aligned */
-#define FBC_CONTROL 0x03208
-#define FBC_CTL_EN (1<<31)
-#define FBC_CTL_PERIODIC (1<<30)
-#define FBC_CTL_INTERVAL_SHIFT (16)
-#define FBC_CTL_UNCOMPRESSIBLE (1<<14)
-#define FBC_CTL_STRIDE_SHIFT (5)
-#define FBC_CTL_FENCENO (1<<0)
-#define FBC_COMMAND 0x0320c
-#define FBC_CMD_COMPRESS (1<<0)
-#define FBC_STATUS 0x03210
-#define FBC_STAT_COMPRESSING (1<<31)
-#define FBC_STAT_COMPRESSED (1<<30)
-#define FBC_STAT_MODIFIED (1<<29)
-#define FBC_STAT_CURRENT_LINE (1<<0)
-#define FBC_CONTROL2 0x03214
-#define FBC_CTL_FENCE_DBL (0<<4)
-#define FBC_CTL_IDLE_IMM (0<<2)
-#define FBC_CTL_IDLE_FULL (1<<2)
-#define FBC_CTL_IDLE_LINE (2<<2)
-#define FBC_CTL_IDLE_DEBUG (3<<2)
-#define FBC_CTL_CPU_FENCE (1<<1)
-#define FBC_CTL_PLANEA (0<<0)
-#define FBC_CTL_PLANEB (1<<0)
-#define FBC_FENCE_OFF 0x0321b
-#define FBC_MOD_NUM 0x03220
-#define FBC_TAG_DEBUG 0x03300
-
-#define FBC_LL_SIZE (1536)
-#define FBC_LL_PAD (32)
-
#define I830_SET_FIELD( var, mask, value ) (var &= ~(mask), var |= value)
#define CMD_3D (0x3<<29)
commit e64f4929690a57701241334fbca17e95b39ba3d4
Author: Jesse Barnes <jesse.barnes@intel.com>
Date: Wed Nov 14 16:44:34 2007 -0800
Backlight fixes
Open the "actual_brightness" file as read only, since we only read from it.
Also set an initial backlight_duty_cycle at init time so we don't set the
brightness to 0 at startup.
diff --git a/src/i830_lvds.c b/src/i830_lvds.c
index 0942d1c..a3a56f7 100644
--- a/src/i830_lvds.c
+++ b/src/i830_lvds.c
@@ -295,7 +295,7 @@ i830_lvds_get_backlight_kernel(xf86OutputPtr output)
sprintf(path, "%s/%s/actual_brightness", BACKLIGHT_CLASS,
backlight_interfaces[backlight_index]);
- fd = open(path, O_RDWR);
+ fd = open(path, O_RDONLY);
if (fd == -1) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "failed to open %s for backlight "
"control: %s\n", path, strerror(errno));
@@ -1015,6 +1015,8 @@ i830_lvds_init(ScrnInfoPtr pScrn)
break;
}
+ dev_priv->backlight_duty_cycle = dev_priv->backlight_max;
+
return;
disable_exit:
commit 53e3693ef13f31f3fc33bcff7286ab2b03b2d430
Author: Jesse Barnes <jbarnes@hobbes.virtuousgeek.org>
Date: Wed Nov 14 16:24:56 2007 -0800
Disable FBC by default on 965GM
Several people have reported that they see frequent FBC related display
corruption on 965GM, so disable it for now. Users wanting to enable it can use
the driver option "Framebuffercompression" to override the default.
diff --git a/src/i830_driver.c b/src/i830_driver.c
index abe6932..5d56104 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -2449,7 +2449,7 @@ I830ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
}
/* Enable FB compression if possible */
- if (i830_fb_compression_supported(pI830))
+ if (i830_fb_compression_supported(pI830) && !IS_I965GM(pI830))
pI830->fb_compression = TRUE;
else
pI830->fb_compression = FALSE;
commit b2726899bc6ebd108aa4a5dd66fe1d881bb778b3
Author: Jesse Barnes <jbarnes@hobbes.virtuousgeek.org>
Date: Wed Nov 14 15:49:41 2007 -0800
Add more FBC regs
Needed for the new debug code
diff --git a/src/i830_reg.h b/src/i830_reg.h
index df22ed4..4d7736a 100644
--- a/src/i830_reg.h
+++ b/src/i830_reg.h
@@ -56,6 +56,8 @@
#define FBC_CTL_PLANEA (0<<0)
#define FBC_CTL_PLANEB (1<<0)
#define FBC_FENCE_OFF 0x0321b
+#define FBC_MOD_NUM 0x03220
+#define FBC_TAG_DEBUG 0x03300
#define FBC_LL_SIZE (1536)
#define FBC_LL_PAD (32)
commit b7bc694c6b98dac17763426d905a22d3ae17a018
Author: Jesse Barnes <jbarnes@hobbes.virtuousgeek.org>
Date: Wed Nov 14 15:46:57 2007 -0800
Fix kernel get_brightness function
We need to look at "actual_brightness" rather than "brightness". The former
contains the brightness value the kernel driver has actually set, while the
latter is merely what the user requested.
diff --git a/src/i830_lvds.c b/src/i830_lvds.c
index 694414a..0942d1c 100644
--- a/src/i830_lvds.c
+++ b/src/i830_lvds.c
@@ -293,7 +293,7 @@ i830_lvds_get_backlight_kernel(xf86OutputPtr output)
char path[BACKLIGHT_PATH_LEN], val[BACKLIGHT_VALUE_LEN];
int fd;
- sprintf(path, "%s/%s/brightness", BACKLIGHT_CLASS,
+ sprintf(path, "%s/%s/actual_brightness", BACKLIGHT_CLASS,
backlight_interfaces[backlight_index]);
fd = open(path, O_RDWR);
if (fd == -1) {
commit 9ee96ed02aacd953ab58288fddf0fa60f60b668e
Author: Jesse Barnes <jbarnes@hobbes.virtuousgeek.org>
Date: Wed Nov 14 15:44:56 2007 -0800
Correct FBC debug message
To be consistent, it should say 'plane' rather than 'pipe'.
diff --git a/src/i830_display.c b/src/i830_display.c
index ea10c8a..223a6aa 100644
--- a/src/i830_display.c
+++ b/src/i830_display.c
@@ -646,7 +646,7 @@ i830_disable_fb_compression(xf86CrtcPtr crtc)
/* Wait for compressing bit to clear */
while (INREG(FBC_STATUS) & FBC_STAT_COMPRESSING)
; /* nothing */
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "fbc disabled on pipe %c\n", plane);
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "fbc disabled on plane %c\n", plane);
}
/**
commit 675b9471d84059496ca41d427a4f95d419f82be9
Author: Jesse Barnes <jbarnes@hobbes.virtuousgeek.org>
Date: Wed Nov 14 15:17:05 2007 -0800
Add FBC registers to register dump output
Just for completeness.
diff --git a/src/i830_debug.c b/src/i830_debug.c
index 0237182..6963c89 100644
--- a/src/i830_debug.c
+++ b/src/i830_debug.c
@@ -36,6 +36,7 @@
#include "xf86.h"
#include "i830.h"
+#include "i830_reg.h"
#include "i830_debug.h"
#include <strings.h>
@@ -403,6 +404,15 @@ static struct i830SnapshotRec {
DEFINEREG2(PIPEACONF, i830_debug_pipeconf),
DEFINEREG2(PIPEASRC, i830_debug_yxminus1),
+ 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),
+
DEFINEREG2(FPA0, i830_debug_fp),
DEFINEREG2(FPA1, i830_debug_fp),
DEFINEREG2(DPLL_A, i830_debug_dpll),
commit a2a0821e74a61f53cc7f0c41ce629644ad712114
Author: Jesse Barnes <jbarnes@hobbes.virtuousgeek.org>
Date: Wed Nov 14 11:30:20 2007 -0800
Don't stop ring before restoring hw state
Some of the hw state restoration callbacks may want to use the ring for various
things like stopping video playback, so leave the ring enabled until we get
back from RestoreHWState. Also rename the functions so that their purpose is
clearer and remove a couple of redundant lines.
diff --git a/src/i830.h b/src/i830.h
index 3abc800..2c1ac86 100644
--- a/src/i830.h
+++ b/src/i830.h
@@ -664,7 +664,7 @@ i830_crtc_hide_cursor (xf86CrtcPtr crtc);
void
i830_crtc_set_cursor_colors (xf86CrtcPtr crtc, int bg, int fg);
-extern void I830RefreshRing(ScrnInfoPtr pScrn);
+extern void i830_refresh_ring(ScrnInfoPtr pScrn);
extern void I830EmitFlush(ScrnInfoPtr pScrn);
#ifdef I830_XV
diff --git a/src/i830_accel.c b/src/i830_accel.c
index 4d9ea79..7501c2b 100644
--- a/src/i830_accel.c
+++ b/src/i830_accel.c
@@ -249,25 +249,6 @@ I830SelectBuffer(ScrnInfoPtr pScrn, int buffer)
buffer, pI830->bufferOffset);
}
-void
-I830RefreshRing(ScrnInfoPtr pScrn)
-{
- I830Ptr pI830 = I830PTR(pScrn);
-
- /* If we're reaching RefreshRing as a result of grabbing the DRI lock
- * before we've set up the ringbuffer, don't bother.
- */
- if (pI830->LpRing->mem == NULL)
- return;
-
- pI830->LpRing->head = INREG(LP_RING + RING_HEAD) & I830_HEAD_MASK;
- pI830->LpRing->tail = INREG(LP_RING + RING_TAIL);
- pI830->LpRing->space = pI830->LpRing->head - (pI830->LpRing->tail + 8);
- if (pI830->LpRing->space < 0)
- pI830->LpRing->space += pI830->LpRing->mem->size;
- i830MarkSync(pScrn);
-}
-
/* The following function sets up the supported acceleration. Call it
* from the FbInit() function in the SVGA driver, or before ScreenInit
* in a monolithic server.
diff --git a/src/i830_dri.c b/src/i830_dri.c
index 4928808..b223b02 100644
--- a/src/i830_dri.c
+++ b/src/i830_dri.c
@@ -1093,7 +1093,7 @@ I830DRISwapContext(ScreenPtr pScreen, DRISyncType syncType,
if (!pScrn->vtSema)
return;
pI830->LockHeld = 1;
- I830RefreshRing(pScrn);
+ i830_refresh_ring(pScrn);
I830EmitFlush(pScrn);
@@ -1777,7 +1777,7 @@ I830DRILock(ScrnInfoPtr pScrn)
if (pI830->directRenderingEnabled && !pI830->LockHeld) {
DRILock(screenInfo.screens[pScrn->scrnIndex], 0);
pI830->LockHeld = 1;
- I830RefreshRing(pScrn);
+ i830_refresh_ring(pScrn);
return TRUE;
}
else
diff --git a/src/i830_driver.c b/src/i830_driver.c
index e000d92..abe6932 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -1730,7 +1730,7 @@ I830PreInit(ScrnInfoPtr pScrn, int flags)
* whoever gets control next should do.
*/
static void
-ResetState(ScrnInfoPtr pScrn, Bool flush)
+i830_stop_ring(ScrnInfoPtr pScrn, Bool flush)
{
I830Ptr pI830 = I830PTR(pScrn);
unsigned long temp;
@@ -1743,34 +1743,23 @@ ResetState(ScrnInfoPtr pScrn, Bool flush)
pI830->entityPrivate->RingRunning = 0;
/* Flush the ring buffer (if enabled), then disable it. */
- /* God this is ugly */
-#define flush_ring() do { \
- temp = INREG(LP_RING + RING_LEN); \
- if (temp & RING_VALID) { \
- I830RefreshRing(pScrn); \
- I830Sync(pScrn); \
- DO_RING_IDLE(); \
- } \
- } while(0)
-#ifdef I830_USE_XAA
- if (!pI830->useEXA && flush && pI830->AccelInfoRec)
- flush_ring();
-#endif
-#ifdef I830_USE_EXA
- if (pI830->useEXA && flush && pI830->EXADriverPtr)
- flush_ring();
-#endif
-
- OUTREG(LP_RING + RING_LEN, 0);
- OUTREG(LP_RING + RING_HEAD, 0);
- OUTREG(LP_RING + RING_TAIL, 0);
- OUTREG(LP_RING + RING_START, 0);
+ if (!pI830->noAccel) {
+ temp = INREG(LP_RING + RING_LEN);
+ if (temp & RING_VALID) {
+ i830_refresh_ring(pScrn);
+ I830Sync(pScrn);
+ DO_RING_IDLE();
+ }
- xf86_hide_cursors (pScrn);
+ OUTREG(LP_RING + RING_LEN, 0);
+ OUTREG(LP_RING + RING_HEAD, 0);
+ OUTREG(LP_RING + RING_TAIL, 0);
+ OUTREG(LP_RING + RING_START, 0);
+ }
}
static void
-SetRingRegs(ScrnInfoPtr pScrn)
+i830_start_ring(ScrnInfoPtr pScrn)
{
I830Ptr pI830 = I830PTR(pScrn);
unsigned int itemp;
@@ -1807,7 +1796,26 @@ SetRingRegs(ScrnInfoPtr pScrn)
itemp = (pI830->LpRing->mem->size - 4096) & I830_RING_NR_PAGES;
itemp |= (RING_NO_REPORT | RING_VALID);
OUTREG(LP_RING + RING_LEN, itemp);
- I830RefreshRing(pScrn);
+ i830_refresh_ring(pScrn);
+}
+
+void
+i830_refresh_ring(ScrnInfoPtr pScrn)
+{
+ I830Ptr pI830 = I830PTR(pScrn);
+
+ /* If we're reaching RefreshRing as a result of grabbing the DRI lock
+ * before we've set up the ringbuffer, don't bother.
+ */
+ if (pI830->LpRing->mem == NULL)
+ return;
+
+ pI830->LpRing->head = INREG(LP_RING + RING_HEAD) & I830_HEAD_MASK;
+ pI830->LpRing->tail = INREG(LP_RING + RING_TAIL);
+ pI830->LpRing->space = pI830->LpRing->head - (pI830->LpRing->tail + 8);
+ if (pI830->LpRing->space < 0)
+ pI830->LpRing->space += pI830->LpRing->mem->size;
+ i830MarkSync(pScrn);
}
/*
@@ -1834,8 +1842,7 @@ SetHWOperatingState(ScrnInfoPtr pScrn)
OUTREG(DSPCLK_GATE_D, OVRUNIT_CLOCK_GATE_DISABLE);
}
- if (!pI830->noAccel)
- SetRingRegs(pScrn);
+ i830_start_ring(pScrn);
if (!pI830->SWCursor)
I830InitHWCursor(pScrn);
}
@@ -3002,10 +3009,10 @@ I830LeaveVT(int scrnIndex, int flags)
xf86_hide_cursors (pScrn);
- ResetState(pScrn, TRUE);
-
RestoreHWState(pScrn);
+ i830_stop_ring(pScrn, TRUE);
+
if (pI830->debug_modes) {
i830CompareRegsToSnapshot(pScrn, "After LeaveVT");
i830DumpRegs (pScrn);
@@ -3078,7 +3085,7 @@ I830EnterVT(int scrnIndex, int flags)
"Existing errors found in hardware state.\n");
}
- ResetState(pScrn, FALSE);
+ i830_stop_ring(pScrn, FALSE);
SetHWOperatingState(pScrn);
/* Clear the framebuffer */
@@ -3099,7 +3106,7 @@ I830EnterVT(int scrnIndex, int flags)
}
i830DescribeOutputConfiguration(pScrn);
- ResetState(pScrn, TRUE);
+ i830_stop_ring(pScrn, TRUE);
SetHWOperatingState(pScrn);
#ifdef XF86DRI
@@ -3119,7 +3126,7 @@ I830EnterVT(int scrnIndex, int flags)
I830DRIResume(screenInfo.screens[scrnIndex]);
- I830RefreshRing(pScrn);
+ i830_refresh_ring(pScrn);
I830Sync(pScrn);
DO_RING_IDLE();
commit ad3bc0158d37e98fcbbe6a8e31413c142a260424
Author: Zhenyu Wang <zhenyu.z.wang@intel.com>
Date: Wed Nov 14 22:46:46 2007 +0800
Don't enable fbc with XAA or tiling is off.
This slightly reworks my last fbc patch. We don't
support tiled front buffer with XAA now, so also
disable fbc on it. If tiled alloc failed, disable
fbc too.
diff --git a/src/i830.h b/src/i830.h
index 17d2fe2..3abc800 100644
--- a/src/i830.h
+++ b/src/i830.h
@@ -805,6 +805,11 @@ static inline int i830_fb_compression_supported(I830Ptr pI830)
return FALSE;
if (IS_I810(pI830) || IS_I815(pI830) || IS_I830(pI830))
return FALSE;
+ /* fbc depends on tiled surface. And we don't support tiled
+ * front buffer with XAA now.
+ */
+ if (!pI830->tiling || (IS_I965G(pI830) && !pI830->useEXA))
+ return FALSE;
return TRUE;
}
diff --git a/src/i830_driver.c b/src/i830_driver.c
index 8d58a08..e000d92 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -2554,15 +2554,17 @@ I830ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
"Couldn't allocate tiled memory, page flipping "
"disabled\n");
pI830->allowPageFlip = FALSE;
+ if (pI830->fb_compression)
+ xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
+ "Couldn't allocate tiled memory, fb compression "
+ "disabled\n");
+ pI830->fb_compression = FALSE;
}
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"Attempting memory allocation with %s buffers.\n",
(i & 1) ? "untiled" : "tiled");
- if (!pI830->tiling && pI830->fb_compression)
- pI830->fb_compression = FALSE;
-
if (i830_allocate_2d_memory(pScrn) &&
i830_allocate_3d_memory(pScrn))
{
commit 26194e19e1c80615697016e25640d4c8c244353f
Author: Keith Packard <keithp@koto.keithp.com>
Date: Tue Nov 13 22:26:40 2007 -0800
Review PLL spreadsheet and update register ranges.
The PLL spreadsheet makes the precise register ranges allowed for each mode
quite clear, and shows a few inaccuracies in the b-spec. In particular, the
N register value may range from 1 to 6 instead of 3 to 8. This should close
the gap we've seen in the reachable frequencies.
diff --git a/src/i830_display.c b/src/i830_display.c
index d988b86..ea10c8a 100644
--- a/src/i830_display.c
+++ b/src/i830_display.c
@@ -100,14 +100,26 @@ typedef struct {
#define I9XX_DOT_MAX 400000
#define I9XX_VCO_MIN 1400000
#define I9XX_VCO_MAX 2800000
-#define I9XX_N_MIN 3
-#define I9XX_N_MAX 8
+
+/* Haven't found any reason to go this fast, but newer chips support it */
+#define I96X_VCO_MAX 3200000
+
+/*
+ * These values are taken from the broadwater/crestline PLL spreadsheet.
+ * All of the defines here are for the programmed register value, not
+ * the 'counter' value (e.g. Ncounter = Nregister + 2)
+ */
+#define I9XX_N_MIN 1
+#define I9XX_N_MAX 6
#define I9XX_M_MIN 70
#define I9XX_M_MAX 120
+
+/* these two come from the calm1 macro */
#define I9XX_M1_MIN 10
-#define I9XX_M1_MAX 20
+#define I9XX_M1_MAX 22
#define I9XX_M2_MIN 5
#define I9XX_M2_MAX 9
+
#define I9XX_P_SDVO_DAC_MIN 5
#define I9XX_P_SDVO_DAC_MAX 80
#define I9XX_P_LVDS_MIN 7
diff --git a/src/scripts/clock-graph.5c b/src/scripts/clock-graph.5c
index e39e559..324febf 100644
--- a/src/scripts/clock-graph.5c
+++ b/src/scripts/clock-graph.5c
@@ -9,7 +9,7 @@ int max_vco = 2800000000;
int min = 0xffffffff;
int max = 0;
-int max_clocks = 1000;
+int max_clocks = 2000;
int[4][max_clocks] clocks;
int[4][max_clocks] vcos;
int[4] clock_count = {0...};
@@ -35,9 +35,9 @@ void calc_p2(int p2i)
max_p = 80;
}
- for (int m1 = 10; m1 <= 20; m1++) {
+ for (int m1 = 10; m1 <= 22; m1++) {
for (int m2 = 5; m2 <= 9; m2++) {
- for (int n = 3; n <= 8; n++) {
+ for (int n = 1; n <= 5; n++) {
for (int p1 = 1; p1 <= 8; p1++) {
int ref = 96000000;
int m = 5 * (m1 + 2) + (m2 + 2);
diff --git a/src/scripts/clock.5c b/src/scripts/clock.5c
index 8ee9d90..c83c689 100644
--- a/src/scripts/clock.5c
+++ b/src/scripts/clock.5c
@@ -11,9 +11,9 @@ if (p2 == 7 || p2 == 14) {
max_p = 80;
}
-for (int m1 = 10; m1 <= 20; m1++) {
+for (int m1 = 10; m1 <= 22; m1++) {
for (int m2 = 5; m2 <= 9; m2++) {
- for (int n = 3; n <= 8; n++) {
+ for (int n = 1; n <= 6; n++) {
for (int p1 = 1; p1 <= 8; p1++) {
int ref = 96000000;
int m = 5 * (m1 + 2) + (m2 + 2);
commit 581509321e51becb8ee6ddcfaa15a2a713c9ef8e
Author: Zhenyu Wang <zhenyu.z.wang@intel.com>
Date: Wed Nov 14 22:16:04 2007 +0800
Remove one redundant line.
diff --git a/src/i830_driver.c b/src/i830_driver.c
index debe539..8d58a08 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -2606,8 +2606,6 @@ I830ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
pI830->directRenderingEnabled = FALSE;
}
- pScrn->displayWidth = pScrn->displayWidth;
-
#ifdef HAS_MTRR_SUPPORT
{
int fd;
commit 8cea3c8cfa86600b5f2c3e1f21c19d4b2a320fd4
Author: Zhenyu Wang <zhenyu.z.wang@intel.com>
Date: Wed Nov 14 22:13:30 2007 +0800
Don't setup fb compression if fb is not tiling
diff --git a/src/i830_driver.c b/src/i830_driver.c
index fdbf9ec..debe539 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -2560,6 +2560,9 @@ I830ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
"Attempting memory allocation with %s buffers.\n",
(i & 1) ? "untiled" : "tiled");
+ if (!pI830->tiling && pI830->fb_compression)
+ pI830->fb_compression = FALSE;
+
if (i830_allocate_2d_memory(pScrn) &&
i830_allocate_3d_memory(pScrn))
{
commit 539b669d6e23833a917a9b0d3a355d4283e0b76a
Author: Jesse Barnes <jbarnes@hobbes.virtuousgeek.org>
Date: Tue Nov 13 17:59:54 2007 -0800
Remove harmless error message
This really isn't an error in general. If vblank pipe setup really fails for
some reason, it'll be obvious enough when the user tries to use vblank events
for something.
Patch from Hong Liu.
diff --git a/src/i830_dri.c b/src/i830_dri.c
index 4d3458f..4928808 100644
--- a/src/i830_dri.c
+++ b/src/i830_dri.c
@@ -1762,7 +1762,6 @@ I830DRISetVBlankInterrupt (ScrnInfoPtr pScrn, Bool on)
}
if (drmCommandWrite(pI830->drmSubFD, DRM_I830_SET_VBLANK_PIPE,
&pipe, sizeof (pipe))) {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "I830 Vblank Pipe Setup Failed %d\n", pipe.pipe);
return FALSE;
}
}
commit 43fbc547786cf26514f95bce79fab58a66c291bf
Author: Jesse Barnes <jbarnes@jbarnes-mobile.amr.corp.intel.com>
Date: Mon Nov 12 12:23:41 2007 -0800
Improve backlight control
This commit fixes backlight support for several platforms.
Except on recent machines supporting the IGD OpRegion specification,
backlight control is rather platform specific. In some cases, we can
program the native backlight control regsiters directly without any
trouble. On others, we need to use the legacy backlight control
register. On still others, we need a combination of the two. And on
some platforms, none of the above will work, so we go through the
kernel backlight interface, which provides a platform specific driver
for backlight control.
diff --git a/man/intel.man b/man/intel.man
index 963c6a2..6245736 100644
--- a/man/intel.man
+++ b/man/intel.man
@@ -184,7 +184,9 @@ The 830M and newer driver supports the following outputs through RandR 1.2:
Analog VGA output
.TP
.BI "LVDS"
-Laptop panel
+Laptop panel. Properties:
+ BACKLIGHT - set backlight level
+ BACKLIGHT_CONTROL - set backlight level control method (i.e. use kernel interfaces, native LVDS power register, legacy register, or combination)
.TP
.BI "TV"
Integrated TV output
diff --git a/src/i830.h b/src/i830.h
index 57f0544..17d2fe2 100644
--- a/src/i830.h
+++ b/src/i830.h
@@ -295,6 +295,57 @@ enum last_3d {
LAST_3D_ROTATION
};
+/*
+ * Backlight control has some unfortunate properties:
+ * - many machines won't give us brightness change notifications
+ * o brightness hotkeys
+ * o events like AC plug/unplug (can be controlled via _DOS setting)
+ * o ambient light sensor triggered changes
+ * - some machines use the so-called "legacy" backlight interface
+ * o resulting brightness is a combo of LBB and PWM values
+ * o LBB sits in config space
+ * - some machines have ACPI methods for changing brightness
+ * o one of the few ways the X server and firmware can stay in sync
+ * - new machines have the IGD OpRegion interface available
+ * o a reliable way of keeping the firmware and X in sync
+ *
+ * So the real problem is on machines where ACPI or OpRegion methods aren't
+ * available. In that case, problems can occur:
+ * 1) the BIOS and X will have different ideas of what the brightness is,
+ * leading to unexpected results when the brightness is increased or
+ * decreased via hotkey or X protocol
+ * 2) unless X takes the legacy register into account, machines using it
+ * may prevent X from raising the brightness above 0 if the firmware
+ * set LBB to 0
+ * Given these problems, we provide the user with a selection of methods,
+ * so they can choose an ideal one for their platform (assuming our quirk
+ * code picks the wrong one).
+ *
+ * Four different methods are available:
+ * NATIVE: only ever touch the native backlight control registers
+ * This method may be susceptible to problem (2) above if the firmware
+ * modifies the legacy registers.
+ * LEGACY: only ever touch the legacy backlight control registers
+ * This method may be susceptible to problem (1) above if the firmware
+ * also modifies the legacy registers.
+ * COMBO: try to use both sets
+ * In this case, the driver will try to modify both sets of registers
+ * if needed. To avoid problem (2) above it may set the LBB register
+ * to a non-zero value if the brightness is to be increased. It's still
+ * susceptible to problem (1), but to a lesser extent than the LEGACY only
+ * method.
+ * KERNEL: use kernel methods for controlling the backlight
+ * This is only available on some platforms, but where present this can
+ * provide the best user experience.
+ */
+
+enum backlight_control {
+ NATIVE = 0,
+ LEGACY,
+ COMBO,
+ KERNEL,
+};
+
typedef struct _I830Rec {
unsigned char *MMIOBase;
unsigned char *GTTBase;
@@ -498,6 +549,8 @@ typedef struct _I830Rec {
int ddc2;
+ enum backlight_control backlight_control_method;
+
CARD32 saveDSPACNTR;
CARD32 saveDSPBCNTR;
CARD32 savePIPEACONF;
diff --git a/src/i830_lvds.c b/src/i830_lvds.c
index 0b6b192..694414a 100644
--- a/src/i830_lvds.c
+++ b/src/i830_lvds.c
@@ -29,6 +29,15 @@
#include "config.h"
#endif
+#include <errno.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+
#include "xf86.h"
#include "i830.h"
#include "i830_bios.h"
@@ -44,67 +53,113 @@ struct i830_lvds_priv {
/* restore backlight to this value */
int backlight_duty_cycle;
+
+ void (*set_backlight)(xf86OutputPtr output, int level);
+ int (*get_backlight)(xf86OutputPtr output);
+ int backlight_max;
};
-/**
- * Use legacy backlight controls?
- *
- * \param pI830 device in question
- *
- * Returns TRUE if legacy backlight should be used, false otherwise.
+#define BACKLIGHT_CLASS "/sys/class/backlight"
+
+/*
+ * List of available kernel interfaces in priority order
*/
-static int
-i830_lvds_backlight_legacy(I830Ptr pI830)
+static char *backlight_interfaces[] = {
+ "thinkpad_screen",
+ "acpi_video1",
+ "acpi_video0",
+ NULL,
+};
+
+/*
+ * Must be long enough for BACKLIGHT_CLASS + '/' + longest in above table +
+ * '/' + "max_backlight"
+ */
+#define BACKLIGHT_PATH_LEN 80
+/* Enough for 8 digits of backlight + '\n' + '\0' */
+#define BACKLIGHT_VALUE_LEN 10
+
+static int backlight_index;
+
+static Bool
+i830_kernel_backlight_available(xf86OutputPtr output)
Reply to: