1 /* 2 Copyright (c) 2002, Thomas Kurschel 3 4 5 Part of Radeon accelerant 6 7 Contains entry point to get public functions. 8 (directly copied from sample driver) 9 */ 10 11 12 #include "generic.h" 13 14 /* 15 16 The standard entry point. Given a uint32 feature identifier, this routine 17 returns a pointer to the function that implements the feature. Some features 18 require more information than just the identifier to select the proper 19 function. The extra information (which is specific to the feature) is 20 pointed at by the void *data parameter. By default, no extra information 21 is available. Any extra information available to choose the function will be 22 noted on a case by case below. 23 24 */ 25 void * get_accelerant_hook(uint32 feature, void *data) { 26 switch (feature) { 27 /* 28 These definitions are out of pure lazyness. 29 */ 30 #define HOOK(x) case B_##x: return (void *)x 31 #define ZERO(x) case B_##x: return (void *)0 32 33 /* 34 One of either B_INIT_ACCELERANT or B_CLONE_ACCELERANT will be requested and 35 subsequently called before any other hook is requested. All other feature 36 hook selections can be predicated on variables assigned during the accelerant 37 initialization process. 38 */ 39 /* initialization */ 40 HOOK(INIT_ACCELERANT); 41 HOOK(CLONE_ACCELERANT); 42 43 HOOK(ACCELERANT_CLONE_INFO_SIZE); 44 HOOK(GET_ACCELERANT_CLONE_INFO); 45 HOOK(UNINIT_ACCELERANT); 46 HOOK(GET_ACCELERANT_DEVICE_INFO); 47 HOOK(ACCELERANT_RETRACE_SEMAPHORE); 48 49 /* mode configuration */ 50 HOOK(ACCELERANT_MODE_COUNT); 51 HOOK(GET_MODE_LIST); 52 HOOK(PROPOSE_DISPLAY_MODE); 53 HOOK(SET_DISPLAY_MODE); 54 HOOK(GET_DISPLAY_MODE); 55 HOOK(GET_FRAME_BUFFER_CONFIG); 56 HOOK(GET_PIXEL_CLOCK_LIMITS); 57 HOOK(MOVE_DISPLAY); 58 HOOK(SET_INDEXED_COLORS); 59 //HOOK(GET_TIMING_CONSTRAINTS); 60 61 HOOK(DPMS_CAPABILITIES); 62 HOOK(DPMS_MODE); 63 HOOK(SET_DPMS_MODE); 64 65 /* cursor managment */ 66 HOOK(SET_CURSOR_SHAPE); 67 HOOK(MOVE_CURSOR); 68 HOOK(SHOW_CURSOR); 69 70 /* synchronization */ 71 HOOK(ACCELERANT_ENGINE_COUNT); 72 HOOK(ACQUIRE_ENGINE); 73 HOOK(RELEASE_ENGINE); 74 HOOK(WAIT_ENGINE_IDLE); 75 HOOK(GET_SYNC_TOKEN); 76 HOOK(SYNC_TO_TOKEN); 77 78 /* 79 When requesting an acceleration hook, the calling application provides a 80 pointer to the display_mode for which the acceleration function will be used. 81 Depending on the engine architecture, you may choose to provide a different 82 function to be used with each bit-depth. In the sample driver we return 83 the same function all the time. 84 */ 85 /* 2D acceleration */ 86 HOOK(SCREEN_TO_SCREEN_BLIT); 87 HOOK(FILL_RECTANGLE); 88 HOOK(INVERT_RECTANGLE); 89 HOOK(FILL_SPAN); 90 91 // overlay 92 HOOK(OVERLAY_COUNT); 93 HOOK(OVERLAY_SUPPORTED_SPACES); 94 HOOK(OVERLAY_SUPPORTED_FEATURES); 95 HOOK(ALLOCATE_OVERLAY_BUFFER); 96 HOOK(RELEASE_OVERLAY_BUFFER); 97 HOOK(GET_OVERLAY_CONSTRAINTS); 98 HOOK(ALLOCATE_OVERLAY); 99 HOOK(RELEASE_OVERLAY); 100 HOOK(CONFIGURE_OVERLAY); 101 #undef HOOK 102 #undef ZERO 103 } 104 /* 105 Return a null pointer for any feature we don't understand. 106 */ 107 return 0; 108 } 109