summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2020-12-21 12:58:43 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2020-12-21 12:58:43 +0000
commitcf44a7ed275b7caea7078451692fb8ba98102720 (patch)
tree91417ad0ae1033f94de8a8deab1d23825a8e7c8f
parenta739ec1feebec78f9935621b02b9693c1b571700 (diff)
Only enable rasops1_putchar8() and rasops1_putchar16() optomizations on
big-endian architectectures. These functions assume big-endian bit order whereas rasops1_putchar() assumes native-endian bit order. Since ssdfb(4) assumes little-endian bit order and is the only consumer of these interfaces on little-endian platforms, go with the rasop1_putchar() convention for now. ok mpi@
-rw-r--r--sys/dev/rasops/rasops1.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/dev/rasops/rasops1.c b/sys/dev/rasops/rasops1.c
index 63663019e49..397b4acebda 100644
--- a/sys/dev/rasops/rasops1.c
+++ b/sys/dev/rasops/rasops1.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rasops1.c,v 1.10 2020/05/25 09:55:49 jsg Exp $ */
+/* $OpenBSD: rasops1.c,v 1.11 2020/12/21 12:58:42 kettenis Exp $ */
/* $NetBSD: rasops1.c,v 1.11 2000/04/12 14:22:29 pk Exp $ */
/*-
@@ -44,7 +44,7 @@ int rasops1_copycols(void *, int, int, int, int);
int rasops1_erasecols(void *, int, int, int, uint32_t);
int rasops1_do_cursor(struct rasops_info *);
int rasops1_putchar(void *, int, int col, u_int, uint32_t);
-#ifndef RASOPS_SMALL
+#if defined(RASOPS_SMALL) && BYTE_ORDER == BIG_ENDIAN
int rasops1_putchar8(void *, int, int col, u_int, uint32_t);
int rasops1_putchar16(void *, int, int col, u_int, uint32_t);
#endif
@@ -58,7 +58,7 @@ rasops1_init(struct rasops_info *ri)
rasops_masks_init();
switch (ri->ri_font->fontwidth) {
-#ifndef RASOPS_SMALL
+#if defined(RASOPS_SMALL) && BYTE_ORDER == BIG_ENDIAN
case 8:
ri->ri_ops.putchar = rasops1_putchar8;
break;
@@ -223,7 +223,7 @@ rasops1_putchar(void *cookie, int row, int col, u_int uc, uint32_t attr)
return 0;
}
-#ifndef RASOPS_SMALL
+#if defined(RASOPS_SMALL) && BYTE_ORDER == BIG_ENDIAN
/*
* Paint a single character. This is for 8-pixel wide fonts.
*/
@@ -350,7 +350,7 @@ rasops1_putchar16(void *cookie, int row, int col, u_int uc, uint32_t attr)
return 0;
}
-#endif /* !RASOPS_SMALL */
+#endif /* !defined(RASOPS_SMALL) && BYTE_ORDER == BIG_ENDIAN */
/*
* Grab routines common to depths where (bpp < 8)