hlfw.ca

x9dev

Download patch

ref: b295e767a794363bfc21fcdee6e3c4372fcb7fd5
parent: 2fb379357a9273381df6faf114a9c357afd56ba1
author: Michael Misch <michealmisch1985@gmail.com>
date: Sat Sep 5 17:07:39 PDT 2020

remove use of shadowfb for now

--- a/dix-config.h
+++ b/dix-config.h
@@ -24,6 +24,10 @@
 #ifndef _DIX_CONFIG_H_
 #define _DIX_CONFIG_H_
 
+#undef X_BYTE_ORDER
+#define X_BYTE_ORDER    X_LITTLE_ENDIAN
+#define BITMAP_BIT_ORDER    LSBFirst
+#define IMAGE_BYTE_ORDER    LSBFirst
 #define ABORTONFATALERROR  1
 #define BUILDERADDR "michaelmisch1985@gmail.com"
 #define PACKAGE "x9dev"
--- a/mkfile
+++ b/mkfile
@@ -172,9 +172,6 @@
 	mitri.$O\
 	picture.$O\
 	render.$O\
-# xfree86 \
-	shadowfb.$O\
-	sfbmodule.$O\
 
 HFILES=\
 	dix-config.h
@@ -181,11 +178,11 @@
 
 <$PLAN9/src/mkone
 
-CFLAGS=-c -D_POSIX_SOURCE -D_BSD_EXTENSION -D_SUSV2_SOURCE -DSHADOWFB \
+CFLAGS=-c -D_POSIX_SOURCE -D_BSD_EXTENSION -D_SUSV2_SOURCE \
 	-DHAVE_DIX_CONFIG_H -DPLAN9 -DT$objtype -I. -I../../include \
 	-I../../fb -I../../mi -I../../miext/damage -I../../miext/shadow -I../../randr \
-	-I../../render -I../../Xext -I../../Xi -I../xfree86/shadowfb \
-	-I/usr/local/include -I/usr/local/plan9/include \
+	-I../../render -I../../Xext -I../../Xi \
+	-I/usr/local/include -I/usr/local/plan9 \
 	-I/usr/local/include/pixman-1
 
 x9dev.$O: x9dev.c keymap.h x9dev.h
@@ -220,7 +217,4 @@
 
 %.$O: ../../render/%.c
 	$CC $CFLAGS ../../render/$stem.c
-
-%.$O: ../xfree86/shadowfb/%.c
-	$CC $CFLAGS ../xfree86/shadowfb/$stem.c
 
--- a/plan9port.c
+++ b/plan9port.c
@@ -1,7 +1,8 @@
+#define _PLAN9_SOURCE
 #include <u.h>
 
 /* Unix headers, then libc.h */
-
+#include <stdio.h>
 #include <libc.h>
 #include <draw.h>
 
@@ -141,4 +142,4 @@
         rune = (rune&~KF) + 0x80;
 
     return rune;
-}
\ No newline at end of file
+}
--- a/x9dev.c
+++ b/x9dev.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008 Federico G. Benavento <benavento@gmail.com>
+ * Copyright (c) 2020 Michael Misch <michaelmisch1985@gmail.com> 
  * 
  * Permission is hereby granted, free of charge, to any person obtaining
  * a copy of this software and associated documentation files (the
@@ -43,7 +43,6 @@
 #include "dix.h"
 #include "miline.h"
 #include "shadow.h"
-#include "shadowfb.h"
 #include "x9dev.h"
 #include "keymap.h"
 #include "xkbsrv.h"
@@ -80,8 +79,6 @@
 void
 OsVendorInit(void)
 {
-    char temp[] = "/tmp/x9dev.XXXXXX";
-    LogInit(mktemp(temp), NULL);
 }
 
 void
@@ -374,37 +371,7 @@
     *topleft = *hot;
 }
 
-
-#ifdef SHADOWFB
 static void
-x9devRefreshArea(ScrnInfoPtr ptr, int nbox, BoxPtr pbox)
-{
-    int x1, y1, x2, y2;
-
-    if(nbox <= 0)
-        return;
-
-    x1 = y1 = 100000;
-    x2 = y2 = -100000;
-    while(nbox--) {
-        if(x1 > pbox->x1)
-            x1 = pbox->x1;
-        if(y1 > pbox->y1)
-            y1 = pbox->y1;
-        if(x2 < pbox->x2)
-            x2 = pbox->x2;
-        if(y2 < pbox->y2)
-            y2 = pbox->y2;
-        pbox++;
-    }
-    x9devRefreshScreen(x1, y1, x2, y2);
-}
-
-
-#else
-
-
-static void
 x9devShadowUpdate(ScreenPtr pScreen, shadowBufPtr pBuf)
 {
     BoxPtr pbox;
@@ -438,11 +405,6 @@
     return ret;
 }
 
-
-#endif
-
-
-
 static Bool
 x9devScreenInit(int index, ScreenPtr pScreen, int argc, char *argv[])
 {
@@ -504,16 +466,11 @@
 
     miInitializeBackingStore(pScreen);
 
-#ifdef SHADOWFB
-   if (!ShadowFBInit(pScreen, x9devRefreshArea))
-        return FALSE;
-#else
    if (!shadowSetup(pScreen))
         return FALSE;
 
     x9devCreateResourcesPtr = pScreen->CreateScreenResources;
     pScreen->CreateScreenResources = x9devCreateResources;
-#endif
 
     if (!fbCreateDefColormap(pScreen))
         return FALSE;