0007-sdl-patches.patch 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. diff --git a/package/sdl/0003-add-SDL_NOKBD.patch b/package/sdl/0003-add-SDL_NOKBD.patch
  2. new file mode 100644
  3. index 0000000..d944555
  4. --- /dev/null
  5. +++ b/package/sdl/0003-add-SDL_NOKBD.patch
  6. @@ -0,0 +1,55 @@
  7. +diff --git a/src/video/fbcon/SDL_fbvideo.c b/src/video/fbcon/SDL_fbvideo.c
  8. +index 5e58809..81830b6 100644
  9. +--- a/src/video/fbcon/SDL_fbvideo.c
  10. ++++ b/src/video/fbcon/SDL_fbvideo.c
  11. +@@ -793,9 +793,11 @@ static int FB_VideoInit(_THIS, SDL_PixelFormat *vformat)
  12. + }
  13. +
  14. + /* Enable mouse and keyboard support */
  15. +- if ( FB_OpenKeyboard(this) < 0 ) {
  16. +- FB_VideoQuit(this);
  17. +- return(-1);
  18. ++ if (!SDL_getenv("SDL_NOKBD")){
  19. ++ if ( FB_OpenKeyboard(this) < 0 ) {
  20. ++ FB_VideoQuit(this);
  21. ++ return(-1);
  22. ++ }
  23. + }
  24. + if ( FB_OpenMouse(this) < 0 ) {
  25. + const char *sdl_nomouse;
  26. +@@ -944,7 +946,7 @@ static SDL_Surface *FB_SetVGA16Mode(_THIS, SDL_Surface *current,
  27. +
  28. + /* Set the terminal into graphics mode */
  29. + if ( FB_EnterGraphicsMode(this) < 0 ) {
  30. +- return(NULL);
  31. ++ if (!SDL_getenv("SDL_NOKBD")) return(NULL);
  32. + }
  33. +
  34. + /* Restore the original palette */
  35. +@@ -1009,7 +1011,7 @@ static SDL_Surface *FB_SetVideoMode(_THIS, SDL_Surface *current,
  36. +
  37. + /* Set the terminal into graphics mode */
  38. + if ( FB_EnterGraphicsMode(this) < 0 ) {
  39. +- return(NULL);
  40. ++ if (!SDL_getenv("SDL_NOKBD")) return(NULL);
  41. + }
  42. +
  43. + /* Restore the original palette */
  44. +@@ -1919,7 +1921,7 @@ static void FB_VideoQuit(_THIS)
  45. + SDL_memcpy(flip_address[0], flip_address[1], this->screen->pitch * this->screen->h);
  46. + }
  47. +
  48. +- if ( !dontClearPixels && this->screen->pixels && FB_InGraphicsMode(this) ) {
  49. ++ if ( (!dontClearPixels && this->screen->pixels && FB_InGraphicsMode(this)) || SDL_getenv("SDL_NOKBD") ) {
  50. + #if defined(__powerpc__) || defined(__ia64__) /* SIGBUS when using SDL_memset() ?? */
  51. + Uint8 *rowp = (Uint8 *)this->screen->pixels;
  52. + int left = this->screen->pitch*this->screen->h;
  53. +@@ -1968,7 +1970,7 @@ static void FB_VideoQuit(_THIS)
  54. + }
  55. +
  56. + /* Restore the original video mode and palette */
  57. +- if ( FB_InGraphicsMode(this) ) {
  58. ++ if ( FB_InGraphicsMode(this) || SDL_getenv("SDL_NOKBD") ) {
  59. + FB_RestorePalette(this);
  60. + ioctl(console_fd, FBIOPUT_VSCREENINFO, &saved_vinfo);
  61. + }
  62. diff --git a/package/sdl/0004-sdl-fbdev-blit32.patch b/package/sdl/0004-sdl-fbdev-blit32.patch
  63. new file mode 100644
  64. index 0000000..e06a57a
  65. --- /dev/null
  66. +++ b/package/sdl/0004-sdl-fbdev-blit32.patch
  67. @@ -0,0 +1,99 @@
  68. +diff --git a/src/video/fbcon/SDL_fbvideo.c b/src/video/fbcon/SDL_fbvideo.c
  69. +index 81830b6..1399140 100644
  70. +--- a/src/video/fbcon/SDL_fbvideo.c
  71. ++++ b/src/video/fbcon/SDL_fbvideo.c
  72. +@@ -165,6 +165,10 @@ static void FB_RestorePalette(_THIS);
  73. + static FB_bitBlit FB_blit16;
  74. + static FB_bitBlit FB_blit16blocked;
  75. +
  76. ++static FB_bitBlit FB_blit32;
  77. ++static FB_bitBlit FB_blit32blocked;
  78. ++
  79. ++
  80. + static int SDL_getpagesize(void)
  81. + {
  82. + #ifdef HAVE_GETPAGESIZE
  83. +@@ -1119,6 +1123,10 @@ static SDL_Surface *FB_SetVideoMode(_THIS, SDL_Surface *current,
  84. + blitFunc = (rotate == FBCON_ROTATE_NONE ||
  85. + rotate == FBCON_ROTATE_UD) ?
  86. + FB_blit16 : FB_blit16blocked;
  87. ++ } else if (vinfo.bits_per_pixel == 32) {
  88. ++ blitFunc = (rotate == FBCON_ROTATE_NONE ||
  89. ++ rotate == FBCON_ROTATE_UD) ?
  90. ++ FB_blit32 : FB_blit32blocked;
  91. + } else {
  92. + #ifdef FBCON_DEBUG
  93. + fprintf(stderr, "Init vinfo:\n");
  94. +@@ -1495,6 +1503,57 @@ static void FB_blit16blocked(Uint8 *byte_src_pos, int src_right_delta, int src_d
  95. + }
  96. + }
  97. +
  98. ++static void FB_blit32(Uint8 *byte_src_pos, int src_right_delta, int src_down_delta,
  99. ++ Uint8 *byte_dst_pos, int dst_linebytes, int width, int height)
  100. ++{
  101. ++ int w;
  102. ++ Uint32 *src_pos = (Uint32 *)byte_src_pos;
  103. ++ Uint32 *dst_pos = (Uint32 *)byte_dst_pos;
  104. ++
  105. ++ while (height) {
  106. ++ Uint32 *src = src_pos;
  107. ++ Uint32 *dst = dst_pos;
  108. ++ for (w = width; w != 0; w--) {
  109. ++ *dst = *src;
  110. ++ src += src_right_delta;
  111. ++ dst++;
  112. ++ }
  113. ++ dst_pos = (Uint32 *)((Uint8 *)dst_pos + dst_linebytes);
  114. ++ src_pos += src_down_delta;
  115. ++ height--;
  116. ++ }
  117. ++}
  118. ++
  119. ++#define BLOCKSIZE_W 32
  120. ++#define BLOCKSIZE_H 32
  121. ++
  122. ++static void FB_blit32blocked(Uint8 *byte_src_pos, int src_right_delta, int src_down_delta,
  123. ++ Uint8 *byte_dst_pos, int dst_linebytes, int width, int height)
  124. ++{
  125. ++ int w;
  126. ++ Uint32 *src_pos = (Uint32 *)byte_src_pos;
  127. ++ Uint32 *dst_pos = (Uint32 *)byte_dst_pos;
  128. ++
  129. ++ while (height > 0) {
  130. ++ Uint32 *src = src_pos;
  131. ++ Uint32 *dst = dst_pos;
  132. ++ for (w = width; w > 0; w -= BLOCKSIZE_W) {
  133. ++ FB_blit32((Uint8 *)src,
  134. ++ src_right_delta,
  135. ++ src_down_delta,
  136. ++ (Uint8 *)dst,
  137. ++ dst_linebytes,
  138. ++ min(w, BLOCKSIZE_W),
  139. ++ min(height, BLOCKSIZE_H));
  140. ++ src += src_right_delta * BLOCKSIZE_W;
  141. ++ dst += BLOCKSIZE_W;
  142. ++ }
  143. ++ dst_pos = (Uint32 *)((Uint8 *)dst_pos + dst_linebytes * BLOCKSIZE_H);
  144. ++ src_pos += src_down_delta * BLOCKSIZE_H;
  145. ++ height -= BLOCKSIZE_H;
  146. ++ }
  147. ++}
  148. ++
  149. + static void FB_DirectUpdate(_THIS, int numrects, SDL_Rect *rects)
  150. + {
  151. + int width = cache_vinfo.xres;
  152. +@@ -1507,10 +1566,10 @@ static void FB_DirectUpdate(_THIS, int numrects, SDL_Rect *rects)
  153. + return;
  154. + }
  155. +
  156. +- if (cache_vinfo.bits_per_pixel != 16) {
  157. +- SDL_SetError("Shadow copy only implemented for 16 bpp");
  158. +- return;
  159. +- }
  160. ++// if (cache_vinfo.bits_per_pixel != 16) {
  161. ++// SDL_SetError("Shadow copy only implemented for 16 bpp");
  162. ++// return;
  163. ++// }
  164. +
  165. + for (i = 0; i < numrects; i++) {
  166. + int x1, y1, x2, y2;
  167. diff --git a/package/sdl/Config.in b/package/sdl/Config.in
  168. index 9f1e34d..65ac8a2 100644
  169. --- a/package/sdl/Config.in
  170. +++ b/package/sdl/Config.in
  171. @@ -17,6 +17,10 @@ config BR2_PACKAGE_SDL_DIRECTFB
  172. bool "SDL DirectFB video driver"
  173. depends on BR2_PACKAGE_DIRECTFB
  174. +config BR2_PACKAGE_SDL_QTOPIA
  175. + bool "SDL Qtopia video driver"
  176. + depends on BR2_PACKAGE_QT
  177. +
  178. config BR2_PACKAGE_SDL_X11
  179. bool "SDL X11 video driver"
  180. depends on BR2_PACKAGE_XORG7
  181. diff --git a/package/sdl/sdl.hash b/package/sdl/sdl.hash
  182. index 2c46975..ad59b90 100644
  183. --- a/package/sdl/sdl.hash
  184. +++ b/package/sdl/sdl.hash
  185. @@ -1,4 +1,2 @@
  186. # Locally calculated after checking pgp signature
  187. sha256 d6d316a793e5e348155f0dd93b979798933fb98aa1edebcc108829d6474aad00 SDL-1.2.15.tar.gz
  188. -# Locally computed
  189. -sha256 bb117c0fbd7f57f64170b690285d7df07c2371b578e3b3cd3aa2e1155ef461a0 COPYING
  190. diff --git a/package/sdl/sdl.mk b/package/sdl/sdl.mk
  191. index 7389cd3..38b4b97 100644
  192. --- a/package/sdl/sdl.mk
  193. +++ b/package/sdl/sdl.mk
  194. @@ -7,10 +7,8 @@
  195. SDL_VERSION = 1.2.15
  196. SDL_SOURCE = SDL-$(SDL_VERSION).tar.gz
  197. SDL_SITE = http://www.libsdl.org/release
  198. -SDL_LICENSE = LGPL-2.1+
  199. +SDL_LICENSE = LGPLv2.1+
  200. SDL_LICENSE_FILES = COPYING
  201. -SDL_CPE_ID_VENDOR = libsdl
  202. -SDL_CPE_ID_PRODUCT = simple_directmedia_layer
  203. SDL_INSTALL_STAGING = YES
  204. # we're patching configure.in, but package cannot autoreconf with our version of
  205. @@ -25,8 +23,6 @@ HOST_SDL_PRE_CONFIGURE_HOOKS += SDL_RUN_AUTOGEN
  206. SDL_DEPENDENCIES += host-automake host-autoconf host-libtool
  207. HOST_SDL_DEPENDENCIES += host-automake host-autoconf host-libtool
  208. -SDL_CONF_OPTS += --enable-video-qtopia=no
  209. -
  210. ifeq ($(BR2_PACKAGE_SDL_FBCON),y)
  211. SDL_CONF_OPTS += --enable-video-fbcon=yes
  212. else
  213. @@ -41,6 +37,13 @@ else
  214. SDL_CONF_OPTS += --enable-video-directfb=no
  215. endif
  216. +ifeq ($(BR2_PACKAGE_SDL_QTOPIA),y)
  217. +SDL_CONF_OPTS += --enable-video-qtopia=yes
  218. +SDL_DEPENDENCIES += qt
  219. +else
  220. +SDL_CONF_OPTS += --enable-video-qtopia=no
  221. +endif
  222. +
  223. ifeq ($(BR2_PACKAGE_SDL_X11),y)
  224. SDL_CONF_OPTS += --enable-video-x11=yes
  225. SDL_DEPENDENCIES += \