~ubuntu-branches/ubuntu/intrepid/xserver-xgl/intrepid

« back to all changes in this revision

Viewing changes to hw/kdrive/ati/ati_cursor.c

  • Committer: Bazaar Package Importer
  • Author(s): Matthew Garrett
  • Date: 2006-02-13 14:21:43 UTC
  • Revision ID: james.westby@ubuntu.com-20060213142143-mad6z9xzem7hzxz9
Tags: upstream-7.0.0
ImportĀ upstreamĀ versionĀ 7.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright ļæ½ 2004 Eric Anholt
 
3
 *
 
4
 * Permission to use, copy, modify, distribute, and sell this software and its
 
5
 * documentation for any purpose is hereby granted without fee, provided that
 
6
 * the above copyright notice appear in all copies and that both that
 
7
 * copyright notice and this permission notice appear in supporting
 
8
 * documentation, and that the name of Eric Anholt not be used in
 
9
 * advertising or publicity pertaining to distribution of the software without
 
10
 * specific, written prior permission.  Eric Anholt makes no
 
11
 * representations about the suitability of this software for any purpose.  It
 
12
 * is provided "as is" without express or implied warranty.
 
13
 *
 
14
 * ERIC ANHOLT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
 
15
 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
 
16
 * EVENT SHALL ERIC ANHOLT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
 
17
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
 
18
 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
 
19
 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 
20
 * PERFORMANCE OF THIS SOFTWARE.
 
21
 */
 
22
/* $RCSId$ */
 
23
 
 
24
#ifdef HAVE_CONFIG_H
 
25
#include <kdrive-config.h>
 
26
#endif
 
27
#include "ati.h"
 
28
#include "ati_reg.h"
 
29
#include "cursorstr.h"
 
30
#include "ati_draw.h"
 
31
 
 
32
static void
 
33
ATIMoveCursor(ScreenPtr pScreen, int x, int y)
 
34
{
 
35
        KdScreenPriv(pScreen);
 
36
        ATICardInfo(pScreenPriv);
 
37
        ATIScreenInfo(pScreenPriv);
 
38
        ATICursor *pCurPriv = &atis->cursor;
 
39
        CARD16 xoff, yoff;
 
40
        CARD8 *mmio = atic->reg_base;
 
41
        int stride = atic->is_radeon ? 256 : 16;
 
42
 
 
43
        if (!pCurPriv->has_cursor)
 
44
                return;
 
45
 
 
46
        if (!pScreenPriv->enabled)
 
47
                return;
 
48
 
 
49
        x -= pCurPriv->xhot;
 
50
        xoff = 0;
 
51
        if (x < 0) {
 
52
                xoff = -x;
 
53
                x = 0;
 
54
        }
 
55
        y -= pCurPriv->yhot;
 
56
        yoff = 0;
 
57
        if (y < 0) {
 
58
                yoff = -y;
 
59
                y = 0;
 
60
        }
 
61
 
 
62
        MMIO_OUT32(mmio, ATI_REG_CUR_HORZ_VERT_OFF, ATI_CUR_LOCK |
 
63
            (xoff << 16) | yoff);
 
64
        MMIO_OUT32(mmio, ATI_REG_CUR_HORZ_VERT_POSN, ATI_CUR_LOCK |
 
65
            (x << 16) | y);
 
66
        MMIO_OUT32(mmio, ATI_REG_CUR_OFFSET, (pCurPriv->area->offset + yoff *
 
67
            stride));
 
68
}
 
69
 
 
70
static void
 
71
ClassicAllocCursorColors(ScreenPtr pScreen)
 
72
{
 
73
        KdScreenPriv(pScreen);
 
74
        ATIScreenInfo(pScreenPriv);
 
75
        ATICursor *pCurPriv = &atis->cursor;
 
76
        CursorPtr pCursor = pCurPriv->pCursor;
 
77
 
 
78
        KdAllocateCursorPixels(pScreen, 0, pCursor, &pCurPriv->source,
 
79
            &pCurPriv->mask);
 
80
        switch (pScreenPriv->screen->fb[0].bitsPerPixel) {
 
81
        case 4:
 
82
                pCurPriv->source |= pCurPriv->source << 4;
 
83
                pCurPriv->mask |= pCurPriv->mask << 4;
 
84
                /* FALLTHROUGH */
 
85
        case 8:
 
86
                pCurPriv->source |= pCurPriv->source << 8;
 
87
                pCurPriv->mask |= pCurPriv->mask << 8;
 
88
                /* FALLTHROUGH */
 
89
        case 16:
 
90
                pCurPriv->source |= pCurPriv->source << 16;
 
91
                pCurPriv->mask |= pCurPriv->mask << 16;
 
92
        }
 
93
}
 
94
 
 
95
static void
 
96
ClassicSetCursorColors(ScreenPtr pScreen)
 
97
{
 
98
        KdScreenPriv(pScreen);
 
99
        ATICardInfo(pScreenPriv);
 
100
        ATIScreenInfo(pScreenPriv);
 
101
        ATICursor *pCurPriv = &atis->cursor;
 
102
        CARD8 *mmio = atic->reg_base;
 
103
 
 
104
        MMIO_OUT32(mmio, ATI_REG_CUR_CLR0, pCurPriv->mask);
 
105
        MMIO_OUT32(mmio, ATI_REG_CUR_CLR1, pCurPriv->source);
 
106
}
 
107
 
 
108
static void
 
109
ClassicRecolorCursor(ScreenPtr pScreen, int ndef, xColorItem *pdef)
 
110
{
 
111
        KdScreenPriv(pScreen);
 
112
        ATIScreenInfo(pScreenPriv);
 
113
        ATICursor *pCurPriv = &atis->cursor;
 
114
        CursorPtr pCursor = pCurPriv->pCursor;
 
115
 
 
116
        if (!pCurPriv->has_cursor || !pCursor)
 
117
                return;
 
118
 
 
119
        if (!pScreenPriv->enabled)
 
120
                return;
 
121
 
 
122
        if (pdef) { 
 
123
                while (ndef != 0) {
 
124
                        if (pdef->pixel == pCurPriv->source || 
 
125
                            pdef->pixel == pCurPriv->mask)
 
126
                                break;
 
127
                        ndef--;
 
128
                }
 
129
 
 
130
                if (ndef == 0)
 
131
                        return;
 
132
        }
 
133
        ClassicAllocCursorColors(pScreen);
 
134
        ClassicSetCursorColors(pScreen);
 
135
}
 
136
 
 
137
#define InvertBits32(v) do { \
 
138
        v = ((v & 0x55555555) << 1) | ((v >> 1) & 0x55555555); \
 
139
        v = ((v & 0x33333333) << 2) | ((v >> 2) & 0x33333333); \
 
140
        v = ((v & 0x0f0f0f0f) << 4) | ((v >> 4) & 0x0f0f0f0f); \
 
141
} while (0)
 
142
 
 
143
static void
 
144
ClassicLoadCursor(ScreenPtr pScreen)
 
145
{
 
146
        KdScreenPriv(pScreen);
 
147
        ATICardInfo(pScreenPriv);
 
148
        ATIScreenInfo(pScreenPriv);
 
149
        ATICursor *pCurPriv = &atis->cursor;
 
150
        CursorPtr pCursor = pCurPriv->pCursor;
 
151
        CursorBitsPtr bits = pCursor->bits;
 
152
        int h;
 
153
        CARD32 *ram, *msk, *mskLine, *src, *srcLine;
 
154
        int i;
 
155
        int lwsrc;
 
156
        CARD32 tmp;
 
157
        CARD8 *mmio = atic->reg_base;
 
158
 
 
159
        ClassicAllocCursorColors(pScreen);
 
160
 
 
161
        pCurPriv->pCursor = pCursor;
 
162
        pCurPriv->xhot = pCursor->bits->xhot;
 
163
        pCurPriv->yhot = pCursor->bits->yhot;
 
164
 
 
165
        /* Stick new image into cursor memory */
 
166
        ram = (CARD32 *)(pScreenPriv->screen->memory_base +
 
167
            pCurPriv->area->offset);
 
168
        mskLine = (CARD32 *)bits->mask;
 
169
        srcLine = (CARD32 *)bits->source;
 
170
 
 
171
        h = bits->height;
 
172
        if (h > ATI_CURSOR_HEIGHT)
 
173
                h = ATI_CURSOR_HEIGHT;
 
174
 
 
175
        lwsrc = BitmapBytePad(bits->width) / 4;         /* words per line */
 
176
 
 
177
        tmp = MMIO_IN32(mmio, ATI_REG_GEN_CNTL);
 
178
        MMIO_OUT32(mmio, ATI_REG_GEN_CNTL, tmp & ~ATI_CRTC_CUR_EN);
 
179
 
 
180
        for (i = 0; i < ATI_CURSOR_HEIGHT; i++) {
 
181
                CARD32 m1, m2, s1, s2;
 
182
 
 
183
                msk = mskLine;
 
184
                src = srcLine;
 
185
                mskLine += lwsrc;
 
186
                srcLine += lwsrc;
 
187
 
 
188
                if (i < h && 0 < lwsrc) {
 
189
                        m1 = ~*msk++;
 
190
                        s1 = *src++;
 
191
                        InvertBits32(m1);
 
192
                        InvertBits32(s1);
 
193
                } else {
 
194
                        m1 = 0xffffffff;
 
195
                        s1 = 0x0;
 
196
                }
 
197
                if (i < h && 1 < lwsrc) {
 
198
                        m2 = ~*msk++;
 
199
                        s2 = *src++;
 
200
                        InvertBits32(m2);
 
201
                        InvertBits32(s2);
 
202
                } else {
 
203
                        m2 = 0xffffffff;
 
204
                        s2 = 0x0;
 
205
                }
 
206
 
 
207
                *ram++ = m1;
 
208
                *ram++ = m2;
 
209
                *ram++ = s1;
 
210
                *ram++ = s2;
 
211
        }
 
212
 
 
213
        /* Not sure why this is necessary, but it prevents some cursor
 
214
         * corruption.  Not even all of it.
 
215
         */
 
216
        for (i = 0; i < ATI_CURSOR_HEIGHT; i++) {
 
217
                *ram++ = 0xffffffff;
 
218
                *ram++ = 0xffffffff;
 
219
                *ram++ = 0x0;
 
220
                *ram++ = 0x0;
 
221
        }
 
222
 
 
223
        /* Enable the cursor */
 
224
        tmp = MMIO_IN32(mmio, ATI_REG_GEN_CNTL);
 
225
        MMIO_OUT32(mmio, ATI_REG_GEN_CNTL, tmp | ATI_CRTC_CUR_EN);
 
226
 
 
227
        /* Set new color */
 
228
        ClassicSetCursorColors(pScreen);
 
229
 
 
230
}
 
231
 
 
232
static void
 
233
RadeonLoadCursor(ScreenPtr pScreen)
 
234
{
 
235
        KdScreenPriv(pScreen);
 
236
        ATICardInfo(pScreenPriv);
 
237
        ATIScreenInfo(pScreenPriv);
 
238
        ATICursor *pCurPriv = &atis->cursor;
 
239
        CursorPtr pCursor = pCurPriv->pCursor;
 
240
        CursorBitsPtr bits = pCursor->bits;
 
241
        int h, w;
 
242
        int x, y;
 
243
        CARD32 *ram, *msk, *mskLine, *src, *srcLine;
 
244
        int lwsrc;
 
245
        CARD32 tmp;
 
246
        CARD8 *mmio = atic->reg_base;
 
247
 
 
248
        pCurPriv->pCursor = pCursor;
 
249
        pCurPriv->xhot = pCursor->bits->xhot;
 
250
        pCurPriv->yhot = pCursor->bits->yhot;
 
251
 
 
252
        w = bits->width;
 
253
        if (w > ATI_CURSOR_WIDTH)
 
254
                w = ATI_CURSOR_WIDTH;
 
255
 
 
256
        h = bits->height;
 
257
        if (h > ATI_CURSOR_HEIGHT)
 
258
                h = ATI_CURSOR_HEIGHT;
 
259
    
 
260
        tmp = MMIO_IN32(mmio, 0x7c);
 
261
        tmp = 0x00010f80;
 
262
        MMIO_OUT32 (mmio, 0x7c, tmp);
 
263
 
 
264
        tmp = MMIO_IN32(mmio, ATI_REG_GEN_CNTL);
 
265
        tmp &= ~(ATI_CRTC_CUR_EN | ATI_CRTC_ICON_EN | ATI_CRTC_ARGB_EN);
 
266
        MMIO_OUT32(mmio, ATI_REG_GEN_CNTL, tmp);
 
267
 
 
268
        /* Stick new image into cursor memory */
 
269
        ram = (CARD32 *)(pScreenPriv->screen->memory_base +
 
270
            pCurPriv->area->offset);
 
271
        if (pCursor->bits->argb)
 
272
        {
 
273
                srcLine = pCursor->bits->argb;
 
274
                for (y = 0; y < h; y++)
 
275
                {
 
276
                        src = srcLine;
 
277
                        srcLine += pCursor->bits->width;
 
278
                        for (x = 0; x < w; x++)
 
279
                                *ram++ = *src++;
 
280
                        for (; x < ATI_CURSOR_WIDTH; x++)
 
281
                                *ram++ = 0;
 
282
                }
 
283
                for (; y < ATI_CURSOR_HEIGHT; y++)
 
284
                        for (x = 0; x < ATI_CURSOR_WIDTH; x++)
 
285
                                *ram++ = 0;
 
286
        }
 
287
        else
 
288
        {
 
289
                CARD32  colors[4];
 
290
                
 
291
                colors[0] = 0;
 
292
                colors[1] = 0;
 
293
                colors[2] = (((pCursor->backRed   >> 8) << 16) |
 
294
                             ((pCursor->backGreen >> 8) <<  8) |
 
295
                             ((pCursor->backBlue  >> 8) <<  0) |
 
296
                             0xff000000);
 
297
                colors[3] = (((pCursor->foreRed   >> 8) << 16) |
 
298
                             ((pCursor->foreGreen >> 8) <<  8) |
 
299
                             ((pCursor->foreBlue  >> 8) <<  0) |
 
300
                             0xff000000);
 
301
                
 
302
                mskLine = (CARD32 *)bits->mask;
 
303
                srcLine = (CARD32 *)bits->source;
 
304
 
 
305
                /* words per line */
 
306
                lwsrc = BitmapBytePad(bits->width) / 4;
 
307
 
 
308
                for (y = 0; y < ATI_CURSOR_HEIGHT; y++) 
 
309
                {
 
310
                        CARD32 m, s;
 
311
 
 
312
                        msk = mskLine;
 
313
                        src = srcLine;
 
314
                        mskLine += lwsrc;
 
315
                        srcLine += lwsrc;
 
316
 
 
317
                        for (x = 0; x < ATI_CURSOR_WIDTH / 32; x++)
 
318
                        {
 
319
                                int k;
 
320
                                if (y < h && x < lwsrc) 
 
321
                                {
 
322
                                        m = *msk++;
 
323
                                        s = *src++;
 
324
                                }
 
325
                                else 
 
326
                                {
 
327
                                        m = 0x0;
 
328
                                        s = 0x0;
 
329
                                }
 
330
 
 
331
                                for (k = 0; k < 32; k++)
 
332
                                {
 
333
                                        CARD32 bits = (s & 1) | ((m & 1) << 1);
 
334
                                        *ram++ = colors[bits];
 
335
                                        s >>= 1;
 
336
                                        m >>= 1;
 
337
                                }
 
338
                        }
 
339
                }
 
340
        }
 
341
 
 
342
        /* Enable the cursor */
 
343
        tmp &= ~(ATI_CRTC_ICON_EN);
 
344
        tmp |= ATI_CRTC_ARGB_EN;
 
345
        tmp |= ATI_CRTC_CUR_EN;
 
346
        MMIO_OUT32(mmio, ATI_REG_GEN_CNTL, tmp);
 
347
}
 
348
 
 
349
static void
 
350
ATIUnloadCursor(ScreenPtr pScreen)
 
351
{
 
352
        KdScreenPriv(pScreen);
 
353
        ATICardInfo(pScreenPriv);
 
354
        CARD8 *mmio = atic->reg_base;
 
355
        CARD32 tmp;
 
356
 
 
357
        tmp = MMIO_IN32(mmio, ATI_REG_GEN_CNTL);
 
358
        tmp &= ~(ATI_CRTC_CUR_EN | ATI_CRTC_ICON_EN | ATI_CRTC_ARGB_EN);
 
359
        MMIO_OUT32(mmio, ATI_REG_GEN_CNTL, tmp);
 
360
}
 
361
 
 
362
static Bool
 
363
ATIRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
 
364
{
 
365
        KdScreenPriv(pScreen);
 
366
        ATICardInfo(pScreenPriv);
 
367
        ATIScreenInfo(pScreenPriv);
 
368
        ATICursor *pCurPriv = &atis->cursor;
 
369
 
 
370
        if (!pScreenPriv->enabled)
 
371
                return TRUE;
 
372
 
 
373
        /* miRecolorCursor does this */
 
374
        if (pCursor && pCurPriv->pCursor == pCursor)
 
375
        {
 
376
                int x, y;
 
377
 
 
378
                miPointerPosition(&x, &y);
 
379
                if (atic->is_radeon)
 
380
                        RadeonLoadCursor (pScreen);
 
381
                else
 
382
                        ClassicLoadCursor(pScreen);
 
383
                /* Move to new position */
 
384
                ATIMoveCursor(pScreen, x, y);
 
385
        }
 
386
 
 
387
        return TRUE;
 
388
}
 
389
 
 
390
static Bool
 
391
ATIUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
 
392
{
 
393
        return TRUE;
 
394
}
 
395
 
 
396
static void
 
397
ATISetCursor(ScreenPtr pScreen, CursorPtr pCursor, int x, int y)
 
398
{
 
399
        KdScreenPriv(pScreen);
 
400
        ATICardInfo(pScreenPriv);
 
401
        ATIScreenInfo(pScreenPriv);
 
402
        ATICursor *pCurPriv = &atis->cursor;
 
403
 
 
404
        pCurPriv->pCursor = pCursor;
 
405
 
 
406
        if (!pScreenPriv->enabled)
 
407
                return;
 
408
 
 
409
        if (pCursor)
 
410
        {
 
411
                if (atic->is_radeon)
 
412
                        RadeonLoadCursor (pScreen);
 
413
                else
 
414
                        ClassicLoadCursor(pScreen);
 
415
                /* Move to new position */
 
416
                ATIMoveCursor(pScreen, x, y);
 
417
        }
 
418
        else
 
419
                ATIUnloadCursor(pScreen);
 
420
}
 
421
 
 
422
miPointerSpriteFuncRec ATIPointerSpriteFuncs = {
 
423
        ATIRealizeCursor,
 
424
        ATIUnrealizeCursor,
 
425
        ATISetCursor,
 
426
        ATIMoveCursor,
 
427
};
 
428
 
 
429
static void
 
430
ATIQueryBestSize(int class, unsigned short *pwidth, unsigned short *pheight, 
 
431
    ScreenPtr pScreen)
 
432
{
 
433
        KdScreenPriv(pScreen);
 
434
        ATIScreenInfo(pScreenPriv);
 
435
        ATICursor *pCurPriv = &atis->cursor;
 
436
 
 
437
        switch (class)
 
438
        {
 
439
        case CursorShape:
 
440
                if (*pwidth > pCurPriv->width)
 
441
                        *pwidth = pCurPriv->width;
 
442
                if (*pheight > pCurPriv->height)
 
443
                        *pheight = pCurPriv->height;
 
444
                if (*pwidth > pScreen->width)
 
445
                        *pwidth = pScreen->width;
 
446
                if (*pheight > pScreen->height)
 
447
                        *pheight = pScreen->height;
 
448
                break;
 
449
        default:
 
450
                fbQueryBestSize(class, pwidth, pheight, pScreen);
 
451
                break;
 
452
        }
 
453
}
 
454
 
 
455
static void
 
456
ATICursorSave(ScreenPtr pScreen, KdOffscreenArea *area)
 
457
{
 
458
        KdScreenPriv(pScreen);
 
459
        ATIScreenInfo(pScreenPriv);
 
460
        ATICursor *pCurPriv = &atis->cursor;
 
461
 
 
462
        pCurPriv->area = NULL;
 
463
}
 
464
 
 
465
void
 
466
ATICursorEnable(ScreenPtr pScreen)
 
467
{
 
468
        KdScreenPriv(pScreen);
 
469
        ATICardInfo(pScreenPriv);
 
470
        ATIScreenInfo(pScreenPriv);
 
471
        ATICursor *pCurPriv = &atis->cursor;
 
472
 
 
473
        if (!pCurPriv->has_cursor)
 
474
                return;
 
475
 
 
476
        if (pCurPriv->area == NULL) {
 
477
                if (atic->is_radeon)
 
478
                        pCurPriv->area = KdOffscreenAlloc(pScreen,
 
479
                            ATI_CURSOR_HEIGHT * ATI_CURSOR_WIDTH * 4,
 
480
                            128, TRUE, ATICursorSave, atis);
 
481
                else
 
482
                        pCurPriv->area = KdOffscreenAlloc(pScreen,
 
483
                            ATI_CURSOR_HEIGHT * ATI_CURSOR_PITCH * 2,
 
484
                            32, TRUE, ATICursorSave, atis);
 
485
        }
 
486
        if (pCurPriv->area == NULL)
 
487
                FatalError("Couldn't allocate offscreen memory for cursor.\n");
 
488
 
 
489
        if (pCurPriv->pCursor) {
 
490
                int x, y;
 
491
 
 
492
                miPointerPosition(&x, &y);
 
493
                if (atic->is_radeon)
 
494
                        RadeonLoadCursor(pScreen);
 
495
                else
 
496
                        ClassicLoadCursor(pScreen);
 
497
                /* Move to new position */
 
498
                ATIMoveCursor(pScreen, x, y);
 
499
        }
 
500
        else
 
501
                ATIUnloadCursor(pScreen);
 
502
}
 
503
 
 
504
void
 
505
ATICursorDisable(ScreenPtr pScreen)
 
506
{
 
507
        KdScreenPriv(pScreen);
 
508
        ATIScreenInfo(pScreenPriv);
 
509
        ATICursor *pCurPriv = &atis->cursor;
 
510
 
 
511
        if (!pScreenPriv->enabled || !pCurPriv->has_cursor)
 
512
                return;
 
513
 
 
514
        if (pCurPriv->pCursor)
 
515
                ATIUnloadCursor(pScreen);
 
516
}
 
517
 
 
518
Bool
 
519
ATICursorInit(ScreenPtr pScreen)
 
520
{
 
521
        KdScreenPriv(pScreen);
 
522
        ATICardInfo(pScreenPriv);
 
523
        ATIScreenInfo(pScreenPriv);
 
524
        ATICursor *pCurPriv = &atis->cursor;
 
525
 
 
526
        pCurPriv->has_cursor = FALSE;
 
527
 
 
528
        if (atic->reg_base == NULL)
 
529
                return FALSE;
 
530
 
 
531
        pCurPriv->width = ATI_CURSOR_WIDTH;
 
532
        pCurPriv->height= ATI_CURSOR_HEIGHT;
 
533
        pScreen->QueryBestSize = ATIQueryBestSize;
 
534
        miPointerInitialize(pScreen, &ATIPointerSpriteFuncs,
 
535
            &kdPointerScreenFuncs, FALSE);
 
536
        pCurPriv->has_cursor = TRUE;
 
537
        pCurPriv->pCursor = NULL;
 
538
        return TRUE;
 
539
}
 
540
 
 
541
void
 
542
ATIRecolorCursor (ScreenPtr pScreen, int ndef, xColorItem *pdef)
 
543
{
 
544
        KdScreenPriv(pScreen);
 
545
        ATICardInfo(pScreenPriv);
 
546
 
 
547
        if (!atic->is_radeon)
 
548
                ClassicRecolorCursor (pScreen, ndef, pdef);
 
549
}
 
550
 
 
551
void  
 
552
ATICursorFini(ScreenPtr pScreen)
 
553
{
 
554
        KdScreenPriv(pScreen);
 
555
        ATIScreenInfo(pScreenPriv);
 
556
        ATICursor *pCurPriv = &atis->cursor;
 
557
 
 
558
        pCurPriv->has_cursor = FALSE;
 
559
        pCurPriv->pCursor = NULL;
 
560
}