[PATCH xf86-video-wayland] ANNOUNCEMENT: this is no longer a thing, use the Xwayland server instead
Pekka Paalanen
ppaalanen at gmail.com
Wed Sep 17 23:54:11 PDT 2014
From: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
Signed-off-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
---
COPYING | 22 --
Makefile.am | 29 ---
README | 17 +-
autogen.sh | 12 -
configure.ac | 72 ------
src/Makefile.am | 37 ----
src/compat-api.h | 106 ---------
src/wayland.c | 653 -------------------------------------------------------
src/wayland.h | 54 -----
9 files changed, 6 insertions(+), 996 deletions(-)
delete mode 100644 COPYING
delete mode 100644 Makefile.am
delete mode 100755 autogen.sh
delete mode 100644 configure.ac
delete mode 100644 src/Makefile.am
delete mode 100644 src/compat-api.h
delete mode 100644 src/wayland.c
delete mode 100644 src/wayland.h
diff --git a/COPYING b/COPYING
deleted file mode 100644
index 11a98df..0000000
--- a/COPYING
+++ /dev/null
@@ -1,22 +0,0 @@
-Copyright © 2002 SuSE Linux AG
-Copyright © 2010 commonIT
-Copyright © 2012 Raspberry Pi Foundation
-
-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 furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice (including the next
-paragraph) 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,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-DEALINGS IN THE SOFTWARE.
diff --git a/Makefile.am b/Makefile.am
deleted file mode 100644
index af06d52..0000000
--- a/Makefile.am
+++ /dev/null
@@ -1,29 +0,0 @@
-# Copyright 2005 Adam Jackson.
-#
-# 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
-# on the rights to use, copy, modify, merge, publish, distribute, sub
-# license, and/or sell copies of the Software, and to permit persons to whom
-# the Software is furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice (including the next
-# paragraph) 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,
-# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
-# ADAM JACKSON BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-SUBDIRS = src
-MAINTAINERCLEANFILES = ChangeLog
-
-.PHONY: ChangeLog
-
-ChangeLog:
- $(CHANGELOG_CMD)
-
-dist-hook: ChangeLog
diff --git a/README b/README
index 0702541..cea55df 100644
--- a/README
+++ b/README
@@ -1,20 +1,15 @@
+This used to be:
xf86-video-wlshm - virtual/offscreen frame buffer driver for the Xorg X server
-Please submit bugs & patches to the Xorg bugzilla:
+It is no longer.
+
+Please, use the Xwayland server that is built from
+ http://cgit.freedesktop.org/xorg/xserver/
+and was first released with xserver 1.16.
- https://bugs.freedesktop.org/enter_bug.cgi?product=wayland
All questions regarding this software should be directed at the
Wayland mailing list:
http://lists.freedesktop.org/mailman/listinfo/wayland-devel
-The master development code repository can be found at:
-
- git://anongit.freedesktop.org/git/xorg/driver/xf86-video-wlshm
-
- http://cgit.freedesktop.org/xorg/driver/xf86-video-wlshm
-
-For more information on the git code manager, see:
-
- http://wiki.x.org/wiki/GitPage
diff --git a/autogen.sh b/autogen.sh
deleted file mode 100755
index 904cd67..0000000
--- a/autogen.sh
+++ /dev/null
@@ -1,12 +0,0 @@
-#! /bin/sh
-
-srcdir=`dirname $0`
-test -z "$srcdir" && srcdir=.
-
-ORIGDIR=`pwd`
-cd $srcdir
-
-autoreconf -v --install || exit 1
-cd $ORIGDIR || exit $?
-
-$srcdir/configure --enable-maintainer-mode "$@"
diff --git a/configure.ac b/configure.ac
deleted file mode 100644
index 3688fed..0000000
--- a/configure.ac
+++ /dev/null
@@ -1,72 +0,0 @@
-# Copyright 2005 Adam Jackson.
-#
-# 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
-# on the rights to use, copy, modify, merge, publish, distribute, sub
-# license, and/or sell copies of the Software, and to permit persons to whom
-# the Software is furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice (including the next
-# paragraph) 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,
-# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
-# ADAM JACKSON BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-# Process this file with autoconf to produce a configure script
-
-# Initialize Autoconf
-AC_PREREQ([2.60])
-AC_INIT([xf86-video-wayland],
- [0.4.0],
- [https://bugs.freedesktop.org/enter_bug.cgi?product=wayland],
- [xf86-video-wayland])
-AC_CONFIG_SRCDIR([Makefile.am])
-AC_CONFIG_HEADERS([config.h])
-AC_CONFIG_AUX_DIR(.)
-
-# Initialize Automake
-AM_INIT_AUTOMAKE([foreign dist-bzip2])
-AM_MAINTAINER_MODE
-
-# Require xorg-macros: XORG_DEFAULT_OPTIONS
-m4_ifndef([XORG_MACROS_VERSION],
- [m4_fatal([must install xorg-macros 1.3 or later before running autoconf/autogen])])
-XORG_MACROS_VERSION(1.3)
-XORG_DEFAULT_OPTIONS
-
-# Initialize libtool
-AC_DISABLE_STATIC
-AC_PROG_LIBTOOL
-
-AH_TOP([#include "xorg-server.h"])
-
-# Define a configure option for an alternate module directory
-AC_ARG_WITH(xorg-module-dir, [ --with-xorg-module-dir=DIR ],
- [ moduledir="$withval" ],
- [ moduledir="$libdir/xorg/modules" ])
-AC_SUBST(moduledir)
-
-
-# Store the list of server defined optional extensions in REQUIRED_MODULES
-XORG_DRIVER_CHECK_EXT(RANDR, randrproto)
-XORG_DRIVER_CHECK_EXT(RENDER, renderproto)
-XORG_DRIVER_CHECK_EXT(XV, videoproto)
-XORG_DRIVER_CHECK_EXT(XFreeXDGA, xf86dgaproto)
-
-# Obtain compiler/linker options for the driver dependencies
-PKG_CHECK_MODULES(XORG, [xorg-server >= 1.0.99.901] xproto fontsproto $REQUIRED_MODULES)
-
-# Checks for libraries.
-PKG_CHECK_MODULES(WAYLAND, [wayland-client >= 1.0])
-
-AC_CONFIG_FILES([
- Makefile
- src/Makefile
-])
-AC_OUTPUT
diff --git a/src/Makefile.am b/src/Makefile.am
deleted file mode 100644
index 280943a..0000000
--- a/src/Makefile.am
+++ /dev/null
@@ -1,37 +0,0 @@
-# Copyright 2005 Adam Jackson.
-#
-# 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
-# on the rights to use, copy, modify, merge, publish, distribute, sub
-# license, and/or sell copies of the Software, and to permit persons to whom
-# the Software is furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice (including the next
-# paragraph) 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,
-# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
-# ADAM JACKSON BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-
-# this is obnoxious:
-# -module lets us name the module exactly how we want
-# -avoid-version prevents gratuitous .0.0.0 version numbers on the end
-# _ladir passes a wlshm rpath to libtool so the thing will actually link
-# TODO: -nostdlib/-Bstatic/-lgcc platform magic, not installing the .a, etc.
-
-AM_CFLAGS = $(XORG_CFLAGS) $(PCIACCESS_CFLAGS)
-
-wayland_drv_la_LTLIBRARIES = wayland_drv.la
-wayland_drv_la_LDFLAGS = -module -avoid-version
-wayland_drv_ladir = @moduledir@/drivers
-
-wayland_drv_la_SOURCES = \
- wayland.c \
- wayland.h \
- compat-api.h
diff --git a/src/compat-api.h b/src/compat-api.h
deleted file mode 100644
index 6b76572..0000000
--- a/src/compat-api.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Copyright 2012 Red Hat, Inc.
- *
- * 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 furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) 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,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Author: Dave Airlie <airlied at redhat.com>
- */
-
-/* this file provides API compat between server post 1.13 and pre it,
- it should be reused inside as many drivers as possible */
-#ifndef COMPAT_API_H
-#define COMPAT_API_H
-
-#ifndef GLYPH_HAS_GLYPH_PICTURE_ACCESSOR
-#define GetGlyphPicture(g, s) GlyphPicture((g))[(s)->myNum]
-#define SetGlyphPicture(g, s, p) GlyphPicture((g))[(s)->myNum] = p
-#endif
-
-#ifndef XF86_HAS_SCRN_CONV
-#define xf86ScreenToScrn(s) xf86Screens[(s)->myNum]
-#define xf86ScrnToScreen(s) screenInfo.screens[(s)->scrnIndex]
-#endif
-
-#ifndef XF86_SCRN_INTERFACE
-
-#define SCRN_ARG_TYPE int
-#define SCRN_INFO_PTR(arg1) ScrnInfoPtr scrn = xf86Screens[(arg1)]
-
-#define SCREEN_ARG_TYPE int
-#define SCREEN_PTR(arg1) ScreenPtr screen = screenInfo.screens[(arg1)]
-
-#define SCREEN_INIT_ARGS_DECL int scrnIndex, ScreenPtr screen, int argc, char **argv
-
-#define BLOCKHANDLER_ARGS_DECL int arg, pointer blockData, pointer timeout, pointer read_mask
-#define BLOCKHANDLER_ARGS arg, blockData, timeout, read_mask
-
-#define WAKEUPHANDLER_ARGS_DECL int arg, pointer wakeupData, unsigned long result, pointer read_mask
-#define WAKEUPHANDLER_ARGS arg, wakeupData, result, read_mask
-
-#define CLOSE_SCREEN_ARGS_DECL int scrnIndex, ScreenPtr screen
-#define CLOSE_SCREEN_ARGS scrnIndex, screen
-
-#define ADJUST_FRAME_ARGS_DECL int arg, int x, int y, int flags
-#define ADJUST_FRAME_ARGS(arg, x, y) (arg)->scrnIndex, x, y, 0
-
-#define SWITCH_MODE_ARGS_DECL int arg, DisplayModePtr mode, int flags
-#define SWITCH_MODE_ARGS(arg, m) (arg)->scrnIndex, m, 0
-
-#define FREE_SCREEN_ARGS_DECL int arg, int flags
-
-#define VT_FUNC_ARGS_DECL int arg, int flags
-#define VT_FUNC_ARGS(flags) scrn->scrnIndex, (flags)
-
-#define XF86_ENABLEDISABLEFB_ARG(x) ((x)->scrnIndex)
-
-#else
-#define SCRN_ARG_TYPE ScrnInfoPtr
-#define SCRN_INFO_PTR(arg1) ScrnInfoPtr scrn = (arg1)
-
-#define SCREEN_ARG_TYPE ScreenPtr
-#define SCREEN_PTR(arg1) ScreenPtr screen = (arg1)
-
-#define SCREEN_INIT_ARGS_DECL ScreenPtr screen, int argc, char **argv
-
-#define BLOCKHANDLER_ARGS_DECL ScreenPtr arg, pointer timeout, pointer read_mask
-#define BLOCKHANDLER_ARGS arg, timeout, read_mask
-
-#define WAKEUPHANDLER_ARGS_DECL ScreenPtr arg, unsigned long result, pointer read_mask
-#define WAKEUPHANDLER_ARGS arg, result, read_mask
-
-#define CLOSE_SCREEN_ARGS_DECL ScreenPtr screen
-#define CLOSE_SCREEN_ARGS screen
-
-#define ADJUST_FRAME_ARGS_DECL ScrnInfoPtr arg, int x, int y
-#define ADJUST_FRAME_ARGS(arg, x, y) arg, x, y
-
-#define SWITCH_MODE_ARGS_DECL ScrnInfoPtr arg, DisplayModePtr mode
-#define SWITCH_MODE_ARGS(arg, m) arg, m
-
-#define FREE_SCREEN_ARGS_DECL ScrnInfoPtr arg
-
-#define VT_FUNC_ARGS_DECL ScrnInfoPtr arg
-#define VT_FUNC_ARGS(flags) scrn
-
-#define XF86_ENABLEDISABLEFB_ARG(x) (x)
-
-#endif
-
-#endif
diff --git a/src/wayland.c b/src/wayland.c
deleted file mode 100644
index 8560541..0000000
--- a/src/wayland.c
+++ /dev/null
@@ -1,653 +0,0 @@
-/*
- * Copyright © 2002 SuSE Linux AG
- * Copyright © 2010 commonIT
- * Copyright © 2012 Raspberry Pi Foundation
- *
- * 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 furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) 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,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Authors: Egbert Eich <eich at freedesktop.org>
- * Corentin Chary <corentincj at iksaif.net>
- * Daniel Stone <daniel at fooishbar.org>
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-/* All drivers should typically include these */
-#include "xf86.h"
-#include "xf86_OSproc.h"
-#include "xf86Modes.h"
-#include "micmap.h"
-
-/* All drivers initialising the SW cursor need this */
-#include "mipointer.h"
-
-/* All drivers using framebuffer need this */
-#include "fb.h"
-#include "picturestr.h"
-
-/* All drivers using xwayland module need this */
-#include "xwayland.h"
-#include <xf86Priv.h>
-
-/*
- * Driver data structures.
- */
-#include "wayland.h"
-#include "compat-api.h"
-
-#include <sys/mman.h>
-#include <unistd.h>
-#include <errno.h>
-
-/* These need to be checked */
-#include <X11/X.h>
-#include <X11/Xproto.h>
-#include "scrnintstr.h"
-#include "servermd.h"
-
-static DevPrivateKeyRec wlshm_pixmap_private_key;
-
-static Bool
-wlshm_get_device(ScrnInfoPtr pScrn)
-{
- /*
- * Allocate a wlshm_device, and hook it into pScrn->driverPrivate.
- * pScrn->driverPrivate is initialised to NULL, so we can check if
- * the allocation has already been done.
- */
- if (pScrn->driverPrivate != NULL)
- return TRUE;
-
- pScrn->driverPrivate = xnfcalloc(sizeof(struct wlshm_device), 1);
-
- if (pScrn->driverPrivate == NULL)
- return FALSE;
-
- return TRUE;
-}
-
-static void
-wlshm_free_device(ScrnInfoPtr pScrn)
-{
- if (pScrn->driverPrivate == NULL)
- return;
-
- free(pScrn->driverPrivate);
- pScrn->driverPrivate = NULL;
-}
-
-static Bool
-wlshm_save_screen(ScreenPtr pScreen, int mode)
-{
- return TRUE;
-}
-
-static Bool
-wlshm_enter_vt(VT_FUNC_ARGS_DECL)
-{
- return TRUE;
-}
-
-static void
-wlshm_leave_vt(VT_FUNC_ARGS_DECL)
-{
-}
-
-static Bool
-wlshm_switch_mode(SWITCH_MODE_ARGS_DECL)
-{
- return TRUE;
-}
-
-static void
-wlshm_adjust_frame(ADJUST_FRAME_ARGS_DECL)
-{
-}
-
-static void
-block_handler(pointer blockData, OSTimePtr pTimeout, pointer pReadMask)
-{
- struct wlshm_device *wlshm = (struct wlshm_device *) blockData;
-
- if (wlshm->xwl_screen)
- xwl_screen_post_damage(wlshm->xwl_screen);
-}
-
-static void
-wakeup_handler(pointer blockData, int result, pointer pReadMask)
-{
-}
-
-static Bool
-wlshm_close_screen(CLOSE_SCREEN_ARGS_DECL)
-{
- ScrnInfoPtr pScrn = xf86Screens[screen->myNum];
- struct wlshm_device *wlshm = wlshm_scrninfo_priv(pScrn);
-
- if (wlshm->fb)
- free(wlshm->fb);
- wlshm->fb = NULL;
-
- RemoveBlockAndWakeupHandlers(block_handler, wakeup_handler, wlshm);
-
- xwl_screen_close(wlshm->xwl_screen);
-
- pScrn->vtSema = FALSE;
- screen->CloseScreen = wlshm->CloseScreen;
- return (*screen->CloseScreen)(CLOSE_SCREEN_ARGS);
-}
-
-static void
-wlshm_free_screen(FREE_SCREEN_ARGS_DECL)
-{
- SCRN_INFO_PTR(arg);
- struct wlshm_device *wlshm = wlshm_scrninfo_priv(scrn);
-
- if (wlshm) {
- if (wlshm->xwl_screen)
- xwl_screen_destroy(wlshm->xwl_screen);
- wlshm->xwl_screen = NULL;
- }
-
- wlshm_free_device(scrn);
-}
-
-static ModeStatus
-wlshm_valid_mode(SCRN_ARG_TYPE arg, DisplayModePtr mode, Bool verbose, int flags)
-{
- return MODE_OK;
-}
-
-static void
-wlshm_free_pixmap(PixmapPtr pixmap)
-{
- ScreenPtr pScreen = pixmap->drawable.pScreen;
- struct wlshm_device *wlshm = wlshm_screen_priv(pScreen);
- struct wlshm_pixmap *d;
-
- d = dixLookupPrivate(&pixmap->devPrivates, &wlshm_pixmap_private_key);
- if (!d)
- return;
-
- pScreen->ModifyPixmapHeader(pixmap, 0, 0, 0, 0, 0, NULL);
-
- munmap(d->data, d->bytes);
- close(d->fd);
- free(d);
- dixSetPrivate(&pixmap->devPrivates, &wlshm_pixmap_private_key, NULL);
-}
-
-static Bool
-wlshm_screen_init(SCREEN_INIT_ARGS_DECL)
-{
- ScrnInfoPtr pScrn;
- struct wlshm_device *wlshm;
- int ret;
- VisualPtr visual;
-
- if (!dixRegisterPrivateKey(&wlshm_pixmap_private_key, PRIVATE_PIXMAP, 0))
- return BadAlloc;
-
- pScrn = xf86Screens[screen->myNum];
- wlshm = wlshm_screen_priv(screen);
-
- /* Reset visual list. */
- miClearVisualTypes();
-
- /* Setup the visuals we support. */
- if (!miSetVisualTypes(pScrn->depth,
- miGetDefaultVisualMask(pScrn->depth),
- pScrn->rgbBits, pScrn->defaultVisual))
- return FALSE;
-
- if (!miSetPixmapDepths())
- return FALSE;
-
- wlshm->fb = malloc(pScrn->virtualX * pScrn->virtualY * pScrn->bitsPerPixel);
- if (!wlshm->fb)
- return FALSE;
-
- /*
- * Call the framebuffer layer's ScreenInit function, and fill in other
- * pScreen fields.
- */
- ret = fbScreenInit(screen, wlshm->fb,
- pScrn->virtualX, pScrn->virtualY,
- pScrn->xDpi, pScrn->yDpi,
- pScrn->displayWidth, pScrn->bitsPerPixel);
- if (!ret)
- return FALSE;
-
- if (pScrn->depth > 8) {
- /* Fixup RGB ordering */
- visual = screen->visuals + screen->numVisuals;
- while (--visual >= screen->visuals) {
- if ((visual->class | DynamicClass) != DirectColor)
- continue;
-
- visual->offsetRed = pScrn->offset.red;
- visual->offsetGreen = pScrn->offset.green;
- visual->offsetBlue = pScrn->offset.blue;
- visual->redMask = pScrn->mask.red;
- visual->greenMask = pScrn->mask.green;
- visual->blueMask = pScrn->mask.blue;
- }
- }
-
- /* must be after RGB ordering fixed */
- fbPictureInit(screen, 0, 0);
-
- xf86SetBlackWhitePixels(screen);
-
- xf86SetBackingStore(screen);
- xf86SetSilkenMouse(screen);
-
- /* Initialise cursor functions */
- miDCInitialize(screen, xf86GetPointerScreenFuncs());
-
- /* FIXME: colourmap */
- miCreateDefColormap(screen);
-
- screen->SaveScreen = wlshm_save_screen;
-
- /* Wrap the current CloseScreen function */
- wlshm->CloseScreen = screen->CloseScreen;
- screen->CloseScreen = wlshm_close_screen;
-
- /* Report any unused options (only for the first generation) */
- if (serverGeneration == 1)
- xf86ShowUnusedOptions(pScrn->scrnIndex, pScrn->options);
-
- miScreenDevPrivateInit(screen, screen->width, wlshm->fb);
-
- RegisterBlockAndWakeupHandlers(block_handler, wakeup_handler, wlshm);
-
- if (wlshm->xwl_screen)
- return (xwl_screen_init(wlshm->xwl_screen, screen) == Success);
-
- return TRUE;
-}
-
-static int
-wlshm_create_window_buffer(struct xwl_window *xwl_window,
- PixmapPtr pixmap)
-{
- ScreenPtr pScreen = pixmap->drawable.pScreen;
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- char filename[] = "/tmp/wayland-shm-XXXXXX";
- int ret = BadAlloc;
- struct wlshm_pixmap *d;
-
- d = calloc(sizeof(struct wlshm_pixmap), 1);
- if (!d) {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "can't alloc wlshm pixmap: %s\n",
- strerror(errno));
- goto exit;
- }
- d->fd = -1;
- d->data = MAP_FAILED;
-
- d->fd = mkstemp(filename);
- if (d->fd < 0) {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "open %s failed: %s\n",
- filename, strerror(errno));
- goto exit;
- }
-
- d->bytes = pixmap->drawable.width * pixmap->drawable.height *
- (pixmap->drawable.bitsPerPixel / 8);
-
- if (ftruncate(d->fd, d->bytes) < 0) {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "ftruncate failed: %s\n",
- strerror(errno));
- goto exit;
- }
-
- d->data = mmap(NULL, d->bytes, PROT_READ | PROT_WRITE, MAP_SHARED, d->fd, 0);
- unlink(filename);
-
- if (d->data == MAP_FAILED) {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "mmap failed: %s\n",
- strerror(errno));
- goto exit;
- }
-
- ret = xwl_create_window_buffer_shm(xwl_window, pixmap, d->fd);
- if (ret != Success) {
- goto exit;
- }
-
- memcpy(d->data, pixmap->devPrivate.ptr, d->bytes);
-
- pScreen->ModifyPixmapHeader(pixmap, 0, 0, 0, 0, 0, d->data);
-
- dixSetPrivate(&pixmap->devPrivates, &wlshm_pixmap_private_key, d);
-
- return ret;
-exit:
- if (d) {
- if (d->fd != -1)
- close(d->fd);
- if (d->data != MAP_FAILED)
- munmap(d->data, d->bytes);
- free(d);
- }
-
- return ret;
-}
-
-static struct xwl_driver xwl_driver = {
- .version = 2,
- .create_window_buffer = wlshm_create_window_buffer,
-};
-
-static const OptionInfoRec wlshm_options[] = {
- { -1, NULL, OPTV_NONE, {0}, FALSE }
-};
-
-static Bool
-wlshm_pre_init(ScrnInfoPtr pScrn, int flags)
-{
- struct wlshm_device *wlshm;
- int i;
- GDevPtr device;
- int flags24;
-
- if (flags & PROBE_DETECT)
- return TRUE;
-
- if (!xorgWayland) {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "You must run Xorg with -xwayland parameter\n");
- return FALSE;
- }
-
- /* Allocate the wlshm_device driverPrivate */
- if (!wlshm_get_device(pScrn))
- return FALSE;
-
- wlshm = wlshm_scrninfo_priv(pScrn);
-
- pScrn->chipset = WAYLAND_DRIVER_NAME;
- pScrn->monitor = pScrn->confScreen->monitor;
-
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Initializing Wayland SHM driver\n");
-
- flags24 = Support32bppFb | SupportConvert24to32 | PreferConvert24to32;
- if (!xf86SetDepthBpp(pScrn, 0, 0, 0, flags24))
- return FALSE;
-
- /* Check that the returned depth is one we support */
- switch (pScrn->depth) {
- case 24:
- case 30:
- case 32:
- break;
- default:
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "Given depth (%d) is not supported by this driver\n",
- pScrn->depth);
- return FALSE;
- }
-
- xf86PrintDepthBpp(pScrn);
-
- /*
- * This must happen after pScrn->display has been set because
- * xf86SetWeight references it.
- */
- if (pScrn->depth > 8) {
- /* The defaults are OK for us */
- rgb zeros = {0, 0, 0};
-
- if (!xf86SetWeight(pScrn, zeros, zeros))
- return FALSE;
-
- /* XXX check that weight returned is supported */
- ;
- }
-
- if (!xf86SetDefaultVisual(pScrn, -1))
- return FALSE;
-
- if (pScrn->depth > 1) {
- Gamma zeros = {0.0, 0.0, 0.0};
-
- if (!xf86SetGamma(pScrn, zeros))
- return FALSE;
- }
-
- device = xf86GetEntityInfo(pScrn->entityList[0])->device;
- xf86CollectOptions(pScrn, device->options);
- free(device);
-
- /* Process the options */
- if (!(wlshm->options = malloc(sizeof(wlshm_options))))
- return FALSE;
-
- memcpy(wlshm->options, wlshm_options, sizeof(wlshm_options));
-
- xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, wlshm->options);
-
- wlshm->xwl_screen = xwl_screen_create();
- if (!wlshm->xwl_screen) {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "Failed to initialize xwayland.\n");
- goto error;
- }
-
- if (!xwl_screen_pre_init(pScrn, wlshm->xwl_screen, 0, &xwl_driver)) {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "Failed to pre-init xwayland screen\n");
- xwl_screen_destroy(wlshm->xwl_screen);
- }
-
- /* Subtract memory for HW cursor */
- xf86ValidateModesSize(pScrn, pScrn->monitor->Modes,
- pScrn->display->virtualX,
- pScrn->display->virtualY,
- 0);
-
- /* Prune the modes marked as invalid */
- xf86PruneDriverModes(pScrn);
-
- if (pScrn->modes == NULL) {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "No valid modes found\n");
- goto error;
- }
-
- /*
- * Set the CRTC parameters for all of the modes based on the type
- * of mode, and the chipset's interlace requirements.
- *
- * Calling this is required if the mode->Crtc* values are used by the
- * driver and if the driver doesn't provide code to set them. They
- * are not pre-initialised at all.
- */
- xf86SetCrtcForModes(pScrn, 0);
-
- /* Set the current mode to the first in the list */
- pScrn->currentMode = pScrn->modes;
-
- /* Print the list of modes being used */
- xf86PrintModes(pScrn);
-
- /* If monitor resolution is set on the command line, use it */
- xf86SetDpi(pScrn, 0, 0);
-
- if (xf86LoadSubModule(pScrn, "fb") == NULL)
- goto error;
-
- /* We have no contiguous physical fb in physical memory */
- pScrn->memPhysBase = 0;
- pScrn->fbOffset = 0;
-
- return TRUE;
-
-error:
- wlshm_free_device(pScrn);
- return FALSE;
-}
-
-/* Mandatory */
-static Bool
-wayland_probe(DriverPtr drv, int flags)
-{
- Bool found = FALSE;
- int count;
- GDevPtr *sections;
- int i;
-
- if (flags & PROBE_DETECT)
- return FALSE;
- /*
- * Find the config file Device sections that match this
- * driver, and return if there are none.
- */
- count = xf86MatchDevice(WAYLAND_DRIVER_NAME, §ions);
-
- if (count <= 0) {
- return FALSE;
- }
-
- for (i = 0; i < count; i++) {
- int entityIndex = xf86ClaimNoSlot(drv, 0, sections[i], TRUE);
- ScrnInfoPtr pScrn = xf86AllocateScreen(drv, 0);
-
- if (!pScrn)
- continue;
-
- xf86AddEntityToScreen(pScrn, entityIndex);
- pScrn->driverVersion = COMBINED_DRIVER_VERSION;
- pScrn->driverName = WAYLAND_DRIVER_NAME;
- pScrn->name = WAYLAND_DRIVER_NAME;
- pScrn->Probe = wayland_probe;
- pScrn->PreInit = wlshm_pre_init;
- pScrn->ScreenInit = wlshm_screen_init;
- pScrn->SwitchMode = wlshm_switch_mode;
- pScrn->AdjustFrame = wlshm_adjust_frame;
- pScrn->EnterVT = wlshm_enter_vt;
- pScrn->LeaveVT = wlshm_leave_vt;
- pScrn->FreeScreen = wlshm_free_screen;
- pScrn->ValidMode = wlshm_valid_mode;
-
- found = TRUE;
- }
-
- free(sections);
-
- return found;
-}
-
-static const OptionInfoRec *
-wayland_available_options(int chipid, int busid)
-{
- return wlshm_options;
-}
-
-#ifndef HW_SKIP_CONSOLE
-#define HW_SKIP_CONSOLE 4
-#endif
-
-#ifndef HW_WAYLAND
-#define HW_WAYLAND 8
-#endif
-
-static Bool
-wayland_driver_func(ScrnInfoPtr pScrn, xorgDriverFuncOp op, pointer ptr)
-{
- CARD32 *flag;
-
- switch (op) {
- case GET_REQUIRED_HW_INTERFACES:
- flag = (CARD32*)ptr;
- (*flag) = HW_WAYLAND;
- return TRUE;
- default:
- return FALSE;
- }
-}
-
-/*
- * This contains the functions needed by the server after loading the driver
- * module. It must be supplied, and gets passed back by the SetupProc
- * function in the dynamic case. In the static case, a reference to this
- * is compiled in, and this requires that the name of this DriverRec be
- * an upper-case version of the driver name.
- */
-
-_X_EXPORT DriverRec wayland = {
- COMBINED_DRIVER_VERSION,
- WAYLAND_DRIVER_NAME,
- NULL,
- wayland_probe,
- wayland_available_options,
- NULL,
- 0,
- wayland_driver_func
-};
-
-static XF86ModuleVersionInfo wayland_vers_rec =
-{
- WAYLAND_DRIVER_NAME,
- MODULEVENDORSTRING,
- MODINFOSTRING1,
- MODINFOSTRING2,
- XORG_VERSION_CURRENT,
- PACKAGE_VERSION_MAJOR, PACKAGE_VERSION_MINOR, PACKAGE_VERSION_PATCHLEVEL,
- ABI_CLASS_VIDEODRV,
- ABI_VIDEODRV_VERSION,
- MOD_CLASS_VIDEODRV,
- { 0, 0, 0, 0 }
-};
-
-
-static pointer
-wayland_setup(pointer module, pointer opts, int *errmaj, int *errmin)
-{
- static Bool initialized = FALSE;
-
- if (initialized) {
- if (errmaj)
- *errmaj = LDR_ONCEONLY;
- return NULL;
- }
-
- initialized = TRUE;
- xf86AddDriver(&wayland, module, HaveDriverFuncs);
-
- /*
- * The return value must be non-NULL on success even though there
- * is no TearDownProc.
- */
- return (pointer) 1;
-}
-
-/*
- * This is the module init data.
- * Its name has to be the driver name followed by ModuleData
- */
-_X_EXPORT XF86ModuleData waylandModuleData = {
- &wayland_vers_rec,
- wayland_setup,
- NULL
-};
diff --git a/src/wayland.h b/src/wayland.h
deleted file mode 100644
index 2ae55cb..0000000
--- a/src/wayland.h
+++ /dev/null
@@ -1,54 +0,0 @@
-#ifndef _XF86_VIDEO_WAYLAND_SHM_H_
-#define _XF86_VIDEO_WAYLAND_SHM_H_
-
-/* All drivers should typically include these */
-#include "xf86.h"
-#include "xf86_OSproc.h"
-
-#include "xf86Cursor.h"
-
-#include <string.h>
-
-#include "xwayland.h"
-
-#define WAYLAND_DRIVER_NAME "wayland"
-#define COMBINED_DRIVER_VERSION \
- ((PACKAGE_VERSION_MAJOR << 16) | (PACKAGE_VERSION_MINOR << 8) | \
- PACKAGE_VERSION_PATCHLEVEL)
-
-/* globals */
-struct wlshm_device
-{
- /* options */
- OptionInfoPtr options;
-
- /* proc pointer */
- CloseScreenProcPtr CloseScreen;
- CreateWindowProcPtr CreateWindow;
- DestroyWindowProcPtr DestroyWindow;
- UnrealizeWindowProcPtr UnrealizeWindow;
- SetWindowPixmapProcPtr SetWindowPixmap;
-
- pointer* fb;
-
- struct xwl_screen *xwl_screen;
-};
-
-struct wlshm_pixmap {
- int fd;
- void *orig;
- void *data;
- size_t bytes;
-};
-
-static inline struct wlshm_device *wlshm_scrninfo_priv(ScrnInfoPtr pScrn)
-{
- return ((struct wlshm_device *)((pScrn)->driverPrivate));
-}
-
-static inline struct wlshm_device *wlshm_screen_priv(ScreenPtr pScreen)
-{
- return wlshm_scrninfo_priv(xf86Screens[pScreen->myNum]);
-}
-
-#endif
--
1.8.5.5
More information about the wayland-devel
mailing list