Fix software rendering in the mir backend. The window assumed hardware buffer, which caused testdrawchessboard to fail to mmap a buffer.
authorBrandon Schaefer <brandon.schaefer@canonical.com>
Fri, 02 May 2014 12:33:19 -0700
changeset 8749f34996d809b7
parent 8748 7ba9c0a0cad7
child 8750 5064096ddaf7
Fix software rendering in the mir backend. The window assumed hardware buffer, which caused testdrawchessboard to fail to mmap a buffer.
src/video/mir/SDL_mirframebuffer.c
src/video/mir/SDL_mirvideo.c
src/video/mir/SDL_mirvideo.h
src/video/mir/SDL_mirwindow.c
src/video/mir/SDL_mirwindow.h
     1.1 --- a/src/video/mir/SDL_mirframebuffer.c	Wed Apr 30 21:12:47 2014 -0400
     1.2 +++ b/src/video/mir/SDL_mirframebuffer.c	Fri May 02 12:33:19 2014 -0700
     1.3 @@ -56,6 +56,8 @@
     1.4      MIR_Window* mir_window;
     1.5      MirSurfaceParameters surfaceparm;
     1.6  
     1.7 +    mir_data->software = SDL_TRUE;
     1.8 +
     1.9      if (MIR_CreateWindow(_this, window) < 0)
    1.10          return SDL_SetError("Failed to created a mir window.");
    1.11  
     2.1 --- a/src/video/mir/SDL_mirvideo.c	Wed Apr 30 21:12:47 2014 -0400
     2.2 +++ b/src/video/mir/SDL_mirvideo.c	Fri May 02 12:33:19 2014 -0700
     2.3 @@ -273,6 +273,7 @@
     2.4      MIR_Data* mir_data = _this->driverdata;
     2.5  
     2.6      mir_data->connection = MIR_mir_connect_sync(NULL, __PRETTY_FUNCTION__);
     2.7 +    mir_data->software = SDL_FALSE;
     2.8  
     2.9      if (!MIR_mir_connection_is_valid(mir_data->connection))
    2.10          return SDL_SetError("Failed to connect to the Mir Server");
     3.1 --- a/src/video/mir/SDL_mirvideo.h	Wed Apr 30 21:12:47 2014 -0400
     3.2 +++ b/src/video/mir/SDL_mirvideo.h	Fri May 02 12:33:19 2014 -0700
     3.3 @@ -32,6 +32,8 @@
     3.4  typedef struct
     3.5  {
     3.6      MirConnection* connection;
     3.7 +    SDL_bool software;
     3.8 +    
     3.9  } MIR_Data;
    3.10  
    3.11  #endif /* _SDL_mirvideo_h_ */
     4.1 --- a/src/video/mir/SDL_mirwindow.c	Wed Apr 30 21:12:47 2014 -0400
     4.2 +++ b/src/video/mir/SDL_mirwindow.c	Fri May 02 12:33:19 2014 -0700
     4.3 @@ -99,6 +99,9 @@
     4.4      mir_data = _this->driverdata;
     4.5      window->driverdata = mir_window;
     4.6  
     4.7 +    if (mir_data->software)
     4.8 +        surfaceparm.buffer_usage = mir_buffer_usage_software;
     4.9 +
    4.10      if (window->x == SDL_WINDOWPOS_UNDEFINED)
    4.11          window->x = 0;
    4.12  
     5.1 --- a/src/video/mir/SDL_mirwindow.h	Wed Apr 30 21:12:47 2014 -0400
     5.2 +++ b/src/video/mir/SDL_mirwindow.h	Fri May 02 12:33:19 2014 -0700
     5.3 @@ -34,6 +34,7 @@
     5.4  typedef struct {
     5.5      SDL_Window* sdl_window;
     5.6      MIR_Data* mir_data;
     5.7 +    bool software;
     5.8  
     5.9      MirSurface* surface;
    5.10      EGLSurface egl_surface;