shithub: n900

Download patch

ref: 0d5017d19e7f87c384198d152b867e03b230b613
parent: 72239845a04f00e23487700fac27f8ba88828b6f
author: mia soweli <[email protected]>
date: Wed Nov 15 17:32:02 EST 2023

screen: use graphics attributes to determine screen bit depth

--- a/sys/src/9/omap/screen.c
+++ b/sys/src/9/omap/screen.c
@@ -20,8 +20,6 @@
 	RDcontrol		= 0x440,
 		DClcdon			= 1<<0,
 		DClcdgo			= 1<<5,
-		DClcdbits		= 3<<8,
-		DClcdbits24		= 3<<8,
 	RDconfig		= 0x444,
 	RDdefcolor		= 0x44c,
 	RDtranscolor	= 0x454,
@@ -36,6 +34,8 @@
 	RDgfxpos			= 0x488,
 	RDgfxsize			= 0x48c,
 	RDgfxattr			= 0x4a0,
+		DCgfxattrfmt		= 0xf<<1,
+		DCgfxattrfmt16		= 0x6<<1,
 	RDgfxrowinc			= 0x4ac,
 	RDgfxpixelinc		= 0x4b0,
 };
@@ -146,7 +146,7 @@
 	uint x, y;
 
 	c = &ctlr;
-	if((csr32r(c, RDconfig) & DClcdbits) != DClcdbits24)
+	if((csr32r(c, RDgfxattr) & DCgfxattrfmt) != DCgfxattrfmt16)
 		return;
 
 	x = ((csr32r(c, RDgfxsize) & 0x0000ffff) >> 0) + 1;;