Skip to content

Commit

Permalink
#1215: dummy packaging for Debian, including DPI and 30-bit patches
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@14562 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Dec 17, 2016
1 parent 42f1258 commit d15fd69
Show file tree
Hide file tree
Showing 8 changed files with 231 additions and 0 deletions.
6 changes: 6 additions & 0 deletions debian/xserver-xorg-video-dummy/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
xserver-xorg-video-dummy (1:0.3.8-2) UNRELEASED; urgency=low

* DPI fixes for xpra
* 30-bit display support

-- Antoine Martin <[email protected]> Sat, 17 Dec 2016 17:03:38 +0700
1 change: 1 addition & 0 deletions debian/xserver-xorg-video-dummy/compat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9
35 changes: 35 additions & 0 deletions debian/xserver-xorg-video-dummy/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
Source: xserver-xorg-video-dummy
Section: x11
Priority: optional
Maintainer: Antoine Martin <[email protected]>
Uploaders: Antoine Martin <[email protected]>
Build-Depends:
debhelper,
quilt,
pkg-config,
xserver-xorg-dev,
x11proto-video-dev,
x11proto-xf86dga-dev,
x11proto-core-dev,
x11proto-fonts-dev,
x11proto-randr-dev,
x11proto-render-dev,
xutils-dev
Standards-Version: 3.9.8

Package: xserver-xorg-video-dummy
Architecture: any
Depends:
${shlibs:Depends},
${misc:Depends},
${xviddriver:Depends},
Provides:
${xviddriver:Provides}
Description: X.Org X server -- dummy display driver
This package provides a 'dummy' display driver, which does not actually
display anything.
.
More information about X.Org can be found at:
<URL:https://www.X.org>
.
This package is built from the X.org xf86-video-dummy driver module.
26 changes: 26 additions & 0 deletions debian/xserver-xorg-video-dummy/copyright
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
This package was downloaded from
https://xorg.freedesktop.org/releases/individual/driver/

Copyright (C) 1994-2003 The XFree86 Project, Inc. All Rights Reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is fur-
nished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FIT-
NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CON-
NECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Except as contained in this notice, the name of the XFree86 Project shall not
be used in advertising or otherwise to promote the sale, use or other deal-
ings in this Software without prior written authorization from the XFree86
Project.
98 changes: 98 additions & 0 deletions debian/xserver-xorg-video-dummy/patches/0002-Constant-DPI.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
--- a/src/dummy.h 2016-12-17 23:02:53.396287041 +0100
+++ b/src/dummy.h 2016-12-17 23:03:30.319616550 +0100
@@ -51,6 +51,7 @@
/* options */
OptionInfoPtr Options;
Bool swCursor;
+ Bool constantDPI;
/* proc pointer */
CloseScreenProcPtr CloseScreen;
xf86CursorInfoPtr CursorInfo;
--- a/src/dummy_driver.c 2016-12-14 21:54:20.000000000 +0100
+++ b/src/dummy_driver.c 2016-12-17 23:04:59.916416126 +0100
@@ -17,6 +17,12 @@
/* All drivers using the mi colormap manipulation need this */
#include "micmap.h"

+#ifdef RANDR
+#include "randrstr.h"
+#endif
+
+#include "windowstr.h"
+
/* identifying atom needed by magnifiers */
#include <X11/Xatom.h>
#include "property.h"
@@ -115,11 +121,15 @@
};

typedef enum {
- OPTION_SW_CURSOR
+ OPTION_SW_CURSOR,
+ OPTION_CONSTANT_DPI
} DUMMYOpts;

static const OptionInfoRec DUMMYOptions[] = {
{ OPTION_SW_CURSOR, "SWcursor", OPTV_BOOLEAN, {0}, FALSE },
+#ifdef RANDR
+ { OPTION_CONSTANT_DPI, "ConstantDPI", OPTV_BOOLEAN, {0}, FALSE },
+#endif
{ -1, NULL, OPTV_NONE, {0}, FALSE }
};

@@ -359,6 +369,7 @@
xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, dPtr->Options);

xf86GetOptValBool(dPtr->Options, OPTION_SW_CURSOR,&dPtr->swCursor);
+ xf86GetOptValBool(dPtr->Options, OPTION_CONSTANT_DPI, &dPtr->constantDPI);

if (device->videoRam != 0) {
pScrn->videoRam = device->videoRam;
@@ -639,10 +650,47 @@
return TRUE;
}

+const char *XDPY_PROPERTY = "dummy-constant-xdpi";
+const char *YDPY_PROPERTY = "dummy-constant-ydpi";
+static int get_dpi_value(WindowPtr root, const char *property_name, int default_dpi)
+{
+ PropertyPtr prop;
+ Atom type_atom = MakeAtom("CARDINAL", 8, TRUE);
+ Atom prop_atom = MakeAtom(property_name, strlen(property_name), FALSE);
+
+ for (prop = wUserProps(root); prop; prop = prop->next) {
+ if (prop->propertyName == prop_atom && prop->type == type_atom && prop->data) {
+ int v = (int) (*((CARD32 *) prop->data));
+ if ((v>0) && (v<4096)) {
+ xf86DrvMsg(0, X_INFO, "get_constant_dpi_value() found property \"%s\" with value=%i\n", property_name, (int) v);
+ return (int) v;
+ }
+ break;
+ }
+ }
+ return default_dpi;
+}
+
/* Mandatory */
Bool
DUMMYSwitchMode(SWITCH_MODE_ARGS_DECL)
{
+ SCRN_INFO_PTR(arg);
+ if (!dummyModeInit(pScrn, mode))
+ return FALSE;
+#ifdef RANDR
+ DUMMYPtr dPtr = DUMMYPTR(pScrn);
+ if (dPtr->constantDPI) {
+ int xDpi = get_dpi_value(pScrn->pScreen->root, XDPY_PROPERTY, pScrn->xDpi);
+ int yDpi = get_dpi_value(pScrn->pScreen->root, YDPY_PROPERTY, pScrn->yDpi);
+ //25.4 mm per inch: (254/10)
+ pScrn->pScreen->mmWidth = mode->HDisplay * 254 / xDpi / 10;
+ pScrn->pScreen->mmHeight = mode->VDisplay * 254 / yDpi / 10;
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "mm(dpi %ix%i)=%ix%i\n", xDpi, yDpi, pScrn->pScreen->mmWidth, pScrn->pScreen->mmHeight);
+ RRScreenSizeNotify(pScrn->pScreen);
+ RRTellChanged(pScrn->pScreen);
+ }
+#endif
return TRUE;
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
--- a/src/dummy.h 2016-12-17 23:33:33.279533389 +0100
+++ b/src/dummy.h 2016-12-17 23:33:56.695739166 +0100
@@ -69,7 +69,7 @@
int overlay_offset;
int videoKey;
int interlace;
- dummy_colors colors[256];
+ dummy_colors colors[1024];
pointer* FBBase;
Bool (*CreateWindow)() ; /* wrapped CreateWindow */
Bool prop;
--- a/src/dummy_driver.c 2016-12-17 23:33:47.446657886 +0100
+++ b/src/dummy_driver.c 2016-12-17 23:33:56.696739175 +0100
@@ -317,6 +317,7 @@
case 15:
case 16:
case 24:
+ case 30:
break;
default:
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
@@ -331,8 +332,8 @@
pScrn->rgbBits = 8;

/* Get the depth24 pixmap format */
- if (pScrn->depth == 24 && pix24bpp == 0)
- pix24bpp = xf86GetBppFromDepth(pScrn, 24);
+ if (pScrn->depth >= 24 && pix24bpp == 0)
+ pix24bpp = xf86GetBppFromDepth(pScrn, pScrn->depth);

/*
* This must happen after pScrn->display has been set because
@@ -623,7 +624,7 @@
if(!miCreateDefColormap(pScreen))
return FALSE;

- if (!xf86HandleColormaps(pScreen, 256, pScrn->rgbBits,
+ if (!xf86HandleColormaps(pScreen, 1024, pScrn->rgbBits,
DUMMYLoadPalette, NULL,
CMAP_PALETTED_TRUECOLOR
| CMAP_RELOAD_ON_MODE_SWITCH))
2 changes: 2 additions & 0 deletions debian/xserver-xorg-video-dummy/patches/series
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
0002-Constant-DPI.patch
0005-support-for-30-bit-depth-in-dummy-driver.patch
22 changes: 22 additions & 0 deletions debian/xserver-xorg-video-dummy/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/make -f

# Disable DGA support, it's been on the way out for a while already:
override_dh_auto_configure:
dh_auto_configure -- \
--libdir=\$${exec_prefix}/lib \
--disable-dga

# Install in debian/tmp to retain control through dh_install:
override_dh_auto_install:
dh_auto_install --destdir=debian/tmp

#override_dh_quilt_patch:
# ls -laR
# dh_quilt_patch

# That's a plugin, use appropriate warning level:
override_dh_shlibdeps:
dh_shlibdeps -- --warnings=6

%:
dh $@ --with quilt,xsf --builddirectory=build/

0 comments on commit d15fd69

Please sign in to comment.