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"
79 device->free = VIVANTE_Destroy;
95 #if SDL_VIDEO_OPENGL_EGL
96 device->GL_LoadLibrary = VIVANTE_GLES_LoadLibrary;
97 device->GL_GetProcAddress = VIVANTE_GLES_GetProcAddress;
98 device->GL_UnloadLibrary = VIVANTE_GLES_UnloadLibrary;
99 device->GL_CreateContext = VIVANTE_GLES_CreateContext;
100 device->GL_MakeCurrent = VIVANTE_GLES_MakeCurrent;
101 device->GL_SetSwapInterval = VIVANTE_GLES_SetSwapInterval;
102 device->GL_GetSwapInterval = VIVANTE_GLES_GetSwapInterval;
103 device->GL_SwapWindow = VIVANTE_GLES_SwapWindow;
104 device->GL_DeleteContext = VIVANTE_GLES_DeleteContext;
108 device->Vulkan_LoadLibrary = VIVANTE_Vulkan_LoadLibrary;
109 device->Vulkan_UnloadLibrary = VIVANTE_Vulkan_UnloadLibrary;
110 device->Vulkan_GetInstanceExtensions = VIVANTE_Vulkan_GetInstanceExtensions;
111 device->Vulkan_CreateSurface = VIVANTE_Vulkan_CreateSurface;
121 "Vivante EGL Video Driver",
130 VIVANTE_AddVideoDisplays(
_THIS)
136 int pitch = 0,
bpp = 0;
145 #if SDL_VIDEO_DRIVER_VIVANTE_VDK
146 data->native_display = vdkGetDisplay(videodata->vdk_private);
148 vdkGetDisplayInfo(
data->native_display, ¤t_mode.
w, ¤t_mode.
h, &
pixels, &pitch, &
bpp);
150 data->native_display = videodata->fbGetDisplayByIndex(0);
152 videodata->fbGetDisplayInfo(
data->native_display, ¤t_mode.
w, ¤t_mode.
h, &
pixels, &pitch, &
bpp);
169 display.
name = VIVANTE_GetDisplayName(
_this);
182 #
if SDL_VIDEO_DRIVER_VIVANTE_VDK
183 videodata->vdk_private = vdkInitialize();
184 if (!videodata->vdk_private) {
195 #define LOAD_FUNC(NAME) \
196 videodata->NAME = SDL_LoadFunction(videodata->egl_handle, #NAME); \
197 if (!videodata->NAME) return -1;
199 LOAD_FUNC(fbGetDisplay);
200 LOAD_FUNC(fbGetDisplayByIndex);
201 LOAD_FUNC(fbGetDisplayGeometry);
202 LOAD_FUNC(fbGetDisplayInfo);
203 LOAD_FUNC(fbDestroyDisplay);
204 LOAD_FUNC(fbCreateWindow);
205 LOAD_FUNC(fbGetWindowGeometry);
206 LOAD_FUNC(fbGetWindowInfo);
207 LOAD_FUNC(fbDestroyWindow);
210 if (VIVANTE_SetupPlatform(
_this) < 0) {
214 if (VIVANTE_AddVideoDisplays(
_this) < 0) {
218 VIVANTE_UpdateDisplayScale(
_this);
220 #ifdef SDL_INPUT_LINUXEV
221 if (SDL_EVDEV_Init() < 0) {
238 VIVANTE_CleanupPlatform(
_this);
240 #if SDL_VIDEO_DRIVER_VIVANTE_VDK
241 if (videodata->vdk_private) {
242 vdkExit(videodata->vdk_private);
243 videodata->vdk_private =
NULL;
284 #if SDL_VIDEO_DRIVER_VIVANTE_VDK
289 if (!
data->native_window) {
290 return SDL_SetError(
"VIVANTE: Can't create native window");
293 #if SDL_VIDEO_OPENGL_EGL
295 data->egl_surface = SDL_EGL_CreateSurface(
_this,
data->native_window);
297 return SDL_SetError(
"VIVANTE: Can't create EGL surface");
316 #if SDL_VIDEO_OPENGL_EGL
318 SDL_EGL_DestroySurface(
_this,
data->egl_surface);
322 if (
data->native_window) {
323 #if SDL_VIDEO_DRIVER_VIVANTE_VDK
324 vdkDestroyWindow(
data->native_window);
326 videodata->fbDestroyWindow(
data->native_window);
338 #if SDL_VIDEO_DRIVER_VIVANTE_VDK
340 vdkSetWindowTitle(
data->native_window,
window->title);
359 #if SDL_VIDEO_DRIVER_VIVANTE_VDK
361 vdkShowWindow(
data->native_window);
370 #if SDL_VIDEO_DRIVER_VIVANTE_VDK
372 vdkHideWindow(
data->native_window);
388 info->
info.vivante.
display = displaydata->native_display;
403 #ifdef SDL_INPUT_LINUXEV
#define SDL_OutOfMemory()
void SDL_SetKeyboardFocus(SDL_Window *window)
void SDL_SetMouseFocus(SDL_Window *window)
GLint GLint GLsizei GLsizei GLsizei GLint GLenum GLenum const GLvoid * pixels
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
@ SDL_PIXELFORMAT_ARGB8888
void * SDL_GetDisplayDriverData(int displayIndex)
VideoBootStrap VIVANTE_bootstrap
int SDL_AddVideoDisplay(const SDL_VideoDisplay *display, SDL_bool send_event)
SDL_bool SDL_AddDisplayMode(SDL_VideoDisplay *display, const SDL_DisplayMode *mode)
#define SDL_MINOR_VERSION
#define SDL_MAJOR_VERSION
static SDL_VideoDevice * _this
void VIVANTE_PumpEvents(_THIS)
void VIVANTE_VideoQuit(_THIS)
void VIVANTE_SetWindowPosition(_THIS, SDL_Window *window)
void VIVANTE_SetWindowSize(_THIS, SDL_Window *window)
int VIVANTE_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode)
int VIVANTE_VideoInit(_THIS)
void VIVANTE_ShowWindow(_THIS, SDL_Window *window)
SDL_bool VIVANTE_GetWindowWMInfo(_THIS, SDL_Window *window, struct SDL_SysWMinfo *info)
void VIVANTE_SetWindowTitle(_THIS, SDL_Window *window)
void VIVANTE_HideWindow(_THIS, SDL_Window *window)
int VIVANTE_CreateWindow(_THIS, SDL_Window *window)
void VIVANTE_DestroyWindow(_THIS, SDL_Window *window)
void VIVANTE_GetDisplayModes(_THIS, SDL_VideoDisplay *display)
EGLSurface EGLNativeWindowType * window
#define SDL_INPUT_LINUXEV
static SDL_AudioDeviceID device
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 skip1(dst_w_bpp<=(lowbit *8)) &&((lowbit *8)<(pixblock_size *dst_w_bpp)) .if lowbit< 16 tst DST_R
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
The structure that defines a display mode.
union SDL_SysWMinfo::@10 info
SDL_DisplayMode desktop_mode
SDL_DisplayMode current_mode
The type used to identify a window.