summaryrefslogtreecommitdiff
path: root/sys/dev/rasops
diff options
context:
space:
mode:
authormlelstv <mlelstv@NetBSD.org>2018-12-04 09:27:59 +0000
committermlelstv <mlelstv@NetBSD.org>2018-12-04 09:27:59 +0000
commitf0e8ec2a3be80b304eb0f402aacaf9cc2f53741f (patch)
tree3a4a1106d52604aa0b702c6d1e8df6d839b2ef5f /sys/dev/rasops
parentfa2ad75e21bc99d6db569172a6528a4a569005f7 (diff)
rasops reused wscons attribute bits for internal control.
- make upper 4 attribute bits available for such use - use wscons flag names instead of literal constants.
Diffstat (limited to 'sys/dev/rasops')
-rw-r--r--sys/dev/rasops/rasops.c20
-rw-r--r--sys/dev/rasops/rasops1.c12
-rw-r--r--sys/dev/rasops/rasops15.c14
-rw-r--r--sys/dev/rasops/rasops2.c14
-rw-r--r--sys/dev/rasops/rasops24.c16
-rw-r--r--sys/dev/rasops/rasops4.c14
-rw-r--r--sys/dev/rasops/rasops8.c14
7 files changed, 52 insertions, 52 deletions
diff --git a/sys/dev/rasops/rasops.c b/sys/dev/rasops/rasops.c
index 2b9153227c5..884d4de6c39 100644
--- a/sys/dev/rasops/rasops.c
+++ b/sys/dev/rasops/rasops.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rasops.c,v 1.78 2018/11/29 23:44:50 macallan Exp $ */
+/* $NetBSD: rasops.c,v 1.79 2018/12/04 09:27:59 mlelstv Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rasops.c,v 1.78 2018/11/29 23:44:50 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rasops.c,v 1.79 2018/12/04 09:27:59 mlelstv Exp $");
#include "opt_rasops.h"
#include "rasops_glue.h"
@@ -570,13 +570,13 @@ rasops_allocattr_color(void *cookie, int fg, int bg, int flg,
if ((flg & WSATTR_HILIT) != 0)
fg += 8;
- flg = ((flg & WSATTR_UNDERLINE) ? 1 : 0);
+ flg = flg & WSATTR_USERMASK;
if (rasops_isgray[fg])
- flg |= 2;
+ flg |= WSATTR_PRIVATE1;
if (rasops_isgray[bg])
- flg |= 4;
+ flg |= WSATTR_PRIVATE2;
*attr = (bg << 16) | (fg << 24) | flg;
return (0);
@@ -903,7 +903,7 @@ rasops_unpack_attr(long attr, int *fg, int *bg, int *underline)
*fg = ((u_int)attr >> 24) & 0xf;
*bg = ((u_int)attr >> 16) & 0xf;
if (underline != NULL)
- *underline = (u_int)attr & 1;
+ *underline = (u_int)attr & WSATTR_UNDERLINE;
}
/*
@@ -1366,7 +1366,7 @@ rasops_putchar_rotated_cw(void *cookie, int row, int col, u_int uc, long attr)
/* Do rotated char sans (side)underline */
ri->ri_real_ops.putchar(cookie, col, ri->ri_rows - row - 1, uc,
- attr & ~1);
+ attr & ~WSATTR_UNDERLINE);
/* Do rotated underline */
rp = ri->ri_bits + col * ri->ri_yscale + (ri->ri_rows - row - 1) *
@@ -1374,7 +1374,7 @@ rasops_putchar_rotated_cw(void *cookie, int row, int col, u_int uc, long attr)
height = ri->ri_font->fontheight;
/* XXX this assumes 16-bit color depth */
- if ((attr & 1) != 0) {
+ if ((attr & WSATTR_UNDERLINE) != 0) {
int16_t c = (int16_t)ri->ri_devcmap[((u_int)attr >> 24) & 0xf];
while (height--) {
@@ -1493,7 +1493,7 @@ rasops_putchar_rotated_ccw(void *cookie, int row, int col, u_int uc, long attr)
/* Do rotated char sans (side)underline */
ri->ri_real_ops.putchar(cookie, ri->ri_cols - col - 1, row, uc,
- attr & ~1);
+ attr & ~WSATTR_UNDERLINE);
/* Do rotated underline */
rp = ri->ri_bits + (ri->ri_cols - col - 1) * ri->ri_yscale +
@@ -1502,7 +1502,7 @@ rasops_putchar_rotated_ccw(void *cookie, int row, int col, u_int uc, long attr)
height = ri->ri_font->fontheight;
/* XXX this assumes 16-bit color depth */
- if ((attr & 1) != 0) {
+ if ((attr & WSATTR_UNDERLINE) != 0) {
int16_t c = (int16_t)ri->ri_devcmap[((u_int)attr >> 24) & 0xf];
while (height--) {
diff --git a/sys/dev/rasops/rasops1.c b/sys/dev/rasops/rasops1.c
index cacaf8237b4..ca2c82fa0fb 100644
--- a/sys/dev/rasops/rasops1.c
+++ b/sys/dev/rasops/rasops1.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rasops1.c,v 1.23 2010/05/04 04:57:34 macallan Exp $ */
+/* $NetBSD: rasops1.c,v 1.24 2018/12/04 09:27:59 mlelstv Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rasops1.c,v 1.23 2010/05/04 04:57:34 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rasops1.c,v 1.24 2018/12/04 09:27:59 mlelstv Exp $");
#include "opt_rasops.h"
@@ -180,7 +180,7 @@ rasops1_putchar(void *cookie, int row, int col, u_int uc, long attr)
}
/* Do underline */
- if ((attr & 1) != 0) {
+ if ((attr & WSATTR_UNDERLINE) != 0) {
DELTA(rp, -(ri->ri_stride << 1), int32_t *);
tmp = (*rp & lmask) | (fg & rmask);
*rp = tmp;
@@ -257,7 +257,7 @@ rasops1_putchar(void *cookie, int row, int col, u_int uc, long attr)
}
/* Do underline */
- if ((attr & 1) != 0) {
+ if ((attr & WSATTR_UNDERLINE) != 0) {
DELTA(rp, -(ri->ri_stride << 1), int32_t *);
tmp = (rp[0] & lmask) | (fg & ~lmask);
tmp2 = (rp[1] & rmask) | (fg & ~rmask);
@@ -344,7 +344,7 @@ rasops1_putchar8(void *cookie, int row, int col, u_int uc, long attr)
}
/* Do underline */
- if ((attr & 1) != 0) {
+ if ((attr & WSATTR_UNDERLINE) != 0) {
rp[-(ri->ri_stride << 1)] = fg;
if (ri->ri_hwbits) {
hrp[-(ri->ri_stride << 1)] = fg;
@@ -426,7 +426,7 @@ rasops1_putchar16(void *cookie, int row, int col, u_int uc, long attr)
}
/* Do underline */
- if ((attr & 1) != 0) {
+ if ((attr & WSATTR_UNDERLINE) != 0) {
/* XXX alignment?! */
*(int16_t *)(rp - (ri->ri_stride << 1)) = fg;
if (ri->ri_hwbits) {
diff --git a/sys/dev/rasops/rasops15.c b/sys/dev/rasops/rasops15.c
index 8fd50cf68a4..205a680599b 100644
--- a/sys/dev/rasops/rasops15.c
+++ b/sys/dev/rasops/rasops15.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rasops15.c,v 1.21 2017/01/25 14:53:43 jakllsch Exp $ */
+/* $NetBSD: rasops15.c,v 1.22 2018/12/04 09:27:59 mlelstv Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rasops15.c,v 1.21 2017/01/25 14:53:43 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rasops15.c,v 1.22 2018/12/04 09:27:59 mlelstv Exp $");
#include "opt_rasops.h"
@@ -191,7 +191,7 @@ rasops15_putchar(void *cookie, int row, int col, u_int uc, long attr)
}
/* Do underline */
- if ((attr & 1) != 0) {
+ if ((attr & WSATTR_UNDERLINE) != 0) {
int16_t c = (int16_t)clr[1];
rp -= ri->ri_stride << 1;
if (ri->ri_hwbits)
@@ -292,7 +292,7 @@ rasops15_putchar_aa(void *cookie, int row, int col, u_int uc, long attr)
}
/* Do underline */
- if ((attr & 1) != 0) {
+ if ((attr & WSATTR_UNDERLINE) != 0) {
rp = (uint16_t *)rrp;
DELTA(rp, (ri->ri_stride * (height - 2)), int16_t *);
while (width--)
@@ -412,7 +412,7 @@ rasops15_putchar8(void *cookie, int row, int col, u_int uc, long attr)
}
/* Do underline */
- if ((attr & 1) != 0) {
+ if ((attr & WSATTR_UNDERLINE) != 0) {
int32_t c = STAMP_READ(28);
DELTA(rp, -(ri->ri_stride << 1), int32_t *);
@@ -518,7 +518,7 @@ rasops15_putchar12(void *cookie, int row, int col, u_int uc, long attr)
}
/* Do underline */
- if (attr & 1) {
+ if (attr & WSATTR_UNDERLINE) {
int32_t c = STAMP_READ(28);
DELTA(rp, -(ri->ri_stride << 1), int32_t *);
@@ -633,7 +633,7 @@ rasops15_putchar16(void *cookie, int row, int col, u_int uc, long attr)
}
/* Do underline */
- if (attr & 1) {
+ if (attr & WSATTR_UNDERLINE) {
int32_t c = STAMP_READ(28);
DELTA(rp, -(ri->ri_stride << 1), int32_t *);
diff --git a/sys/dev/rasops/rasops2.c b/sys/dev/rasops/rasops2.c
index 470ce42d6df..a7beef88760 100644
--- a/sys/dev/rasops/rasops2.c
+++ b/sys/dev/rasops/rasops2.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rasops2.c,v 1.18 2013/04/21 04:28:05 kiyohara Exp $ */
+/* $NetBSD: rasops2.c,v 1.19 2018/12/04 09:27:59 mlelstv Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rasops2.c,v 1.18 2013/04/21 04:28:05 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rasops2.c,v 1.19 2018/12/04 09:27:59 mlelstv Exp $");
#include "opt_rasops.h"
@@ -159,7 +159,7 @@ rasops2_putchar(void *cookie, int row, int col, u_int uc, long attr)
}
/* Do underline */
- if (attr & 1) {
+ if (attr & WSATTR_UNDERLINE) {
DELTA(rp, -(ri->ri_stride << 1), int32_t *);
*rp = (*rp & lmask) | (fg & rmask);
}
@@ -196,7 +196,7 @@ rasops2_putchar(void *cookie, int row, int col, u_int uc, long attr)
}
/* Do underline */
- if (attr & 1) {
+ if (attr & WSATTR_UNDERLINE) {
DELTA(rp, -(ri->ri_stride << 1), int32_t *);
rp[0] = (rp[0] & lmask) | (fg & ~lmask);
rp[1] = (rp[1] & rmask) | (fg & ~rmask);
@@ -309,7 +309,7 @@ rasops2_putchar8(void *cookie, int row, int col, u_int uc, long attr)
}
/* Do underline */
- if ((attr & 1) != 0)
+ if ((attr & WSATTR_UNDERLINE) != 0)
*(int16_t *)(rp - (ri->ri_stride << 1)) = stamp[15];
stamp_mutex--;
@@ -375,7 +375,7 @@ rasops2_putchar12(void *cookie, int row, int col, u_int uc, long attr)
}
/* Do underline */
- if ((attr & 1) != 0) {
+ if ((attr & WSATTR_UNDERLINE) != 0) {
rp -= ri->ri_stride << 1;
rp[0] = rp[1] = rp[2] = stamp[15];
}
@@ -444,7 +444,7 @@ rasops2_putchar16(void *cookie, int row, int col, u_int uc, long attr)
}
/* Do underline */
- if ((attr & 1) != 0)
+ if ((attr & WSATTR_UNDERLINE) != 0)
*(int32_t *)(rp - (ri->ri_stride << 1)) = stamp[15];
stamp_mutex--;
diff --git a/sys/dev/rasops/rasops24.c b/sys/dev/rasops/rasops24.c
index 1a2ada7696c..c073024cda9 100644
--- a/sys/dev/rasops/rasops24.c
+++ b/sys/dev/rasops/rasops24.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rasops24.c,v 1.29 2011/07/25 18:02:47 njoly Exp $ */
+/* $NetBSD: rasops24.c,v 1.30 2018/12/04 09:27:59 mlelstv Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rasops24.c,v 1.29 2011/07/25 18:02:47 njoly Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rasops24.c,v 1.30 2018/12/04 09:27:59 mlelstv Exp $");
#include "opt_rasops.h"
@@ -178,7 +178,7 @@ rasops24_putchar(void *cookie, int row, int col, u_int uc, long attr)
}
/* Do underline */
- if ((attr & 1) != 0) {
+ if ((attr & WSATTR_UNDERLINE) != 0) {
u_char c = clr[1];
rp -= ri->ri_stride << 1;
@@ -299,7 +299,7 @@ rasops24_putchar8(void *cookie, int row, int col, u_int uc, long attr)
}
/* Do underline */
- if ((attr & 1) != 0) {
+ if ((attr & WSATTR_UNDERLINE) != 0) {
int32_t c = STAMP_READ(52);
DELTA(rp, -(ri->ri_stride << 1), int32_t *);
@@ -381,7 +381,7 @@ rasops24_putchar12(void *cookie, int row, int col, u_int uc, long attr)
}
/* Do underline */
- if ((attr & 1) != 0) {
+ if ((attr & WSATTR_UNDERLINE) != 0) {
int32_t c = STAMP_READ(52);
DELTA(rp, -(ri->ri_stride << 1), int32_t *);
@@ -470,7 +470,7 @@ rasops24_putchar16(void *cookie, int row, int col, u_int uc, long attr)
}
/* Do underline */
- if ((attr & 1) != 0) {
+ if ((attr & WSATTR_UNDERLINE) != 0) {
int32_t c = STAMP_READ(52);
DELTA(rp, -(ri->ri_stride << 1), int32_t *);
@@ -497,7 +497,7 @@ rasops24_eraserows(void *cookie, int row, int num, long attr)
* If the color is gray, we can cheat and use the generic routines
* (which are faster, hopefully) since the r,g,b values are the same.
*/
- if ((attr & 4) != 0) {
+ if ((attr & WSATTR_PRIVATE2) != 0) {
rasops_eraserows(cookie, row, num, attr);
return;
}
@@ -599,7 +599,7 @@ rasops24_erasecols(void *cookie, int row, int col, int num, long attr)
* If the color is gray, we can cheat and use the generic routines
* (which are faster, hopefully) since the r,g,b values are the same.
*/
- if ((attr & 4) != 0) {
+ if ((attr & WSATTR_PRIVATE2) != 0) {
rasops_erasecols(cookie, row, col, num, attr);
return;
}
diff --git a/sys/dev/rasops/rasops4.c b/sys/dev/rasops/rasops4.c
index 0bb137c961c..5f5466ba19d 100644
--- a/sys/dev/rasops/rasops4.c
+++ b/sys/dev/rasops/rasops4.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rasops4.c,v 1.11 2013/04/21 04:28:05 kiyohara Exp $ */
+/* $NetBSD: rasops4.c,v 1.12 2018/12/04 09:27:59 mlelstv Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rasops4.c,v 1.11 2013/04/21 04:28:05 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rasops4.c,v 1.12 2018/12/04 09:27:59 mlelstv Exp $");
#include "opt_rasops.h"
@@ -159,7 +159,7 @@ rasops4_putchar(void *cookie, int row, int col, u_int uc, long attr)
}
/* Do underline */
- if (attr & 1) {
+ if (attr & WS_UNDERLINE) {
DELTA(rp, -(ri->ri_stride << 1), int32_t *);
*rp = (*rp & lmask) | (fg & rmask);
}
@@ -196,7 +196,7 @@ rasops4_putchar(void *cookie, int row, int col, u_int uc, long attr)
}
/* Do underline */
- if (attr & 1) {
+ if (attr & WS_UNDERLINE) {
DELTA(rp, -(ri->ri_stride << 1), int32_t *);
rp[0] = (rp[0] & lmask) | (fg & ~lmask);
rp[1] = (rp[1] & rmask) | (fg & ~rmask);
@@ -311,7 +311,7 @@ rasops4_putchar8(void *cookie, int row, int col, u_int uc, long attr)
}
/* Do underline */
- if ((attr & 1) != 0) {
+ if ((attr & WS_UNDERLINE) != 0) {
rp -= (rs << 1);
rp[0] = stamp[15];
rp[1] = stamp[15];
@@ -383,7 +383,7 @@ rasops4_putchar12(void *cookie, int row, int col, u_int uc, long attr)
}
/* Do underline */
- if ((attr & 1) != 0) {
+ if ((attr & WS_UNDERLINE) != 0) {
rp -= (rs << 1);
rp[0] = stamp[15];
rp[1] = stamp[15];
@@ -458,7 +458,7 @@ rasops4_putchar16(void *cookie, int row, int col, u_int uc, long attr)
}
/* Do underline */
- if ((attr & 1) != 0) {
+ if ((attr & WS_UNDERLINE) != 0) {
rp -= (rs << 1);
rp[0] = stamp[15];
rp[1] = stamp[15];
diff --git a/sys/dev/rasops/rasops8.c b/sys/dev/rasops/rasops8.c
index 55bed375057..765789b44a9 100644
--- a/sys/dev/rasops/rasops8.c
+++ b/sys/dev/rasops/rasops8.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rasops8.c,v 1.34 2013/09/15 09:41:55 martin Exp $ */
+/* $NetBSD: rasops8.c,v 1.35 2018/12/04 09:27:59 mlelstv Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rasops8.c,v 1.34 2013/09/15 09:41:55 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rasops8.c,v 1.35 2018/12/04 09:27:59 mlelstv Exp $");
#include "opt_rasops.h"
@@ -175,7 +175,7 @@ rasops8_putchar(void *cookie, int row, int col, u_int uc, long attr)
}
/* Do underline */
- if ((attr & 1) != 0) {
+ if ((attr & WSATTR_UNDERLINE) != 0) {
u_char c = clr[1];
rp -= (ri->ri_stride << 1);
@@ -278,7 +278,7 @@ rasops8_putchar_aa(void *cookie, int row, int col, u_int uc, long attr)
}
/* Do underline */
- if ((attr & 1) != 0) {
+ if ((attr & WSATTR_UNDERLINE) != 0) {
rp -= (ri->ri_stride << 1);
if (ri->ri_hwbits)
@@ -406,7 +406,7 @@ rasops8_putchar8(void *cookie, int row, int col, u_int uc, long attr)
}
/* Do underline */
- if ((attr & 1) != 0) {
+ if ((attr & WSATTR_UNDERLINE) != 0) {
DELTA(rp, -(ri->ri_stride << 1), int32_t *);
rp[0] = rp[1] = stamp[15];
if (ri->ri_hwbits) {
@@ -500,7 +500,7 @@ rasops8_putchar12(void *cookie, int row, int col, u_int uc, long attr)
}
/* Do underline */
- if ((attr & 1) != 0) {
+ if ((attr & WSATTR_UNDERLINE) != 0) {
DELTA(rp, -(ri->ri_stride << 1), int32_t *);
rp[0] = rp[1] = rp[2] = stamp[15];
if (ri->ri_hwbits) {
@@ -595,7 +595,7 @@ rasops8_putchar16(void *cookie, int row, int col, u_int uc, long attr)
}
/* Do underline */
- if ((attr & 1) != 0) {
+ if ((attr & WSATTR_UNDERLINE) != 0) {
DELTA(rp, -(ri->ri_stride << 1), int32_t *);
rp[0] = rp[1] = rp[2] = rp[3] = stamp[15];
if (ri->ri_hwbits) {