scripts: remove explicit --with-paranoia from configure line as it is enabled by...
[AROS.git] / workbench / hidds / radeon / ati_class.c
blobb4596650e34b73bc8e49db3f9000facc59855aa4
1 /*
2 Copyright © 2004-2015, 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 HiddPCIDeviceAttrBase
25 #undef HiddGfxAttrBase
26 #undef HiddPixFmtAttrBase
27 #undef HiddSyncAttrBase
28 #undef HiddBitMapAttrBase
29 #define HiddPCIDeviceAttrBase (sd->pciAttrBase)
30 #define HiddATIBitMapAttrBase (sd->atiBitMapAttrBase)
31 #define HiddBitMapAttrBase (sd->bitMapAttrBase)
32 #define HiddPixFmtAttrBase (sd->pixFmtAttrBase)
33 #define HiddGfxAttrBase (sd->gfxAttrBase)
34 #define HiddSyncAttrBase (sd->syncAttrBase)
36 #define ToRGB8888(alp,c) ((c) | ((alp) << 24))
38 #if AROS_BIG_ENDIAN
40 #define CURSOR_SWAPPING_DECL_MMIO ULONG __temp_surface_cntl = INREG(RADEON_SURFACE_CNTL)
41 #define CURSOR_SWAPPING_START() \
42 OUTREG(RADEON_SURFACE_CNTL, \
43 (__temp_surface_cntl | \
44 RADEON_NONSURF_AP0_SWP_32BPP) & \
45 ~RADEON_NONSURF_AP0_SWP_16BPP)
46 #define CURSOR_SWAPPING_END() (OUTREG(RADEON_SURFACE_CNTL, \
47 __temp_surface_cntl))
49 #else
51 #define CURSOR_SWAPPING_DECL_MMIO
52 #define CURSOR_SWAPPING_START()
53 #define CURSOR_SWAPPING_END()
55 #endif
57 #define MAKE_SYNC(name,clock,hdisp,hstart,hend,htotal,vdisp,vstart,vend,vtotal,descr) \
58 struct TagItem sync_ ## name[]={ \
59 { aHidd_Sync_PixelClock, clock*1000 }, \
60 { aHidd_Sync_HDisp, hdisp }, \
61 { aHidd_Sync_HSyncStart, hstart }, \
62 { aHidd_Sync_HSyncEnd, hend }, \
63 { aHidd_Sync_HTotal, htotal }, \
64 { aHidd_Sync_VDisp, vdisp }, \
65 { aHidd_Sync_VSyncStart, vstart }, \
66 { aHidd_Sync_VSyncEnd, vend }, \
67 { aHidd_Sync_VTotal, vtotal }, \
68 { aHidd_Sync_Description, (IPTR)descr}, \
69 { TAG_DONE, 0UL }}
71 //#define DEBUG_POINTER
73 #ifdef DEBUG_POINTER
75 #define PRINT_POINTER(image, xsize, xmax, ymax) \
76 bug("[ATI] Pointer data:\n"); \
77 { \
78 ULONG *pix = (ULONG *)image; \
79 ULONG x, y; \
81 for (y = 0; y < ymax; y++) { \
82 for (x = 0; x < xmax; x++) \
83 bug("0x%08X ", pix[x]); \
84 bug("\n"); \
85 pix += xsize; \
86 } \
89 #else
90 #define PRINT_POINTER(image, xsize, xmax, ymax)
91 #endif
93 OOP_Object *METHOD(ATI, Hidd_Gfx, Show)
95 OOP_Object *fb = NULL;
96 if (msg->bitMap)
98 atiBitMap *bm = OOP_INST_DATA(OOP_OCLASS(msg->bitMap), msg->bitMap);
99 if (bm->state)
101 /* Suppose bm has properly allocated state structure */
102 if (bm->fbgfx)
104 bm->usecount++;
106 LOCK_HW
107 LoadState(sd, bm->state);
108 DPMS(sd, sd->dpms);
110 fb = bm->BitMap;
111 ShowHideCursor(sd, sd->Card.cursorVisible);
113 RADEONEngineReset(sd);
114 RADEONEngineRestore(sd);
116 UNLOCK_HW
121 if (!fb)
122 fb = (OOP_Object *)OOP_DoSuperMethod(cl, o, (OOP_Msg)msg);
124 return fb;
127 OOP_Object *METHOD(ATI, Hidd_Gfx, CreateObject)
129 OOP_Object *object = NULL;
131 if (msg->cl == sd->basebm)
133 BOOL displayable, framebuffer;
134 OOP_Class *classptr = NULL;
135 struct TagItem mytags[] =
137 { TAG_IGNORE, TAG_IGNORE }, /* Placeholder for aHidd_BitMap_ClassPtr */
138 { TAG_MORE, (IPTR)msg->attrList }
141 struct pHidd_Gfx_CreateObject p;
143 /* Displayable bitmap ? */
144 displayable = GetTagData(aHidd_BitMap_Displayable, FALSE, msg->attrList);
145 framebuffer = GetTagData(aHidd_BitMap_FrameBuffer, FALSE, msg->attrList);
147 if (framebuffer)
149 /* If the user asks for a framebuffer map we must ALLWAYS supply a class */
150 classptr = sd->OnBMClass;
152 else if (displayable)
154 classptr = sd->OnBMClass; //offbmclass;
156 else
158 HIDDT_ModeID modeid;
160 For the non-displayable case we can either supply a class ourselves
161 if we can optimize a certain type of non-displayable bitmaps. Or we
162 can let the superclass create on for us.
164 The attributes that might come from the user deciding the bitmap
165 pixel format are:
166 - aHidd_BitMap_ModeID: a modeid. create a nondisplayable
167 bitmap with the size and pixelformat of a gfxmode.
168 - aHidd_BitMap_StdPixFmt: a standard pixelformat as described in
169 hidd/graphics.h
170 - aHidd_BitMap_Friend: if this is supplied and none of the two above
171 are supplied, then the pixel format of the created bitmap
172 will be the same as the one of the friend bitmap.
174 These tags are listed in prioritized order, so if
175 the user supplied a ModeID tag, then you should not care about StdPixFmt
176 or Friend. If there is no ModeID, but a StdPixFmt tag supplied,
177 then you should not care about Friend because you have to
178 create the correct pixelformat. And as said above, if only Friend
179 is supplied, you can create a bitmap with same pixelformat as Frien
182 modeid = (HIDDT_ModeID)GetTagData(aHidd_BitMap_ModeID, vHidd_ModeID_Invalid, msg->attrList);
184 if (vHidd_ModeID_Invalid != modeid)
186 /* User supplied a valid modeid. We can use our offscreen class */
187 classptr = sd->OffBMClass;
189 else
192 We may create an offscreen bitmap if the user supplied a friend
193 bitmap. But we need to check that he did not supplied a StdPixFmt
195 HIDDT_StdPixFmt stdpf = (HIDDT_StdPixFmt)GetTagData(aHidd_BitMap_StdPixFmt, vHidd_StdPixFmt_Unknown, msg->attrList);
197 if (vHidd_StdPixFmt_Plane == stdpf)
199 classptr = sd->PlanarBMClass;
201 else if (vHidd_StdPixFmt_Unknown == stdpf)
203 /* No std pixfmt supplied */
204 OOP_Object *friend;
206 /* Did the user supply a friend bitmap ? */
207 friend = (OOP_Object *)GetTagData(aHidd_BitMap_Friend, 0, msg->attrList);
208 if (NULL != friend)
210 OOP_Class *friend_class = NULL;
211 /* User supplied friend bitmap. Is the friend bitmap a Ati Gfx hidd bitmap ? */
212 OOP_GetAttr(friend, aHidd_BitMap_ClassPtr, (APTR)&friend_class);
213 if (friend_class == sd->OnBMClass)
215 /* Friend was ATI hidd bitmap. Now we can supply our own class */
216 classptr = sd->OffBMClass;
223 D(bug("[ATI] classptr = %p\n", classptr));
225 /* Do we supply our own class ? */
226 if (NULL != classptr)
228 /* Yes. We must let the superclass not that we do this. This is
229 done through adding a tag in the frot of the taglist */
230 mytags[0].ti_Tag = aHidd_BitMap_ClassPtr;
231 mytags[0].ti_Data = (IPTR)classptr;
234 /* Like in Gfx::New() we init a new message struct */
235 p.mID = msg->mID;
236 p.cl = msg->cl;
237 p.attrList = mytags;
239 /* Pass the new message to the superclass */
240 object = (OOP_Object *)OOP_DoSuperMethod(cl, o, (OOP_Msg)&p);
242 else
243 object = (OOP_Object *)OOP_DoSuperMethod(cl, o, (OOP_Msg)msg);
245 return object;
248 void METHOD(ATI, Hidd_Gfx, CopyBox)
250 ULONG mode = GC_DRMD(msg->gc);
251 IPTR src=0, dst=0;
253 /* Check whether we can get Drawable attribute of our ATI class */
254 OOP_GetAttr(msg->src, aHidd_ATIBitMap_Drawable, &src);
255 OOP_GetAttr(msg->dest, aHidd_ATIBitMap_Drawable, &dst);
257 if (!dst || !src)
259 /* No. One of the bitmaps is not an ATI bitmap */
260 OOP_DoSuperMethod(cl, o, (OOP_Msg)msg);
262 else
265 /* Yes. Get the instance data of both bitmaps */
266 atiBitMap *bm_src = OOP_INST_DATA(OOP_OCLASS(msg->src), msg->src);
267 atiBitMap *bm_dst = OOP_INST_DATA(OOP_OCLASS(msg->dest), msg->dest);
269 D(bug("[ATI] CopyBox(src(%p,%d:%d@%d),dst(%p,%d:%d@%d),%d:%d\n",
270 bm_src->framebuffer,msg->srcX,msg->srcY,bm_src->depth,
271 bm_dst->framebuffer,msg->destX,msg->destY,bm_dst->depth,
272 msg->width, msg->height));
274 /* Case -1: (To be fixed) one of the bitmaps have chunky outside GFX mem */
275 if (!bm_src->fbgfx || !bm_dst->fbgfx)
277 OOP_DoSuperMethod(cl, o, (OOP_Msg)msg);
279 /* Case 0: one of bitmaps is 8bpp, whereas the other is TrueColor one */
280 else if ((bm_src->depth <= 8 || bm_dst->depth <= 8) &&
281 (bm_src->depth != bm_dst->depth))
283 /* Unsupported case */
284 OOP_DoSuperMethod(cl, o, (OOP_Msg)msg);
285 return;
287 /* Case 1: both bitmaps have the same depth - use Blit engine */
288 else if (bm_src->depth == bm_dst->depth)
290 int xdir = 0, ydir = 0;
291 WORD xa = msg->srcX;
292 WORD ya = msg->srcY;
293 WORD xb = msg->destX;
294 WORD yb = msg->destY;
295 WORD w = msg->width;
296 WORD h = msg->height;
298 if (bm_src->pitch_offset == bm_dst->pitch_offset)
300 xdir = xa - xb;
301 ydir = ya - yb;
303 if (xdir < 0) xa += w - 1, xb += w - 1;
304 if (ydir < 0) ya += h - 1, yb += h - 1;
307 LOCK_MULTI_BITMAP
308 LOCK_BITMAP_BM(bm_src)
309 LOCK_BITMAP_BM(bm_dst)
310 UNLOCK_MULTI_BITMAP
312 LOCK_HW
313 sd->Card.Busy = TRUE;
315 RADEONWaitForFifo(sd, 2);
316 OUTREG(RADEON_DST_PITCH_OFFSET, bm_dst->pitch_offset);
317 OUTREG(RADEON_SRC_PITCH_OFFSET, bm_src->pitch_offset);
319 bm_dst->dp_gui_master_cntl_clip = (bm_dst->dp_gui_master_cntl
320 | RADEON_GMC_BRUSH_NONE
321 | RADEON_GMC_SRC_DATATYPE_COLOR
322 | RADEON_GMC_SRC_PITCH_OFFSET_CNTL
323 | RADEON_ROP[mode].rop
324 | RADEON_DP_SRC_SOURCE_MEMORY);
326 RADEONWaitForFifo(sd, 6);
327 OUTREG(RADEON_DP_GUI_MASTER_CNTL, bm_dst->dp_gui_master_cntl_clip);
328 OUTREG(RADEON_DP_WRITE_MASK, ~0);
329 OUTREG(RADEON_DP_CNTL,
330 ((xdir >= 0 ? RADEON_DST_X_LEFT_TO_RIGHT : 0) |
331 (ydir >= 0 ? RADEON_DST_Y_TOP_TO_BOTTOM : 0)));
333 OUTREG(RADEON_SRC_Y_X, (ya << 16) | (UWORD)xa);
334 OUTREG(RADEON_DST_Y_X, (yb << 16) | (UWORD)xb);
335 OUTREG(RADEON_DST_HEIGHT_WIDTH, (h << 16) | (UWORD)w);
337 UNLOCK_HW
339 UNLOCK_BITMAP_BM(bm_src)
340 UNLOCK_BITMAP_BM(bm_dst)
342 else /* Case 2: different bitmaps. HELP? */
344 OOP_DoSuperMethod(cl, o, (OOP_Msg)msg);
347 bm_src->usecount++;
348 bm_dst->usecount++;
354 BOOL METHOD(ATI, Hidd_Gfx, SetCursorShape)
356 D(bug("[ATI] Set cursor shape %08x\n", msg->shape));
358 if (msg->shape == NULL)
360 ShowHideCursor(sd, 0);
361 sd->Card.cursorVisible = 0;
363 else
365 IPTR width, height;
366 ULONG x;
367 ULONG save1=0, save2=0;
369 volatile ULONG *curimg = (ULONG*)((IPTR)sd->Card.CursorStart + (IPTR)sd->Card.FrameBuffer);
371 CURSOR_SWAPPING_DECL_MMIO;
373 OOP_GetAttr(msg->shape, aHidd_BitMap_Width, &width);
374 OOP_GetAttr(msg->shape, aHidd_BitMap_Height, &height);
376 if (width > 64) width = 64;
377 if (height > 64) height = 64;
379 LOCK_HW
381 if (!sd->Card.IsSecondary) {
382 save1 = INREG(RADEON_CRTC_GEN_CNTL) & ~(ULONG)(RADEON_CRTC_ARGB_EN|RADEON_CRTC_ARGB_EN);
383 save1 |= RADEON_CRTC_ARGB_EN;
384 OUTREG(RADEON_CRTC_GEN_CNTL, save1 & (ULONG)~RADEON_CRTC_CUR_EN);
387 if (sd->Card.IsSecondary) {
388 save2 = INREG(RADEON_CRTC_GEN_CNTL) & ~(ULONG)(RADEON_CRTC_ARGB_EN|RADEON_CRTC_ARGB_EN);
389 save2 |= RADEON_CRTC_ARGB_EN;
390 OUTREG(RADEON_CRTC2_GEN_CNTL, save2 & (ULONG)~RADEON_CRTC2_CUR_EN);
393 for (x = 0; x < 64*64; x++)
394 curimg[x] = 0;
396 /* I always get the image in BGRA32 format (it becomes ARGB32 when picked up as ULONG on little-endian),
397 so i don't turn on byte swapping */
399 CURSOR_SWAPPING_START();
401 #if AROS_BIG_ENDIAN
402 HIDD_BM_GetImage(msg->shape, (UBYTE *)curimg, 64*4, 0, 0, width, height, vHidd_StdPixFmt_ARGB32);
403 #else
404 HIDD_BM_GetImage(msg->shape, (UBYTE *)curimg, 64*4, 0, 0, width, height, vHidd_StdPixFmt_BGRA32);
405 #endif
406 PRINT_POINTER(curimg, 64, 16, 16);
408 CURSOR_SWAPPING_END();
410 if (!sd->Card.IsSecondary)
411 OUTREG(RADEON_CRTC_GEN_CNTL, save1);
413 if (sd->Card.IsSecondary)
414 OUTREG(RADEON_CRTC2_GEN_CNTL, save2);
416 UNLOCK_HW
419 return TRUE;
422 void METHOD(ATI, Hidd_Gfx, SetCursorVisible)
424 ShowHideCursor(sd, msg->visible);
425 sd->Card.cursorVisible = msg->visible;
428 void METHOD(ATI, Hidd_Gfx, SetCursorPos)
430 D(bug("[ATI] Set cursor pos %d:%d\n", msg->x, msg->y));
432 WORD x,y,xoff=0,yoff=0;
434 x = (WORD)msg->x;
435 y = (WORD)msg->y;
437 if (x < 0)
439 xoff = -x;
440 x = 0;
443 if (y < 0)
445 yoff = -y;
446 y = 0;
449 if (!sd->Card.IsSecondary) {
450 OUTREG(RADEON_CUR_HORZ_VERT_OFF, RADEON_CUR_LOCK | (xoff << 16) | (yoff & 0xffff));
451 OUTREG(RADEON_CUR_HORZ_VERT_POSN, (RADEON_CUR_LOCK
452 | (x << 16)
453 | (y & 0xffff)));
454 OUTREG(RADEON_CUR_OFFSET, sd->Card.CursorStart);
456 D(bug("[ATI] OFF=%08x, HV_OFF=%08x, HV_POSN=%08x\n",
457 INREG(RADEON_CUR_OFFSET),
458 INREG(RADEON_CUR_HORZ_VERT_OFF),
459 INREG(RADEON_CUR_HORZ_VERT_POSN)));
461 } else {
462 OUTREG(RADEON_CUR2_HORZ_VERT_OFF, RADEON_CUR2_LOCK | (xoff << 16) | (yoff & 0xffff));
463 OUTREG(RADEON_CUR2_HORZ_VERT_POSN, (RADEON_CUR2_LOCK
464 | (x << 16)
465 | (y & 0xffff)));
466 OUTREG(RADEON_CUR2_OFFSET, sd->Card.CursorStart /* + addend???? */);
470 OOP_Object *METHOD(ATI, Root, New)
472 struct TagItem pftags_24bpp[] = {
473 { aHidd_PixFmt_RedShift, 8 }, /* 0 */
474 { aHidd_PixFmt_GreenShift, 16 }, /* 1 */
475 { aHidd_PixFmt_BlueShift, 24 }, /* 2 */
476 { aHidd_PixFmt_AlphaShift, 0 }, /* 3 */
477 { aHidd_PixFmt_RedMask, 0x00ff0000 }, /* 4 */
478 { aHidd_PixFmt_GreenMask, 0x0000ff00 }, /* 5 */
479 { aHidd_PixFmt_BlueMask, 0x000000ff }, /* 6 */
480 { aHidd_PixFmt_AlphaMask, 0x00000000 }, /* 7 */
481 { aHidd_PixFmt_ColorModel, vHidd_ColorModel_TrueColor }, /* 8 */
482 { aHidd_PixFmt_Depth, 24 }, /* 9 */
483 { aHidd_PixFmt_BytesPerPixel, 4 }, /* 10 */
484 { aHidd_PixFmt_BitsPerPixel, 24 }, /* 11 */
485 { aHidd_PixFmt_StdPixFmt, vHidd_StdPixFmt_Native }, /* 12 Native */
486 // { aHidd_PixFmt_StdPixFmt, vHidd_StdPixFmt_BGR032 }, /* 12 Native */
487 { aHidd_PixFmt_BitMapType, vHidd_BitMapType_Chunky }, /* 15 */
488 { TAG_DONE, 0UL }
491 struct TagItem pftags_16bpp[] = {
492 { aHidd_PixFmt_RedShift, 16 }, /* 0 */
493 { aHidd_PixFmt_GreenShift, 21 }, /* 1 */
494 { aHidd_PixFmt_BlueShift, 27 }, /* 2 */
495 { aHidd_PixFmt_AlphaShift, 0 }, /* 3 */
496 { aHidd_PixFmt_RedMask, 0x0000f800 }, /* 4 */
497 { aHidd_PixFmt_GreenMask, 0x000007e0 }, /* 5 */
498 { aHidd_PixFmt_BlueMask, 0x0000001f }, /* 6 */
499 { aHidd_PixFmt_AlphaMask, 0x00000000 }, /* 7 */
500 { aHidd_PixFmt_ColorModel, vHidd_ColorModel_TrueColor }, /* 8 */
501 { aHidd_PixFmt_Depth, 16 }, /* 9 */
502 { aHidd_PixFmt_BytesPerPixel, 2 }, /* 10 */
503 { aHidd_PixFmt_BitsPerPixel, 16 }, /* 11 */
504 { aHidd_PixFmt_StdPixFmt, vHidd_StdPixFmt_Native }, /* 12 */
505 // { aHidd_PixFmt_StdPixFmt, vHidd_StdPixFmt_RGB16_LE }, /* 12 */
506 { aHidd_PixFmt_BitMapType, vHidd_BitMapType_Chunky }, /* 15 */
507 { TAG_DONE, 0UL }
510 struct TagItem pftags_15bpp[] = {
511 { aHidd_PixFmt_RedShift, 17 }, /* 0 */
512 { aHidd_PixFmt_GreenShift, 22 }, /* 1 */
513 { aHidd_PixFmt_BlueShift, 27 }, /* 2 */
514 { aHidd_PixFmt_AlphaShift, 0 }, /* 3 */
515 { aHidd_PixFmt_RedMask, 0x00007c00 }, /* 4 */
516 { aHidd_PixFmt_GreenMask, 0x000003e0 }, /* 5 */
517 { aHidd_PixFmt_BlueMask, 0x0000001f }, /* 6 */
518 { aHidd_PixFmt_AlphaMask, 0x00000000 }, /* 7 */
519 { aHidd_PixFmt_ColorModel, vHidd_ColorModel_TrueColor }, /* 8 */
520 { aHidd_PixFmt_Depth, 15 }, /* 9 */
521 { aHidd_PixFmt_BytesPerPixel, 2 }, /* 10 */
522 { aHidd_PixFmt_BitsPerPixel, 15 }, /* 11 */
523 { aHidd_PixFmt_StdPixFmt, vHidd_StdPixFmt_Native }, /* 12 */
524 // { aHidd_PixFmt_StdPixFmt, vHidd_StdPixFmt_RGB15_LE }, /* 12 */
525 { aHidd_PixFmt_BitMapType, vHidd_BitMapType_Chunky }, /* 15 */
526 { TAG_DONE, 0UL }
529 MAKE_SYNC(640x480_60, 25174,
530 640, 656, 752, 800,
531 480, 490, 492, 525,
532 "ATI:640x480");
534 MAKE_SYNC(800x600_56, 36000, // 36000
535 800, 824, 896, 1024,
536 600, 601, 603, 625,
537 "ATI:800x600");
539 MAKE_SYNC(1024x768_60, 65000, //78654=60kHz, 75Hz. 65000=50kHz,62Hz
540 1024, 1048, 1184, 1344,
541 768, 771, 777, 806,
542 "ATI:1024x768");
544 MAKE_SYNC(1152x864_60, 80000,
545 1152, 1216, 1328, 1456,
546 864, 870, 875, 916,
547 "ATI:1152x864");
549 MAKE_SYNC(1280x1024_60, 108880,
550 1280, 1360, 1496, 1712,
551 1024, 1025, 1028, 1060,
552 "ATI:1280x1024");
554 MAKE_SYNC(1600x1200_60, 155982,
555 1600, 1632, 1792, 2048,
556 1200, 1210, 1218, 1270,
557 "ATI:1600x1200");
559 /* "new" 16:10 modes */
561 MAKE_SYNC(1280x800_60, 83530,
562 1280, 1344, 1480, 1680,
563 800, 801, 804, 828,
564 "ATI:1280x800");
566 MAKE_SYNC(1440x900_60, 106470,
567 1440, 1520, 1672, 1904,
568 900, 901, 904, 932,
569 "ATI:1440x900");
571 MAKE_SYNC(1680x1050_60, 147140,
572 1680, 1784, 1968, 2256,
573 1050, 1051, 1054, 1087,
574 "ATI:1680x1050");
576 MAKE_SYNC(1920x1080_60, 173000,
577 1920, 2048, 2248, 2576,
578 1080, 1083, 1088, 1120,
579 "ATI:1920x1080");
581 MAKE_SYNC(1920x1200_60, 154000,
582 1920, 1968, 2000, 2080,
583 1200, 1203, 1209, 1235,
584 "ATI:1920x1200");
586 // MAKE_SYNC(1920x1200_60, 162090,
587 // 1920, 1984, 2176, 2480,
588 // 1200, 1201, 1204, 1250,
589 // "ATI:1920x1200");
591 // MAKE_SYNC(1920x1200_60, 193160,
592 // 1920, 2048, 2256, 2592,
593 // 1200, 1201, 1204, 1242,
594 // "ATI:1920x1200");
596 struct TagItem modetags[] = {
597 { aHidd_Gfx_PixFmtTags, (IPTR)pftags_24bpp },
598 { aHidd_Gfx_PixFmtTags, (IPTR)pftags_16bpp },
599 { aHidd_Gfx_PixFmtTags, (IPTR)pftags_15bpp },
600 { aHidd_Gfx_SyncTags, (IPTR)sync_1280x1024_60 },
601 { aHidd_Gfx_SyncTags, (IPTR)sync_640x480_60 },
602 { aHidd_Gfx_SyncTags, (IPTR)sync_800x600_56 },
603 { aHidd_Gfx_SyncTags, (IPTR)sync_1024x768_60 },
604 { aHidd_Gfx_SyncTags, (IPTR)sync_1152x864_60 },
605 { aHidd_Gfx_SyncTags, (IPTR)sync_1600x1200_60 },
606 { aHidd_Gfx_SyncTags, (IPTR)sync_1280x800_60 },
607 { aHidd_Gfx_SyncTags, (IPTR)sync_1440x900_60 },
608 { aHidd_Gfx_SyncTags, (IPTR)sync_1680x1050_60 },
609 { aHidd_Gfx_SyncTags, (IPTR)sync_1920x1080_60 },
610 { aHidd_Gfx_SyncTags, (IPTR)sync_1920x1200_60 },
612 { TAG_DONE, 0UL }
615 struct TagItem mytags[] = {
616 { aHidd_Gfx_ModeTags, (IPTR)modetags },
617 { TAG_MORE, (IPTR)msg->attrList }
620 struct pRoot_New mymsg;
622 mymsg.mID = msg->mID;
623 mymsg.attrList = mytags;
625 msg = &mymsg;
627 o = (OOP_Object *)OOP_DoSuperMethod(cl, o, (OOP_Msg)msg);
628 if (o)
630 sd->AtiObject = o;
633 EnterFunc(bug("[ATI] RadeonDriver::New()=%08x\n",o));
635 return o;
638 void METHOD(ATI, Root, Get)
640 ULONG idx;
641 BOOL found = FALSE;
643 if (IS_GFX_ATTR(msg->attrID, idx))
645 switch (idx)
647 case aoHidd_Gfx_SupportsHWCursor:
648 *msg->storage = (IPTR)TRUE;
649 found = TRUE;
650 break;
652 case aoHidd_Gfx_DPMSLevel:
653 *msg->storage = sd->dpms;
654 found = TRUE;
655 break;
659 if (!found)
660 OOP_DoSuperMethod(cl, o, (OOP_Msg)msg);
662 return;
665 void METHOD(ATI, Root, Set)
667 ULONG idx;
668 struct TagItem *tag;
669 struct TagItem *tags = msg->attrList;
671 while ((tag = NextTagItem(&tags)))
673 if (IS_GFX_ATTR(tag->ti_Tag, idx))
675 switch(idx)
677 case aoHidd_Gfx_DPMSLevel:
678 LOCK_HW
680 DPMS(sd, tag->ti_Data);
681 sd->dpms = tag->ti_Data;
683 UNLOCK_HW
684 break;
689 OOP_DoSuperMethod(cl, o, (OOP_Msg)msg);