xf86-video-wsfb-dfbsd: Import xf86-video-wsfb-0.0.4 as wip/xf86-video-wsfb-dfbsd

Knobs with patches from NetBSD xsrc
This commit is contained in:
David Shao 2019-07-22 22:19:50 -07:00
parent 70639db527
commit d80c7280dd
11 changed files with 1959 additions and 0 deletions

View File

@ -5016,6 +5016,7 @@ SUBDIR+= xf86-video-intel-git
SUBDIR+= xf86-video-intel-old
SUBDIR+= xf86-video-scfb-dfbsd
SUBDIR+= xf86-video-virtualbox
SUBDIR+= xf86-video-wsfb-dfbsd
SUBDIR+= xf86rushproto
SUBDIR+= xfce4-wm-dfbsd
SUBDIR+= xfs

View File

@ -0,0 +1,2 @@
This is the X11 video driver for NetBSD and OpenBSD wsdisplay
framebuffer devices. This is from the modular X.org project.

View File

@ -0,0 +1,83 @@
# $NetBSD: Makefile,v 1.19 2018/05/13 03:45:07 ryoon Exp $
DISTNAME= xf86-video-wsfb-0.4.0
PKGREVISION= 8
CATEGORIES= x11
MASTER_SITES= ${MASTER_SITE_XORG:=driver/}
EXTRACT_SUFX= .tar.bz2
MAINTAINER= reed@NetBSD.org
HOMEPAGE= http://xorg.freedesktop.org/
COMMENT= Modular Xorg wsdisplay framebuffer video driver
ONLY_FOR_PLATFORM= NetBSD-*-* OpenBSD-*-*
USE_LIBTOOL= YES
GNU_CONFIGURE= YES
USE_TOOLS+= pkg-config
CONFIGURE_ENV.SunOS+= DRIVER_MAN_SUFFIX=4
.include "../../mk/bsd.prefs.mk"
PKG_OPTIONS_VAR= PKG_OPTIONS.xf86-video-wsfb
PKG_SUPPORTED_OPTIONS=
PKG_SUGGESTED_OPTIONS=
PKG_SUPPORTED_OPTIONS+= ramdac_xsrc_netbsd
PKG_SUPPORTED_OPTIONS+= hwcursor_xsrc_netbsd
PKG_SUPPORTED_OPTIONS+= luna68k_xsrc_netbsd
PKG_SUPPORTED_OPTIONS+= bgra_xsrc_netbsd
PKG_SUPPORTED_OPTIONS+= wildcat_xsrc_netbsd
PKG_SUPPORTED_OPTIONS+= modesetting_fb_xsrc_netbsd
PKG_SUPPORTED_OPTIONS+= strict_xsrc_netbsd
# As of 2019-01-30 core ramdac code and ramdac drivers
# removed from xorg server
.if ${OPSYS} == "NetBSD"
PKG_SUGGESTED_OPTIONS+= ramdac_xsrc_netbsd
.endif
.if ${OPSYS} == "NetBSD"
PKG_SUGGESTED_OPTIONS+= hwcursor_xsrc_netbsd
PKG_SUGGESTED_OPTIONS+= luna68k_xsrc_netbsd
PKG_SUGGESTED_OPTIONS+= bgra_xsrc_netbsd
PKG_SUGGESTED_OPTIONS+= wildcat_xsrc_netbsd
PKG_SUGGESTED_OPTIONS+= modesetting_fb_xsrc_netbsd
PKG_SUGGESTED_OPTIONS+= strict_xsrc_netbsd
.endif
.include "../../mk/bsd.options.mk"
.if !empty(PKG_OPTIONS:Mramdac_xsrc_netbsd)
CPPFLAGS+= -DRAMDAC_XSRC_NETBSD
.endif
.if !empty(PKG_OPTIONS:Mhwcursor_xsrc_netbsd)
CPPFLAGS+= -DHWCURSOR_XSRC_NETBSD
.endif
.if !empty(PKG_OPTIONS:Mluna68k_xsrc_netbsd)
CPPFLAGS+= -DLUNA68K_XSRC_NETBSD
.endif
.if !empty(PKG_OPTIONS:Mbgra_xsrc_netbsd)
CPPFLAGS+= -DBGRA_XSRC_NETBSD
.endif
.if !empty(PKG_OPTIONS:Mwildcat_xsrc_netbsd)
CPPFLAGS+= -DWILDCAT_XSRC_NETBSD
.endif
.if !empty(PKG_OPTIONS:Mmodesetting_fb_xsrc_netbsd)
CPPFLAGS+= -DMODESETTING_FB_XSRC_NETBSD
.endif
.if !empty(PKG_OPTIONS:Mstrict_xsrc_netbsd)
CPPFLAGS+= -DSTRICT_XSRC_NETBSD
.endif
.include "../../x11/modular-xorg-server/buildlink3.mk"
.include "../../x11/xorgproto/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"

View File

@ -0,0 +1,3 @@
@comment $NetBSD: PLIST,v 1.2 2009/06/14 18:25:14 joerg Exp $
lib/xorg/modules/drivers/wsfb_drv.la
man/man4/wsfb.4

View File

@ -0,0 +1,12 @@
$NetBSD: distinfo,v 1.8 2018/05/13 03:45:07 ryoon Exp $
SHA1 (xf86-video-wsfb-0.4.0.tar.bz2) = fc04a2127fc5de3f5d13c56c3be781df34c26a90
RMD160 (xf86-video-wsfb-0.4.0.tar.bz2) = d35555d20ed5ae303846a1e72fa5e55049428edd
SHA512 (xf86-video-wsfb-0.4.0.tar.bz2) = 7a42ab3c29408ed934b21d3e6620c11d0a2765dc7aed0d7f9eebb6068665b32afcec934a413c30ccb655411ca59871c8f503b21377eb4c18f269493d205c5a8d
Size (xf86-video-wsfb-0.4.0.tar.bz2) = 264372 bytes
SHA1 (patch-src_Makefile.am) = 5615c601094d94363842db8883b579152e2931ba
SHA1 (patch-src_Makefile.in) = df1397d345d7db0d6af29f9d8a2d1b22c7386114
SHA1 (patch-src_compat-api.h) = 114cfc96361770c145f74c38abd9696943319253
SHA1 (patch-src_wsfb.h) = de971e7402a6c00cbba8016e933002b961ab9e41
SHA1 (patch-src_wsfb__cursor.c) = 915ed66fcda1dafcae6faf748ca115e621207357
SHA1 (patch-src_wsfb__driver.c) = c8e561142e4d7898936d5297c3ac04ca3afbe194

View File

@ -0,0 +1,10 @@
$NetBSD$
--- src/Makefile.am.orig 2012-01-01 15:25:08.000000000 +0000
+++ src/Makefile.am
@@ -29,4 +29,5 @@ wsfb_drv_la_LDFLAGS = -module -avoid-ver
wsfb_drv_ladir = @moduledir@/drivers
wsfb_drv_la_SOURCES = \
+ wsfb_driver.c \
wsfb_driver.c

View File

@ -0,0 +1,14 @@
$NetBSD$
--- src/Makefile.in.orig 2012-01-01 15:28:51.000000000 +0000
+++ src/Makefile.in
@@ -278,7 +278,8 @@ wsfb_drv_la_LTLIBRARIES = wsfb_drv.la
wsfb_drv_la_LDFLAGS = -module -avoid-version
wsfb_drv_ladir = @moduledir@/drivers
wsfb_drv_la_SOURCES = \
- wsfb_driver.c
+ wsfb_driver.c \
+ wsfb_cursor.c
all: all-am

View File

@ -0,0 +1,108 @@
$NetBSD: patch-src_compat-api.h,v 1.1 2015/04/02 22:16:49 tnn Exp $
From 586b722fb17b3eb0ab776c170ee21e6a66fc7f22 Mon Sep 17 00:00:00 2001
From: Matthieu Herrb <matthieu.herrb@laas.fr>
Date: Sun, 9 Sep 2012 11:41:58 +0200
Subject: Add compat-api.h for compatibility with xserver 1.13
--- src/compat-api.h.orig 2015-04-02 17:09:03.000000000 +0000
+++ src/compat-api.h
@@ -0,0 +1,98 @@
+/*
+ * 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@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 pScrn = xf86Screens[(arg1)]
+
+#define SCREEN_ARG_TYPE int
+#define SCREEN_PTR(arg1) ScreenPtr pScreen = screenInfo.screens[(arg1)]
+
+#define SCREEN_INIT_ARGS_DECL int i, ScreenPtr pScreen, int argc, char **argv
+
+#define BLOCKHANDLER_ARGS_DECL int arg, pointer blockData, pointer pTimeout, pointer pReadmask
+#define BLOCKHANDLER_ARGS arg, blockData, pTimeout, pReadmask
+
+#define CLOSE_SCREEN_ARGS_DECL int scrnIndex, ScreenPtr pScreen
+#define CLOSE_SCREEN_ARGS scrnIndex, pScreen
+
+#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 pScrn->scrnIndex, 0
+
+#define SCRN_OR_INDEX_ARG(x) ((x)->scrnIndex)
+#else
+#define SCRN_ARG_TYPE ScrnInfoPtr
+#define SCRN_INFO_PTR(arg1) ScrnInfoPtr pScrn = (arg1)
+
+#define SCREEN_ARG_TYPE ScreenPtr
+#define SCREEN_PTR(arg1) ScreenPtr pScreen = (arg1)
+
+#define SCREEN_INIT_ARGS_DECL ScreenPtr pScreen, int argc, char **argv
+
+#define BLOCKHANDLER_ARGS_DECL ScreenPtr arg, pointer pTimeout, pointer pReadmask
+#define BLOCKHANDLER_ARGS arg, pTimeout, pReadmask
+
+#define CLOSE_SCREEN_ARGS_DECL ScreenPtr pScreen
+#define CLOSE_SCREEN_ARGS pScreen
+
+#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 pScrn
+
+#define SCRN_OR_INDEX_ARG(x) (x)
+
+#endif
+
+#endif

View File

@ -0,0 +1,91 @@
$NetBSD$
--- src/wsfb.h.orig 2019-07-01 02:01:37.618641940 +0000
+++ src/wsfb.h
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2001 Matthieu Herrb
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+/*
+ * Based on fbdev.c written by:
+ *
+ * Authors: Alan Hourihane, <alanh@fairlite.demon.co.uk>
+ * Michel Dänzer, <michdaen@iiic.ethz.ch>
+ */
+
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/time.h>
+#include <dev/wscons/wsconsio.h>
+
+#include "compat-api.h"
+
+#include "xf86.h"
+#include "xf86_OSproc.h"
+
+#include "xf86RamDac.h"
+
+#ifndef WSFB_H
+#define WSFB_H
+
+/* private data */
+typedef struct {
+ int fd; /* file descriptor of open device */
+ struct wsdisplayio_fbinfo fbi;
+ int rotate;
+ unsigned char* fbstart;
+ unsigned char* fbmem;
+ size_t fbmem_len;
+ void * shadow;
+ Bool shadowFB;
+ Bool HWCursor;
+ Bool useSwap32;
+ CloseScreenProcPtr CloseScreen;
+ CreateScreenResourcesProcPtr CreateScreenResources;
+ void (*PointerMoved)(SCRN_ARG_TYPE, int, int);
+ EntityInfoPtr pEnt;
+ struct wsdisplay_cmap saved_cmap;
+
+ struct wsdisplay_cursor cursor;
+ int maskoffset;
+ xf86CursorInfoPtr CursorInfoRec;
+#ifdef XFreeXDGA
+ /* DGA info */
+ DGAModePtr pDGAMode;
+ int nDGAMode;
+#endif
+ OptionInfoPtr Options;
+} WsfbRec, *WsfbPtr;
+
+#define WSFBPTR(p) ((WsfbPtr)((p)->driverPrivate))
+
+Bool WsfbSetupCursor(ScreenPtr);
+
+#endif

View File

@ -0,0 +1,196 @@
$NetBSD$
--- src/wsfb_cursor.c.orig 2019-07-01 02:01:45.611659863 +0000
+++ src/wsfb_cursor.c
@@ -0,0 +1,191 @@
+/*
+ * Copyright (c) 2005 Michael Lorenz
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+/*
+ * Based on fbdev.c written by:
+ *
+ * Authors: Alan Hourihane, <alanh@fairlite.demon.co.uk>
+ * Michel Dänzer, <michdaen@iiic.ethz.ch>
+ */
+
+#if defined(HWCURSOR_XSRC_NETBSD)
+
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/endian.h>
+#include <dev/wscons/wsconsio.h>
+#include <errno.h>
+
+/* all driver need this */
+#include "xf86.h"
+#include "xf86_OSproc.h"
+#include "xf86_OSlib.h"
+
+#include "wsfb.h"
+
+static void WsfbLoadCursorImage(ScrnInfoPtr pScrn, unsigned char *src);
+static void WsfbSetCursorPosition(ScrnInfoPtr pScrn, int x, int y);
+static void WsfbSetCursorColors(ScrnInfoPtr pScrn, int bg, int fg);
+
+static void
+WsfbLoadCursorImage(ScrnInfoPtr pScrn, unsigned char *src)
+{
+ WsfbPtr pWsfb = WSFBPTR(pScrn);
+ int err, i;
+
+ pWsfb->cursor.which = WSDISPLAY_CURSOR_DOALL;
+ pWsfb->cursor.image = src;
+ pWsfb->cursor.mask = src + pWsfb->maskoffset;
+ if(ioctl(pWsfb->fd, WSDISPLAYIO_SCURSOR, &pWsfb->cursor) == -1)
+ xf86Msg(X_ERROR, "WsfbLoadCursorImage: %d\n", errno);
+}
+
+void
+WsfbShowCursor(ScrnInfoPtr pScrn)
+{
+ WsfbPtr pWsfb = WSFBPTR(pScrn);
+
+ pWsfb->cursor.which = WSDISPLAY_CURSOR_DOCUR;
+ pWsfb->cursor.enable = 1;
+ if(ioctl(pWsfb->fd, WSDISPLAYIO_SCURSOR, &pWsfb->cursor) == -1)
+ xf86Msg(X_ERROR, "WsfbShowCursor: %d\n", errno);
+}
+
+void
+WsfbHideCursor(ScrnInfoPtr pScrn)
+{
+ WsfbPtr pWsfb = WSFBPTR(pScrn);
+
+ pWsfb->cursor.which = WSDISPLAY_CURSOR_DOCUR;
+ pWsfb->cursor.enable = 0;
+ if(ioctl(pWsfb->fd, WSDISPLAYIO_SCURSOR, &pWsfb->cursor) == -1)
+ xf86Msg(X_ERROR, "WsfbHideCursor: %d\n", errno);
+}
+
+static void
+WsfbSetCursorPosition(ScrnInfoPtr pScrn, int x, int y)
+{
+ WsfbPtr pWsfb = WSFBPTR(pScrn);
+ int xoff = 0, yoff = 0;
+
+ pWsfb->cursor.which = WSDISPLAY_CURSOR_DOPOS | WSDISPLAY_CURSOR_DOHOT;
+
+ if (x < 0) {
+ xoff = -x;
+ x = 0;
+ }
+ if (y < 0) {
+ yoff = -y;
+ y = 0;
+ }
+
+ pWsfb->cursor.pos.x = x;
+ pWsfb->cursor.hot.x = xoff;
+ pWsfb->cursor.pos.y = y;
+ pWsfb->cursor.hot.y = yoff;
+
+ if(ioctl(pWsfb->fd, WSDISPLAYIO_SCURSOR, &pWsfb->cursor) == -1)
+ xf86Msg(X_ERROR, "WsfbSetCursorPosition: %d\n", errno);
+}
+
+static void
+WsfbSetCursorColors(ScrnInfoPtr pScrn, int bg, int fg)
+{
+ WsfbPtr pWsfb = WSFBPTR(pScrn);
+ u_char r[4], g[4], b[4];
+
+ pWsfb->cursor.which = WSDISPLAY_CURSOR_DOCMAP;
+ pWsfb->cursor.cmap.red = r;
+ pWsfb->cursor.cmap.green = g;
+ pWsfb->cursor.cmap.blue = b;
+ r[1] = fg & 0xff;
+ g[1] = (fg & 0xff00) >> 8;
+ b[1] = (fg & 0xff0000) >> 16;
+ r[0] = bg & 0xff;
+ g[0] = (bg & 0xff00) >> 8;
+ b[0] = (bg & 0xff0000) >> 16;
+ pWsfb->cursor.cmap.index = 0;
+ pWsfb->cursor.cmap.count = 2;
+ if(ioctl(pWsfb->fd, WSDISPLAYIO_SCURSOR, &pWsfb->cursor) == -1)
+ xf86Msg(X_ERROR, "WsfbSetCursorColors: %d\n", errno);
+}
+
+Bool
+WsfbSetupCursor(ScreenPtr pScreen)
+{
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ WsfbPtr pWsfb = WSFBPTR(pScrn);
+ xf86CursorInfoPtr infoPtr;
+
+ pWsfb->cursor.pos.x = 0;
+ pWsfb->cursor.pos.y = 0;
+ pWsfb->cursor.enable = 0;
+
+ infoPtr = xf86CreateCursorInfoRec();
+ if(!infoPtr) return FALSE;
+
+ pWsfb->CursorInfoRec = infoPtr;
+ if(ioctl(pWsfb->fd, WSDISPLAYIO_GCURMAX, &pWsfb->cursor.size) == -1) {
+ xf86Msg(X_WARNING, "No HW cursor support found\n");
+ return FALSE;
+ }
+
+ xf86Msg(X_INFO, "HW cursor enabled\n");
+
+ infoPtr->MaxWidth = pWsfb->cursor.size.x;
+ infoPtr->MaxHeight = pWsfb->cursor.size.y;
+ pWsfb->maskoffset = ( pWsfb->cursor.size.x >> 3) * pWsfb->cursor.size.y;
+
+ pWsfb->cursor.hot.x = 0;
+ pWsfb->cursor.hot.y = 0;
+ pWsfb->cursor.which = WSDISPLAY_CURSOR_DOHOT | WSDISPLAY_CURSOR_DOCUR |
+ WSDISPLAY_CURSOR_DOPOS;
+ if(ioctl(pWsfb->fd, WSDISPLAYIO_SCURSOR, &pWsfb->cursor) == -1)
+ xf86Msg(X_ERROR, "WSDISPLAYIO_SCURSOR: %d\n", errno);
+
+ infoPtr->Flags = HARDWARE_CURSOR_AND_SOURCE_WITH_MASK |
+ HARDWARE_CURSOR_TRUECOLOR_AT_8BPP
+/* XXX not sure why exactly we need this */
+#if BYTE_ORDER == BIG_ENDIAN
+ | HARDWARE_CURSOR_BIT_ORDER_MSBFIRST
+#endif
+ ;
+ infoPtr->SetCursorColors = WsfbSetCursorColors;
+ infoPtr->SetCursorPosition = WsfbSetCursorPosition;
+ infoPtr->LoadCursorImage = WsfbLoadCursorImage;
+ infoPtr->HideCursor = WsfbHideCursor;
+ infoPtr->ShowCursor = WsfbShowCursor;
+ infoPtr->UseHWCursor = NULL;
+
+ return xf86InitCursor(pScreen, infoPtr);
+}
+
+#endif /* HWCURSOR_XSRC_NETBSD */

File diff suppressed because it is too large Load Diff