Bug#697062: s390x porting attempt

2016-08-23 Thread Ola Lundqvist
Hi Dann

I'm sorry for a very late reply. Spring was a little too busy for me.

Thanks a lot for the patch. I will not include it yet due to two reasons.
1) The display looks a little broken as you mention. I want fully
working to avoid serious bugs in the future.
2) It may be so that the package will be removed once we get tigervnc
included in Debian instead. TigerVNC is much more up to date than both
vnc4 and tightvnc.

Best regards

// Ola

On Wed, Mar 23, 2016 at 10:40 PM, dann frazier  wrote:
> I made an attempt at fixing the s390x port by cargo culting what has
> been done for other architectures. With this patch, I can connect to
> the server and start an icewm desktop. However, the screen is still
> pretty corrupted - text is offset, etc. See the attached screenshot.



-- 
 --- Inguza Technology AB --- MSc in Information Technology 
/  o...@inguza.comFolkebogatan 26\
|  o...@debian.org   654 68 KARLSTAD|
|  http://inguza.com/Mobile: +46 (0)70-332 1551 |
\  gpg/f.p.: 7090 A92B 18FE 7994 0C36 4FE4 18A1 B1CF 0FE5 3DD9  /
 ---



Bug#697062: s390x porting attempt

2016-03-23 Thread dann frazier
I made an attempt at fixing the s390x port by cargo culting what has
been done for other architectures. With this patch, I can connect to
the server and start an icewm desktop. However, the screen is still
pretty corrupted - text is offset, etc. See the attached screenshot.
Index: tightvnc-1.3.10/Xvnc/include/Xmd.h
===
--- tightvnc-1.3.10.orig/Xvnc/include/Xmd.h
+++ tightvnc-1.3.10/Xvnc/include/Xmd.h
@@ -59,7 +59,7 @@ SOFTWARE.
 #ifdef CRAY
 #define WORD64/* 64-bit architecture */
 #endif
-#if defined(__alpha) || defined(__alpha__) || defined(__x86_64__) || defined(__powerpc64__) || defined(__aarch64__)
+#if defined(__alpha) || defined(__alpha__) || defined(__x86_64__) || defined(__powerpc64__) || defined(__aarch64__) || defined(__s390x__)
 #define LONG64/* 32/64-bit architecture */
 #endif
 #ifdef __sgi
Index: tightvnc-1.3.10/Xvnc/programs/Xserver/include/servermd.h
===
--- tightvnc-1.3.10.orig/Xvnc/programs/Xserver/include/servermd.h
+++ tightvnc-1.3.10/Xvnc/programs/Xserver/include/servermd.h
@@ -464,6 +464,26 @@ SOFTWARE.
 
 #endif /* Linux/PPC */
 
+#if defined (linux) && defined(__s390x__)
+#  define BITMAP_SCANLINE_UNIT			64
+# define BITMAP_SCANLINE_PAD 			64
+# define LOG2_BITMAP_PAD			6
+# define LOG2_BYTES_PER_SCANLINE_PAD		3
+
+/* Add for handling protocol XPutImage and XGetImage; see comment in
+ * Alpha section.
+ */
+#define INTERNAL_VS_EXTERNAL_PADDING
+#define BITMAP_SCANLINE_UNIT_PROTO		32
+
+#define BITMAP_SCANLINE_PAD_PROTO 	 	32
+#define LOG2_BITMAP_PAD_PROTO			5
+#define LOG2_BYTES_PER_SCANLINE_PAD_PROTO	2
+/*#define GLYPHPADBYTES  4
+  #define GETLEFTBITS_ALIGNMENT  1*/
+
+#endif /* linux/s390x */
+
 #if defined (linux) && defined(__sparc__)
 
 #define IMAGE_BYTE_ORDER   MSBFirst
Index: tightvnc-1.3.10/Xvnc/config/cf/Imake.cf
===
--- tightvnc-1.3.10.orig/Xvnc/config/cf/Imake.cf
+++ tightvnc-1.3.10/Xvnc/config/cf/Imake.cf
@@ -700,6 +700,10 @@ XCOMM Keep cpp from replacing path eleme
 #   define s390Architecture
 #  undef __s390__
 # endif /* s390 */
+# ifdef __s390x__
+#   define s390xArchitecture
+#  undef __s390x__
+# endif /* s390x */
 # ifdef __aarch64__
 #  define AArch64Architecture
 #  undef __aarch64__
Index: tightvnc-1.3.10/Xvnc/config/cf/linux.cf
===
--- tightvnc-1.3.10.orig/Xvnc/config/cf/linux.cf
+++ tightvnc-1.3.10/Xvnc/config/cf/linux.cf
@@ -291,10 +291,10 @@ XCOMM binutils:	(LinuxBinUtilsMajorVersi
 #endif /* s390Architecture */
 
 #ifdef s390xArchitecture
-#define OptimzedCDebugFlags	-O2
+#define OptimizedCDebugFlags	-O2
 #define LinuxMachineDefines	-D__s390x__
 #define ServerOSDefines		XFree86ServerOSDefines -DDDXTIME -DPART_NET
-#define ServerExtraDefines	-DGCCUSESGAS XFree86ServerDefines
+#define ServerExtraDefines	-DGCCUSESGAS XFree86ServerDefines -D_XSERVER64
 #endif /* s390xArchitecture */
 
 #ifdef Ppc64Architecture