2 Copyright 1999, Be Incorporated. All Rights Reserved.
3 This file may be used under the terms of the Be Sample Code License.
7 Rudolf Cornelissen 10/2002-6/2008
10 #define MODULE_BIT 0x08000000
15 The standard entry point. Given a uint32 feature identifier, this routine
16 returns a pointer to the function that implements the feature. Some features
17 require more information than just the identifier to select the proper
18 function. The extra information (which is specific to the feature) is
19 pointed at by the void *data parameter. By default, no extra information
20 is available. Any extra information available to choose the function will be
21 noted on a case by case below.
25 These definitions are out of pure lazyness.
27 #define CHKA(x) case B_##x: \
28 if (check_acc_capability(B_##x) == B_OK) \
29 return (void *)x##_DMA; \
32 #define CHKS(x) case B_##x: return (void *)x##_DMA
33 #define HOOK(x) case B_##x: return (void *)x
34 #define ZERO(x) case B_##x: return (void *)0
35 #define HRDC(x) case B_##x: return si->settings.hardcursor? (void *)x: (void *)0; // apsed
37 void * get_accelerant_hook(uint32 feature
, void *data
)
42 One of either B_INIT_ACCELERANT or B_CLONE_ACCELERANT will be requested and
43 subsequently called before any other hook is requested. All other feature
44 hook selections can be predicated on variables assigned during the accelerant
45 initialization process.
49 HOOK(INIT_ACCELERANT
);
50 HOOK(CLONE_ACCELERANT
);
52 HOOK(ACCELERANT_CLONE_INFO_SIZE
);
53 HOOK(GET_ACCELERANT_CLONE_INFO
);
54 HOOK(UNINIT_ACCELERANT
);
55 HOOK(GET_ACCELERANT_DEVICE_INFO
);
56 HOOK(ACCELERANT_RETRACE_SEMAPHORE
);
58 /* mode configuration */
59 HOOK(ACCELERANT_MODE_COUNT
);
61 HOOK(PROPOSE_DISPLAY_MODE
);
62 HOOK(SET_DISPLAY_MODE
);
63 HOOK(GET_DISPLAY_MODE
);
64 HOOK(GET_FRAME_BUFFER_CONFIG
);
65 HOOK(GET_PIXEL_CLOCK_LIMITS
);
67 HOOK(SET_INDEXED_COLORS
);
68 HOOK(GET_TIMING_CONSTRAINTS
);
70 HOOK(DPMS_CAPABILITIES
);
74 /* cursor managment */
75 //HRDC(SET_CURSOR_SHAPE);
80 HOOK(ACCELERANT_ENGINE_COUNT
);
83 HOOK(WAIT_ENGINE_IDLE
);
88 Depending on the engine architecture, you may choose to provide a different
89 function to be used with each bit-depth for example.
91 Note: These hooks are re-acquired by the app_server after each mode switch.
94 /* video overlay functions are not supported */
97 When requesting an acceleration hook, the calling application provides a
98 pointer to the display_mode for which the acceleration function will be used.
99 Depending on the engine architecture, you may choose to provide a different
100 function to be used with each bit-depth. In the sample driver we return
101 the same function all the time.
103 Note: These hooks are re-acquired by the app_server after each mode switch.
106 /* only export 2D acceleration functions in modes that are capable of it */
107 /* used by the app_server and applications (BWindowScreen) */
108 //CHKA(SCREEN_TO_SCREEN_BLIT);
109 //CHKA(FILL_RECTANGLE);
110 //CHKA(INVERT_RECTANGLE);
112 /* not (yet) used by the app_server:
113 * so just for application use (BWindowScreen) */
114 // CHKA(SCREEN_TO_SCREEN_TRANSPARENT_BLIT);
115 //CHKA(SCREEN_TO_SCREEN_SCALED_FILTERED_BLIT);
118 /* Return a null pointer for any feature we don't understand. */
127 status_t
check_acc_capability(uint32 feature
)
131 /* setup logmessage text */
134 case B_SCREEN_TO_SCREEN_BLIT
:
135 msg
= "B_SCREEN_TO_SCREEN_BLIT";
137 case B_FILL_RECTANGLE
:
138 msg
= "B_FILL_RECTANGLE";
140 case B_INVERT_RECTANGLE
:
141 msg
= "B_INVERT_RECTANGLE";
146 case B_SCREEN_TO_SCREEN_TRANSPARENT_BLIT
:
147 msg
= "B_SCREEN_TO_SCREEN_TRANSPARENT_BLIT";
149 case B_SCREEN_TO_SCREEN_SCALED_FILTERED_BLIT
:
150 msg
= "B_SCREEN_TO_SCREEN_SCALED_FILTERED_BLIT";
151 /* this function doesn't support the B_CMAP8 colorspace */
152 //fixme: checkout B_CMAP8 support sometime, as some cards seem to support it?
153 if (si
->dm
.space
== B_CMAP8
)
155 LOG(4, ("Acc: Not exporting hook %s.\n", msg
));
164 /* hardware acceleration is only supported in modes with upto a certain
168 LOG(4, ("Acc: Exporting hook %s.\n", msg
));
173 LOG(4, ("Acc: Not exporting hook %s.\n", msg
));