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;
117 "Vivante EGL Video Driver",
127 VIVANTE_AddVideoDisplays(
_THIS)
133 int pitch = 0,
bpp = 0;
142 #if SDL_VIDEO_DRIVER_VIVANTE_VDK 145 vdkGetDisplayInfo(data->
native_display, ¤t_mode.
w, ¤t_mode.
h, &pixels, &pitch, &
bpp);
149 videodata->fbGetDisplayInfo(data->
native_display, ¤t_mode.
w, ¤t_mode.
h, &pixels, &pitch, &
bpp);
175 #
if SDL_VIDEO_DRIVER_VIVANTE_VDK
176 videodata->vdk_private = vdkInitialize();
177 if (!videodata->vdk_private) {
188 #define LOAD_FUNC(NAME) \ 189 videodata->NAME = SDL_LoadFunction(videodata->egl_handle, #NAME); \ 190 if (!videodata->NAME) return -1; 192 LOAD_FUNC(fbGetDisplay);
193 LOAD_FUNC(fbGetDisplayByIndex);
194 LOAD_FUNC(fbGetDisplayGeometry);
195 LOAD_FUNC(fbGetDisplayInfo);
196 LOAD_FUNC(fbDestroyDisplay);
197 LOAD_FUNC(fbCreateWindow);
198 LOAD_FUNC(fbGetWindowGeometry);
199 LOAD_FUNC(fbGetWindowInfo);
200 LOAD_FUNC(fbDestroyWindow);
203 if (VIVANTE_SetupPlatform(
_this) < 0) {
207 if (VIVANTE_AddVideoDisplays(
_this) < 0) {
211 #ifdef SDL_INPUT_LINUXEV 212 if (SDL_EVDEV_Init() < 0) {
229 VIVANTE_CleanupPlatform(
_this);
231 #if SDL_VIDEO_DRIVER_VIVANTE_VDK 232 if (videodata->vdk_private) {
233 vdkExit(videodata->vdk_private);
234 videodata->vdk_private =
NULL;
275 #if SDL_VIDEO_DRIVER_VIVANTE_VDK 276 data->native_window = vdkCreateWindow(displaydata->native_display, window->
x, window->
y, window->
w, window->
h);
278 data->native_window = videodata->fbCreateWindow(displaydata->native_display, window->
x, window->
y, window->
w, window->
h);
280 if (!data->native_window) {
281 return SDL_SetError(
"VIVANTE: Can't create native window");
285 data->egl_surface = SDL_EGL_CreateSurface(
_this, data->native_window);
286 if (data->egl_surface == EGL_NO_SURFACE) {
287 return SDL_SetError(
"VIVANTE: Can't create EGL surface");
290 data->egl_surface = EGL_NO_SURFACE;
305 if (data->egl_surface != EGL_NO_SURFACE) {
306 SDL_EGL_DestroySurface(
_this, data->egl_surface);
309 if (data->native_window) {
310 #if SDL_VIDEO_DRIVER_VIVANTE_VDK 311 vdkDestroyWindow(data->native_window);
313 videodata->fbDestroyWindow(data->native_window);
325 #if SDL_VIDEO_DRIVER_VIVANTE_VDK 346 #if SDL_VIDEO_DRIVER_VIVANTE_VDK 357 #if SDL_VIDEO_DRIVER_VIVANTE_VDK 375 info->
info.vivante.
display = displaydata->native_display;
379 SDL_SetError(
"Application not compiled with SDL %d.%d\n",
390 #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
static SDL_Window * window
void VIVANTE_ShowWindow(_THIS, SDL_Window *window)
void VIVANTE_PumpEvents(_THIS)
int(* GL_SetSwapInterval)(_THIS, int interval)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
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 GLint GLsizei GLsizei GLsizei GLint GLenum GLenum const GLvoid * pixels
void SDL_SetMouseFocus(SDL_Window *window)
void(* GL_SwapWindow)(_THIS, 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)
void * SDL_calloc(size_t nmemb, size_t size)
#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)
SDL_bool VIVANTE_GetWindowWMInfo(_THIS, SDL_Window *window, struct SDL_SysWMinfo *info)
void(* GL_UnloadLibrary)(_THIS)
void(* GetDisplayModes)(_THIS, SDL_VideoDisplay *display)
#define SDL_OutOfMemory()
SDL_DisplayMode desktop_mode
void(* SetWindowPosition)(_THIS, SDL_Window *window)
void VIVANTE_SetWindowSize(_THIS, SDL_Window *window)
void VIVANTE_DestroyWindow(_THIS, SDL_Window *window)
int(* CreateWindow)(_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)