Rev 868 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 868 | Rev 876 | ||
---|---|---|---|
Line 1... | Line -... | ||
1 | #define BRUSH_MONO (0<<4) |
- | |
2 | - | ||
Line 3... | Line 1... | ||
3 | 1 | int DrawRect(draw_t* draw) |
|
4 | int DrawRect(draw_t* draw) |
2 | { |
5 | { |
3 | int x0, y0, x1, y1; |
Line 6... | Line 4... | ||
6 | int x0, y0, x1, y1; |
4 | |
- | 5 | local_pixmap_t *dstpixmap; |
|
Line 7... | Line 6... | ||
7 | 6 | clip_t dst_clip; |
|
Line 8... | Line 7... | ||
8 | pixmap_t *dstpixmap; |
7 | |
9 | 8 | dstpixmap = (draw->dstpix == (void*)-1) ? &scr_pixmap : draw->dstpix ; |
|
Line 10... | Line 9... | ||
10 | dstpixmap = (draw->dstpix == (void*)-1) ? &scr_pixmap : draw->dstpix ; |
9 | |
11 | 10 | x0 = draw->x0; |
|
Line -... | Line 11... | ||
- | 11 | y0 = draw->y0; |
|
- | 12 | ||
- | 13 | x1 = x0+draw->w-1; |
|
- | 14 | y1 = y0+draw->h-1; |
|
- | 15 | ||
- | 16 | dst_clip.xmin = 0; |
|
12 | x0 = draw->x; |
17 | dst_clip.ymin = 0; |
13 | y0 = draw->y; |
18 | dst_clip.xmax = dstpixmap->width-1; |
Line 14... | Line 19... | ||
14 | 19 | dst_clip.ymax = dstpixmap->height-1; |
|
15 | x1 = x0+draw->w-1; |
20 | |
16 | y1 = y0+draw->h-1; |
21 | |
- | 22 | // dbgprintf("draw rect x0:%d, y0:%d, x1:%d, y1:%d, color: %x\n", |
|
17 | 23 | // x0, y0, x1, y1, draw->color); |
|
18 | // dbgprintf("draw rect x0:%d, y0:%d, x1:%d, y1:%d, color: %x\n", |
- | |
Line 19... | Line 24... | ||
19 | // x0, y0, x1, y1, draw->color); |
24 | |
20 | 25 | if( ! BlockClip( &dst_clip, &x0, &y0, &x1, &y1)) |
|
Line 21... | Line 26... | ||
21 | if( ! BlockClip( &x0, &y0, &x1, &y1)) |
26 | { |
Line 22... | Line -... | ||
22 | { |
- | |
23 | u32 *ring, write; |
27 | u32_t *ring, write; |
Line 24... | Line 28... | ||
24 | int w, h; |
28 | u32_t ifl; |
Line 25... | Line 29... | ||
25 | u32 ifl; |
29 | int w, h; |
- | 30 | ||
- | 31 | w = x1-x0+1; |
|
26 | 32 | h = y1-y0+1; |
|
27 | w = x1-x0+1; |
33 | |
- | 34 | ifl = safe_cli(); |
|
- | 35 | ||
- | 36 | #if R300_PIO |
|
Line 28... | Line 37... | ||
28 | h = y1-y0+1; |
37 | |
29 | - | ||
30 | ifl = safe_cli(); |
38 | R5xxFIFOWait(6); |
31 | 39 | ||
32 | 40 | OUTREG(R5XX_DP_GUI_MASTER_CNTL, |
|
33 | #if R300_PIO |
41 | rhd.gui_control | |
34 | - | ||
35 | R5xxFIFOWait(7); |
42 | R5XX_ROP3_P | |
36 | - | ||
37 | OUTREG(R5XX_DP_GUI_MASTER_CNTL, rhd.gui_control | R5XX_ROP3_P | |
43 | R5XX_GMC_BRUSH_SOLID_COLOR | |
38 | R5XX_GMC_BRUSH_SOLID_COLOR | |
44 | R5XX_GMC_SRC_DATATYPE_COLOR | |
Line 39... | Line 45... | ||
39 | R5XX_GMC_SRC_DATATYPE_COLOR); |
45 | R5XX_GMC_CLR_CMP_CNTL_DIS | |
40 | 46 | R5XX_GMC_WR_MSK_DIS |
|
41 | OUTREG(R5XX_DP_BRUSH_FRGD_CLR, draw->color); |
47 | ); |
42 | OUTREG(R5XX_DP_WRITE_MASK, 0xFFFFFFFF); |
48 | |
- | 49 | OUTREG(R5XX_DP_BRUSH_FRGD_CLR, draw->color); |
|
- | 50 | OUTREG(R5XX_DP_CNTL, R5XX_DST_X_LEFT_TO_RIGHT | R5XX_DST_Y_TOP_TO_BOTTOM); |
|
43 | OUTREG(R5XX_DP_CNTL, R5XX_DST_X_LEFT_TO_RIGHT | R5XX_DST_Y_TOP_TO_BOTTOM); |
51 | OUTREG(R5XX_DST_PITCH_OFFSET, dstpixmap->pitch_offset); |
- | 52 | OUTREG(R5XX_DST_Y_X,(draw->y0<<16)|draw->x0); |
|
Line 44... | Line 53... | ||
44 | OUTREG(R5XX_DST_PITCH_OFFSET, dstpixmap->pitch_offset); |
53 | OUTREG(R5XX_DST_WIDTH_HEIGHT,(w<<16)|h); |
45 | OUTREG(R5XX_DST_Y_X,(y0<<16)|x0); |
54 | #else |
46 | OUTREG(R5XX_DST_WIDTH_HEIGHT,(w<<16)|h); |
55 | BEGIN_RING(); |
47 | 56 | OUT_RING(CP_PACKET3(RADEON_CNTL_PAINT_MULTI, 4)); |
|
48 | #else |
57 | |
49 | - | ||
50 | BEGIN_RING(); |
58 | OUT_RING(RADEON_GMC_DST_PITCH_OFFSET_CNTL | |
51 | OUT_RING(CP_PACKET3(RADEON_CNTL_PAINT_MULTI, 4)); |
- | |
52 | 59 | RADEON_GMC_BRUSH_SOLID_COLOR | |
|
53 | OUT_RING(RADEON_GMC_DST_PITCH_OFFSET_CNTL | |
60 | RADEON_GMC_DST_32BPP | |
54 | RADEON_GMC_BRUSH_SOLID_COLOR | |
61 | RADEON_GMC_SRC_DATATYPE_COLOR | |
55 | RADEON_GMC_DST_32BPP | |
62 | R5XX_GMC_CLR_CMP_CNTL_DIS | |
Line 56... | Line 63... | ||
56 | RADEON_GMC_SRC_DATATYPE_COLOR | |
63 | R5XX_GMC_WR_MSK_DIS | |
57 | (1 << 28)+(1 << 30) | R5XX_ROP3_P); |
64 | R5XX_ROP3_P |
58 | 65 | ); |
|
- | 66 | ||
59 | OUT_RING(dstpixmap->pitch_offset); |
67 | OUT_RING(dstpixmap->pitch_offset); |
Line 60... | Line 68... | ||
60 | OUT_RING(draw->color); |
68 | OUT_RING(draw->color); |
Line 61... | Line 69... | ||
61 | OUT_RING((x0<<16)|y0); |
69 | OUT_RING((draw->x0<<16)|y0); |
62 | OUT_RING((w<<16)|h); |
70 | OUT_RING((w<<16)|h); |
Line 63... | Line 71... | ||
63 | COMMIT_RING(); |
71 | COMMIT_RING(); |
64 | 72 | #endif |
|
Line -... | Line 73... | ||
- | 73 | safe_sti(ifl); |
|
- | 74 | }; |
|
- | 75 | return ERR_OK; |
|
- | 76 | } |
|
- | 77 | ||
65 | #endif |
78 | int FillRect(fill_t *fill) |
66 | 79 | { |
|
Line 67... | Line 80... | ||
67 | safe_sti(ifl); |
80 | local_pixmap_t *dstpixmap; |
68 | } ; |
81 | clip_t dst_clip; |
69 | return ERR_OK; |
82 | int x0, y0, x1, y1; |
70 | } |
- | |
71 | - | ||
72 | int FillRect(fill_t *fill) |
83 | |
Line 73... | Line 84... | ||
73 | { |
84 | dstpixmap = (fill->dstpix == (void*)-1) ? &scr_pixmap : fill->dstpix ; |
Line -... | Line 85... | ||
- | 85 | ||
- | 86 | x0 = fill->x; |
|
- | 87 | y0 = fill->y; |
|
- | 88 | ||
74 | pixmap_t *dstpixmap; |
89 | x1 = x0+fill->w-1; |
- | 90 | y1 = y0+fill->h-1; |
|
- | 91 | ||
- | 92 | dst_clip.xmin = 0; |
|
- | 93 | dst_clip.ymin = 0; |
|
- | 94 | dst_clip.xmax = dstpixmap->width-1; |
|
- | 95 | dst_clip.ymax = dstpixmap->height-1; |
|
- | 96 | ||
- | 97 | // dbgprintf("fill rect x0:%d, y0:%d, x1:%d, y1:%d\n", |
|
- | 98 | // x0, y0, x1, y1); |
|
- | 99 | ||
- | 100 | if( ! BlockClip(&dst_clip, &x0, &y0, &x1, &y1)) |
|
- | 101 | { |
|
Line -... | Line 102... | ||
- | 102 | u32_t *ring, write; |
|
- | 103 | u32_t ifl = safe_cli(); |
|
- | 104 | ||
- | 105 | #if R300_PIO |
|
- | 106 | ||
- | 107 | int w = x1-x0+1; |
|
- | 108 | int h = y1-y0+1; |
|
- | 109 | ||
- | 110 | R5xxFIFOWait(9); |
|
75 | int x0, y0, x1, y1; |
111 | |
76 | 112 | OUTREG(R5XX_DP_GUI_MASTER_CNTL, |
|
77 | dstpixmap = (fill->dstpix == (void*)-1) ? &scr_pixmap : fill->dstpix ; |
113 | RADEON_GMC_DST_PITCH_OFFSET_CNTL | |
78 | 114 | R5XX_GMC_BRUSH_8X8_MONO_FG_BG | |
|
79 | x0 = fill->x; |
115 | RADEON_GMC_DST_32BPP | |
80 | y0 = fill->y; |
116 | R5XX_GMC_SRC_DATATYPE_COLOR | |
- | 117 | R5XX_GMC_CLR_CMP_CNTL_DIS | |
|
- | 118 | R5XX_GMC_WR_MSK_DIS | |
|
81 | 119 | R5XX_ROP3_P |
|
- | 120 | ); |
|
Line 82... | Line 121... | ||
82 | x1 = x0+fill->w-1; |
121 | |
83 | y1 = y0+fill->h-1; |
122 | OUTREG(R5XX_DP_BRUSH_BKGD_CLR, fill->bkcolor); |
84 | 123 | OUTREG(R5XX_DP_BRUSH_FRGD_CLR, fill->fcolor); |
|
Line 115... | Line 154... | ||
115 | OUT_RING((y1<<16)|x1); |
154 | COMMIT_RING(); |
116 | COMMIT_RING(); |
155 | |
117 | 156 | #endif |
|
Line 118... | Line 157... | ||
118 | #endif |
157 | safe_sti(ifl); |
119 | - | ||
120 | safe_sti(ifl); |
158 | }; |
121 | }; |
159 | return ERR_OK; |
122 | return ERR_OK; |
160 | }; |
123 | } |
161 | |
Line -... | Line 162... | ||
- | 162 | #if 0 |
|
124 | 163 | int Blit(blit_t *blit) |
|
125 | int Blit(blit_t *blit) |
164 | { |
126 | { |
165 | int x0, y0, x1, y1; |
Line 127... | Line 166... | ||
127 | int x0, y0, x1, y1; |
166 | |
Line 132... | Line 171... | ||
132 | x1 = x0+blit->w-1; |
171 | y1 = y0+blit->h-1; |
133 | y1 = y0+blit->h-1; |
172 | |
Line 134... | Line 173... | ||
134 | 173 | ||
135 | 174 | if( ! BlockClip(&clip, &x0, &y0, &x1, &y1)) |
|
136 | if( ! BlockClip( &x0, &y0, &x1, &y1)) |
175 | { |
137 | { |
176 | u32 *ring, write; |
138 | u32 *ring, write; |
177 | int w, h; |
Line 174... | Line 213... | ||
174 | } ; |
213 | return ERR_OK; |
175 | return ERR_OK; |
214 | } |
176 | } |
215 | |
177 | 216 | int Line2P(draw_t *draw) |
|
Line 178... | Line 217... | ||
178 | int Line2P(line2p_t *draw) |
217 | { |
179 | { |
218 | local_pixmap_t *dstpixmap; |
180 | - | ||
- | 219 | int x0, y0, x1, y1; |
|
181 | int x0, y0, x1, y1; |
220 | |
Line -... | Line 221... | ||
- | 221 | dstpixmap = (draw->dstpix == (void*)-1) ? &scr_pixmap : draw->dstpix ; |
|
- | 222 | ||
182 | 223 | x0 = draw->x0; |
|
183 | x0 = draw->x0; |
224 | y0 = draw->y0; |
Line 184... | Line 225... | ||
184 | y0 = draw->y0; |
225 | |
185 | 226 | x1 = draw->x1; |
|
Line 186... | Line 227... | ||
186 | x1 = draw->x1; |
227 | y1 = draw->y1; |
187 | y1 = draw->y1; |
228 | |
188 | 229 | if ( !LineClip(&clip, &x0, &y0, &x1, &y1 )) |
|
189 | if ( !LineClip( &x0, &y0, &x1, &y1 )) |
230 | { |
Line 190... | Line 231... | ||
190 | { |
231 | u32 efl; |
Line 191... | Line 232... | ||
191 | u32 ifl; |
232 | u32 *ring, write; |
Line 192... | Line 233... | ||
192 | u32 *ring, write; |
233 | |
Line 232... | Line 273... | ||
232 | OUT_RING((y1<<16)|x1); |
273 | COMMIT_RING(); |
233 | COMMIT_RING(); |
274 | |
234 | 275 | #endif |
|
Line 235... | Line 276... | ||
235 | #endif |
276 | safe_sti(efl); |
236 | safe_sti(ifl); |
277 | |
Line 237... | Line 278... | ||
237 | 278 | }; |
|
238 | }; |
279 | return ERR_OK; |
239 | return ERR_OK; |
280 | } |
- | 281 | #endif |
|
Line 240... | Line -... | ||
240 | } |
- | |
241 | 282 | ||
242 | 283 | int CreatePixmap(pixmap_t *io) |
|
- | 284 | { |
|
Line -... | Line 285... | ||
- | 285 | local_pixmap_t *pixmap; |
|
243 | int CreatePixmap(userpixmap_t *io) |
286 | |
Line 244... | Line -... | ||
244 | { |
- | |
245 | 287 | unsigned pitch; |
|
Line 246... | Line 288... | ||
246 | pixmap_t *pixmap; |
288 | size_t size; |
247 | 289 | ||
248 | u32_t pitch; |
290 | void *local; |
249 | void *raw; |
291 | |
250 | 292 | if( (io->width == 0) || (io->width > 2048)|| |
|
251 | if( (io->width == 0) || (io->width > 2048)|| |
- | |
252 | (io->height == 0)|| (io->height > 2048)) |
293 | (io->height == 0)|| (io->height > 2048)) |
Line 253... | Line 294... | ||
253 | { |
294 | { |
- | 295 | dbgprintf("Invalid pixmap size w:%d h:%d\n", io->width,io->height); |
|
- | 296 | return ERR_PARAM; |
|
254 | dbgprintf("Invalid pixmap size w:%d h:%d\n", io->width,io->height); |
297 | }; |
Line 255... | Line 298... | ||
255 | return ERR_PARAM; |
298 | |
256 | 299 | pitch = ((io->width+15)&~15)*4; |
|
257 | }; |
300 | size = pitch*io->height; |
258 | 301 | ||
259 | pitch = ((io->width+15)&~15)*4; |
302 | dbgprintf("pitch = %d\n", pitch); |
260 | dbgprintf("pitch = %d\n", pitch); |
303 | |
Line 261... | Line 304... | ||
261 | 304 | local = rhd_mem_alloc(&rhd,RHD_MEM_FB,size) ; |
|
262 | raw = rhd_mem_alloc(&rhd,RHD_MEM_FB,pitch*io->height) ; |
305 | if ( !local) |
263 | if (! raw) |
306 | { |
264 | { |
307 | dbgprintf("Not enough memory for pixmap\n"); |
265 | dbgprintf("Not enough memory for pixmap\n"); |
308 | return ERR_PARAM; |
266 | return ERR_PARAM; |
309 | }; |
267 | }; |
310 | |
268 | 311 | pixmap = malloc(sizeof(local_pixmap_t)); |
|
269 | pixmap = malloc(sizeof(pixmap_t)); |
312 | if(!pixmap) |
- | 313 | { |
|
270 | if(!pixmap) |
314 | rhd_mem_free(&rhd, RHD_MEM_FB,local); |
- | 315 | return ERR_PARAM; |
|
271 | { |
316 | } |
- | 317 | else |
|
- | 318 | { |
|
- | 319 | void *mapped; |
|
- | 320 | ||
272 | rhd_mem_free(&rhd, RHD_MEM_FB,raw); |
321 | size = (size+4095) & ~ 4095; |
- | 322 | ||
Line 273... | Line 323... | ||
273 | return ERR_PARAM; |
323 | if (mapped = UserAlloc(size)) |
274 | } |
324 | { |
275 | else |
325 | CommitPages(mapped, ((u32_t)local+rhd.PhisBase)|7|(1<<9), size); |
276 | { |
326 | |
277 | io->pixmap = pixmap; |
327 | io->mapped = mapped; |
278 | io->usermap = NULL; |
328 | io->pitch = pitch; |
279 | io->format = PICT_a8r8g8b8; |
329 | io->handle = (u32_t)pixmap; |
280 | io->pitch = 0; |
330 | |
281 | - | ||
Line 282... | Line 331... | ||
282 | pixmap->width = io->width; |
331 | pixmap->width = io->width; |
283 | pixmap->height = io->height; |
332 | pixmap->height = io->height; |
284 | pixmap->format = PICT_a8r8g8b8; |
333 | pixmap->format = PICT_a8r8g8b8; |
Line 285... | Line -... | ||
285 | pixmap->flags = 0; |
- | |
286 | pixmap->pitch = pitch; |
334 | pixmap->flags = io->flags; |
- | 335 | pixmap->pitch = pitch; |
|
- | 336 | pixmap->mapped = mapped; |
|
- | 337 | pixmap->pitch_offset = ((pitch/64)<<22)| (((u32_t)local+rhd.FbIntAddress)>>10); |
|
- | 338 | pixmap->local = local; |
|
- | 339 | ||
287 | pixmap->offset = (u32_t)raw+rhd.FbIntAddress; |
340 | dbgprintf("pixmap.pitch_offset: %x\n", pixmap->pitch_offset); |
- | 341 | dbgprintf("width: %d height: %d\n",pixmap->width,pixmap->height ); |
|
Line 288... | Line 342... | ||
288 | pixmap->pitch_offset = ((pitch/64)<<22)| (pixmap->offset>>10); |
342 | dbgprintf("map at %x\n", pixmap->mapped); |
289 | pixmap->raw = raw; |
343 | |
290 | pixmap->usermap = NULL; |
344 | return ERR_OK; |
- | 345 | }; |
|
Line 291... | Line 346... | ||
291 | 346 | rhd_mem_free(&rhd, RHD_MEM_FB,local); |
|
Line 292... | Line 347... | ||
292 | dbgprintf("pixmap.pitch_offset: %x\n", pixmap->pitch_offset); |
347 | free(pixmap); |
293 | dbgprintf("width: %d height: %d\n",pixmap->width,pixmap->height ); |
348 | }; |
294 | dbgprintf("pixmap.offset: %x\n", pixmap->offset); |
349 | return ERR_PARAM; |
295 | 350 | }; |
|
Line 296... | Line 351... | ||
296 | } |
351 | |
297 | return ERR_OK; |
- | |
Line -... | Line 352... | ||
- | 352 | ||
298 | } |
353 | int DestroyPixmap( pixmap_t *io ) |
- | 354 | { |
|
299 | 355 | local_pixmap_t *pixmap; |
|
300 | int DestroyPixmap( userpixmap_t *io) |
356 | size_t size; |
Line 301... | Line -... | ||
301 | { |
- | |
302 | pixmap_t *pixmap; |
- | |
303 | 357 | ||
304 | dbgprintf("Destroy pixmap %x\n", io->pixmap); |
358 | dbgprintf("Destroy pixmap %x\n", io->handle); |
- | 359 | ||
- | 360 | if(io->handle == -1) |
|
Line 305... | Line 361... | ||
305 | 361 | return ERR_PARAM; |
|
306 | if(io->pixmap == (pixmap_t*)-1) |
362 | else |
Line -... | Line 363... | ||
- | 363 | pixmap = (local_pixmap_t*)io->handle; |
|
- | 364 | ||
307 | return ERR_PARAM; |
365 | size = (pixmap->pitch*pixmap->height+4095) & ~ 4095; |
308 | else |
366 | |
309 | pixmap = io->pixmap; |
367 | UnmapPages(pixmap->mapped, size); |
310 | 368 | UserFree(pixmap->mapped); |
|
311 | if( (pixmap->flags & 1) == PX_LOCK ) |
369 | |
Line 389... | Line 447... | ||
389 | 447 | return ERR_OK; |
|
Line 390... | Line 448... | ||
390 | return ERR_OK; |
448 | }; |
391 | }; |
449 | |
Line -... | Line 450... | ||
- | 450 | #endif |
|
Line 392... | Line 451... | ||
392 | 451 | ||
393 | 452 | int PixBlit(pixblit_t *blit) |
|
- | 453 | { |
|
Line 394... | Line -... | ||
394 | int PixBlit(pixblit_t *blit) |
- | |
395 | { |
- | |
396 | - | ||
397 | u32 *ring, write; |
- | |
398 | int w, h; |
- | |
399 | u32 ifl; |
454 | clip_t src_clip, dst_clip; |
400 | int x0, y0; |
455 | |
Line 401... | Line 456... | ||
401 | 456 | local_pixmap_t *srcpixmap; |
|
Line 402... | Line 457... | ||
402 | pixmap_t *srcpixmap; |
457 | local_pixmap_t *dstpixmap; |
403 | pixmap_t *dstpixmap; |
458 | |
Line 413... | Line 468... | ||
413 | //dbgprintf("src.width: %d src.height: %d\n", srcpixmap->width,srcpixmap->height); |
468 | //dbgprintf("srcpitch: %x dstpitch: %x\n", |
414 | //dbgprintf("srcpitch: %x dstpitch: %x\n", |
469 | // srcpixmap->pitch_offset,dstpixmap->pitch_offset); |
415 | // srcpixmap->pitch_offset,dstpixmap->pitch_offset); |
470 | |
416 | 471 | src_clip.xmin = 0; |
|
Line -... | Line 472... | ||
- | 472 | src_clip.ymin = 0; |
|
- | 473 | src_clip.xmax = srcpixmap->width-1; |
|
- | 474 | src_clip.ymax = srcpixmap->height-1; |
|
- | 475 | ||
- | 476 | dst_clip.xmin = 0; |
|
- | 477 | dst_clip.ymin = 0; |
|
- | 478 | dst_clip.xmax = dstpixmap->width-1; |
|
- | 479 | dst_clip.ymax = dstpixmap->height-1; |
|
- | 480 | ||
- | 481 | if( !blit_clip(&dst_clip, &blit->dst_x, &blit->dst_y, |
|
- | 482 | &src_clip, &blit->src_x, &blit->src_y, |
|
- | 483 | &blit->w, &blit->h) ) |
|
- | 484 | { |
|
- | 485 | u32_t *ring, write; |
|
- | 486 | ||
- | 487 | u32_t ifl = safe_cli(); |
|
417 | ifl = safe_cli(); |
488 | |
Line 418... | Line 489... | ||
418 | 489 | #if R300_PIO |
|
Line 419... | Line 490... | ||
419 | #if R300_PIO |
490 | |
Line 465... | Line 536... | ||
465 | OUT_RING((blit->w<<16)|blit->h); |
536 | COMMIT_RING(); |
466 | COMMIT_RING(); |
537 | |
467 | 538 | #endif |
|
Line 468... | Line 539... | ||
468 | #endif |
539 | safe_sti(ifl); |
469 | - | ||
470 | safe_sti(ifl); |
540 | }; |
- | 541 | return ERR_OK; |
|
471 | return ERR_OK; |
542 | }; |
472 | } |
543 | |
Line 473... | Line 544... | ||
473 | 544 | ||
474 | 545 | int TransBlit(pixblit_t *blit) |
|
- | 546 | { |
|
Line 475... | Line -... | ||
475 | int TransBlit(pixblit_t *blit) |
- | |
476 | { |
- | |
477 | - | ||
478 | u32 *ring, write; |
- | |
479 | int w, h; |
- | |
480 | u32 ifl; |
547 | clip_t src_clip, dst_clip; |
481 | int x0, y0; |
548 | |
Line 482... | Line 549... | ||
482 | 549 | local_pixmap_t *srcpixmap; |
|
Line 483... | Line 550... | ||
483 | pixmap_t *srcpixmap; |
550 | local_pixmap_t *dstpixmap; |
484 | pixmap_t *dstpixmap; |
551 | |
Line 493... | Line 560... | ||
493 | //dbgprintf("dst.width: %d dst.height: %d\n", dstpixmap->width,dstpixmap->height); |
560 | //dbgprintf("src.width: %d src.height: %d\n", srcpixmap->width,srcpixmap->height); |
494 | //dbgprintf("src.width: %d src.height: %d\n", srcpixmap->width,srcpixmap->height); |
561 | //dbgprintf("srcpitch: %x dstpitch: %x\n", |
495 | //dbgprintf("srcpitch: %x dstpitch: %x\n", |
562 | // srcpixmap->pitch_offset,dstpixmap->pitch_offset); |
496 | // srcpixmap->pitch_offset,dstpixmap->pitch_offset); |
563 | src_clip.xmin = 0; |
- | 564 | src_clip.ymin = 0; |
|
- | 565 | src_clip.xmax = srcpixmap->width-1; |
|
- | 566 | src_clip.ymax = srcpixmap->height-1; |
|
- | 567 | ||
- | 568 | dst_clip.xmin = 0; |
|
- | 569 | dst_clip.ymin = 0; |
|
- | 570 | dst_clip.xmax = dstpixmap->width-1; |
|
- | 571 | dst_clip.ymax = dstpixmap->height-1; |
|
- | 572 | ||
- | 573 | if( !blit_clip(&dst_clip, &blit->dst_x, &blit->dst_y, |
|
- | 574 | &src_clip, &blit->src_x, &blit->src_y, |
|
- | 575 | &blit->w, &blit->h) ) |
|
- | 576 | { |
|
- | 577 | u32_t *ring, write; |
|
- | 578 | ||
Line 497... | Line 579... | ||
497 | 579 | u32_t ifl = safe_cli(); |
|
Line 498... | Line 580... | ||
498 | ifl = safe_cli(); |
580 | |
Line 499... | Line 581... | ||
499 | 581 | #if R300_PIO |
|
Line 555... | Line 637... | ||
555 | 637 | #endif |
|
Line 556... | Line 638... | ||
556 | #endif |
638 | |
Line 557... | Line 639... | ||
557 | 639 | safe_sti(ifl); |
|
- | 640 | }; |
|
558 | safe_sti(ifl); |
641 | return ERR_OK; |
559 | return ERR_OK; |
642 | }16)|blit-><16)|blit->16)|blit-><16)|blit->16)|blit-><16)|blit->16)|blit-><16)|blit->16)|blit-><16)|blit->16)|blit-><16)|blit->16)|blit-><16)|blit->16)|blit-><16)|blit->16)|blit-><16)|blit->16)|blit-><16)|blit->16)|blit-><16)|blit->16)|blit-><16)|blit->9),><9),>22)|><22)|>9),><9),>16)|x1); |