Subversion Repositories Kolibri OS

Rev

Rev 813 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
808 serge 1
 
2
3
 
812 serge 4
 
808 serge 5
{
6
  int x0, y0, x1, y1;
7
8
 
9
  y0 = draw->y;
10
11
 
12
  y1 = y0+draw->h-1;
13
14
 
15
//             x0, y0, x1, y1, draw->color);
16
17
 
18
  {
19
     u32 *ring, write;
20
     int w, h;
21
     u32 ifl;
22
23
 
24
     h = y1-y0+1;
25
26
 
27
28
 
812 serge 29
 
813 serge 30
812 serge 31
 
32
33
 
34
                                     R5XX_GMC_BRUSH_SOLID_COLOR |
35
                                     R5XX_GMC_SRC_DATATYPE_COLOR);
36
37
 
38
     OUTREG(R5XX_DP_WRITE_MASK, 0xFFFFFFFF);
39
     OUTREG(R5XX_DP_CNTL, R5XX_DST_X_LEFT_TO_RIGHT | R5XX_DST_Y_TOP_TO_BOTTOM);
40
     OUTREG(R5XX_DST_PITCH_OFFSET, rhd.dst_pitch_offset);
41
     OUTREG(R5XX_DST_Y_X,(y0<<16)|x0);
42
     OUTREG( R5XX_DST_WIDTH_HEIGHT,(w<<16)|h);
43
44
 
45
46
 
808 serge 47
       OUT_RING(CP_PACKET3(RADEON_CNTL_PAINT_MULTI, 4));
48
49
 
50
 
51
                RADEON_GMC_BRUSH_SOLID_COLOR      |
52
                RADEON_GMC_DST_32BPP              |
53
                RADEON_GMC_SRC_DATATYPE_COLOR     |
54
                (1 << 28)+(1 << 30) | R5XX_ROP3_P);
55
56
 
57
       OUT_RING(draw->color);
58
       OUT_RING((y0<<16)|x0);
59
       OUT_RING((w<<16)|h);
60
     COMMIT_RING();
61
62
 
812 serge 63
808 serge 64
 
65
  } ;
66
  return 0;
67
}
68
69
 
70
{
71
  int x0, y0, x1, y1;
72
73
 
74
  y0 = fill->y;
75
76
 
77
  y1 = y0+fill->h-1;
78
79
 
80
//             x0, y0, x1, y1);
81
82
 
83
  {
84
     u32 *ring, write;
85
     u32 ifl;
86
87
 
88
89
 
813 serge 90
812 serge 91
 
92
93
 
808 serge 94
       OUT_RING(CP_PACKET3(RADEON_CNTL_PAINT, 7));
95
       OUT_RING(RADEON_GMC_DST_PITCH_OFFSET_CNTL    |
96
                BRUSH_MONO                          |
97
                RADEON_GMC_DST_32BPP                |
98
                RADEON_GMC_SRC_DATATYPE_COLOR       |
99
                (1 << 28)+(1 << 30) | R5XX_ROP3_P);
100
101
 
102
         OUT_RING(fill->bkcolor);
103
         OUT_RING(fill->fcolor);
104
105
 
106
         OUT_RING(fill->bmp1);
107
108
 
109
         OUT_RING((y1<<16)|x1);
110
     COMMIT_RING();
111
112
 
812 serge 113
114
 
808 serge 115
  };
116
  return 0;
117
}
118
119
 
810 serge 120
{
121
  int x0, y0, x1, y1;
122
808 serge 123
 
810 serge 124
  y0 = blit->src_y;
125
808 serge 126
 
810 serge 127
  y1 = y0+blit->h-1;
128
129
 
130
 
131
  {
132
     u32 *ring, write;
133
     int w, h;
134
     u32 ifl;
135
136
 
137
     h = y1-y0+1;
138
139
 
140
141
 
813 serge 142
812 serge 143
 
144
 
145
146
 
810 serge 147
       OUT_RING(CP_PACKET3(RADEON_CNTL_BITBLT, 5));
148
149
 
150
                RADEON_GMC_DST_PITCH_OFFSET_CNTL  |
151
                RADEON_GMC_BRUSH_NONE             |
152
                RADEON_GMC_DST_32BPP              |
153
                RADEON_GMC_SRC_DATATYPE_COLOR     |
154
                RADEON_DP_SRC_SOURCE_MEMORY       |
155
                (1 << 28)+(1 << 30) | R5XX_ROP3_S);
156
157
 
158
       OUT_RING(rhd.dst_pitch_offset);
159
160
 
161
       OUT_RING((blit->dst_x<<16)|blit->dst_y);
162
       OUT_RING((w<<16)|h);
163
     COMMIT_RING();
164
165
 
812 serge 166
167
 
810 serge 168
  } ;
169
  return 0;
170
}
171
172
 
808 serge 173
{
174
175
 
176
177
 
178
  y0 = draw->y0;
179
180
 
181
  y1 = draw->y1;
182
183
 
184
  {
185
    u32 ifl;
186
    u32 *ring, write;
187
188
 
189
190
 
813 serge 191
808 serge 192
 
193
194
 
195
                                     R5XX_GMC_BRUSH_SOLID_COLOR |
196
                                     R5XX_GMC_SRC_DATATYPE_COLOR);
197
198
 
199
200
 
201
     OUTREG(R5XX_DP_WRITE_MASK, 0xFFFFFFFF);
202
     OUTREG(R5XX_DST_PITCH_OFFSET, rhd.dst_pitch_offset);
203
204
 
205
     OUTREG(R5XX_DST_LINE_END,(y1<<16)|x1);
206
813 serge 207
 
208
209
 
210
         OUT_RING(CP_PACKET3(RADEON_CNTL_PAINT_POLYLINE, 4));
211
         OUT_RING(RADEON_GMC_DST_PITCH_OFFSET_CNTL  |
212
                  RADEON_GMC_BRUSH_SOLID_COLOR      |
213
                  RADEON_GMC_DST_32BPP              |
214
                  RADEON_GMC_SRC_DATATYPE_COLOR     |
215
                  (1 << 28)+(1 << 30) | R5XX_ROP3_P);
216
217
 
218
         OUT_RING(draw->color);
219
         OUT_RING((y0<<16)|x0);
220
         OUT_RING((y1<<16)|x1);
221
     COMMIT_RING();
222
223
 
224
     safe_sti(ifl);
808 serge 225
226
 
227
  return 0;
228
}
229
815 serge 230
 
231
 
232
{
233
234
 
235
236
 
237
  void *raw;
238
239
 
240
      (io->height == 0)|| (io->height > 2048))
241
  {
242
     dbgprintf("Invalid pixmap size w:%d h:%d\n", io->width,io->height);
243
     return 0;
244
245
 
246
247
 
248
  dbgprintf("pitch = %d\n", pitch);
249
250
 
251
  if (! raw)
252
  {
253
    dbgprintf("Not enough memory for pixmap\n");
254
    return 0;
255
  };
256
257
 
258
  if(!pixmap)
259
  {
260
    rhd_mem_free(&rhd, RHD_MEM_FB,raw);
261
    return 0;
262
  }
263
  else
264
  {
265
    io->pixmap = (u32_t)pixmap;
266
    io->format = PICT_a8r8g8b8;
267
    io->pitch = pitch;
268
269
 
270
    pixmap->height = io->height;
271
    pixmap->format = PICT_a8r8g8b8;
272
    pixmap->pitch = pitch;
273
    pixmap->offset = (u32_t)raw-rhd.FbBase+rhd.FbIntAddress;
274
    pixmap->pitch_offset =  ((pitch/64)<<22)| (pixmap->offset>>10);
275
    pixmap->raw = raw;
276
277
 
278
    dbgprintf("width: %d height: %d\n",pixmap->width,pixmap->height );
279
    dbgprintf("pixmap.offset: %x\n", pixmap->offset);
280
281
 
282
  return 1;
283
}
284
285
 
286
 
287
 
288
{
289
290
 
291
     int w, h;
292
     u32 ifl;
293
     int x0, y0;
294
295
 
296
     pixmap_t *dstpixmap;
297
298
 
299
300
 
301
     srcpixmap = (blit->srcpix == (void*)-1) ? &scr_pixmap : blit->srcpix ;
302
303
 
304
305
 
306
     dbgprintf("src.width: %d src.height: %d\n", srcpixmap->width,srcpixmap->height);
307
     dbgprintf("srcpitch: %x dstpitch: %x\n",
308
                srcpixmap->pitch_offset,dstpixmap->pitch_offset);
309
310
 
311
312
 
313
 
314
       OUT_RING(CP_PACKET3(RADEON_CNTL_BITBLT, 5));
315
316
 
317
                RADEON_GMC_DST_PITCH_OFFSET_CNTL  |
318
                RADEON_GMC_BRUSH_NONE             |
319
                RADEON_GMC_DST_32BPP              |
320
                RADEON_GMC_SRC_DATATYPE_COLOR     |
321
                RADEON_DP_SRC_SOURCE_MEMORY       |
322
                (1 << 28)+(1 << 30) | R5XX_ROP3_S);
323
324
 
325
       OUT_RING(dstpixmap->pitch_offset);
326
327
 
328
  //   y0 = blit->src_y;
329
  //   w =  blit->w;
330
  //   h =  blit->h;
331
332
 
333
       OUT_RING((blit->dst_x<<16)|blit->dst_y);
334
       OUT_RING((blit->w<<16)|blit->h);
335
     COMMIT_RING();
336
337
 
338
  return 0;
339
}
340
>