diff --git a/src/i830_common.h b/src/i830_common.h index 9c8616c..af04835 100644 --- a/src/i830_common.h +++ b/src/i830_common.h @@ -124,14 +124,17 @@ typedef struct { unsigned int rotated_tiled; unsigned int rotated2_tiled; - int pipeA_x; - int pipeA_y; - int pipeA_w; - int pipeA_h; - int pipeB_x; - int pipeB_y; - int pipeB_w; - int pipeB_h; + int planeA_x; + int planeA_y; + int planeA_w; + int planeA_h; + int planeB_x; + int planeB_y; + int planeB_w; + int planeB_h; + + int pipeA_plane; + int pipeB_plane; /* Triple buffering */ drm_handle_t third_handle; diff --git a/src/i830_display.c b/src/i830_display.c index d8be8d9..92e52ed 100644 --- a/src/i830_display.c +++ b/src/i830_display.c @@ -414,14 +414,14 @@ i830PipeSetBase(xf86CrtcPtr crtc, int x, int y) if (!sPriv) return; - switch (pipe) { + switch (plane) { case 0: - sPriv->pipeA_x = x; - sPriv->pipeA_y = y; + sPriv->planeA_x = x; + sPriv->planeA_y = y; break; case 1: - sPriv->pipeB_x = x; - sPriv->pipeB_y = y; + sPriv->planeB_x = x; + sPriv->planeB_y = y; break; default: xf86DrvMsg(pScrn->scrnIndex, X_ERROR, @@ -763,14 +763,14 @@ i830_crtc_dpms(xf86CrtcPtr crtc, int mode) if (!sPriv) return; - switch (pipe) { + switch (plane) { case 0: - sPriv->pipeA_w = enabled ? crtc->mode.HDisplay : 0; - sPriv->pipeA_h = enabled ? crtc->mode.VDisplay : 0; + sPriv->planeA_w = enabled ? crtc->mode.HDisplay : 0; + sPriv->planeA_h = enabled ? crtc->mode.VDisplay : 0; break; case 1: - sPriv->pipeB_w = enabled ? crtc->mode.HDisplay : 0; - sPriv->pipeB_h = enabled ? crtc->mode.VDisplay : 0; + sPriv->planeB_w = enabled ? crtc->mode.HDisplay : 0; + sPriv->planeB_h = enabled ? crtc->mode.VDisplay : 0; break; default: xf86DrvMsg(pScrn->scrnIndex, X_ERROR, diff --git a/src/i830_dri.c b/src/i830_dri.c index 32f6510..2654ae6 100644 --- a/src/i830_dri.c +++ b/src/i830_dri.c @@ -91,7 +91,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #define DRM_VBLANK_FLIP 0x8000000 typedef struct drm_i915_flip { - int pipes; + int planes; } drm_i915_flip_t; #undef DRM_IOCTL_I915_FLIP @@ -1288,20 +1288,20 @@ I830DRISwapContext(ScreenPtr pScreen, DRISyncType syncType, #ifdef DAMAGE /* Try flipping back to the front page if necessary */ if (sPriv && !sPriv->pf_enabled && sPriv->pf_current_page != 0) { - drm_i915_flip_t flip = { .pipes = 0 }; + drm_i915_flip_t flip = { .planes = 0 }; if (sPriv->pf_current_page & (0x3 << 2)) { sPriv->pf_current_page = sPriv->pf_current_page & 0x3; sPriv->pf_current_page |= (sPriv->third_handle ? 2 : 1) << 2; - flip.pipes |= 0x2; + flip.planes |= 0x2; } if (sPriv->pf_current_page & 0x3) { sPriv->pf_current_page = sPriv->pf_current_page & (0x3 << 2); sPriv->pf_current_page |= sPriv->third_handle ? 2 : 1; - flip.pipes |= 0x1; + flip.planes |= 0x1; } drmCommandWrite(pI830->drmSubFD, DRM_I915_FLIP, &flip, sizeof(flip)); @@ -1634,14 +1634,14 @@ I830DRIClipNotify(ScreenPtr pScreen, WindowPtr *ppWin, int num) unsigned numvisible[2] = { 0, 0 }; int i, j; - crtcBox[0].x1 = sPriv->pipeA_x; - crtcBox[0].y1 = sPriv->pipeA_y; - crtcBox[0].x2 = crtcBox[0].x1 + sPriv->pipeA_w; - crtcBox[0].y2 = crtcBox[0].y1 + sPriv->pipeA_h; - crtcBox[1].x1 = sPriv->pipeB_x; - crtcBox[1].y1 = sPriv->pipeB_y; - crtcBox[1].x2 = crtcBox[1].x1 + sPriv->pipeB_w; - crtcBox[1].y2 = crtcBox[1].y1 + sPriv->pipeB_h; + crtcBox[0].x1 = sPriv->planeA_x; + crtcBox[0].y1 = sPriv->planeA_y; + crtcBox[0].x2 = crtcBox[0].x1 + sPriv->planeA_w; + crtcBox[0].y2 = crtcBox[0].y1 + sPriv->planeA_h; + crtcBox[1].x1 = sPriv->planeB_x; + crtcBox[1].y1 = sPriv->planeB_y; + crtcBox[1].x2 = crtcBox[1].x1 + sPriv->planeB_w; + crtcBox[1].y2 = crtcBox[1].y1 + sPriv->planeB_h; for (i = 0; i < 2; i++) { for (j = 0; j < num; j++) { diff --git a/src/i830_driver.c b/src/i830_driver.c index b168fd4..464c59f 100644 --- a/src/i830_driver.c +++ b/src/i830_driver.c @@ -2249,11 +2249,13 @@ I830ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) VisualPtr visual; I830Ptr pI8301 = NULL; unsigned long sys_mem; - int i; + int i, c; Bool allocation_done = FALSE; MessageType from; #ifdef XF86DRI Bool driDisabled; + drmI830Sarea *sPriv = (drmI830Sarea *) DRIGetSAREAPrivate(pScrn->pScreen); + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); #ifdef XF86DRI_MM unsigned long savedMMSize; #endif @@ -2706,6 +2708,17 @@ I830ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) i830_free_3d_memory(pScrn); } + /* Setup pipe->plane mappings for DRI & DRM */ + for (c = 0; c < config->num_crtc; c++) { + xf86CrtcPtr crtc = config->crtc[c]; + I830CrtcPrivatePtr intel_crtc = crtc->driver_private; + + if (intel_crtc->pipe == 0) + sPriv->pipeA_plane = intel_crtc->plane; + else if (intel_crtc->pipe == 1) + sPriv->pipeB_plane = intel_crtc->plane; + } + #else pI830->directRenderingEnabled = FALSE; #endif