1 /* 2 * Copyright 2006-2009, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Axel Dörfler, axeld@pinc-software.de 7 */ 8 9 10 #include "accelerant_protos.h" 11 #include "accelerant.h" 12 13 14 extern "C" void * 15 get_accelerant_hook(uint32 feature, void *data) 16 { 17 switch (feature) { 18 /* general */ 19 case B_INIT_ACCELERANT: 20 return (void*)intel_init_accelerant; 21 case B_UNINIT_ACCELERANT: 22 return (void*)intel_uninit_accelerant; 23 case B_CLONE_ACCELERANT: 24 return (void*)intel_clone_accelerant; 25 case B_ACCELERANT_CLONE_INFO_SIZE: 26 return (void*)intel_accelerant_clone_info_size; 27 case B_GET_ACCELERANT_CLONE_INFO: 28 return (void*)intel_get_accelerant_clone_info; 29 case B_GET_ACCELERANT_DEVICE_INFO: 30 return (void*)intel_get_accelerant_device_info; 31 case B_ACCELERANT_RETRACE_SEMAPHORE: 32 return (void*)intel_accelerant_retrace_semaphore; 33 34 /* mode configuration */ 35 case B_ACCELERANT_MODE_COUNT: 36 return (void*)intel_accelerant_mode_count; 37 case B_GET_MODE_LIST: 38 return (void*)intel_get_mode_list; 39 case B_PROPOSE_DISPLAY_MODE: 40 return (void*)intel_propose_display_mode; 41 case B_SET_DISPLAY_MODE: 42 return (void*)intel_set_display_mode; 43 case B_GET_DISPLAY_MODE: 44 return (void*)intel_get_display_mode; 45 #ifdef __HAIKU__ 46 case B_GET_EDID_INFO: 47 return (void*)intel_get_edid_info; 48 #endif 49 case B_GET_FRAME_BUFFER_CONFIG: 50 return (void*)intel_get_frame_buffer_config; 51 case B_GET_PIXEL_CLOCK_LIMITS: 52 return (void*)intel_get_pixel_clock_limits; 53 case B_MOVE_DISPLAY: 54 return (void*)intel_move_display; 55 case B_SET_INDEXED_COLORS: 56 return (void*)intel_set_indexed_colors; 57 case B_GET_TIMING_CONSTRAINTS: 58 return (void*)intel_get_timing_constraints; 59 60 /* DPMS */ 61 case B_DPMS_CAPABILITIES: 62 return (void*)intel_dpms_capabilities; 63 case B_DPMS_MODE: 64 return (void*)intel_dpms_mode; 65 case B_SET_DPMS_MODE: 66 return (void*)intel_set_dpms_mode; 67 68 /* cursor managment */ 69 case B_SET_CURSOR_SHAPE: 70 if (gInfo->shared_info->cursor_memory != NULL) 71 return (void*)intel_set_cursor_shape; 72 case B_MOVE_CURSOR: 73 if (gInfo->shared_info->cursor_memory != NULL) 74 return (void*)intel_move_cursor; 75 case B_SHOW_CURSOR: 76 if (gInfo->shared_info->cursor_memory != NULL) 77 return (void*)intel_show_cursor; 78 79 return NULL; 80 81 /* engine/synchronization */ 82 case B_ACCELERANT_ENGINE_COUNT: 83 return (void*)intel_accelerant_engine_count; 84 case B_ACQUIRE_ENGINE: 85 return (void*)intel_acquire_engine; 86 case B_RELEASE_ENGINE: 87 return (void*)intel_release_engine; 88 case B_WAIT_ENGINE_IDLE: 89 return (void*)intel_wait_engine_idle; 90 case B_GET_SYNC_TOKEN: 91 return (void*)intel_get_sync_token; 92 case B_SYNC_TO_TOKEN: 93 return (void*)intel_sync_to_token; 94 95 /* 2D acceleration */ 96 case B_SCREEN_TO_SCREEN_BLIT: 97 return (void*)intel_screen_to_screen_blit; 98 case B_FILL_RECTANGLE: 99 return (void*)intel_fill_rectangle; 100 case B_INVERT_RECTANGLE: 101 return (void*)intel_invert_rectangle; 102 case B_FILL_SPAN: 103 return NULL;//(void*)intel_fill_span; 104 105 // overlay 106 case B_OVERLAY_COUNT: 107 return (void*)intel_overlay_count; 108 case B_OVERLAY_SUPPORTED_SPACES: 109 return (void*)intel_overlay_supported_spaces; 110 case B_OVERLAY_SUPPORTED_FEATURES: 111 return (void*)intel_overlay_supported_features; 112 case B_ALLOCATE_OVERLAY_BUFFER: 113 // TODO: overlay doesn't seem to work on these chips 114 if (gInfo->shared_info->device_type.InGroup(INTEL_TYPE_91x) 115 || gInfo->shared_info->device_type.InGroup(INTEL_TYPE_94x) 116 || gInfo->shared_info->device_type.IsModel(INTEL_TYPE_965M) 117 || gInfo->shared_info->device_type.InGroup(INTEL_TYPE_G4x)) 118 return NULL; 119 120 return (void*)intel_allocate_overlay_buffer; 121 case B_RELEASE_OVERLAY_BUFFER: 122 return (void*)intel_release_overlay_buffer; 123 case B_GET_OVERLAY_CONSTRAINTS: 124 return (void*)intel_get_overlay_constraints; 125 case B_ALLOCATE_OVERLAY: 126 return (void*)intel_allocate_overlay; 127 case B_RELEASE_OVERLAY: 128 return (void*)intel_release_overlay; 129 case B_CONFIGURE_OVERLAY: 130 return (void*)intel_configure_overlay; 131 } 132 133 return NULL; 134 } 135 136