[Midnightbsd-cvs] mports [20557] trunk/x11-drivers: add the xf86-video-scfb driver.

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Fri Oct 30 20:06:17 EDT 2015


Revision: 20557
          http://svnweb.midnightbsd.org/mports/?rev=20557
Author:   laffer1
Date:     2015-10-30 20:06:16 -0400 (Fri, 30 Oct 2015)
Log Message:
-----------
add the xf86-video-scfb driver. ported from freebsd

Modified Paths:
--------------
    trunk/x11-drivers/Makefile

Added Paths:
-----------
    trunk/x11-drivers/xf86-video-scfb/
    trunk/x11-drivers/xf86-video-scfb/Makefile
    trunk/x11-drivers/xf86-video-scfb/distinfo
    trunk/x11-drivers/xf86-video-scfb/files/
    trunk/x11-drivers/xf86-video-scfb/files/patch-src_compat-api.h
    trunk/x11-drivers/xf86-video-scfb/files/patch-src_scfb__driver.c
    trunk/x11-drivers/xf86-video-scfb/pkg-descr
    trunk/x11-drivers/xf86-video-scfb/pkg-plist

Modified: trunk/x11-drivers/Makefile
===================================================================
--- trunk/x11-drivers/Makefile	2015-10-30 23:53:04 UTC (rev 20556)
+++ trunk/x11-drivers/Makefile	2015-10-31 00:06:16 UTC (rev 20557)
@@ -34,6 +34,7 @@
 SUBDIR += xf86-video-s3
 SUBDIR += xf86-video-s3virge
 SUBDIR += xf86-video-savage
+SUBDIR += xf86-video-scfb
 SUBDIR += xf86-video-siliconmotion
 SUBDIR += xf86-video-sis
 SUBDIR += xf86-video-tdfx

Added: trunk/x11-drivers/xf86-video-scfb/Makefile
===================================================================
--- trunk/x11-drivers/xf86-video-scfb/Makefile	                        (rev 0)
+++ trunk/x11-drivers/xf86-video-scfb/Makefile	2015-10-31 00:06:16 UTC (rev 20557)
@@ -0,0 +1,31 @@
+# Created by: Florent Thoumie <flz at freebsd.org>
+# $FreeBSD: head/x11-drivers/xf86-video-scfb/Makefile 385665 2015-05-07 20:24:15Z mat $
+# $MidnightBSD$
+
+PORTNAME=	xf86-video-scfb
+PORTVERSION=	0.0.4
+CATEGORIES=	x11-drivers
+
+MAINTAINER=	ports at MidnightBSD.org
+COMMENT=	X.Org syscons display driver
+
+LICENSE=	mit bsd2
+LICENSE_COMB=	multi
+
+USE_GITHUB=     yes
+GH_ACCOUNT=     rayddteam
+GH_TAGNAME=     bdeb3bf
+
+WRKSRC=		${WRKDIR}/xf86-video-scfb-${GH_TAGNAME}
+
+USES=		libtool pkgconfig
+GNU_CONFIGURE= 	yes
+DIST_SUBDIR=	xorg/driver
+USE_XORG=	xorg-server xproto randrproto xi renderproto xextproto \
+		inputproto kbproto fontsproto videoproto dri2proto \
+		xf86driproto glproto xineramaproto resourceproto \
+		scrnsaverproto
+CONFIGURE_ENV=	DRIVER_MAN_SUFFIX=4x DRIVER_MAN_DIR='$$(mandir)/man4'
+INSTALL_TARGET=	install-strip
+
+.include <bsd.port.mk>


Property changes on: trunk/x11-drivers/xf86-video-scfb/Makefile
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/x11-drivers/xf86-video-scfb/distinfo
===================================================================
--- trunk/x11-drivers/xf86-video-scfb/distinfo	                        (rev 0)
+++ trunk/x11-drivers/xf86-video-scfb/distinfo	2015-10-31 00:06:16 UTC (rev 20557)
@@ -0,0 +1,2 @@
+SHA256 (xorg/driver/xf86-video-scfb-0.0.4_GH0.tar.gz) = b5bf6611ed31ecfc4d7abbcd95aa2d3f6df285696541d3283a13ef85905a48f8
+SIZE (xorg/driver/xf86-video-scfb-0.0.4_GH0.tar.gz) = 345252


Property changes on: trunk/x11-drivers/xf86-video-scfb/distinfo
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/x11-drivers/xf86-video-scfb/files/patch-src_compat-api.h
===================================================================
--- trunk/x11-drivers/xf86-video-scfb/files/patch-src_compat-api.h	                        (rev 0)
+++ trunk/x11-drivers/xf86-video-scfb/files/patch-src_compat-api.h	2015-10-31 00:06:16 UTC (rev 20557)
@@ -0,0 +1,102 @@
+--- src/compat-api.h.orig	2014-11-23 09:47:32 UTC
++++ src/compat-api.h
+@@ -0,0 +1,99 @@
++/*
++ * 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 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(flags) pScrn->scrnIndex, (flags)
++
++#define XF86_ENABLEDISABLEFB_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(flags) pScrn
++
++#define XF86_ENABLEDISABLEFB_ARG(x) (x)
++
++#endif
++
++#endif


Property changes on: trunk/x11-drivers/xf86-video-scfb/files/patch-src_compat-api.h
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/x11-drivers/xf86-video-scfb/files/patch-src_scfb__driver.c
===================================================================
--- trunk/x11-drivers/xf86-video-scfb/files/patch-src_scfb__driver.c	                        (rev 0)
+++ trunk/x11-drivers/xf86-video-scfb/files/patch-src_scfb__driver.c	2015-10-31 00:06:16 UTC (rev 20557)
@@ -0,0 +1,222 @@
+--- src/scfb_driver.c.orig	2014-07-19 22:22:29 UTC
++++ src/scfb_driver.c
+@@ -55,7 +55,6 @@
+ #include "xf86Priv.h"
+ 
+ #include "mipointer.h"
+-#include "mibstore.h"
+ #include "micmap.h"
+ #include "colormapst.h"
+ #include "xf86cmap.h"
+@@ -80,6 +79,8 @@
+ #include "xf86xv.h"
+ #endif
+ 
++#include "compat-api.h"
++
+ #undef	DEBUG
+ #define	DEBUG	1
+ 
+@@ -101,15 +102,15 @@ static const OptionInfoRec * ScfbAvailab
+ static void ScfbIdentify(int);
+ static Bool ScfbProbe(DriverPtr, int);
+ static Bool ScfbPreInit(ScrnInfoPtr, int);
+-static Bool ScfbScreenInit(int, ScreenPtr, int, char **);
+-static Bool ScfbCloseScreen(int, ScreenPtr);
++static Bool ScfbScreenInit(SCREEN_INIT_ARGS_DECL);
++static Bool ScfbCloseScreen(CLOSE_SCREEN_ARGS_DECL);
+ static void *ScfbWindowLinear(ScreenPtr, CARD32, CARD32, int, CARD32 *,
+ 			      void *);
+-static void ScfbPointerMoved(int, int, int);
+-static Bool ScfbEnterVT(int, int);
+-static void ScfbLeaveVT(int, int);
+-static Bool ScfbSwitchMode(int, DisplayModePtr, int);
+-static int ScfbValidMode(int, DisplayModePtr, Bool, int);
++static void ScfbPointerMoved(SCRN_ARG_TYPE, int, int);
++static Bool ScfbEnterVT(VT_FUNC_ARGS_DECL);
++static void ScfbLeaveVT(VT_FUNC_ARGS_DECL);
++static Bool ScfbSwitchMode(SWITCH_MODE_ARGS_DECL);
++static int ScfbValidMode(SCRN_ARG_TYPE, DisplayModePtr, Bool, int);
+ static void ScfbLoadPalette(ScrnInfoPtr, int, int *, LOCO *, VisualPtr);
+ static Bool ScfbSaveScreen(ScreenPtr, int);
+ static void ScfbSave(ScrnInfoPtr);
+@@ -231,7 +232,7 @@ typedef struct {
+ 	void *			shadow;
+ 	CloseScreenProcPtr	CloseScreen;
+ 	CreateScreenResourcesProcPtr CreateScreenResources;
+-	void			(*PointerMoved)(int, int, int);
++	void			(*PointerMoved)(SCRN_ARG_TYPE, int, int);
+ 	EntityInfoPtr		pEnt;
+ 
+ #ifdef XFreeXDGA
+@@ -302,7 +303,7 @@ scfb_mmap(size_t len, off_t off, int fd)
+ 		mapaddr = NULL;
+ 	}
+ #if DEBUG
+-	ErrorF("mmap returns: addr %p len 0x%x, fd %d, off %x\n", mapaddr, mapsize, fd, off);
++	ErrorF("mmap returns: addr %p len 0x%x, fd %d, off %lx\n", mapaddr, mapsize, fd, off);
+ #endif
+ 	return mapaddr;
+ }
+@@ -633,9 +634,9 @@ ScfbShadowInit(ScreenPtr pScreen)
+ }
+ 
+ static Bool
+-ScfbScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
++ScfbScreenInit(SCREEN_INIT_ARGS_DECL)
+ {
+-	ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
++	ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
+ 	ScfbPtr fPtr = SCFBPTR(pScrn);
+ 	VisualPtr visual;
+ 	int ret, flags, ncolors;
+@@ -792,7 +793,7 @@ ScfbScreenInit(int scrnIndex, ScreenPtr 
+ 				   "RENDER extension initialisation failed.");
+ 	}
+ 	if (fPtr->shadowFB && !ScfbShadowInit(pScreen)) {
+-		xf86DrvMsg(scrnIndex, X_ERROR,
++		xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ 		    "shadow framebuffer initialization failed\n");
+ 		return FALSE;
+ 	}
+@@ -801,20 +802,19 @@ ScfbScreenInit(int scrnIndex, ScreenPtr 
+ 	if (!fPtr->rotate)
+ 		ScfbDGAInit(pScrn, pScreen);
+ 	else
+-		xf86DrvMsg(scrnIndex, X_INFO, "Rotated display, "
++		xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Rotated display, "
+ 		    "disabling DGA\n");
+ #endif
+ 	if (fPtr->rotate) {
+-		xf86DrvMsg(scrnIndex, X_INFO, "Enabling Driver Rotation, "
++		xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Enabling Driver Rotation, "
+ 		    "disabling RandR\n");
+ 		xf86DisableRandR();
+ 		if (pScrn->bitsPerPixel == 24)
+-			xf86DrvMsg(scrnIndex, X_WARNING,
++			xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
+ 			    "Rotation might be broken in 24 bpp\n");
+ 	}
+ 
+ 	xf86SetBlackWhitePixels(pScreen);
+-	miInitializeBackingStore(pScreen);
+ 	xf86SetBackingStore(pScreen);
+ 
+ 	/* Software cursor. */
+@@ -858,9 +858,9 @@ ScfbScreenInit(int scrnIndex, ScreenPtr 
+ }
+ 
+ static Bool
+-ScfbCloseScreen(int scrnIndex, ScreenPtr pScreen)
++ScfbCloseScreen(CLOSE_SCREEN_ARGS_DECL)
+ {
+-	ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
++	ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
+ 	PixmapPtr pPixmap;
+ 	ScfbPtr fPtr = SCFBPTR(pScrn);
+ 
+@@ -892,7 +892,7 @@ ScfbCloseScreen(int scrnIndex, ScreenPtr
+ 	/* Unwrap CloseScreen. */
+ 	pScreen->CloseScreen = fPtr->CloseScreen;
+ 	TRACE_EXIT("ScfbCloseScreen");
+-	return (*pScreen->CloseScreen)(scrnIndex, pScreen);
++	return (*pScreen->CloseScreen)(CLOSE_SCREEN_ARGS);
+ }
+ 
+ static void *
+@@ -907,9 +907,9 @@ ScfbWindowLinear(ScreenPtr pScreen, CARD
+ }
+ 
+ static void
+-ScfbPointerMoved(int index, int x, int y)
++ScfbPointerMoved(SCRN_ARG_TYPE arg, int x, int y)
+ {
+-    ScrnInfoPtr pScrn = xf86Screens[index];
++    SCRN_INFO_PTR(arg);
+     ScfbPtr fPtr = SCFBPTR(pScrn);
+     int newX, newY;
+ 
+@@ -941,13 +941,13 @@ ScfbPointerMoved(int index, int x, int y
+     }
+ 
+     /* Pass adjusted pointer coordinates to wrapped PointerMoved function. */
+-    (*fPtr->PointerMoved)(index, newX, newY);
++    (*fPtr->PointerMoved)(arg, newX, newY);
+ }
+ 
+ static Bool
+-ScfbEnterVT(int scrnIndex, int flags)
++ScfbEnterVT(VT_FUNC_ARGS_DECL)
+ {
+-	ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
++	SCRN_INFO_PTR(arg);
+ 
+ 	TRACE_ENTER("EnterVT");
+ 	pScrn->vtSema = TRUE;
+@@ -956,20 +956,20 @@ ScfbEnterVT(int scrnIndex, int flags)
+ }
+ 
+ static void
+-ScfbLeaveVT(int scrnIndex, int flags)
++ScfbLeaveVT(VT_FUNC_ARGS_DECL)
+ {
+ #if DEBUG
+-	ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
++	SCRN_INFO_PTR(arg);
+ #endif
+ 
+ 	TRACE_ENTER("LeaveVT");
+ }
+ 
+ static Bool
+-ScfbSwitchMode(int scrnIndex, DisplayModePtr mode, int flags)
++ScfbSwitchMode(SWITCH_MODE_ARGS_DECL)
+ {
+ #if DEBUG
+-	ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
++	SCRN_INFO_PTR(arg);
+ #endif
+ 
+ 	TRACE_ENTER("SwitchMode");
+@@ -978,10 +978,10 @@ ScfbSwitchMode(int scrnIndex, DisplayMod
+ }
+ 
+ static int
+-ScfbValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose, int flags)
++ScfbValidMode(SCRN_ARG_TYPE arg, DisplayModePtr mode, Bool verbose, int flags)
+ {
+ #if DEBUG
+-	ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
++	SCRN_INFO_PTR(arg);
+ #endif
+ 
+ 	TRACE_ENTER("ValidMode");
+@@ -1067,7 +1067,6 @@ static Bool
+ ScfbDGASetMode(ScrnInfoPtr pScrn, DGAModePtr pDGAMode)
+ {
+ 	DisplayModePtr pMode;
+-	int scrnIdx = pScrn->pScreen->myNum;
+ 	int frameX0, frameY0;
+ 
+ 	if (pDGAMode) {
+@@ -1081,9 +1080,9 @@ ScfbDGASetMode(ScrnInfoPtr pScrn, DGAMod
+ 		frameY0 = pScrn->frameY0;
+ 	}
+ 
+-	if (!(*pScrn->SwitchMode)(scrnIdx, pMode, 0))
++	if (!(*pScrn->SwitchMode)(SWITCH_MODE_ARGS(pScrn, pMode)))
+ 		return FALSE;
+-	(*pScrn->AdjustFrame)(scrnIdx, frameX0, frameY0, 0);
++	(*pScrn->AdjustFrame)(ADJUST_FRAME_ARGS(pScrn, frameX0, frameY0));
+ 
+ 	return TRUE;
+ }
+@@ -1091,7 +1090,7 @@ ScfbDGASetMode(ScrnInfoPtr pScrn, DGAMod
+ static void
+ ScfbDGASetViewport(ScrnInfoPtr pScrn, int x, int y, int flags)
+ {
+-	(*pScrn->AdjustFrame)(pScrn->pScreen->myNum, x, y, flags);
++	(*pScrn->AdjustFrame)(ADJUST_FRAME_ARGS(pScrn, x, y));
+ }
+ 
+ static int


Property changes on: trunk/x11-drivers/xf86-video-scfb/files/patch-src_scfb__driver.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/x11-drivers/xf86-video-scfb/pkg-descr
===================================================================
--- trunk/x11-drivers/xf86-video-scfb/pkg-descr	                        (rev 0)
+++ trunk/x11-drivers/xf86-video-scfb/pkg-descr	2015-10-31 00:06:16 UTC (rev 20557)
@@ -0,0 +1,2 @@
+This package contains the X.Org xf86-video-scfb driver.
+Framebuffer access via FreeBSD/MidnightBSD syscons.


Property changes on: trunk/x11-drivers/xf86-video-scfb/pkg-descr
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/x11-drivers/xf86-video-scfb/pkg-plist
===================================================================
--- trunk/x11-drivers/xf86-video-scfb/pkg-plist	                        (rev 0)
+++ trunk/x11-drivers/xf86-video-scfb/pkg-plist	2015-10-31 00:06:16 UTC (rev 20557)
@@ -0,0 +1,2 @@
+lib/xorg/modules/drivers/scfb_drv.so
+man/man4/scfb.4x.gz


Property changes on: trunk/x11-drivers/xf86-video-scfb/pkg-plist
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property


More information about the Midnightbsd-cvs mailing list