Subversion Repositories Kolibri OS

Rev

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