[Intel-gfx] [PATCH] Leave FIFO ram space for overlay plane

Zhenyu Wang zhenyu.z.wang at intel.com
Wed Sep 10 04:31:22 CEST 2008


Here're three patches I'd like to be got reviewed.

Subject: [PATCH] Leave FIFO ram space for overlay plane

We missed to leave space for overlay plane, which causes Xv
overlay failure. It keeps default entries 37 for it now.
---
 src/i830.h         |   10 ++++++++++
 src/i830_display.c |    6 ++++++
 src/i830_video.c   |    3 +--
 3 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/src/i830.h b/src/i830.h
index f0efc4e..bdfb18e 100644
--- a/src/i830.h
+++ b/src/i830.h
@@ -990,4 +990,14 @@ extern const int I830CopyROP[16];
 #define QUIRK_PFIT_SAFE			0x00000040
 extern void i830_fixup_devices(ScrnInfoPtr);
 
+static inline Bool
+i830_overlay_supported(ScrnInfoPtr pScrn)
+{
+    I830Ptr pI830 = I830PTR(pScrn);
+    if (!OVERLAY_NOEXIST(pI830) && pScrn->bitsPerPixel != 8 &&
+	    pI830->overlay_regs != NULL)
+	return TRUE;
+    else
+	return FALSE;
+}
 #endif /* _I830_H_ */
diff --git a/src/i830_display.c b/src/i830_display.c
index ed49fb0..dd8c28f 100644
--- a/src/i830_display.c
+++ b/src/i830_display.c
@@ -1107,6 +1107,7 @@ i830_update_dsparb(ScrnInfoPtr pScrn)
    I830Ptr pI830 = I830PTR(pScrn);
    int total_hdisplay = 0, planea_hdisplay = 0, planeb_hdisplay = 0;
    int fifo_entries = 0, planea_entries = 0, planeb_entries = 0, i;
+   int planec_entries = 37;
 
    if ((INREG(DSPACNTR) & DISPLAY_PLANE_ENABLE) &&
        (INREG(DSPBCNTR) & DISPLAY_PLANE_ENABLE))
@@ -1128,8 +1129,13 @@ i830_update_dsparb(ScrnInfoPtr pScrn)
 	* The BIOS set it up for 96.
 	*/
 	fifo_entries = 95;
+	planec_entries = 0;
    }
 
+   /* we should leave ram space for plane C (overlay) */
+   if (pI830->XvEnabled && i830_overlay_supported(pScrn))
+       fifo_entries -= planec_entries;
+
    for (i = 0; i < xf86_config->num_crtc; i++) {
       xf86CrtcPtr crtc = xf86_config->crtc[i];
       I830CrtcPrivatePtr intel_crtc = crtc->driver_private;
diff --git a/src/i830_video.c b/src/i830_video.c
index 5e6ebd7..ab16245 100644
--- a/src/i830_video.c
+++ b/src/i830_video.c
@@ -620,8 +620,7 @@ I830InitVideo(ScreenPtr pScreen)
     }
 
     /* Set up overlay video if we can do it at this depth. */
-    if (!OVERLAY_NOEXIST(pI830) && pScrn->bitsPerPixel != 8 &&
-	    pI830->overlay_regs != NULL)
+    if (i830_overlay_supported(pScrn))
     {
 	overlayAdaptor = I830SetupImageVideoOverlay(pScreen);
 	if (overlayAdaptor != NULL) {
-- 
1.5.6.5

-- 
Open Source Technology Center, Intel ltd.

$gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://lists.freedesktop.org/archives/intel-gfx/attachments/20080910/a34b97f8/attachment.sig>


More information about the Intel-gfx mailing list