comparison src/video/fbcon/SDL_fbmatrox.c @ 109:5a9c36a45db1

Fixed switching away from the SDL at the framebuffer console
author Sam Lantinga <slouken@lokigames.com>
date Sat, 14 Jul 2001 19:10:06 +0000
parents 63ec24e0575f
children e8157fcb3114
comparison
equal deleted inserted replaced
108:e021a4c9e25f 109:5a9c36a45db1
72 int dstX, dstY; 72 int dstX, dstY;
73 Uint32 fxbndry; 73 Uint32 fxbndry;
74 Uint32 ydstlen; 74 Uint32 ydstlen;
75 Uint32 fillop; 75 Uint32 fillop;
76 76
77 /* Don't blit to the display surface when switched away */
78 if ( dst == this->screen ) {
79 SDL_mutexP(hw_lock);
80 }
81
77 switch (dst->format->BytesPerPixel) { 82 switch (dst->format->BytesPerPixel) {
78 case 1: 83 case 1:
79 color |= (color<<8); 84 color |= (color<<8);
80 case 2: 85 case 2:
81 color |= (color<<16); 86 color |= (color<<16);
106 mga_out32(MGAREG_FXBNDRY, fxbndry); 111 mga_out32(MGAREG_FXBNDRY, fxbndry);
107 mga_out32(MGAREG_YDSTLEN + MGAREG_EXEC, ydstlen); 112 mga_out32(MGAREG_YDSTLEN + MGAREG_EXEC, ydstlen);
108 113
109 FB_AddBusySurface(dst); 114 FB_AddBusySurface(dst);
110 115
116 if ( dst == this->screen ) {
117 SDL_mutexV(hw_lock);
118 }
111 return(0); 119 return(0);
112 } 120 }
113 121
114 static int HWAccelBlit(SDL_Surface *src, SDL_Rect *srcrect, 122 static int HWAccelBlit(SDL_Surface *src, SDL_Rect *srcrect,
115 SDL_Surface *dst, SDL_Rect *dstrect) 123 SDL_Surface *dst, SDL_Rect *dstrect)
116 { 124 {
117 SDL_VideoDevice *this; 125 SDL_VideoDevice *this = current_video;
118 int pitch, w, h; 126 int pitch, w, h;
119 int srcX, srcY; 127 int srcX, srcY;
120 int dstX, dstY; 128 int dstX, dstY;
121 Uint32 sign; 129 Uint32 sign;
122 Uint32 start, stop; 130 Uint32 start, stop;
126 /* FIXME: For now, only blit to display surface */ 134 /* FIXME: For now, only blit to display surface */
127 if ( dst->pitch != SDL_VideoSurface->pitch ) { 135 if ( dst->pitch != SDL_VideoSurface->pitch ) {
128 return(src->map->sw_blit(src, srcrect, dst, dstrect)); 136 return(src->map->sw_blit(src, srcrect, dst, dstrect));
129 } 137 }
130 138
139 /* Don't blit to the display surface when switched away */
140 if ( dst == this->screen ) {
141 SDL_mutexP(hw_lock);
142 }
143
131 /* Calculate source and destination base coordinates (in pixels) */ 144 /* Calculate source and destination base coordinates (in pixels) */
132 this = current_video;
133 w = dstrect->w; 145 w = dstrect->w;
134 h = dstrect->h; 146 h = dstrect->h;
135 FB_dst_to_xy(this, src, &srcX, &srcY); 147 FB_dst_to_xy(this, src, &srcX, &srcY);
136 FB_dst_to_xy(this, dst, &dstX, &dstY); 148 FB_dst_to_xy(this, dst, &dstX, &dstY);
137 149
199 mga_out32(MGAREG_DWGCTL + MGAREG_EXEC, blitop); 211 mga_out32(MGAREG_DWGCTL + MGAREG_EXEC, blitop);
200 212
201 FB_AddBusySurface(src); 213 FB_AddBusySurface(src);
202 FB_AddBusySurface(dst); 214 FB_AddBusySurface(dst);
203 215
216 if ( dst == this->screen ) {
217 SDL_mutexV(hw_lock);
218 }
204 return(0); 219 return(0);
205 } 220 }
206 221
207 static int CheckHWBlit(_THIS, SDL_Surface *src, SDL_Surface *dst) 222 static int CheckHWBlit(_THIS, SDL_Surface *src, SDL_Surface *dst)
208 { 223 {