2 Copyright © 2004, The AROS Development Team. All rights reserved.
8 #include "radeon_reg.h"
9 #include "radeon_bios.h"
10 #include "radeon_accel.h"
11 #include "radeon_macros.h"
14 #include <hidd/graphics.h>
15 #include <hidd/hidd.h>
17 #include <proto/oop.h>
18 #include <proto/utility.h>
21 #include <aros/debug.h>
23 #define sd ((struct ati_staticdata*)SD(cl))
25 #undef HiddPCIDeviceAttrBase
26 #undef HiddGfxAttrBase
27 #undef HiddPixFmtAttrBase
28 #undef HiddSyncAttrBase
29 #undef HiddBitMapAttrBase
30 #define HiddPCIDeviceAttrBase (sd->pciAttrBase)
31 #define HiddATIBitMapAttrBase (sd->atiBitMapAttrBase)
32 #define HiddBitMapAttrBase (sd->bitMapAttrBase)
33 #define HiddPixFmtAttrBase (sd->pixFmtAttrBase)
34 #define HiddGfxAttrBase (sd->gfxAttrBase)
35 #define HiddSyncAttrBase (sd->syncAttrBase)
37 struct pRoot_Dispose
{
41 OOP_Object
*METHOD(ATIOffBM
, Root
, New
)
42 __attribute__((alias(METHOD_NAME_S(ATIOnBM
, Root
, New
))));
44 OOP_Object
*METHOD(ATIOnBM
, Root
, New
)
46 if (cl
== sd
->OnBMClass
)
47 EnterFunc(bug("[ATIBitMap] OnBitmap::New()\n"));
49 EnterFunc(bug("[ATIBitMap] OffBitmap::New()\n"));
51 o
= (OOP_Object
*)OOP_DoSuperMethod(cl
, o
, (OOP_Msg
)msg
);
54 atiBitMap
*bm
= OOP_INST_DATA(cl
, o
);
56 ULONG width
, height
, depth
;
62 InitSemaphore(&bm
->bmLock
);
64 D(bug("[ATIBitMap] Super called. o=%p\n", o
));
66 bm
->onbm
= (cl
== sd
->OnBMClass
);
68 OOP_GetAttr(o
, aHidd_BitMap_Width
, &width
);
69 OOP_GetAttr(o
, aHidd_BitMap_Height
, &height
);
70 OOP_GetAttr(o
, aHidd_BitMap_PixFmt
, (APTR
)&pf
);
71 OOP_GetAttr(pf
, aHidd_PixFmt_Depth
, &depth
);
72 fb
= GetTagData(aHidd_BitMap_FrameBuffer
, FALSE
, msg
->attrList
);
74 D(bug("[ATIBitmap] width=%d height=%d depth=%d\n", width
, height
, depth
));
76 if (width
== 0 || height
== 0 || depth
== 0)
78 bug("[ATIBitMap] size mismatch!\n");
101 bm
->pitch
= (width
* bytesPerPixel
+ 63) & ~63;
103 bm
->bpp
= bytesPerPixel
;
104 bm
->framebuffer
= AllocBitmapArea(sd
, bm
->width
, bm
->height
, bm
->bpp
, TRUE
);
110 if (bm
->framebuffer
!= -1)
112 ULONG pitch64
= ((bm
->pitch
)) >> 6;
129 bm
->dp_gui_master_cntl
=
130 ((bm
->datatype
<< RADEON_GMC_DST_DATATYPE_SHIFT
)
131 |RADEON_GMC_CLR_CMP_CNTL_DIS
132 |RADEON_GMC_DST_PITCH_OFFSET_CNTL
);
134 bm
->pitch_offset
= ((bm
->framebuffer
>> 10) | (bm
->pitch
<< 16));
136 D(bug("[ATIBitMap] PITCH_OFFSET=%08x\n", bm
->pitch_offset
));
139 if (cl
== sd
->OnBMClass
)
141 if (fb
&& bm
->framebuffer
!= -1)
143 bm
->state
= (struct CardState
*)AllocPooled(sd
->memPool
,
144 sizeof(struct CardState
));
146 bzero((APTR
)(sd
->Card
.FrameBuffer
+ bm
->framebuffer
), 640*480*2);
152 InitMode(sd
, bm
->state
, 640, 480, 16, 25200, bm
->framebuffer
,
157 LoadState(sd
, bm
->state
);
158 //LoadState(sd, sd->poweron_state);
161 RADEONEngineReset(sd
);
162 RADEONEngineRestore(sd
);
169 else if (bm
->framebuffer
!= -1)
174 /* We should be able to get modeID from the bitmap */
175 OOP_GetAttr(o
, aHidd_BitMap_ModeID
, &modeid
);
177 D(bug("[ATIBitMap] BM_ModeID=%x\n", modeid
));
179 if (modeid
!= vHidd_ModeID_Invalid
)
182 ULONG hdisp
, vdisp
, hstart
, hend
, htotal
, vstart
, vend
, vtotal
;
184 /* Get Sync and PixelFormat properties */
185 struct pHidd_Gfx_GetMode __getmodemsg
= {
189 }, *getmodemsg
= &__getmodemsg
;
191 getmodemsg
->mID
= OOP_GetMethodID((STRPTR
)CLID_Hidd_Gfx
, moHidd_Gfx_GetMode
);
192 OOP_DoMethod(sd
->AtiObject
, (OOP_Msg
)getmodemsg
);
194 OOP_GetAttr(sync
, aHidd_Sync_PixelClock
, &pixel
);
195 OOP_GetAttr(sync
, aHidd_Sync_HDisp
, &hdisp
);
196 OOP_GetAttr(sync
, aHidd_Sync_VDisp
, &vdisp
);
197 OOP_GetAttr(sync
, aHidd_Sync_HSyncStart
, &hstart
);
198 OOP_GetAttr(sync
, aHidd_Sync_VSyncStart
, &vstart
);
199 OOP_GetAttr(sync
, aHidd_Sync_HSyncEnd
, &hend
);
200 OOP_GetAttr(sync
, aHidd_Sync_VSyncEnd
, &vend
);
201 OOP_GetAttr(sync
, aHidd_Sync_HTotal
, &htotal
);
202 OOP_GetAttr(sync
, aHidd_Sync_VTotal
, &vtotal
);
204 bm
->state
= (struct CardState
*)AllocPooled(sd
->memPool
,
205 sizeof(struct CardState
));
213 InitMode(sd
, bm
->state
, width
, height
, depth
, pixel
, bm
->framebuffer
,
215 hstart
, hend
, htotal
,
216 vstart
, vend
, vtotal
);
218 LoadState(sd
, bm
->state
);
221 RADEONEngineReset(sd
);
222 RADEONEngineRestore(sd
);
233 if (bm
->framebuffer
== -1)
235 bm
->framebuffer
= (IPTR
)AllocMem(bm
->pitch
* bm
->height
,
236 MEMF_PUBLIC
| MEMF_CLEAR
);
242 if ((bm
->framebuffer
!= 0xffffffff) && (bm
->framebuffer
!= 0))
248 OOP_MethodID disp_mid
= OOP_GetMethodID((STRPTR
)IID_Root
, moRoot_Dispose
);
249 OOP_CoerceMethod(cl
, o
, (OOP_Msg
) &disp_mid
);
256 VOID
METHOD(ATIOffBM
, Root
, Dispose
)
257 __attribute__((alias(METHOD_NAME_S(ATIOnBM
, Root
, Dispose
))));
259 VOID
METHOD(ATIOnBM
, Root
, Dispose
)
261 atiBitMap
*bm
= OOP_INST_DATA(cl
, o
);
265 // NVDmaKickoff(&sd->Card);
266 RADEONWaitForIdleMMIO(sd
);
270 FreeBitmapArea(sd
, bm
->framebuffer
, bm
->width
, bm
->height
, bm
->bpp
);
272 bm
->framebuffer
= -1;
276 FreeMem((APTR
)bm
->framebuffer
, bm
->pitch
* bm
->height
);
279 FreePooled(sd
->memPool
, bm
->state
, sizeof(struct CardState
));
286 OOP_DoSuperMethod(cl
, o
, (OOP_Msg
)msg
);
290 VOID
METHOD(ATIOffBM
, Root
, Get
)
291 __attribute__((alias(METHOD_NAME_S(ATIOnBM
, Root
, Get
))));
293 VOID
METHOD(ATIOnBM
, Root
, Get
)
295 atiBitMap
*bm
= OOP_INST_DATA(cl
, o
);
298 if (IS_ATIBM_ATTR(msg
->attrID
, idx
))
302 case aoHidd_ATIBitMap_Drawable
:
304 *msg
->storage
= bm
->framebuffer
+ (IPTR
)sd
->Card
.FrameBuffer
;
306 *msg
->storage
= bm
->framebuffer
;
310 OOP_DoSuperMethod(cl
, o
, (OOP_Msg
)msg
);
315 OOP_DoSuperMethod(cl
, o
, (OOP_Msg
)msg
);
320 VOID
METHOD(ATIOffBM
, Hidd_BitMap
, Clear
)
321 __attribute__((alias(METHOD_NAME_S(ATIOnBM
, Hidd_BitMap
, Clear
))));
323 VOID
METHOD(ATIOnBM
, Hidd_BitMap
, Clear
)
325 atiBitMap
*bm
= OOP_INST_DATA(cl
, o
);
327 D(bug("[ATI] Clear(%p)\n",
335 sd
->Card
.Busy
= TRUE
;
338 RADEONWaitForFifo(sd
, 1);
339 OUTREG(RADEON_DST_PITCH_OFFSET
, bm
->pitch_offset
);
341 bm
->dp_gui_master_cntl_clip
= (bm
->dp_gui_master_cntl
342 | RADEON_GMC_BRUSH_SOLID_COLOR
343 | RADEON_GMC_SRC_DATATYPE_COLOR
344 | RADEON_ROP
[vHidd_GC_DrawMode_Copy
].pattern
);
346 RADEONWaitForFifo(sd
, 4);
348 OUTREG(RADEON_DP_GUI_MASTER_CNTL
, bm
->dp_gui_master_cntl_clip
);
349 OUTREG(RADEON_DP_BRUSH_FRGD_CLR
, GC_BG(msg
->gc
));
350 OUTREG(RADEON_DP_WRITE_MASK
, ~0);
351 OUTREG(RADEON_DP_CNTL
, (RADEON_DST_X_LEFT_TO_RIGHT
352 | RADEON_DST_Y_TOP_TO_BOTTOM
));
354 RADEONWaitForFifo(sd
, 2);
356 OUTREG(RADEON_DST_Y_X
, 0);
357 OUTREG(RADEON_DST_WIDTH_HEIGHT
, (bm
->width
<< 16) | bm
->height
);
363 ULONG
*ptr
= (ULONG
*)bm
->framebuffer
;
365 int i
= (bm
->pitch
* bm
->height
) >> 2;
370 val
= GC_BG(msg
->gc
) << 16 | (GC_BG(msg
->gc
) & 0xffff);
374 val
= GC_BG(msg
->gc
) << 16 | (GC_BG(msg
->gc
) & 0xffff);
378 do { *ptr
++ = val
; } while(--i
);
384 struct pHidd_BitMap_FillRect
{
385 struct pHidd_BitMap_DrawRect dr
;
388 VOID
METHOD(ATIOffBM
, Hidd_BitMap
, FillRect
)
389 __attribute__((alias(METHOD_NAME_S(ATIOnBM
, Hidd_BitMap
, FillRect
))));
391 VOID
METHOD(ATIOnBM
, Hidd_BitMap
, FillRect
)
393 OOP_Object
*gc
= msg
->dr
.gc
;
394 atiBitMap
*bm
= OOP_INST_DATA(cl
, o
);
396 D(bug("[ATI] FillRect(%p, %d:%d - %d:%d)\n",
397 bm
->framebuffer
, msg
->dr
.minX
, msg
->dr
.minY
, msg
->dr
.maxX
, msg
->dr
.maxY
));
404 sd
->Card
.Busy
= TRUE
;
407 RADEONWaitForFifo(sd
, 1);
408 OUTREG(RADEON_DST_PITCH_OFFSET
, bm
->pitch_offset
);
410 bm
->dp_gui_master_cntl_clip
= (bm
->dp_gui_master_cntl
411 | RADEON_GMC_BRUSH_SOLID_COLOR
412 | RADEON_GMC_SRC_DATATYPE_COLOR
413 | RADEON_ROP
[GC_DRMD(gc
)].pattern
);
415 RADEONWaitForFifo(sd
, 4);
417 OUTREG(RADEON_DP_GUI_MASTER_CNTL
, bm
->dp_gui_master_cntl_clip
);
418 OUTREG(RADEON_DP_BRUSH_FRGD_CLR
, GC_FG(gc
));
419 OUTREG(RADEON_DP_WRITE_MASK
, ~0);
420 OUTREG(RADEON_DP_CNTL
, (RADEON_DST_X_LEFT_TO_RIGHT
421 | RADEON_DST_Y_TOP_TO_BOTTOM
));
423 RADEONWaitForFifo(sd
, 2);
425 OUTREG(RADEON_DST_Y_X
, (msg
->dr
.minY
<< 16) | msg
->dr
.minX
);
426 OUTREG(RADEON_DST_WIDTH_HEIGHT
, ((msg
->dr
.maxX
- msg
->dr
.minX
+ 1) << 16) | (msg
->dr
.maxY
- msg
->dr
.minY
+ 1));
432 OOP_DoSuperMethod(cl
, o
, (OOP_Msg
)msg
);
440 VOID
METHOD(ATIOffBM
, Hidd_BitMap
, DrawLine
)
441 __attribute__((alias(METHOD_NAME_S(ATIOnBM
, Hidd_BitMap
, DrawLine
))));
443 VOID
METHOD(ATIOnBM
, Hidd_BitMap
, DrawLine
)
445 OOP_Object
*gc
= msg
->gc
;
446 atiBitMap
*bm
= OOP_INST_DATA(cl
, o
);
448 D(bug("[ATI] DrawLine(%p, %d:%d - %d:%d) %08x\n",
449 bm
->framebuffer
, msg
->x1
, msg
->y1
, msg
->x2
, msg
->y2
,GC_FG(gc
)));
453 if ((GC_LINEPAT(gc
) =! (UWORD
)~0) || !bm
->fbgfx
)
455 OOP_DoSuperMethod(cl
, o
, (OOP_Msg
)msg
);
460 sd
->Card
.Busy
= TRUE
;
463 RADEONWaitForFifo(sd
, 1);
464 OUTREG(RADEON_DST_PITCH_OFFSET
, bm
->pitch_offset
);
466 bm
->dp_gui_master_cntl_clip
= (bm
->dp_gui_master_cntl
467 | RADEON_GMC_BRUSH_SOLID_COLOR
468 | RADEON_GMC_SRC_DATATYPE_COLOR
469 | RADEON_ROP
[GC_DRMD(gc
)].pattern
);
471 if (sd
->Card
.Type
>= RV200
) {
472 RADEONWaitForFifo(sd
, 1);
473 OUTREG(RADEON_DST_LINE_PATCOUNT
,
474 0x55 << RADEON_BRES_CNTL_SHIFT
);
479 bm
->dp_gui_master_cntl_clip
|= RADEON_GMC_DST_CLIPPING
;
483 x2
= GC_CLIPX2(gc
) + 1;
484 y2
= GC_CLIPY2(gc
) + 1;
486 RADEONWaitForFifo(sd
, 2);
487 OUTREG(RADEON_SC_TOP_LEFT
, (y1
<< 16) | x1
);
488 OUTREG(RADEON_SC_BOTTOM_RIGHT
, (y2
<< 16) | x2
);
491 RADEONWaitForFifo(sd
, 3);
493 OUTREG(RADEON_DP_GUI_MASTER_CNTL
, bm
->dp_gui_master_cntl_clip
);
494 OUTREG(RADEON_DP_BRUSH_FRGD_CLR
, GC_FG(gc
));
495 OUTREG(RADEON_DP_WRITE_MASK
, ~0);
497 RADEONWaitForFifo(sd
, 4);
499 OUTREG(RADEON_DST_LINE_START
, (msg
->y1
<< 16) | msg
->x1
);
500 OUTREG(RADEON_DST_LINE_END
, (msg
->y2
<< 16) | msg
->x2
);
501 OUTREG(RADEON_DST_LINE_START
, (msg
->y2
<< 16) | msg
->x2
);
502 OUTREG(RADEON_DST_LINE_END
, ((msg
->y2
+1) << 16) | (msg
->x2
+1));
511 VOID
METHOD(ATIOffBM
, Hidd_BitMap
, DrawRect
)
512 __attribute__((alias(METHOD_NAME_S(ATIOnBM
, Hidd_BitMap
, DrawRect
))));
514 VOID
METHOD(ATIOnBM
, Hidd_BitMap
, DrawRect
)
516 OOP_Object
*gc
= msg
->gc
;
517 atiBitMap
*bm
= OOP_INST_DATA(cl
, o
);
520 D(bug("[ATI] DrawRect(%p, %d:%d - %d:%d)\n",
521 bm
->framebuffer
, msg
->minX
, msg
->minY
, msg
->maxX
, msg
->maxY
));
523 if (msg
->minX
== msg
->maxX
) addX
= 1; else addX
= 0;
524 if (msg
->minY
== msg
->maxY
) addY
= 1; else addY
= 0;
528 if ((GC_LINEPAT(gc
) =! (UWORD
)~0) || !bm
->fbgfx
)
530 OOP_DoSuperMethod(cl
, o
, (OOP_Msg
)msg
);
535 sd
->Card
.Busy
= TRUE
;
538 RADEONWaitForFifo(sd
, 1);
539 OUTREG(RADEON_DST_PITCH_OFFSET
, bm
->pitch_offset
);
541 bm
->dp_gui_master_cntl_clip
= (bm
->dp_gui_master_cntl
542 | RADEON_GMC_BRUSH_SOLID_COLOR
543 | RADEON_GMC_SRC_DATATYPE_COLOR
544 | RADEON_ROP
[GC_DRMD(gc
)].pattern
);
546 if (sd
->Card
.Type
>= RV200
) {
547 RADEONWaitForFifo(sd
, 1);
548 OUTREG(RADEON_DST_LINE_PATCOUNT
,
549 0x55 << RADEON_BRES_CNTL_SHIFT
);
554 bm
->dp_gui_master_cntl_clip
|= RADEON_GMC_DST_CLIPPING
;
558 x2
= GC_CLIPX2(gc
) + 1;
559 y2
= GC_CLIPY2(gc
) + 1;
561 RADEONWaitForFifo(sd
, 2);
562 OUTREG(RADEON_SC_TOP_LEFT
, (y1
<< 16) | x1
);
563 OUTREG(RADEON_SC_BOTTOM_RIGHT
, (y2
<< 16) | x2
);
566 RADEONWaitForFifo(sd
, 3);
568 OUTREG(RADEON_DP_GUI_MASTER_CNTL
, bm
->dp_gui_master_cntl_clip
);
569 OUTREG(RADEON_DP_BRUSH_FRGD_CLR
, GC_FG(gc
));
570 OUTREG(RADEON_DP_WRITE_MASK
, ~0);
572 RADEONWaitForFifo(sd
, 8);
574 OUTREG(RADEON_DST_LINE_START
, (msg
->minY
<< 16) | (msg
->minX
& 0xffff));
575 OUTREG(RADEON_DST_LINE_END
, (msg
->minY
<< 16) | (msg
->maxX
& 0xffff));
577 OUTREG(RADEON_DST_LINE_START
, ((msg
->minY
+ addY
) << 16) | (msg
->maxX
& 0xffff));
578 OUTREG(RADEON_DST_LINE_END
, ((msg
->maxY
<< 16)) | (msg
->maxX
& 0xffff));
580 OUTREG(RADEON_DST_LINE_START
, ((msg
->maxY
<< 16)) | ((msg
->maxX
- addX
) & 0xffff));
581 OUTREG(RADEON_DST_LINE_END
, ((msg
->maxY
<< 16)) | ((msg
->minX
) & 0xffff));
583 OUTREG(RADEON_DST_LINE_START
, ((msg
->maxY
- addY
) << 16) | (msg
->minX
& 0xffff));
584 OUTREG(RADEON_DST_LINE_END
, ((msg
->minY
+ addY
) << 16) | (msg
->minX
& 0xffff));
593 VOID
METHOD(ATIOffBM
, Hidd_BitMap
, DrawPolygon
)
594 __attribute__((alias(METHOD_NAME_S(ATIOnBM
, Hidd_BitMap
, DrawPolygon
))));
596 VOID
METHOD(ATIOnBM
, Hidd_BitMap
, DrawPolygon
)
598 OOP_Object
*gc
= msg
->gc
;
599 atiBitMap
*bm
= OOP_INST_DATA(cl
, o
);
602 D(bug("[ATI] DrawPolygon(%p)\n",
607 if ((GC_LINEPAT(gc
) =! (UWORD
)~0) || !bm
->fbgfx
)
609 OOP_DoSuperMethod(cl
, o
, (OOP_Msg
)msg
);
614 sd
->Card
.Busy
= TRUE
;
617 RADEONWaitForFifo(sd
, 1);
618 OUTREG(RADEON_DST_PITCH_OFFSET
, bm
->pitch_offset
);
620 bm
->dp_gui_master_cntl_clip
= (bm
->dp_gui_master_cntl
621 | RADEON_GMC_BRUSH_SOLID_COLOR
622 | RADEON_GMC_SRC_DATATYPE_COLOR
623 | RADEON_ROP
[GC_DRMD(gc
)].pattern
);
625 if (sd
->Card
.Type
>= RV200
) {
626 RADEONWaitForFifo(sd
, 1);
627 OUTREG(RADEON_DST_LINE_PATCOUNT
,
628 0x55 << RADEON_BRES_CNTL_SHIFT
);
633 bm
->dp_gui_master_cntl_clip
|= RADEON_GMC_DST_CLIPPING
;
637 x2
= GC_CLIPX2(gc
) + 1;
638 y2
= GC_CLIPY2(gc
) + 1;
640 RADEONWaitForFifo(sd
, 2);
641 OUTREG(RADEON_SC_TOP_LEFT
, (y1
<< 16) | x1
);
642 OUTREG(RADEON_SC_BOTTOM_RIGHT
, (y2
<< 16) | x2
);
645 RADEONWaitForFifo(sd
, 3);
647 OUTREG(RADEON_DP_GUI_MASTER_CNTL
, bm
->dp_gui_master_cntl_clip
);
648 OUTREG(RADEON_DP_BRUSH_FRGD_CLR
, GC_FG(gc
));
649 OUTREG(RADEON_DP_WRITE_MASK
, ~0);
651 for (i
= 2; i
< (2 * msg
->n
); i
+=2)
653 RADEONWaitForFifo(sd
, 2);
654 OUTREG(RADEON_DST_LINE_START
, (msg
->coords
[i
-1] << 16) | msg
->coords
[i
-2]);
655 OUTREG(RADEON_DST_LINE_END
, (msg
->coords
[i
+1] << 16) | msg
->coords
[i
]);
666 VOID
METHOD(ATIOffBM
, Hidd_BitMap
, PutPixel
)
667 __attribute__((alias(METHOD_NAME_S(ATIOnBM
, Hidd_BitMap
, PutPixel
))));
669 VOID
METHOD(ATIOnBM
, Hidd_BitMap
, PutPixel
)
671 atiBitMap
*bm
= OOP_INST_DATA(cl
, o
);
675 UBYTE
*ptr
= (UBYTE
*)((IPTR
)bm
->framebuffer
+ bm
->bpp
* msg
->x
+ bm
->pitch
* msg
->y
);
679 ptr
+= (IPTR
)sd
->Card
.FrameBuffer
;
683 #warning TODO: NVSync(sd)
684 RADEONWaitForIdleMMIO(sd
);
695 *(UWORD
*)ptr
= msg
->pixel
;
698 *(ULONG
*)ptr
= msg
->pixel
;
706 HIDDT_Pixel
METHOD(ATIOffBM
, Hidd_BitMap
, GetPixel
)
707 __attribute__((alias(METHOD_NAME_S(ATIOnBM
, Hidd_BitMap
, GetPixel
))));
709 HIDDT_Pixel
METHOD(ATIOnBM
, Hidd_BitMap
, GetPixel
)
712 atiBitMap
*bm
= OOP_INST_DATA(cl
, o
);
716 UBYTE
*ptr
= (UBYTE
*)((IPTR
)bm
->framebuffer
+ bm
->bpp
* msg
->x
+ bm
->pitch
* msg
->y
);
720 ptr
+= (IPTR
)sd
->Card
.FrameBuffer
;
724 #warning TODO: NVSync(sd)
725 RADEONWaitForIdleMMIO(sd
);
736 pixel
= *(UWORD
*)ptr
;
739 pixel
= *(ULONG
*)ptr
;
745 /* Get pen number from colortab */
750 void METHOD(ATIOffBM
, Hidd_BitMap
, BlitColorExpansion
)
751 __attribute__((alias(METHOD_NAME_S(ATIOnBM
, Hidd_BitMap
, BlitColorExpansion
))));
753 void METHOD(ATIOnBM
, Hidd_BitMap
, BlitColorExpansion
)
755 atiBitMap
*bm
= OOP_INST_DATA(cl
, o
);
759 if ((OOP_OCLASS(msg
->srcBitMap
) == sd
->PlanarBMClass
) && bm
->fbgfx
)
761 struct planarbm_data
*planar
= OOP_INST_DATA(OOP_OCLASS(msg
->srcBitMap
), msg
->srcBitMap
);
764 ULONG skipleft
= msg
->srcX
- (msg
->srcX
& ~31);
765 ULONG mask
= ~0 << bm
->depth
;
767 cemd
= GC_COLEXP(msg
->gc
);
768 bg
= GC_BG(msg
->gc
) | mask
;
769 fg
= GC_FG(msg
->gc
) | mask
;
771 ULONG bw
= (msg
->width
+ 31 + skipleft
) & ~31;
772 LONG x
= msg
->destX
, y
= msg
->destY
, w
= msg
->width
, h
= msg
->height
;
777 sd
->Card
.Busy
= TRUE
;
779 RADEONWaitForFifo(sd
, 1);
780 OUTREG(RADEON_DST_PITCH_OFFSET
, bm
->pitch_offset
);
782 bm
->dp_gui_master_cntl_clip
= (bm
->dp_gui_master_cntl
783 | RADEON_GMC_WR_MSK_DIS
784 | RADEON_GMC_BRUSH_NONE
785 | RADEON_DP_SRC_SOURCE_HOST_DATA
786 | RADEON_GMC_DST_CLIPPING
787 | RADEON_GMC_BYTE_MSB_TO_LSB
788 | RADEON_ROP
[vHidd_GC_DrawMode_Copy
].rop
);
790 if (cemd
& vHidd_GC_ColExp_Transparent
)
792 bm
->dp_gui_master_cntl_clip
|= RADEON_GMC_SRC_DATATYPE_MONO_FG_LA
;
794 RADEONWaitForFifo(sd
, 6);
795 OUTREG(RADEON_DP_GUI_MASTER_CNTL
, bm
->dp_gui_master_cntl_clip
);
796 OUTREG(RADEON_DP_SRC_FRGD_CLR
, fg
);
800 bm
->dp_gui_master_cntl_clip
|= RADEON_GMC_SRC_DATATYPE_MONO_FG_BG
;
802 RADEONWaitForFifo(sd
, 7);
803 OUTREG(RADEON_DP_GUI_MASTER_CNTL
, bm
->dp_gui_master_cntl_clip
);
804 OUTREG(RADEON_DP_SRC_FRGD_CLR
, fg
);
805 OUTREG(RADEON_DP_SRC_BKGD_CLR
, bg
);
808 OUTREG(RADEON_SC_TOP_LEFT
, (y
<< 16) | x
);
809 OUTREG(RADEON_SC_BOTTOM_RIGHT
, ((y
+h
) << 16) | (x
+w
));
811 OUTREG(RADEON_DST_X_Y
, ((x
- skipleft
) << 16) | y
);
812 OUTREG(RADEON_DST_WIDTH_HEIGHT
, (bw
<< 16) | h
);
814 ULONG
*ptr
= (ULONG
*)planar
->planes
[0];
815 ptr
+= ((msg
->srcY
* planar
->bytesperrow
) >> 2) + (msg
->srcX
>> 5);
818 RADEONWaitForFifo(sd
, 1);
819 OUTREG(RADEON_RBBM_GUICNTL
, RADEON_HOST_DATA_SWAP_32BIT
);
826 for (i
=0; i
< bw
>> 5; i
++)
828 RADEONWaitForFifo(sd
, 1);
829 OUTREG(RADEON_HOST_DATA0
, ptr
[i
]);
832 ptr
+= planar
->bytesperrow
>> 2;
836 RADEONWaitForFifo(sd
, 1);
837 OUTREG(RADEON_RBBM_GUICNTL
, RADEON_HOST_DATA_SWAP_NONE
);
844 OOP_DoSuperMethod(cl
, o
, msg
);
850 ULONG
METHOD(ATIOffBM
, Hidd_BitMap
, BytesPerLine
)
851 __attribute__((alias(METHOD_NAME_S(ATIOnBM
, Hidd_BitMap
, BytesPerLine
))));
853 ULONG
METHOD(ATIOnBM
, Hidd_BitMap
, BytesPerLine
)
855 atiBitMap
*bm
= OOP_INST_DATA(cl
, o
);
857 return (bm
->bpp
* msg
->width
+ 255) & ~255;
861 BOOL
METHOD(ATIOffBM
, Hidd_BitMap
, ObtainDirectAccess
)
862 __attribute__((alias(METHOD_NAME_S(ATIOnBM
, Hidd_BitMap
, ObtainDirectAccess
))));
864 BOOL
METHOD(ATIOnBM
, Hidd_BitMap
, ObtainDirectAccess
)
866 atiBitMap
*bm
= OOP_INST_DATA(cl
, o
);
869 IPTR VideoData
= bm
->framebuffer
;
873 VideoData
+= (IPTR
)sd
->Card
.FrameBuffer
;
877 #warning TODO: NVSync(sd)
878 RADEONWaitForIdleMMIO(sd
);
883 *msg
->addressReturn
= (UBYTE
*)VideoData
;
884 *msg
->widthReturn
= bm
->pitch
/ bm
->bpp
;
885 *msg
->heightReturn
= bm
->height
;
886 *msg
->bankSizeReturn
= *msg
->memSizeReturn
= bm
->pitch
* bm
->height
;
891 VOID
METHOD(ATIOffBM
, Hidd_BitMap
, ReleaseDirectAccess
)
892 __attribute__((alias(METHOD_NAME_S(ATIOnBM
, Hidd_BitMap
, ReleaseDirectAccess
))));
894 VOID
METHOD(ATIOnBM
, Hidd_BitMap
, ReleaseDirectAccess
)
896 atiBitMap
*bm
= OOP_INST_DATA(cl
, o
);
903 * Unaccelerated methods
906 VOID
METHOD(ATIOffBM
, Hidd_BitMap
, PutImageLUT
)
907 __attribute__((alias(METHOD_NAME_S(ATIOnBM
, Hidd_BitMap
, PutImageLUT
))));
909 VOID
METHOD(ATIOnBM
, Hidd_BitMap
, PutImageLUT
)
911 atiBitMap
*bm
= OOP_INST_DATA(cl
, o
);
913 // bug("[ATI] PutImageLUT(%d, %d, %d, %d, %d, %p)\n", msg->x, msg->y, msg->width, msg->height, msg->modulo, msg->pixels);
919 // IPTR VideoData = bm->framebuffer;
924 UBYTE
*src
= msg
->pixels
;
925 ULONG x_add
= msg
->modulo
;
926 UWORD height
= msg
->height
;
927 UWORD bw
= msg
->width
;
928 HIDDT_Pixel
*colmap
= msg
->pixlut
->pixels
;
936 sd
->Card
.Busy
= TRUE
;
938 RADEONWaitForFifo(sd
, 1);
939 OUTREG(RADEON_DST_PITCH_OFFSET
, bm
->pitch_offset
);
941 bm
->dp_gui_master_cntl_clip
= (bm
->dp_gui_master_cntl
942 | RADEON_GMC_WR_MSK_DIS
943 | RADEON_GMC_BRUSH_NONE
944 | RADEON_DP_SRC_SOURCE_HOST_DATA
945 | RADEON_GMC_DST_CLIPPING
946 | RADEON_GMC_SRC_DATATYPE_COLOR
947 | RADEON_ROP
[vHidd_GC_DrawMode_Copy
].rop
);
949 RADEONWaitForFifo(sd
, 5);
950 OUTREG(RADEON_DP_GUI_MASTER_CNTL
, bm
->dp_gui_master_cntl_clip
);
952 OUTREG(RADEON_SC_TOP_LEFT
, (msg
->y
<< 16) | msg
->x
);
953 OUTREG(RADEON_SC_BOTTOM_RIGHT
, ((msg
->y
+msg
->height
) << 16) | (msg
->x
+msg
->width
));
955 OUTREG(RADEON_DST_X_Y
, ((msg
->x
) << 16) | msg
->y
);
956 OUTREG(RADEON_DST_WIDTH_HEIGHT
, (bw
<< 16) | msg
->height
);
961 RADEONWaitForFifo(sd
, 1);
962 OUTREG(RADEON_RBBM_GUICNTL
, RADEON_HOST_DATA_SWAP_32BIT
);
966 UBYTE
*line
= (UBYTE
*)src
;
967 ULONG width
= msg
->width
;
973 RADEONWaitForFifo(sd
, width
);
976 case 8: OUTREGN(RADEON_HOST_DATA0
, colmap
[*line
++]);
977 case 7: OUTREGN(RADEON_HOST_DATA1
, colmap
[*line
++]);
978 case 6: OUTREGN(RADEON_HOST_DATA2
, colmap
[*line
++]);
979 case 5: OUTREGN(RADEON_HOST_DATA3
, colmap
[*line
++]);
980 case 4: OUTREGN(RADEON_HOST_DATA4
, colmap
[*line
++]);
981 case 3: OUTREGN(RADEON_HOST_DATA5
, colmap
[*line
++]);
982 case 2: OUTREGN(RADEON_HOST_DATA6
, colmap
[*line
++]);
983 case 1: OUTREGN(RADEON_HOST_DATA7
, colmap
[*line
++]);
989 RADEONWaitForFifo(sd
, 8);
991 OUTREGN(RADEON_HOST_DATA0
, colmap
[*line
++]);
992 OUTREGN(RADEON_HOST_DATA1
, colmap
[*line
++]);
993 OUTREGN(RADEON_HOST_DATA2
, colmap
[*line
++]);
994 OUTREGN(RADEON_HOST_DATA3
, colmap
[*line
++]);
995 OUTREGN(RADEON_HOST_DATA4
, colmap
[*line
++]);
996 OUTREGN(RADEON_HOST_DATA5
, colmap
[*line
++]);
997 OUTREGN(RADEON_HOST_DATA6
, colmap
[*line
++]);
998 OUTREGN(RADEON_HOST_DATA7
, colmap
[*line
++]);
1007 else if (bm
->bpp
== 2)
1010 RADEONWaitForFifo(sd
, 1);
1011 OUTREG(RADEON_RBBM_GUICNTL
, RADEON_HOST_DATA_SWAP_HDW
);
1015 UBYTE
*line
= (UBYTE
*)src
;
1016 ULONG width
= bw
>> 1;
1020 ULONG tmp
= (colmap
[line
[0]] << 16) | (colmap
[line
[1]] & 0x0000ffff);
1021 RADEONWaitForFifo(sd
, 1);
1022 OUTREG(RADEON_HOST_DATA0
, tmp
);
1032 RADEONWaitForFifo(sd
, 1);
1033 OUTREG(RADEON_RBBM_GUICNTL
, RADEON_HOST_DATA_SWAP_NONE
);
1038 // VideoData += (IPTR)sd->Card.FrameBuffer;
1040 // if (sd->Card.Busy)
1043 //#warning TODO: NVSync(sd)
1044 // RADEONWaitForIdleMMIO(sd);
1053 // struct pHidd_BitMap_CopyLUTMemBox16 __m = {
1054 // sd->mid_CopyLUTMemBox16,
1068 // OOP_DoMethod(o, (OOP_Msg)m);
1074 // struct pHidd_BitMap_CopyLUTMemBox32 __m = {
1075 // sd->mid_CopyLUTMemBox32,
1089 // OOP_DoMethod(o, (OOP_Msg)m);
1094 // OOP_DoSuperMethod(cl, o, (OOP_Msg)msg);
1099 OOP_DoSuperMethod(cl
, o
, (OOP_Msg
)msg
);
1105 VOID
METHOD(ATIOffBM
, Hidd_BitMap
, PutImage
)
1106 __attribute__((alias(METHOD_NAME_S(ATIOnBM
, Hidd_BitMap
, PutImage
))));
1108 VOID
METHOD(ATIOnBM
, Hidd_BitMap
, PutImage
)
1110 atiBitMap
*bm
= OOP_INST_DATA(cl
, o
);
1115 IPTR VideoData
= bm
->framebuffer
;
1117 /* Try to PutImage with 2D engine first */
1120 UBYTE
*src
= msg
->pixels
;
1121 ULONG x_add
= msg
->modulo
;
1122 UWORD height
= msg
->height
;
1123 UWORD bw
= msg
->width
;
1135 sd
->Card
.Busy
= TRUE
;
1137 RADEONWaitForFifo(sd
, 1);
1138 OUTREG(RADEON_DST_PITCH_OFFSET
, bm
->pitch_offset
);
1140 bm
->dp_gui_master_cntl_clip
= (bm
->dp_gui_master_cntl
1141 | RADEON_GMC_WR_MSK_DIS
1142 | RADEON_GMC_BRUSH_NONE
1143 | RADEON_DP_SRC_SOURCE_HOST_DATA
1144 | RADEON_GMC_DST_CLIPPING
1145 | RADEON_GMC_SRC_DATATYPE_COLOR
1146 | RADEON_ROP
[vHidd_GC_DrawMode_Copy
].rop
);
1148 RADEONWaitForFifo(sd
, 5);
1149 OUTREG(RADEON_DP_GUI_MASTER_CNTL
, bm
->dp_gui_master_cntl_clip
);
1151 OUTREG(RADEON_SC_TOP_LEFT
, (msg
->y
<< 16) | msg
->x
);
1152 OUTREG(RADEON_SC_BOTTOM_RIGHT
, ((msg
->y
+msg
->height
) << 16) | (msg
->x
+msg
->width
));
1154 OUTREG(RADEON_DST_X_Y
, ((msg
->x
) << 16) | msg
->y
);
1155 OUTREG(RADEON_DST_WIDTH_HEIGHT
, (bw
<< 16) | msg
->height
);
1157 switch (msg
->pixFmt
)
1159 case vHidd_StdPixFmt_Native32
:
1160 case vHidd_StdPixFmt_Native
:
1164 RADEONWaitForFifo(sd
, 1);
1165 OUTREG(RADEON_RBBM_GUICNTL
, RADEON_HOST_DATA_SWAP_32BIT
);
1169 ULONG
*line
= (ULONG
*)src
;
1170 ULONG width
= msg
->width
;
1176 RADEONWaitForFifo(sd
, width
);
1179 case 8: OUTREGN(RADEON_HOST_DATA0
, *line
++);
1180 case 7: OUTREGN(RADEON_HOST_DATA1
, *line
++);
1181 case 6: OUTREGN(RADEON_HOST_DATA2
, *line
++);
1182 case 5: OUTREGN(RADEON_HOST_DATA3
, *line
++);
1183 case 4: OUTREGN(RADEON_HOST_DATA4
, *line
++);
1184 case 3: OUTREGN(RADEON_HOST_DATA5
, *line
++);
1185 case 2: OUTREGN(RADEON_HOST_DATA6
, *line
++);
1186 case 1: OUTREGN(RADEON_HOST_DATA7
, *line
++);
1192 RADEONWaitForFifo(sd
, 8);
1194 OUTREGN(RADEON_HOST_DATA0
, *line
++);
1195 OUTREGN(RADEON_HOST_DATA1
, *line
++);
1196 OUTREGN(RADEON_HOST_DATA2
, *line
++);
1197 OUTREGN(RADEON_HOST_DATA3
, *line
++);
1198 OUTREGN(RADEON_HOST_DATA4
, *line
++);
1199 OUTREGN(RADEON_HOST_DATA5
, *line
++);
1200 OUTREGN(RADEON_HOST_DATA6
, *line
++);
1201 OUTREGN(RADEON_HOST_DATA7
, *line
++);
1210 RADEONWaitForFifo(sd
, 1);
1211 OUTREG(RADEON_RBBM_GUICNTL
, RADEON_HOST_DATA_SWAP_NONE
);
1215 else if (bm
->bpp
== 2)
1218 RADEONWaitForFifo(sd
, 1);
1219 OUTREG(RADEON_RBBM_GUICNTL
, RADEON_HOST_DATA_SWAP_HDW
);
1221 if (msg
->pixFmt
== vHidd_StdPixFmt_Native
)
1225 ULONG
*line
= (ULONG
*)src
;
1226 ULONG width
= bw
>> 1;
1230 RADEONWaitForFifo(sd
, 1);
1231 OUTREG(RADEON_HOST_DATA0
, *line
++);
1241 ULONG
*line
= (ULONG
*)src
;
1242 ULONG width
= bw
>> 1;
1246 ULONG tmp
= (line
[0] << 16) | (line
[1] & 0x0000ffff);
1247 RADEONWaitForFifo(sd
, 1);
1248 OUTREG(RADEON_HOST_DATA0
, tmp
);
1258 RADEONWaitForFifo(sd
, 1);
1259 OUTREG(RADEON_RBBM_GUICNTL
, RADEON_HOST_DATA_SWAP_NONE
);
1269 srcpf
= HIDD_Gfx_GetPixFmt(sd
->AtiObject
, msg
->pixFmt
);
1270 OOP_GetAttr(o
, aHidd_BitMap_PixFmt
, (APTR
)&dstpf
);
1275 RADEONWaitForFifo(sd
, 1);
1276 OUTREG(RADEON_RBBM_GUICNTL
, RADEON_HOST_DATA_SWAP_32BIT
);
1280 ULONG
*line
= (ULONG
*)sd
->cpuscratch
;
1284 HIDD_BM_ConvertPixels(o
, &_src
, srcpf
, msg
->modulo
, &line
, dstpf
, msg
->modulo
, msg
->width
, 1, NULL
);
1286 line
= (ULONG
*)sd
->cpuscratch
;
1292 RADEONWaitForFifo(sd
, width
);
1295 case 8: OUTREGN(RADEON_HOST_DATA0
, *line
++);
1296 case 7: OUTREGN(RADEON_HOST_DATA1
, *line
++);
1297 case 6: OUTREGN(RADEON_HOST_DATA2
, *line
++);
1298 case 5: OUTREGN(RADEON_HOST_DATA3
, *line
++);
1299 case 4: OUTREGN(RADEON_HOST_DATA4
, *line
++);
1300 case 3: OUTREGN(RADEON_HOST_DATA5
, *line
++);
1301 case 2: OUTREGN(RADEON_HOST_DATA6
, *line
++);
1302 case 1: OUTREGN(RADEON_HOST_DATA7
, *line
++);
1308 RADEONWaitForFifo(sd
, 8);
1310 OUTREGN(RADEON_HOST_DATA0
, *line
++);
1311 OUTREGN(RADEON_HOST_DATA1
, *line
++);
1312 OUTREGN(RADEON_HOST_DATA2
, *line
++);
1313 OUTREGN(RADEON_HOST_DATA3
, *line
++);
1314 OUTREGN(RADEON_HOST_DATA4
, *line
++);
1315 OUTREGN(RADEON_HOST_DATA5
, *line
++);
1316 OUTREGN(RADEON_HOST_DATA6
, *line
++);
1317 OUTREGN(RADEON_HOST_DATA7
, *line
++);
1326 RADEONWaitForFifo(sd
, 1);
1327 OUTREG(RADEON_RBBM_GUICNTL
, RADEON_HOST_DATA_SWAP_NONE
);
1331 else if (bm
->bpp
== 2)
1334 RADEONWaitForFifo(sd
, 1);
1335 OUTREG(RADEON_RBBM_GUICNTL
, RADEON_HOST_DATA_SWAP_HDW
);
1340 ULONG
*line
= (ULONG
*)sd
->cpuscratch
;
1344 HIDD_BM_ConvertPixels(o
, &_src
, srcpf
, msg
->modulo
, &line
, dstpf
, msg
->modulo
, msg
->width
, 1, NULL
);
1346 line
= (ULONG
*)sd
->cpuscratch
;
1352 RADEONWaitForFifo(sd
, width
>> 1);
1355 case 16: OUTREG(RADEON_HOST_DATA0
, *line
++);
1356 case 14: OUTREG(RADEON_HOST_DATA1
, *line
++);
1357 case 12: OUTREG(RADEON_HOST_DATA2
, *line
++);
1358 case 10: OUTREG(RADEON_HOST_DATA3
, *line
++);
1359 case 8: OUTREG(RADEON_HOST_DATA4
, *line
++);
1360 case 6: OUTREG(RADEON_HOST_DATA5
, *line
++);
1361 case 4: OUTREG(RADEON_HOST_DATA6
, *line
++);
1362 case 2: OUTREG(RADEON_HOST_DATA7
, *line
++);
1368 RADEONWaitForFifo(sd
, 8);
1370 OUTREG(RADEON_HOST_DATA0
, *line
++);
1371 OUTREG(RADEON_HOST_DATA1
, *line
++);
1372 OUTREG(RADEON_HOST_DATA2
, *line
++);
1373 OUTREG(RADEON_HOST_DATA3
, *line
++);
1374 OUTREG(RADEON_HOST_DATA4
, *line
++);
1375 OUTREG(RADEON_HOST_DATA5
, *line
++);
1376 OUTREG(RADEON_HOST_DATA6
, *line
++);
1377 OUTREG(RADEON_HOST_DATA7
, *line
++);
1387 RADEONWaitForFifo(sd
, 1);
1388 OUTREG(RADEON_RBBM_GUICNTL
, RADEON_HOST_DATA_SWAP_NONE
);
1400 // bug("[ATI] PutImage x=%d y=%d w=%d h=%d bpp=%d fmt=%d\n", msg->x, msg->y, msg->width, msg->height, bm->bpp, msg->pixFmt);
1405 VideoData
+= (IPTR
)sd
->Card
.FrameBuffer
;
1410 #warning TODO: NVSync(sd)
1411 RADEONWaitForIdleMMIO(sd
);
1418 case vHidd_StdPixFmt_Native
:
1423 struct pHidd_BitMap_CopyMemBox8 __m
= {
1424 sd
->mid_CopyMemBox8
,
1437 OOP_DoMethod(o
, (OOP_Msg
)m
);
1443 struct pHidd_BitMap_CopyMemBox16 __m
= {
1444 sd
->mid_CopyMemBox16
,
1457 OOP_DoMethod(o
, (OOP_Msg
)m
);
1463 struct pHidd_BitMap_CopyMemBox32 __m
= {
1464 sd
->mid_CopyMemBox32
,
1477 OOP_DoMethod(o
, (OOP_Msg
)m
);
1481 } /* switch(data->bytesperpix) */
1484 case vHidd_StdPixFmt_Native32
:
1489 struct pHidd_BitMap_PutMem32Image8 __m
= {
1490 sd
->mid_PutMem32Image8
,
1500 OOP_DoMethod(o
, (OOP_Msg
)m
);
1506 struct pHidd_BitMap_PutMem32Image16 __m
= {
1507 sd
->mid_PutMem32Image16
,
1517 OOP_DoMethod(o
, (OOP_Msg
)m
);
1523 struct pHidd_BitMap_CopyMemBox32 __m
= {
1524 sd
->mid_CopyMemBox32
,
1537 OOP_DoMethod(o
, (OOP_Msg
)m
);
1541 } /* switch(data->bytesperpix) */
1545 OOP_DoSuperMethod(cl
, o
, (OOP_Msg
)msg
);
1547 } /* switch(msg->pixFmt) */
1553 VOID
METHOD(ATIOffBM
, Hidd_BitMap
, GetImage
)
1554 __attribute__((alias(METHOD_NAME_S(ATIOnBM
, Hidd_BitMap
, GetImage
))));
1556 VOID
METHOD(ATIOnBM
, Hidd_BitMap
, GetImage
)
1558 atiBitMap
*bm
= OOP_INST_DATA(cl
, o
);
1562 IPTR VideoData
= bm
->framebuffer
;
1566 VideoData
+= (IPTR
)sd
->Card
.FrameBuffer
;
1570 #warning TODO: NVSync(sd)
1571 RADEONWaitForIdleMMIO(sd
);
1578 case vHidd_StdPixFmt_Native
:
1583 struct pHidd_BitMap_CopyMemBox8 __m
= {
1584 sd
->mid_CopyMemBox8
,
1597 OOP_DoMethod(o
, (OOP_Msg
)m
);
1603 struct pHidd_BitMap_CopyMemBox16 __m
= {
1604 sd
->mid_CopyMemBox16
,
1617 OOP_DoMethod(o
, (OOP_Msg
)m
);
1623 struct pHidd_BitMap_CopyMemBox32 __m
= {
1624 sd
->mid_CopyMemBox32
,
1637 OOP_DoMethod(o
, (OOP_Msg
)m
);
1641 } /* switch(data->bytesperpix) */
1644 case vHidd_StdPixFmt_Native32
:
1649 struct pHidd_BitMap_GetMem32Image8 __m
= {
1650 sd
->mid_GetMem32Image8
,
1661 OOP_DoMethod(o
, (OOP_Msg
)m
);
1667 struct pHidd_BitMap_GetMem32Image16 __m
= {
1668 sd
->mid_GetMem32Image16
,
1679 OOP_DoMethod(o
, (OOP_Msg
)m
);
1685 struct pHidd_BitMap_CopyMemBox32 __m
= {
1686 sd
->mid_CopyMemBox32
,
1699 OOP_DoMethod(o
, (OOP_Msg
)m
);
1703 } /* switch(data->bytesperpix) */
1707 OOP_DoSuperMethod(cl
, o
, (OOP_Msg
)msg
);
1710 } /* switch(msg->pixFmt) */
1716 VOID
METHOD(ATIOffBM
, Hidd_BitMap
, PutTemplate
)
1717 __attribute__((alias(METHOD_NAME_S(ATIOnBM
, Hidd_BitMap
, PutTemplate
))));
1719 VOID
METHOD(ATIOnBM
, Hidd_BitMap
, PutTemplate
)
1721 atiBitMap
*bm
= OOP_INST_DATA(cl
, o
);
1725 IPTR VideoData
= bm
->framebuffer
;
1729 VideoData
+= (IPTR
)sd
->Card
.FrameBuffer
;
1733 #warning TODO: NVSync(sd)
1734 RADEONWaitForIdleMMIO(sd
);
1744 struct pHidd_BitMap_PutMemTemplate8 __m
= {
1745 sd
->mid_PutMemTemplate8
,
1759 OOP_DoMethod(o
, (OOP_Msg
)m
);
1765 struct pHidd_BitMap_PutMemTemplate16 __m
= {
1766 sd
->mid_PutMemTemplate16
,
1780 OOP_DoMethod(o
, (OOP_Msg
)m
);
1786 struct pHidd_BitMap_PutMemTemplate32 __m
= {
1787 sd
->mid_PutMemTemplate32
,
1801 OOP_DoMethod(o
, (OOP_Msg
)m
);
1804 } /* switch(bm->bpp) */
1809 VOID
METHOD(ATIOffBM
, Hidd_BitMap
, PutPattern
)
1810 __attribute__((alias(METHOD_NAME_S(ATIOnBM
, Hidd_BitMap
, PutPattern
))));
1812 VOID
METHOD(ATIOnBM
, Hidd_BitMap
, PutPattern
)
1814 atiBitMap
*bm
= OOP_INST_DATA(cl
, o
);
1818 IPTR VideoData
= bm
->framebuffer
;
1822 VideoData
+= (IPTR
)sd
->Card
.FrameBuffer
;
1826 #warning TODO: NVSync(sd)
1827 RADEONWaitForIdleMMIO(sd
);
1837 struct pHidd_BitMap_PutMemPattern8 __m
= {
1838 sd
->mid_PutMemPattern8
,
1858 OOP_DoMethod(o
, (OOP_Msg
)m
);
1864 struct pHidd_BitMap_PutMemPattern16 __m
= {
1865 sd
->mid_PutMemPattern16
,
1885 OOP_DoMethod(o
, (OOP_Msg
)m
);
1891 struct pHidd_BitMap_PutMemPattern32 __m
= {
1892 sd
->mid_PutMemPattern32
,
1912 OOP_DoMethod(o
, (OOP_Msg
)m
);
1915 } /* switch(bm->bpp) */