summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ast.h3
-rw-r--r--src/ast_accel.c30
-rw-r--r--src/ast_cursor.c8
-rw-r--r--src/ast_driver.c7
4 files changed, 32 insertions, 16 deletions
diff --git a/src/ast.h b/src/ast.h
index 937709a..bafd29b 100644
--- a/src/ast.h
+++ b/src/ast.h
@@ -132,7 +132,8 @@ typedef struct {
USHORT offset_y;
ULONG fg;
ULONG bg;
-
+
+ UCHAR cursorpattern[1024];
} HWCINFO, *PHWCINFO;
diff --git a/src/ast_accel.c b/src/ast_accel.c
index ad954e8..ef21462 100644
--- a/src/ast_accel.c
+++ b/src/ast_accel.c
@@ -351,22 +351,29 @@ ASTSubsequentScreenToScreenCopy(ScrnInfoPtr pScrn, int x1, int y1, int x2,
else
cmdreg &= ~CMD_ENABLE_CLIP;
srcbase = dstbase = 0;
+
+ if (x1 < x2)
+ cmdreg |= CMD_X_DEC;
+
+ if (y1 < y2)
+ cmdreg |= CMD_Y_DEC;
- if (y1 >= MAX_SRC_Y)
+ if ((y1 + height) >= MAX_SRC_Y)
{
srcbase=pAST->VideoModeInfo.ScreenPitch*y1;
+ y1 = 0;
}
- if (y2 >= pScrn->virtualY)
+ if ((y2 + height) >= pScrn->virtualY)
{
dstbase=pAST->VideoModeInfo.ScreenPitch*y2;
+ y2 = 0;
}
- if (x1 < x2)
+ if (cmdreg & CMD_X_DEC)
{
- src_x = x1 + width - 1;
- dst_x = x2 + width - 1;
- cmdreg |= CMD_X_DEC;
+ src_x = x1 + width - 1;
+ dst_x = x2 + width - 1;
}
else
{
@@ -374,20 +381,13 @@ ASTSubsequentScreenToScreenCopy(ScrnInfoPtr pScrn, int x1, int y1, int x2,
dst_x = x2;
}
- if (y1 < y2)
- {
- if (srcbase) y1 = 0;
- if (dstbase) y2 = 0;
-
+ if (cmdreg & CMD_Y_DEC)
+ {
src_y = y1 + height - 1;
dst_y = y2 + height - 1;
- cmdreg |= CMD_Y_DEC;
}
else
{
- if (srcbase) y1 = 0;
- if (dstbase) y2 = 0;
-
src_y = y1;
dst_y = y2;
}
diff --git a/src/ast_cursor.c b/src/ast_cursor.c
index 6b6cb94..8c9757a 100644
--- a/src/ast_cursor.c
+++ b/src/ast_cursor.c
@@ -203,6 +203,10 @@ ASTSetCursorColors(ScrnInfoPtr pScrn, int bg, int fg)
pAST->HWCInfo.fg = (fg & 0x0F) | (((fg>>8) & 0x0F) << 4) | (((fg>>16) & 0x0F) << 8);
pAST->HWCInfo.bg = (bg & 0x0F) | (((bg>>8) & 0x0F) << 4) | (((bg>>16) & 0x0F) << 8);
+
+ /* Fixed xorg bugzilla #20609, ycchen@031209 */
+ ASTLoadCursorImage(pScrn, pAST->HWCInfo.cursorpattern);
+
}
static void
@@ -223,6 +227,10 @@ ASTLoadCursorImage(ScrnInfoPtr pScrn, UCHAR *src)
pAST->HWCInfo.offset_x = MAX_HWC_WIDTH - pAST->HWCInfo.width;
pAST->HWCInfo.offset_y = MAX_HWC_HEIGHT - pAST->HWCInfo.height;
+ /* copy to hwc info */
+ for (i=0; i< MAX_HWC_WIDTH*MAX_HWC_HEIGHT/4; i+=4)
+ *(ULONG *) (pAST->HWCInfo.cursorpattern + i) = *(ULONG *) (src + i);
+
/* copy cursor image to cache */
pjSrcXor = src;
pjSrcAnd = src + (MAX_HWC_WIDTH*MAX_HWC_HEIGHT/8);
diff --git a/src/ast_driver.c b/src/ast_driver.c
index 920987b..927ad6a 100644
--- a/src/ast_driver.c
+++ b/src/ast_driver.c
@@ -658,10 +658,12 @@ ASTPreInit(ScrnInfoPtr pScrn, int flags)
pAST->FbMapSize = pScrn->videoRam * 1024;
+#if 0
if (!ASTMapMem(pScrn)) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Map FB Memory Failed \n");
return FALSE;
}
+#endif
pScrn->memPhysBase = (ULONG)pAST->FBPhysAddr;
pScrn->fbOffset = 0;
@@ -797,6 +799,11 @@ ASTScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
pScrn = xf86Screens[pScreen->myNum];
pAST = ASTPTR(pScrn);
hwp = VGAHWPTR(pScrn);
+
+ if (!ASTMapMem(pScrn)) {
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Map FB Memory Failed \n");
+ return FALSE;
+ }
/* if (!pAST->noAccel) */
{