kernel: replace BY2WD in scanline width calculation to sizeof(ulong) like libmemdraw
This commit is contained in:
parent
02a2eb6676
commit
ba787cc587
|
@ -186,7 +186,7 @@ flushmemscreen(Rectangle r)
|
|||
if(rectclip(&r, scr->gscreen->r) == 0)
|
||||
return;
|
||||
disp = scr->vaddr;
|
||||
incs = scr->gscreen->width*BY2WD;
|
||||
incs = scr->gscreen->width*sizeof(ulong);
|
||||
off = (r.min.x*scr->gscreen->depth) / 8;
|
||||
len = (r.max.x*scr->gscreen->depth + 7) / 8;
|
||||
len -= off;
|
||||
|
|
|
@ -34,7 +34,7 @@ ct65545enable(VGAscr* scr)
|
|||
* Find a place for the cursor data in display memory.
|
||||
* Must be on a 1024-byte boundary.
|
||||
*/
|
||||
storage = ROUND(scr->gscreen->width*BY2WD*scr->gscreen->r.max.y, 1024);
|
||||
storage = ROUND(scr->gscreen->width*sizeof(ulong)*scr->gscreen->r.max.y, 1024);
|
||||
outl(0xB3D0, storage);
|
||||
scr->storage = storage;
|
||||
|
||||
|
|
|
@ -169,7 +169,7 @@ cyber938xcurenable(VGAscr* scr)
|
|||
/*
|
||||
* Find a place for the cursor data in display memory.
|
||||
*/
|
||||
storage = ((scr->gscreen->width*BY2WD*scr->gscreen->r.max.y+1023)/1024);
|
||||
storage = ((scr->gscreen->width*sizeof(ulong)*scr->gscreen->r.max.y+1023)/1024);
|
||||
vgaxo(Crtx, 0x44, storage & 0xFF);
|
||||
vgaxo(Crtx, 0x45, (storage>>8) & 0xFF);
|
||||
storage *= 1024;
|
||||
|
|
|
@ -79,7 +79,7 @@ et4000enable(VGAscr *scr)
|
|||
* 1024-byte boundary so that there's no danger of it
|
||||
* crossing a page.
|
||||
*/
|
||||
scr->storage = (scr->gscreen->width*BY2WD*scr->gscreen->r.max.y+1023)/1024;
|
||||
scr->storage = (scr->gscreen->width*sizeof(ulong)*scr->gscreen->r.max.y+1023)/1024;
|
||||
scr->storage *= 1024/4;
|
||||
outb(0x217A, 0xE8);
|
||||
outb(0x217B, scr->storage & 0xFF);
|
||||
|
|
|
@ -589,7 +589,7 @@ mach64xxcurenable(VGAscr* scr)
|
|||
* Find a place for the cursor data in display memory.
|
||||
* Must be 64-bit aligned.
|
||||
*/
|
||||
storage = (scr->gscreen->width*BY2WD*scr->gscreen->r.max.y+7)/8;
|
||||
storage = (scr->gscreen->width*sizeof(ulong)*scr->gscreen->r.max.y+7)/8;
|
||||
iow32(scr, CurOffset, storage);
|
||||
scr->storage = storage*8;
|
||||
|
||||
|
|
|
@ -377,7 +377,7 @@ neomagichwfill(VGAscr *scr, Rectangle r, ulong sval)
|
|||
| NEO_BC3_SKIP_MAPPING
|
||||
| GXcopy;
|
||||
mmio[DstStartOff] = scr->paddr
|
||||
+ r.min.y*scr->gscreen->width*BY2WD
|
||||
+ r.min.y*scr->gscreen->width*sizeof(ulong)
|
||||
+ r.min.x*scr->gscreen->depth/BI2BY;
|
||||
mmio[XYExt] = (Dy(r) << 16) | (Dx(r) & 0xffff);
|
||||
waitforidle(scr);
|
||||
|
@ -392,7 +392,7 @@ neomagichwscroll(VGAscr *scr, Rectangle r, Rectangle sr)
|
|||
|
||||
mmio = scr->mmio;
|
||||
|
||||
pitch = scr->gscreen->width*BY2WD;
|
||||
pitch = scr->gscreen->width*sizeof(ulong);
|
||||
pixel = scr->gscreen->depth/BI2BY;
|
||||
|
||||
waitforfifo(scr, 4);
|
||||
|
@ -433,7 +433,7 @@ neomagicdrawinit(VGAscr *scr)
|
|||
|
||||
mmio = scr->mmio;
|
||||
|
||||
pitch = scr->gscreen->width*BY2WD;
|
||||
pitch = scr->gscreen->width*sizeof(ulong);
|
||||
|
||||
neomagicbltflags = bltmode = 0;
|
||||
|
||||
|
|
|
@ -346,7 +346,7 @@ nvresetgraphics(VGAscr *scr)
|
|||
if(scr->paddr == 0)
|
||||
return -1;
|
||||
|
||||
pitch = scr->gscreen->width*BY2WD;
|
||||
pitch = scr->gscreen->width*sizeof(ulong);
|
||||
|
||||
/*
|
||||
* DMA is at the end of the virtual window,
|
||||
|
|
|
@ -307,7 +307,7 @@ s3enable(VGAscr* scr)
|
|||
* Find a place for the cursor data in display memory.
|
||||
* Must be on a 1024-byte boundary.
|
||||
*/
|
||||
storage = (scr->gscreen->width*BY2WD*scr->gscreen->r.max.y+1023)/1024;
|
||||
storage = (scr->gscreen->width*sizeof(ulong)*scr->gscreen->r.max.y+1023)/1024;
|
||||
vgaxo(Crtx, 0x4C, storage>>8);
|
||||
vgaxo(Crtx, 0x4D, storage & 0xFF);
|
||||
storage *= 1024;
|
||||
|
|
Loading…
Reference in a new issue