21 #include "../../SDL_internal.h" 23 #if SDL_VIDEO_DRIVER_VIVANTE 26 #include "../SDL_sysvideo.h" 31 #include "../../events/SDL_events_c.h" 33 #ifdef SDL_INPUT_LINUXEV 34 #include "../../core/linux/SDL_evdev.h" 43 VIVANTE_Available(
void)
84 device->
free = VIVANTE_Destroy;
100 #if SDL_VIDEO_OPENGL_EGL 119 "Vivante EGL Video Driver",
129 VIVANTE_AddVideoDisplays(
_THIS)
135 int pitch = 0,
bpp = 0;
144 #if SDL_VIDEO_DRIVER_VIVANTE_VDK 147 vdkGetDisplayInfo(data->
native_display, ¤t_mode.
w, ¤t_mode.
h, &pixels, &pitch, &
bpp);
151 videodata->fbGetDisplayInfo(data->
native_display, ¤t_mode.
w, ¤t_mode.
h, &pixels, &pitch, &
bpp);
168 display.
name = VIVANTE_GetDisplayName(
_this);
181 #
if SDL_VIDEO_DRIVER_VIVANTE_VDK
182 videodata->vdk_private = vdkInitialize();
183 if (!videodata->vdk_private) {
194 #define LOAD_FUNC(NAME) \ 195 videodata->NAME = SDL_LoadFunction(videodata->egl_handle, #NAME); \ 196 if (!videodata->NAME) return -1; 198 LOAD_FUNC(fbGetDisplay);
199 LOAD_FUNC(fbGetDisplayByIndex);
200 LOAD_FUNC(fbGetDisplayGeometry);
201 LOAD_FUNC(fbGetDisplayInfo);
202 LOAD_FUNC(fbDestroyDisplay);
203 LOAD_FUNC(fbCreateWindow);
204 LOAD_FUNC(fbGetWindowGeometry);
205 LOAD_FUNC(fbGetWindowInfo);
206 LOAD_FUNC(fbDestroyWindow);
209 if (VIVANTE_SetupPlatform(
_this) < 0) {
213 if (VIVANTE_AddVideoDisplays(
_this) < 0) {
217 VIVANTE_UpdateDisplayScale(
_this);
219 #ifdef SDL_INPUT_LINUXEV 220 if (SDL_EVDEV_Init() < 0) {
237 VIVANTE_CleanupPlatform(
_this);
239 #if SDL_VIDEO_DRIVER_VIVANTE_VDK 240 if (videodata->vdk_private) {
241 vdkExit(videodata->vdk_private);
242 videodata->vdk_private =
NULL;
283 #if SDL_VIDEO_DRIVER_VIVANTE_VDK 284 data->native_window = vdkCreateWindow(displaydata->native_display, window->
x, window->
y, window->
w, window->
h);
286 data->native_window = videodata->fbCreateWindow(displaydata->native_display, window->
x, window->
y, window->
w, window->
h);
288 if (!data->native_window) {
289 return SDL_SetError(
"VIVANTE: Can't create native window");
292 #if SDL_VIDEO_OPENGL_EGL 294 data->egl_surface = SDL_EGL_CreateSurface(
_this, data->native_window);
296 return SDL_SetError(
"VIVANTE: Can't create EGL surface");
315 #if SDL_VIDEO_OPENGL_EGL 317 SDL_EGL_DestroySurface(
_this, data->egl_surface);
321 if (data->native_window) {
322 #if SDL_VIDEO_DRIVER_VIVANTE_VDK 323 vdkDestroyWindow(data->native_window);
325 videodata->fbDestroyWindow(data->native_window);
337 #if SDL_VIDEO_DRIVER_VIVANTE_VDK 358 #if SDL_VIDEO_DRIVER_VIVANTE_VDK 369 #if SDL_VIDEO_DRIVER_VIVANTE_VDK 387 info->
info.vivante.
display = displaydata->native_display;
402 #ifdef SDL_INPUT_LINUXEV
#define SDL_MINOR_VERSION
void VIVANTE_SetWindowTitle(_THIS, SDL_Window *window)
void VIVANTE_SetWindowPosition(_THIS, SDL_Window *window)
int VIVANTE_VideoInit(_THIS)
void SDL_SetKeyboardFocus(SDL_Window *window)
#define SDL_MAJOR_VERSION
void VIVANTE_ShowWindow(_THIS, SDL_Window *window)
void VIVANTE_PumpEvents(_THIS)
int(* GL_SetSwapInterval)(_THIS, int interval)
void(* ShowWindow)(_THIS, SDL_Window *window)
The structure that defines a display mode.
set set set set set set set macro pixldst1 abits if abits op else op endif endm macro pixldst2 abits if abits op else op endif endm macro pixldst4 abits if abits op else op endif endm macro pixldst0 abits op endm macro pixldst3 mem_operand op endm macro pixldst30 mem_operand op endm macro pixldst abits if abits elseif abits elseif abits elseif abits elseif abits pixldst0 abits else pixldst0 abits pixldst0 abits pixldst0 abits pixldst0 abits endif elseif abits else pixldst0 abits pixldst0 abits endif elseif abits else error unsupported bpp *numpix else pixst endif endm macro pixld1_s mem_operand if asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl elseif asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl else error unsupported endif endm macro pixld2_s mem_operand if mov asr add asl add asl mov asr sub UNIT_X add asl mov asr add asl add asl mov asr add UNIT_X add asl else pixld1_s mem_operand pixld1_s mem_operand endif endm macro pixld0_s mem_operand if asr adds SRC_WIDTH_FIXED bpl add asl elseif asr adds SRC_WIDTH_FIXED bpl add asl endif endm macro pixld_s_internal mem_operand if mem_operand pixld2_s mem_operand pixdeinterleave basereg elseif mem_operand elseif mem_operand elseif mem_operand elseif mem_operand pixld0_s mem_operand else pixld0_s mem_operand pixld0_s mem_operand pixld0_s mem_operand pixld0_s mem_operand endif elseif mem_operand else pixld0_s mem_operand pixld0_s mem_operand endif elseif mem_operand else error unsupported mem_operand if bpp mem_operand endif endm macro vuzp8 reg2 vuzp d d ®2 endm macro vzip8 reg2 vzip d d ®2 endm macro pixdeinterleave basereg basereg basereg basereg basereg endif endm macro pixinterleave basereg basereg basereg basereg basereg endif endm macro PF boost_increment endif if endif PF tst PF addne PF subne PF cmp ORIG_W if endif if endif if endif PF subge ORIG_W PF subges if endif if endif if endif endif endm macro cache_preload_simple endif if dst_r_bpp pld [DST_R, #(PREFETCH_DISTANCE_SIMPLE *dst_r_bpp/8)] endif if mask_bpp pld if[MASK, #(PREFETCH_DISTANCE_SIMPLE *mask_bpp/8)] endif endif endm macro fetch_mask_pixblock pixld mask_basereg pixblock_size MASK endm macro ensure_destination_ptr_alignment process_pixblock_tail_head if beq irp local skip1(dst_w_bpp<=(lowbit *8)) &&((lowbit *8)<(pixblock_size *dst_w_bpp)) .if lowbit< 16 tst DST_R
int VIVANTE_CreateWindow(_THIS, SDL_Window *window)
void(* SetWindowSize)(_THIS, SDL_Window *window)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
void SDL_SetMouseFocus(SDL_Window *window)
set set set set set set set macro pixldst1 abits if abits op else op endif endm macro pixldst2 abits if abits op else op endif endm macro pixldst4 abits if abits op else op endif endm macro pixldst0 abits op endm macro pixldst3 mem_operand op endm macro pixldst30 mem_operand op endm macro pixldst abits if abits elseif abits elseif abits elseif abits elseif abits pixldst0 abits else pixldst0 abits pixldst0 abits pixldst0 abits pixldst0 abits endif elseif abits else pixldst0 abits pixldst0 abits endif elseif abits else error unsupported bpp
int SDL_AddVideoDisplay(const SDL_VideoDisplay *display)
int(* GL_LoadLibrary)(_THIS, const char *path)
int(* SetDisplayMode)(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode)
void * SDL_GetDisplayDriverData(int displayIndex)
static SDL_VideoDevice * _this
void(* HideWindow)(_THIS, SDL_Window *window)
static SDL_AudioDeviceID device
VideoBootStrap VIVANTE_bootstrap
#define SDL_INPUT_LINUXEV
SDL_bool(* GetWindowWMInfo)(_THIS, SDL_Window *window, struct SDL_SysWMinfo *info)
SDL_GLContext(* GL_CreateContext)(_THIS, SDL_Window *window)
int(* GL_MakeCurrent)(_THIS, SDL_Window *window, SDL_GLContext context)
int VIVANTE_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode)
SDL_DisplayMode current_mode
void(* DestroyWindow)(_THIS, SDL_Window *window)
GLint GLint GLsizei GLsizei GLsizei GLint GLenum GLenum const GLvoid * pixels
SDL_bool VIVANTE_GetWindowWMInfo(_THIS, SDL_Window *window, struct SDL_SysWMinfo *info)
void(* GL_UnloadLibrary)(_THIS)
void(* GetDisplayModes)(_THIS, SDL_VideoDisplay *display)
int(* CreateSDLWindow)(_THIS, SDL_Window *window)
#define SDL_OutOfMemory()
SDL_DisplayMode desktop_mode
EGLSurface EGLNativeWindowType * window
void(* SetWindowPosition)(_THIS, SDL_Window *window)
void VIVANTE_SetWindowSize(_THIS, SDL_Window *window)
void VIVANTE_DestroyWindow(_THIS, SDL_Window *window)
int(* GL_SwapWindow)(_THIS, SDL_Window *window)
The type used to identify a window.
void VIVANTE_VideoQuit(_THIS)
SDL_bool SDL_AddDisplayMode(SDL_VideoDisplay *display, const SDL_DisplayMode *mode)
union SDL_SysWMinfo::@18 info
void(* GL_DeleteContext)(_THIS, SDL_GLContext context)
void(* SetWindowTitle)(_THIS, SDL_Window *window)
int(* GL_GetSwapInterval)(_THIS)
ANativeWindow * native_window
void *(* GL_GetProcAddress)(_THIS, const char *proc)
EGLNativeDisplayType native_display
void(* PumpEvents)(_THIS)
void VIVANTE_GetDisplayModes(_THIS, SDL_VideoDisplay *display)
void VIVANTE_HideWindow(_THIS, SDL_Window *window)