summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Barnes <jbarnes@hobbes.virtuousgeek.org>2008-03-07 13:18:09 -0800
committerJesse Barnes <jbarnes@hobbes.virtuousgeek.org>2008-03-07 13:18:09 -0800
commit5915c75422c5277d530e7f8ecbdfe94654706efd (patch)
tree47a11a0a776a47364c990fa4d5652c24892cab0c
parent13ae79b415d944891cfdc2cd2d5397fec36a4e8e (diff)
Enable hardware overlay on 965
Based on Maxim Levitsky's patch for the same. Many thanks to Maxim for discovering that this features still works in recent hardware!
-rw-r--r--src/common.h2
-rw-r--r--src/i830_memory.c16
-rw-r--r--src/i830_video.c13
3 files changed, 10 insertions, 21 deletions
diff --git a/src/common.h b/src/common.h
index c0af1ad2..09f28f88 100644
--- a/src/common.h
+++ b/src/common.h
@@ -440,7 +440,7 @@ extern int I810_DEBUG;
#define IS_MOBILE(pI810) (IS_I830(pI810) || IS_I85X(pI810) || IS_I915GM(pI810) || IS_I945GM(pI810) || IS_I965GM(pI810) || IS_IGD_GM(pI810))
/* mark chipsets for using gfx VM offset for overlay */
-#define OVERLAY_NOPHYSICAL(pI810) (IS_G33CLASS(pI810))
+#define OVERLAY_NOPHYSICAL(pI810) (IS_G33CLASS(pI810) || IS_I965G(pI810))
/* chipsets require graphics mem for hardware status page */
#define HWS_NEED_GFX(pI810) (IS_G33CLASS(pI810) || IS_IGD_GM(pI810))
diff --git a/src/i830_memory.c b/src/i830_memory.c
index ad34f19c..e9097ecb 100644
--- a/src/i830_memory.c
+++ b/src/i830_memory.c
@@ -1044,15 +1044,13 @@ i830_allocate_overlay(ScrnInfoPtr pScrn)
if (!OVERLAY_NOPHYSICAL(pI830))
flags |= NEED_PHYSICAL_ADDR;
- if (!IS_I965G(pI830)) {
- pI830->overlay_regs = i830_allocate_memory(pScrn, "overlay registers",
- OVERLAY_SIZE, GTT_PAGE_SIZE,
- flags);
- if (pI830->overlay_regs == NULL) {
- xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
- "Failed to allocate Overlay register space.\n");
- /* This failure isn't fatal. */
- }
+ pI830->overlay_regs = i830_allocate_memory(pScrn, "overlay registers",
+ OVERLAY_SIZE, GTT_PAGE_SIZE,
+ flags);
+ if (pI830->overlay_regs == NULL) {
+ xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
+ "Failed to allocate Overlay register space.\n");
+ /* This failure isn't fatal. */
}
return TRUE;
diff --git a/src/i830_video.c b/src/i830_video.c
index 79e05740..bf260e46 100644
--- a/src/i830_video.c
+++ b/src/i830_video.c
@@ -352,7 +352,7 @@ i830_overlay_switch_to_crtc (ScrnInfoPtr pScrn, xf86CrtcPtr crtc)
I830CrtcPrivatePtr intel_crtc = crtc->driver_private;
int pipeconf_reg = intel_crtc->pipe == 0 ? PIPEACONF : PIPEBCONF;
- if (INREG(pipeconf_reg) & PIPEACONF_DOUBLE_WIDE)
+ if (!IS_I965G(pI830) && (INREG(pipeconf_reg) & PIPEACONF_DOUBLE_WIDE))
pPriv->overlayOK = FALSE;
else
pPriv->overlayOK = TRUE;
@@ -580,8 +580,7 @@ I830InitVideo(ScreenPtr pScreen)
}
/* Set up overlay video if we can do it at this depth. */
- if (!IS_I965G(pI830) && pScrn->bitsPerPixel != 8 &&
- pI830->overlay_regs != NULL)
+ if (pScrn->bitsPerPixel != 8 && pI830->overlay_regs != NULL)
{
overlayAdaptor = I830SetupImageVideoOverlay(pScreen);
if (overlayAdaptor != NULL) {
@@ -2563,10 +2562,6 @@ I830VideoBlockHandler(int i, pointer blockData, pointer pTimeout,
if (pI830->adaptor == NULL)
return;
- /* No overlay scaler on the 965. */
- if (IS_I965G(pI830))
- return;
-
pPriv = GET_PORT_PRIVATE(pScrn);
if (pPriv->videoStatus & TIMER_MASK) {
@@ -2846,10 +2841,6 @@ i830_crtc_dpms_video(xf86CrtcPtr crtc, Bool on)
if (pI830->adaptor == NULL)
return;
- /* No overlay scaler on the 965. */
- if (IS_I965G(pI830))
- return;
-
pPriv = GET_PORT_PRIVATE(pScrn);
if (crtc != pPriv->current_crtc)