summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2014-01-19 03:29:52 +0100
committercinap_lenrek <cinap_lenrek@felloff.net>2014-01-19 03:29:52 +0100
commitba787cc587803e3dfe400755c4fa2fa04701dd53 (patch)
tree83b48349c852ded3684a90205118470326580a1d
parent02a2eb6676d3dbdaea5e5339b32bfa4c9d321175 (diff)
kernel: replace BY2WD in scanline width calculation to sizeof(ulong) like libmemdraw
-rw-r--r--sys/src/9/pc/screen.c2
-rw-r--r--sys/src/9/pc/vgact65545.c2
-rw-r--r--sys/src/9/pc/vgacyber938x.c2
-rw-r--r--sys/src/9/pc/vgaet4000.c2
-rw-r--r--sys/src/9/pc/vgamach64xx.c2
-rw-r--r--sys/src/9/pc/vganeomagic.c6
-rw-r--r--sys/src/9/pc/vganvidia.c2
-rw-r--r--sys/src/9/pc/vgas3.c2
8 files changed, 10 insertions, 10 deletions
diff --git a/sys/src/9/pc/screen.c b/sys/src/9/pc/screen.c
index 92361f556..da3f2d730 100644
--- a/sys/src/9/pc/screen.c
+++ b/sys/src/9/pc/screen.c
@@ -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;
diff --git a/sys/src/9/pc/vgact65545.c b/sys/src/9/pc/vgact65545.c
index 03818ea29..2696f365f 100644
--- a/sys/src/9/pc/vgact65545.c
+++ b/sys/src/9/pc/vgact65545.c
@@ -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;
diff --git a/sys/src/9/pc/vgacyber938x.c b/sys/src/9/pc/vgacyber938x.c
index ec6acf596..c95d4e996 100644
--- a/sys/src/9/pc/vgacyber938x.c
+++ b/sys/src/9/pc/vgacyber938x.c
@@ -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;
diff --git a/sys/src/9/pc/vgaet4000.c b/sys/src/9/pc/vgaet4000.c
index b7ec5dede..67a692981 100644
--- a/sys/src/9/pc/vgaet4000.c
+++ b/sys/src/9/pc/vgaet4000.c
@@ -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);
diff --git a/sys/src/9/pc/vgamach64xx.c b/sys/src/9/pc/vgamach64xx.c
index c31d4534b..1c97e91d0 100644
--- a/sys/src/9/pc/vgamach64xx.c
+++ b/sys/src/9/pc/vgamach64xx.c
@@ -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;
diff --git a/sys/src/9/pc/vganeomagic.c b/sys/src/9/pc/vganeomagic.c
index 0f7bb6354..171ebbbc3 100644
--- a/sys/src/9/pc/vganeomagic.c
+++ b/sys/src/9/pc/vganeomagic.c
@@ -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;
diff --git a/sys/src/9/pc/vganvidia.c b/sys/src/9/pc/vganvidia.c
index d5563ecf1..6e5e9694e 100644
--- a/sys/src/9/pc/vganvidia.c
+++ b/sys/src/9/pc/vganvidia.c
@@ -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,
diff --git a/sys/src/9/pc/vgas3.c b/sys/src/9/pc/vgas3.c
index ed203af65..f59ff4bac 100644
--- a/sys/src/9/pc/vgas3.c
+++ b/sys/src/9/pc/vgas3.c
@@ -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;