summaryrefslogtreecommitdiff
path: root/src/i830_dri.c
diff options
context:
space:
mode:
authorJesse Barnes <jesse.barnes@intel.com>2007-09-10 23:30:50 -0700
committerJesse Barnes <jesse.barnes@intel.com>2007-09-10 23:30:50 -0700
commit4c7542ef43a5267e470ca1608a2ae57abf9783ec (patch)
treeb45af8968bb1660d173e746a357b360a0322ff2f /src/i830_dri.c
parent286f5df0b62f571cbb4dbf120679d3af029b8775 (diff)
Only swap planes and pipes if DRM supports it
We want to associate plane A with pipe B on pre-965 mobile chips, since that's the only way to get framebuffer compression on the builtin LVDS on those platforms. However, if we do this swapping and DRM isn't aware of it, we may end up requesting vblank events for the wrong pipe, or setting up SAREA buffer swap state incorrectly. This mod checks whether DRM supports the new plane->pipe swapping behavior, and only enables the swapping if so. This should fix the bugs Lukas found and debugged. Reviewed by Michel Danzer.
Diffstat (limited to 'src/i830_dri.c')
-rw-r--r--src/i830_dri.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/i830_dri.c b/src/i830_dri.c
index 32f6510a..2654ae63 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++) {