/programs/system/drivers/ati2d/accel_2d.h |
---|
95,6 → 95,7 |
}; |
}; |
color_t color; |
color_t border; |
}draw_t; |
typedef struct |
/programs/system/drivers/ati2d/accel_2d.inc |
---|
70,7 → 70,7 |
int DrawRect(draw_t* draw) |
{ |
int x0, y0, x1, y1; |
int x0, y0, x1, y1, xend, yend; |
local_pixmap_t *dstpixmap; |
clip_t dst_clip; |
80,8 → 80,8 |
x0 = draw->x0; |
y0 = draw->y0; |
x1 = x0+draw->w-1; |
y1 = y0+draw->h-1; |
x1 = xend = x0 + draw->w - 1; |
y1 = yend = y0 + draw->h - 1; |
dst_clip.xmin = 0; |
dst_clip.ymin = 0; |
119,8 → 119,45 |
OUTREG(R5XX_DP_BRUSH_FRGD_CLR, draw->color); |
OUTREG(R5XX_DP_CNTL, R5XX_DST_X_LEFT_TO_RIGHT | R5XX_DST_Y_TOP_TO_BOTTOM); |
OUTREG(R5XX_DST_PITCH_OFFSET, dstpixmap->pitch_offset); |
OUTREG(R5XX_DST_Y_X,(draw->y0<<16)|draw->x0); |
OUTREG(R5XX_DST_Y_X,(y0<<16)|x0); |
OUTREG(R5XX_DST_WIDTH_HEIGHT,(w<<16)|h); |
if( draw->color != draw->border) |
{ |
OUTREG(R5XX_DP_BRUSH_FRGD_CLR, draw->border); |
if( y0 == draw->y0) |
{ |
R5xxFIFOWait(2); |
OUTREG(R5XX_DST_Y_X,(y0<<16)|x0); |
OUTREG(R5XX_DST_WIDTH_HEIGHT,(w<<16)|1); |
y0++; |
h--; |
} |
if( y1 == yend ) |
{ |
R5xxFIFOWait(2); |
OUTREG(R5XX_DST_Y_X,(y1<<16)|x0); |
OUTREG(R5XX_DST_WIDTH_HEIGHT,(w<<16)|1); |
h--; |
} |
if( x0 == draw->x0) |
{ |
R5xxFIFOWait(2); |
OUTREG(R5XX_DST_Y_X,(y0<<16)|x0); |
OUTREG(R5XX_DST_WIDTH_HEIGHT,(1<<16)|h); |
} |
if( x1 == xend) |
{ |
R5xxFIFOWait(2); |
OUTREG(R5XX_DST_Y_X,(y0<<16)|x1); |
OUTREG(R5XX_DST_WIDTH_HEIGHT,(1<<16)|h); |
} |
}; |
#else |
BEGIN_RING(); |
OUT_RING(CP_PACKET3(RADEON_CNTL_PAINT_MULTI, 4)); |
/programs/system/drivers/ati2d/ati2d.c |
---|
35,6 → 35,11 |
printf("Can't open /rd/1/drivers/ati2d.log\nExit\n"); |
return 0; |
} |
if( GetScreenBpp() != 32) |
{ |
printf("32 bpp dispaly mode required !\nExit\t"); |
return 0; |
} |
if((rhdPtr=FindPciDevice())==NULL) |
{ |
106,7 → 111,7 |
break; |
case PX_DRAW_RECT: |
if(io->inp_size==6) |
if(io->inp_size==7) |
return DrawRect((draw_t*)inp); |
break; |
/programs/system/drivers/ati2d/r500.inc |
---|
351,15 → 351,15 |
void R5xx2DInit() |
{ |
u32_t base; |
int screensize; |
int screenpitch; |
#ifdef R300_TEST |
rhd.displayWidth = 1024; |
rhd.displayHeight = 768; |
#else |
rhd.displayWidth = INREG(D1GRPH_X_END); |
rhd.displayHeight = INREG(D1GRPH_Y_END); |
#endif |
screensize = GetScreenSize(); |
screenpitch = GetScreenPitch(); |
rhd.displayWidth = screensize >> 16; |
rhd.displayHeight = screensize & 0xFFFF; |
rhd.__xmin = 0; |
rhd.__ymin = 0; |
rhd.__xmax = rhd.displayWidth - 1; |
379,7 → 379,7 |
dbgprintf("gui_control %x \n", rhd.gui_control); |
rhd.surface_cntl = 0; |
rhd.dst_pitch_offset = (((rhd.displayWidth * 4) / 64) << 22) | |
rhd.dst_pitch_offset = ((screenpitch / 64) << 22) | |
((rhd.FbIntAddress + rhd.FbScanoutStart) >> 10); |
dbgprintf("dst_pitch_offset %x \n", rhd.dst_pitch_offset); |
388,7 → 388,7 |
scr_pixmap.width = rhd.displayWidth; |
scr_pixmap.height = rhd.displayHeight; |
scr_pixmap.format = PICT_a8r8g8b8; |
scr_pixmap.pitch = rhd.displayWidth * 4; |
scr_pixmap.pitch = screenpitch; |
scr_pixmap.local = (void*)rhd.FbIntAddress; |
scr_pixmap.pitch_offset = rhd.dst_pitch_offset; |
scr_pixmap.mapped = (void*)0; |
437,9 → 437,6 |
OUTREG(RADEON_CP_CSQ_CNTL, RADEON_CSQ_PRIBM_INDBM); // run |
// OUTREG(D1CUR_SIZE, (31<<16)|31); |
// OUTREG(D1CUR_CONTROL, 0x300); |
} |
/programs/system/drivers/ati2d/syscall.h |
---|
71,6 → 71,36 |
/////////////////////////////////////////////////////////////////////////////// |
extern inline int GetScreenSize() |
{ |
int retval; |
asm("int $0x40" |
:"=a"(retval) |
:"a"(61), "b"(1)); |
return retval; |
} |
extern inline int GetScreenBpp() |
{ |
int retval; |
asm("int $0x40" |
:"=a"(retval) |
:"a"(61), "b"(2)); |
return retval; |
} |
extern inline int GetScreenPitch() |
{ |
int retval; |
asm("int $0x40" |
:"=a"(retval) |
:"a"(61), "b"(3)); |
return retval; |
} |
extern inline u32_t GetPgAddr(void *mem) |
{ |
u32_t retval; |