force CC/CXX to the passed in compiler to use.
[AROS.git] / workbench / hidds / radeon / ati_class.c
blob369d233aa499702c3760a62a7bc24b98ea25b503
1 /*
2 Copyright © 2004-2017, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <utility/tagitem.h>
8 #include <proto/exec.h>
9 #include <proto/oop.h>
10 #include <proto/utility.h>
12 #include "ati.h"
13 #include "radeon.h"
14 #include "radeon_reg.h"
15 #include "radeon_bios.h"
16 #include "radeon_accel.h"
17 #include "radeon_macros.h"
19 #define DEBUG 0
20 #include <aros/debug.h>
22 #define sd ((struct ati_staticdata*)SD(cl))
24 #undef HiddAttrBase
25 #undef HiddPCIDeviceAttrBase
26 #undef HiddGfxAttrBase
27 #undef HiddPixFmtAttrBase
28 #undef HiddSyncAttrBase
29 #undef HiddBitMapAttrBase
30 #define HiddAttrBase (sd->hiddAttrBase)
31 #define HiddPCIDeviceAttrBase (sd->pciAttrBase)
32 #define HiddATIBitMapAttrBase (sd->atiBitMapAttrBase)
33 #define HiddBitMapAttrBase (sd->bitMapAttrBase)
34 #define HiddPixFmtAttrBase (sd->pixFmtAttrBase)
35 #define HiddGfxAttrBase (sd->gfxAttrBase)
36 #define HiddSyncAttrBase (sd->syncAttrBase)
38 #define ToRGB8888(alp,c) ((c) | ((alp) << 24))
40 #if AROS_BIG_ENDIAN
42 #define CURSOR_SWAPPING_DECL_MMIO ULONG __temp_surface_cntl = INREG(RADEON_SURFACE_CNTL)
43 #define CURSOR_SWAPPING_START() \
44 OUTREG(RADEON_SURFACE_CNTL, \
45 (__temp_surface_cntl | \
46 RADEON_NONSURF_AP0_SWP_32BPP) & \
47 ~RADEON_NONSURF_AP0_SWP_16BPP)
48 #define CURSOR_SWAPPING_END() (OUTREG(RADEON_SURFACE_CNTL, \
49 __temp_surface_cntl))
51 #else
53 #define CURSOR_SWAPPING_DECL_MMIO
54 #define CURSOR_SWAPPING_START()
55 #define CURSOR_SWAPPING_END()
57 #endif
59 #define MAKE_SYNC(name,clock,hdisp,hstart,hend,htotal,vdisp,vstart,vend,vtotal,descr) \
60 struct TagItem sync_ ## name[]={ \
61 { aHidd_Sync_PixelClock, clock*1000 }, \
62 { aHidd_Sync_HDisp, hdisp }, \
63 { aHidd_Sync_HSyncStart, hstart }, \
64 { aHidd_Sync_HSyncEnd, hend }, \
65 { aHidd_Sync_HTotal, htotal }, \
66 { aHidd_Sync_VDisp, vdisp }, \
67 { aHidd_Sync_VSyncStart, vstart }, \
68 { aHidd_Sync_VSyncEnd, vend }, \
69 { aHidd_Sync_VTotal, vtotal }, \
70 { aHidd_Sync_Description, (IPTR)descr}, \
71 { TAG_DONE, 0UL }}
73 //#define DEBUG_POINTER
75 #ifdef DEBUG_POINTER
77 #define PRINT_POINTER(image, xsize, xmax, ymax) \
78 bug("[ATI] Pointer data:\n"); \
79 { \
80 ULONG *pix = (ULONG *)image; \
81 ULONG x, y; \
83 for (y = 0; y < ymax; y++) { \
84 for (x = 0; x < xmax; x++) \
85 bug("0x%08X ", pix[x]); \
86 bug("\n"); \
87 pix += xsize; \
88 } \
91 #else
92 #define PRINT_POINTER(image, xsize, xmax, ymax)
93 #endif
95 OOP_Object *METHOD(ATI, Hidd_Gfx, Show)
97 OOP_Object *fb = NULL;
98 if (msg->bitMap)
100 atiBitMap *bm = OOP_INST_DATA(OOP_OCLASS(msg->bitMap), msg->bitMap);
101 if (bm->state)
103 /* Suppose bm has properly allocated state structure */
104 if (bm->fbgfx)
106 bm->usecount++;
108 LOCK_HW
109 LoadState(sd, bm->state);
110 DPMS(sd, sd->dpms);
112 fb = bm->BitMap;
113 ShowHideCursor(sd, sd->Card.cursorVisible);
115 RADEONEngineReset(sd);
116 RADEONEngineRestore(sd);
118 UNLOCK_HW
123 if (!fb)
124 fb = (OOP_Object *)OOP_DoSuperMethod(cl, o, (OOP_Msg)msg);
126 return fb;
129 OOP_Object *METHOD(ATI, Hidd_Gfx, CreateObject)
131 OOP_Object *object = NULL;
133 if (msg->cl == sd->basebm)
135 BOOL displayable, framebuffer;
136 OOP_Class *classptr = NULL;
137 struct TagItem mytags[] =
139 { TAG_IGNORE, TAG_IGNORE }, /* Placeholder for aHidd_BitMap_ClassPtr */
140 { TAG_MORE, (IPTR)msg->attrList }
143 struct pHidd_Gfx_CreateObject p;
145 /* Displayable bitmap ? */
146 displayable = GetTagData(aHidd_BitMap_Displayable, FALSE, msg->attrList);
147 framebuffer = GetTagData(aHidd_BitMap_FrameBuffer, FALSE, msg->attrList);
149 if (framebuffer)
151 /* If the user asks for a framebuffer map we must ALLWAYS supply a class */
152 classptr = sd->OnBMClass;
154 else if (displayable)
156 classptr = sd->OnBMClass; //offbmclass;
158 else
160 HIDDT_ModeID modeid;
162 For the non-displayable case we can either supply a class ourselves
163 if we can optimize a certain type of non-displayable bitmaps. Or we
164 can let the superclass create on for us.
166 The attributes that might come from the user deciding the bitmap
167 pixel format are:
168 - aHidd_BitMap_ModeID: a modeid. create a nondisplayable
169 bitmap with the size and pixelformat of a gfxmode.
170 - aHidd_BitMap_StdPixFmt: a standard pixelformat as described in
171 hidd/gfx.h
172 - aHidd_BitMap_Friend: if this is supplied and none of the two above
173 are supplied, then the pixel format of the created bitmap
174 will be the same as the one of the friend bitmap.
176 These tags are listed in prioritized order, so if
177 the user supplied a ModeID tag, then you should not care about StdPixFmt
178 or Friend. If there is no ModeID, but a StdPixFmt tag supplied,
179 then you should not care about Friend because you have to
180 create the correct pixelformat. And as said above, if only Friend
181 is supplied, you can create a bitmap with same pixelformat as Frien
184 modeid = (HIDDT_ModeID)GetTagData(aHidd_BitMap_ModeID, vHidd_ModeID_Invalid, msg->attrList);
186 if (vHidd_ModeID_Invalid != modeid)
188 /* User supplied a valid modeid. We can use our offscreen class */
189 classptr = sd->OffBMClass;
191 else
194 We may create an offscreen bitmap if the user supplied a friend
195 bitmap. But we need to check that he did not supplied a StdPixFmt
197 HIDDT_StdPixFmt stdpf = (HIDDT_StdPixFmt)GetTagData(aHidd_BitMap_StdPixFmt, vHidd_StdPixFmt_Unknown, msg->attrList);
199 if (vHidd_StdPixFmt_Plane == stdpf)
201 classptr = sd->PlanarBMClass;
203 else if (vHidd_StdPixFmt_Unknown == stdpf)
205 /* No std pixfmt supplied */
206 OOP_Object *friend;
208 /* Did the user supply a friend bitmap ? */
209 friend = (OOP_Object *)GetTagData(aHidd_BitMap_Friend, 0, msg->attrList);
210 if (NULL != friend)
212 OOP_Class *friend_class = NULL;
213 /* User supplied friend bitmap. Is the friend bitmap a Ati Gfx hidd bitmap ? */
214 OOP_GetAttr(friend, aHidd_BitMap_ClassPtr, (APTR)&friend_class);
215 if (friend_class == sd->OnBMClass)
217 /* Friend was ATI hidd bitmap. Now we can supply our own class */
218 classptr = sd->OffBMClass;
225 D(bug("[ATI] classptr = %p\n", classptr));
227 /* Do we supply our own class ? */
228 if (NULL != classptr)
230 /* Yes. We must let the superclass not that we do this. This is
231 done through adding a tag in the frot of the taglist */
232 mytags[0].ti_Tag = aHidd_BitMap_ClassPtr;
233 mytags[0].ti_Data = (IPTR)classptr;
236 /* Like in Gfx::New() we init a new message struct */
237 p.mID = msg->mID;
238 p.cl = msg->cl;
239 p.attrList = mytags;
241 /* Pass the new message to the superclass */
242 object = (OOP_Object *)OOP_DoSuperMethod(cl, o, (OOP_Msg)&p);
244 else
245 object = (OOP_Object *)OOP_DoSuperMethod(cl, o, (OOP_Msg)msg);
247 return object;
250 void METHOD(ATI, Hidd_Gfx, CopyBox)
252 ULONG mode = GC_DRMD(msg->gc);
253 IPTR src=0, dst=0;
255 /* Check whether we can get Drawable attribute of our ATI class */
256 OOP_GetAttr(msg->src, aHidd_ATIBitMap_Drawable, &src);
257 OOP_GetAttr(msg->dest, aHidd_ATIBitMap_Drawable, &dst);
259 if (!dst || !src)
261 /* No. One of the bitmaps is not an ATI bitmap */
262 OOP_DoSuperMethod(cl, o, (OOP_Msg)msg);
264 else
267 /* Yes. Get the instance data of both bitmaps */
268 atiBitMap *bm_src = OOP_INST_DATA(OOP_OCLASS(msg->src), msg->src);
269 atiBitMap *bm_dst = OOP_INST_DATA(OOP_OCLASS(msg->dest), msg->dest);
271 D(bug("[ATI] CopyBox(src(%p,%d:%d@%d),dst(%p,%d:%d@%d),%d:%d\n",
272 bm_src->framebuffer,msg->srcX,msg->srcY,bm_src->depth,
273 bm_dst->framebuffer,msg->destX,msg->destY,bm_dst->depth,
274 msg->width, msg->height));
276 /* Case -1: (To be fixed) one of the bitmaps have chunky outside GFX mem */
277 if (!bm_src->fbgfx || !bm_dst->fbgfx)
279 OOP_DoSuperMethod(cl, o, (OOP_Msg)msg);
281 /* Case 0: one of bitmaps is 8bpp, whereas the other is TrueColor one */
282 else if ((bm_src->depth <= 8 || bm_dst->depth <= 8) &&
283 (bm_src->depth != bm_dst->depth))
285 /* Unsupported case */
286 OOP_DoSuperMethod(cl, o, (OOP_Msg)msg);
287 return;
289 /* Case 1: both bitmaps have the same depth - use Blit engine */
290 else if (bm_src->depth == bm_dst->depth)
292 int xdir = 0, ydir = 0;
293 WORD xa = msg->srcX;
294 WORD ya = msg->srcY;
295 WORD xb = msg->destX;
296 WORD yb = msg->destY;
297 WORD w = msg->width;
298 WORD h = msg->height;
300 if (bm_src->pitch_offset == bm_dst->pitch_offset)
302 xdir = xa - xb;
303 ydir = ya - yb;
305 if (xdir < 0) xa += w - 1, xb += w - 1;
306 if (ydir < 0) ya += h - 1, yb += h - 1;
309 LOCK_MULTI_BITMAP
310 LOCK_BITMAP_BM(bm_src)
311 LOCK_BITMAP_BM(bm_dst)
312 UNLOCK_MULTI_BITMAP
314 LOCK_HW
315 sd->Card.Busy = TRUE;
317 RADEONWaitForFifo(sd, 2);
318 OUTREG(RADEON_DST_PITCH_OFFSET, bm_dst->pitch_offset);
319 OUTREG(RADEON_SRC_PITCH_OFFSET, bm_src->pitch_offset);
321 bm_dst->dp_gui_master_cntl_clip = (bm_dst->dp_gui_master_cntl
322 | RADEON_GMC_BRUSH_NONE
323 | RADEON_GMC_SRC_DATATYPE_COLOR
324 | RADEON_GMC_SRC_PITCH_OFFSET_CNTL
325 | RADEON_ROP[mode].rop
326 | RADEON_DP_SRC_SOURCE_MEMORY);
328 RADEONWaitForFifo(sd, 6);
329 OUTREG(RADEON_DP_GUI_MASTER_CNTL, bm_dst->dp_gui_master_cntl_clip);
330 OUTREG(RADEON_DP_WRITE_MASK, ~0);
331 OUTREG(RADEON_DP_CNTL,
332 ((xdir >= 0 ? RADEON_DST_X_LEFT_TO_RIGHT : 0) |
333 (ydir >= 0 ? RADEON_DST_Y_TOP_TO_BOTTOM : 0)));
335 OUTREG(RADEON_SRC_Y_X, (ya << 16) | (UWORD)xa);
336 OUTREG(RADEON_DST_Y_X, (yb << 16) | (UWORD)xb);
337 OUTREG(RADEON_DST_HEIGHT_WIDTH, (h << 16) | (UWORD)w);
339 UNLOCK_HW
341 UNLOCK_BITMAP_BM(bm_src)
342 UNLOCK_BITMAP_BM(bm_dst)
344 else /* Case 2: different bitmaps. HELP? */
346 OOP_DoSuperMethod(cl, o, (OOP_Msg)msg);
349 bm_src->usecount++;
350 bm_dst->usecount++;
356 BOOL METHOD(ATI, Hidd_Gfx, SetCursorShape)
358 D(bug("[ATI] Set cursor shape %08x\n", msg->shape));
360 if (msg->shape == NULL)
362 ShowHideCursor(sd, 0);
363 sd->Card.cursorVisible = 0;
365 else
367 IPTR width, height;
368 ULONG x;
369 ULONG save1=0, save2=0;
371 volatile ULONG *curimg = (ULONG*)((IPTR)sd->Card.CursorStart + (IPTR)sd->Card.FrameBuffer);
373 CURSOR_SWAPPING_DECL_MMIO;
375 OOP_GetAttr(msg->shape, aHidd_BitMap_Width, &width);
376 OOP_GetAttr(msg->shape, aHidd_BitMap_Height, &height);
378 if (width > 64) width = 64;
379 if (height > 64) height = 64;
381 LOCK_HW
383 if (!sd->Card.IsSecondary) {
384 save1 = INREG(RADEON_CRTC_GEN_CNTL) & ~(ULONG)(RADEON_CRTC_ARGB_EN|RADEON_CRTC_ARGB_EN);
385 save1 |= RADEON_CRTC_ARGB_EN;
386 OUTREG(RADEON_CRTC_GEN_CNTL, save1 & (ULONG)~RADEON_CRTC_CUR_EN);
389 if (sd->Card.IsSecondary) {
390 save2 = INREG(RADEON_CRTC_GEN_CNTL) & ~(ULONG)(RADEON_CRTC_ARGB_EN|RADEON_CRTC_ARGB_EN);
391 save2 |= RADEON_CRTC_ARGB_EN;
392 OUTREG(RADEON_CRTC2_GEN_CNTL, save2 & (ULONG)~RADEON_CRTC2_CUR_EN);
395 for (x = 0; x < 64*64; x++)
396 curimg[x] = 0;
398 /* I always get the image in BGRA32 format (it becomes ARGB32 when picked up as ULONG on little-endian),
399 so i don't turn on byte swapping */
401 CURSOR_SWAPPING_START();
403 #if AROS_BIG_ENDIAN
404 HIDD_BM_GetImage(msg->shape, (UBYTE *)curimg, 64*4, 0, 0, width, height, vHidd_StdPixFmt_ARGB32);
405 #else
406 HIDD_BM_GetImage(msg->shape, (UBYTE *)curimg, 64*4, 0, 0, width, height, vHidd_StdPixFmt_BGRA32);
407 #endif
408 PRINT_POINTER(curimg, 64, 16, 16);
410 CURSOR_SWAPPING_END();
412 if (!sd->Card.IsSecondary)
413 OUTREG(RADEON_CRTC_GEN_CNTL, save1);
415 if (sd->Card.IsSecondary)
416 OUTREG(RADEON_CRTC2_GEN_CNTL, save2);
418 UNLOCK_HW
421 return TRUE;
424 void METHOD(ATI, Hidd_Gfx, SetCursorVisible)
426 ShowHideCursor(sd, msg->visible);
427 sd->Card.cursorVisible = msg->visible;
430 void METHOD(ATI, Hidd_Gfx, SetCursorPos)
432 D(bug("[ATI] Set cursor pos %d:%d\n", msg->x, msg->y));
434 WORD x,y,xoff=0,yoff=0;
436 x = (WORD)msg->x;
437 y = (WORD)msg->y;
439 if (x < 0)
441 xoff = -x;
442 x = 0;
445 if (y < 0)
447 yoff = -y;
448 y = 0;
451 if (!sd->Card.IsSecondary) {
452 OUTREG(RADEON_CUR_HORZ_VERT_OFF, RADEON_CUR_LOCK | (xoff << 16) | (yoff & 0xffff));
453 OUTREG(RADEON_CUR_HORZ_VERT_POSN, (RADEON_CUR_LOCK
454 | (x << 16)
455 | (y & 0xffff)));
456 OUTREG(RADEON_CUR_OFFSET, sd->Card.CursorStart);
458 D(bug("[ATI] OFF=%08x, HV_OFF=%08x, HV_POSN=%08x\n",
459 INREG(RADEON_CUR_OFFSET),
460 INREG(RADEON_CUR_HORZ_VERT_OFF),
461 INREG(RADEON_CUR_HORZ_VERT_POSN)));
463 } else {
464 OUTREG(RADEON_CUR2_HORZ_VERT_OFF, RADEON_CUR2_LOCK | (xoff << 16) | (yoff & 0xffff));
465 OUTREG(RADEON_CUR2_HORZ_VERT_POSN, (RADEON_CUR2_LOCK
466 | (x << 16)
467 | (y & 0xffff)));
468 OUTREG(RADEON_CUR2_OFFSET, sd->Card.CursorStart /* + addend???? */);
472 OOP_Object *METHOD(ATI, Root, New)
474 struct TagItem pftags_24bpp[] = {
475 { aHidd_PixFmt_RedShift, 8 }, /* 0 */
476 { aHidd_PixFmt_GreenShift, 16 }, /* 1 */
477 { aHidd_PixFmt_BlueShift, 24 }, /* 2 */
478 { aHidd_PixFmt_AlphaShift, 0 }, /* 3 */
479 { aHidd_PixFmt_RedMask, 0x00ff0000 }, /* 4 */
480 { aHidd_PixFmt_GreenMask, 0x0000ff00 }, /* 5 */
481 { aHidd_PixFmt_BlueMask, 0x000000ff }, /* 6 */
482 { aHidd_PixFmt_AlphaMask, 0x00000000 }, /* 7 */
483 { aHidd_PixFmt_ColorModel, vHidd_ColorModel_TrueColor }, /* 8 */
484 { aHidd_PixFmt_Depth, 24 }, /* 9 */
485 { aHidd_PixFmt_BytesPerPixel, 4 }, /* 10 */
486 { aHidd_PixFmt_BitsPerPixel, 24 }, /* 11 */
487 { aHidd_PixFmt_StdPixFmt, vHidd_StdPixFmt_Native }, /* 12 Native */
488 // { aHidd_PixFmt_StdPixFmt, vHidd_StdPixFmt_BGR032 }, /* 12 Native */
489 { aHidd_PixFmt_BitMapType, vHidd_BitMapType_Chunky }, /* 15 */
490 { TAG_DONE, 0UL }
493 struct TagItem pftags_16bpp[] = {
494 { aHidd_PixFmt_RedShift, 16 }, /* 0 */
495 { aHidd_PixFmt_GreenShift, 21 }, /* 1 */
496 { aHidd_PixFmt_BlueShift, 27 }, /* 2 */
497 { aHidd_PixFmt_AlphaShift, 0 }, /* 3 */
498 { aHidd_PixFmt_RedMask, 0x0000f800 }, /* 4 */
499 { aHidd_PixFmt_GreenMask, 0x000007e0 }, /* 5 */
500 { aHidd_PixFmt_BlueMask, 0x0000001f }, /* 6 */
501 { aHidd_PixFmt_AlphaMask, 0x00000000 }, /* 7 */
502 { aHidd_PixFmt_ColorModel, vHidd_ColorModel_TrueColor }, /* 8 */
503 { aHidd_PixFmt_Depth, 16 }, /* 9 */
504 { aHidd_PixFmt_BytesPerPixel, 2 }, /* 10 */
505 { aHidd_PixFmt_BitsPerPixel, 16 }, /* 11 */
506 { aHidd_PixFmt_StdPixFmt, vHidd_StdPixFmt_Native }, /* 12 */
507 // { aHidd_PixFmt_StdPixFmt, vHidd_StdPixFmt_RGB16_LE }, /* 12 */
508 { aHidd_PixFmt_BitMapType, vHidd_BitMapType_Chunky }, /* 15 */
509 { TAG_DONE, 0UL }
512 struct TagItem pftags_15bpp[] = {
513 { aHidd_PixFmt_RedShift, 17 }, /* 0 */
514 { aHidd_PixFmt_GreenShift, 22 }, /* 1 */
515 { aHidd_PixFmt_BlueShift, 27 }, /* 2 */
516 { aHidd_PixFmt_AlphaShift, 0 }, /* 3 */
517 { aHidd_PixFmt_RedMask, 0x00007c00 }, /* 4 */
518 { aHidd_PixFmt_GreenMask, 0x000003e0 }, /* 5 */
519 { aHidd_PixFmt_BlueMask, 0x0000001f }, /* 6 */
520 { aHidd_PixFmt_AlphaMask, 0x00000000 }, /* 7 */
521 { aHidd_PixFmt_ColorModel, vHidd_ColorModel_TrueColor }, /* 8 */
522 { aHidd_PixFmt_Depth, 15 }, /* 9 */
523 { aHidd_PixFmt_BytesPerPixel, 2 }, /* 10 */
524 { aHidd_PixFmt_BitsPerPixel, 15 }, /* 11 */
525 { aHidd_PixFmt_StdPixFmt, vHidd_StdPixFmt_Native }, /* 12 */
526 // { aHidd_PixFmt_StdPixFmt, vHidd_StdPixFmt_RGB15_LE }, /* 12 */
527 { aHidd_PixFmt_BitMapType, vHidd_BitMapType_Chunky }, /* 15 */
528 { TAG_DONE, 0UL }
531 MAKE_SYNC(640x480_60, 25174,
532 640, 656, 752, 800,
533 480, 490, 492, 525,
534 "ATI:640x480");
536 MAKE_SYNC(800x600_56, 36000, // 36000
537 800, 824, 896, 1024,
538 600, 601, 603, 625,
539 "ATI:800x600");
541 MAKE_SYNC(1024x768_60, 65000, //78654=60kHz, 75Hz. 65000=50kHz,62Hz
542 1024, 1048, 1184, 1344,
543 768, 771, 777, 806,
544 "ATI:1024x768");
546 MAKE_SYNC(1152x864_60, 80000,
547 1152, 1216, 1328, 1456,
548 864, 870, 875, 916,
549 "ATI:1152x864");
551 MAKE_SYNC(1280x1024_60, 108880,
552 1280, 1360, 1496, 1712,
553 1024, 1025, 1028, 1060,
554 "ATI:1280x1024");
556 MAKE_SYNC(1600x1200_60, 155982,
557 1600, 1632, 1792, 2048,
558 1200, 1210, 1218, 1270,
559 "ATI:1600x1200");
561 /* "new" 16:10 modes */
563 MAKE_SYNC(1280x800_60, 83530,
564 1280, 1344, 1480, 1680,
565 800, 801, 804, 828,
566 "ATI:1280x800");
568 MAKE_SYNC(1440x900_60, 106470,
569 1440, 1520, 1672, 1904,
570 900, 901, 904, 932,
571 "ATI:1440x900");
573 MAKE_SYNC(1680x1050_60, 147140,
574 1680, 1784, 1968, 2256,
575 1050, 1051, 1054, 1087,
576 "ATI:1680x1050");
578 MAKE_SYNC(1920x1080_60, 173000,
579 1920, 2048, 2248, 2576,
580 1080, 1083, 1088, 1120,
581 "ATI:1920x1080");
583 MAKE_SYNC(1920x1200_60, 154000,
584 1920, 1968, 2000, 2080,
585 1200, 1203, 1209, 1235,
586 "ATI:1920x1200");
588 // MAKE_SYNC(1920x1200_60, 162090,
589 // 1920, 1984, 2176, 2480,
590 // 1200, 1201, 1204, 1250,
591 // "ATI:1920x1200");
593 // MAKE_SYNC(1920x1200_60, 193160,
594 // 1920, 2048, 2256, 2592,
595 // 1200, 1201, 1204, 1242,
596 // "ATI:1920x1200");
598 struct TagItem modetags[] = {
599 { aHidd_Gfx_PixFmtTags, (IPTR)pftags_24bpp },
600 { aHidd_Gfx_PixFmtTags, (IPTR)pftags_16bpp },
601 { aHidd_Gfx_PixFmtTags, (IPTR)pftags_15bpp },
602 { aHidd_Gfx_SyncTags, (IPTR)sync_1280x1024_60 },
603 { aHidd_Gfx_SyncTags, (IPTR)sync_640x480_60 },
604 { aHidd_Gfx_SyncTags, (IPTR)sync_800x600_56 },
605 { aHidd_Gfx_SyncTags, (IPTR)sync_1024x768_60 },
606 { aHidd_Gfx_SyncTags, (IPTR)sync_1152x864_60 },
607 { aHidd_Gfx_SyncTags, (IPTR)sync_1600x1200_60 },
608 { aHidd_Gfx_SyncTags, (IPTR)sync_1280x800_60 },
609 { aHidd_Gfx_SyncTags, (IPTR)sync_1440x900_60 },
610 { aHidd_Gfx_SyncTags, (IPTR)sync_1680x1050_60 },
611 { aHidd_Gfx_SyncTags, (IPTR)sync_1920x1080_60 },
612 { aHidd_Gfx_SyncTags, (IPTR)sync_1920x1200_60 },
614 { TAG_DONE, 0UL }
617 struct TagItem mytags[] = {
618 { aHidd_Gfx_ModeTags, (IPTR)modetags },
619 { aHidd_Name , (IPTR)"ATI" },
620 { aHidd_HardwareName , (IPTR)"ATI/AMD Gfx Adaptor" },
621 { aHidd_ProducerName , (IPTR)"Advanced Micro Devices, Inc." },
622 { TAG_MORE, (IPTR)msg->attrList }
625 struct pRoot_New mymsg;
627 mymsg.mID = msg->mID;
628 mymsg.attrList = mytags;
630 msg = &mymsg;
632 o = (OOP_Object *)OOP_DoSuperMethod(cl, o, (OOP_Msg)msg);
633 if (o)
635 sd->AtiObject = o;
638 EnterFunc(bug("[ATI] RadeonDriver::New()=%08x\n",o));
640 return o;
643 void METHOD(ATI, Root, Get)
645 ULONG idx;
646 BOOL found = FALSE;
648 if (IS_GFX_ATTR(msg->attrID, idx))
650 switch (idx)
652 case aoHidd_Gfx_SupportsHWCursor:
653 *msg->storage = (IPTR)TRUE;
654 found = TRUE;
655 break;
657 case aoHidd_Gfx_DPMSLevel:
658 *msg->storage = sd->dpms;
659 found = TRUE;
660 break;
664 if (!found)
665 OOP_DoSuperMethod(cl, o, (OOP_Msg)msg);
667 return;
670 void METHOD(ATI, Root, Set)
672 ULONG idx;
673 struct TagItem *tag;
674 struct TagItem *tags = msg->attrList;
676 while ((tag = NextTagItem(&tags)))
678 if (IS_GFX_ATTR(tag->ti_Tag, idx))
680 switch(idx)
682 case aoHidd_Gfx_DPMSLevel:
683 LOCK_HW
685 DPMS(sd, tag->ti_Data);
686 sd->dpms = tag->ti_Data;
688 UNLOCK_HW
689 break;
694 OOP_DoSuperMethod(cl, o, (OOP_Msg)msg);