From 89a5a0024a7e077a0726ffe1427e573df3bcbef5 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Sun, 18 Jun 2006 00:25:34 -0700 Subject: [PATCH] Fix crash with EXA during randr, when XAA structures were being accessed. EXA shouldn't have any issues with there also being pixmaps in framebuffer while rotation is active. --- src/i830_rotate.c | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/src/i830_rotate.c b/src/i830_rotate.c index e4a80645..ad4c484b 100644 --- a/src/i830_rotate.c +++ b/src/i830_rotate.c @@ -959,21 +959,26 @@ I830Rotate(ScrnInfoPtr pScrn, DisplayModePtr mode) } } - /* Don't allow pixmap cache or offscreen pixmaps when rotated */ - /* XAA needs some serious fixing for this to happen */ - if (pI830->rotation == RR_Rotate_0) { - pI830->AccelInfoRec->Flags = LINEAR_FRAMEBUFFER | OFFSCREEN_PIXMAPS | PIXMAP_CACHE; - pI830->AccelInfoRec->UsingPixmapCache = TRUE; - /* funny as it seems this will enable XAA's createpixmap */ - pI830->AccelInfoRec->maxOffPixWidth = 0; - pI830->AccelInfoRec->maxOffPixHeight = 0; - } else { - pI830->AccelInfoRec->Flags = LINEAR_FRAMEBUFFER; - pI830->AccelInfoRec->UsingPixmapCache = FALSE; - /* funny as it seems this will disable XAA's createpixmap */ - pI830->AccelInfoRec->maxOffPixWidth = 1; - pI830->AccelInfoRec->maxOffPixHeight = 1; +#ifdef I830_USE_XAA + if (pI830->AccelInfoRec != NULL) { + /* Don't allow pixmap cache or offscreen pixmaps when rotated */ + /* XAA needs some serious fixing for this to happen */ + if (pI830->rotation == RR_Rotate_0) { + pI830->AccelInfoRec->Flags = LINEAR_FRAMEBUFFER | OFFSCREEN_PIXMAPS | + PIXMAP_CACHE; + pI830->AccelInfoRec->UsingPixmapCache = TRUE; + /* funny as it seems this will enable XAA's createpixmap */ + pI830->AccelInfoRec->maxOffPixWidth = 0; + pI830->AccelInfoRec->maxOffPixHeight = 0; + } else { + pI830->AccelInfoRec->Flags = LINEAR_FRAMEBUFFER; + pI830->AccelInfoRec->UsingPixmapCache = FALSE; + /* funny as it seems this will disable XAA's createpixmap */ + pI830->AccelInfoRec->maxOffPixWidth = 1; + pI830->AccelInfoRec->maxOffPixHeight = 1; + } } +#endif return TRUE;