Module Name: xsrc
Committed By: macallan
Date: Fri Sep 16 21:16:37 UTC 2016
Modified Files:
xsrc/external/mit/xf86-video-suncg14/dist/src: cg14_accel.c
cg14_cursor.c cg14_driver.c cg14_render.c
Log Message:
adapt to xorg 1.18
To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 \
xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c \
xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_render.c
cvs rdiff -u -r1.2 -r1.3 \
xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_cursor.c
cvs rdiff -u -r1.12 -r1.13 \
xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_driver.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c
diff -u xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c:1.7 xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c:1.8
--- xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c:1.7 Tue Jul 30 21:49:38 2013
+++ xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c Fri Sep 16 21:16:37 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: cg14_accel.c,v 1.7 2013/07/30 21:49:38 macallan Exp $ */
+/* $NetBSD: cg14_accel.c,v 1.8 2016/09/16 21:16:37 macallan Exp $ */
/*
* Copyright (c) 2013 Michael Lorenz
* All rights reserved.
@@ -28,7 +28,11 @@
* POSSIBILITY OF SUCH DAMAGE.
*
*/
-
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <sys/types.h>
/* all driver need this */
Index: xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_render.c
diff -u xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_render.c:1.7 xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_render.c:1.8
--- xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_render.c:1.7 Tue Jul 30 21:49:38 2013
+++ xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_render.c Fri Sep 16 21:16:37 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: cg14_render.c,v 1.7 2013/07/30 21:49:38 macallan Exp $ */
+/* $NetBSD: cg14_render.c,v 1.8 2016/09/16 21:16:37 macallan Exp $ */
/*
* Copyright (c) 2013 Michael Lorenz
* All rights reserved.
@@ -29,6 +29,10 @@
*
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <sys/types.h>
/* all driver need this */
@@ -224,10 +228,10 @@ void CG14Comp_Over8Solid(Cg14Ptr p,
/* fetch destination pixels */
write_sx_io(p, dstx, SX_LDUQ0(60, 3, dstx & 7));
/* duplicate them for all channels */
+ write_sx_reg(p, SX_INSTRUCTIONS, SX_ORS(0, 13, 16, 3));
+ write_sx_reg(p, SX_INSTRUCTIONS, SX_ORS(0, 14, 20, 3));
+ write_sx_reg(p, SX_INSTRUCTIONS, SX_ORS(0, 15, 24, 3));
write_sx_reg(p, SX_INSTRUCTIONS, SX_ORS(0, 12, 13, 2));
- write_sx_reg(p, SX_INSTRUCTIONS, SX_ORS(0, 16, 17, 2));
- write_sx_reg(p, SX_INSTRUCTIONS, SX_ORS(0, 20, 21, 2));
- write_sx_reg(p, SX_INSTRUCTIONS, SX_ORS(0, 24, 25, 2));
/* generate inverted alpha */
write_sx_reg(p, SX_INSTRUCTIONS,
SX_XORS(12, 8, 28, 15));
Index: xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_cursor.c
diff -u xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_cursor.c:1.2 xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_cursor.c:1.3
--- xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_cursor.c:1.2 Wed Jun 19 13:20:05 2013
+++ xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_cursor.c Fri Sep 16 21:16:37 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: cg14_cursor.c,v 1.2 2013/06/19 13:20:05 macallan Exp $ */
+/* $NetBSD: cg14_cursor.c,v 1.3 2016/09/16 21:16:37 macallan Exp $ */
/*
* Copyright (c) 2005 Michael Lorenz
* All rights reserved.
@@ -29,6 +29,10 @@
*
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <sys/types.h>
/* all driver need this */
Index: xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_driver.c
diff -u xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_driver.c:1.12 xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_driver.c:1.13
--- xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_driver.c:1.12 Wed Sep 7 17:10:18 2016
+++ xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_driver.c Fri Sep 16 21:16:37 2016
@@ -58,6 +58,8 @@ static void CG14InitCplane24(ScrnInfoPtr
static void CG14ExitCplane24(ScrnInfoPtr pScrn);
static void *CG14WindowLinear(ScreenPtr, CARD32, CARD32, int, CARD32 *,
void *);
+static Bool CG14DriverFunc(ScrnInfoPtr pScrn, xorgDriverFuncOp op,
+ pointer ptr);
/* Required if the driver supports mode switching */
static Bool CG14SwitchMode(SWITCH_MODE_ARGS_DECL);
@@ -93,7 +95,8 @@ _X_EXPORT DriverRec SUNCG14 = {
CG14Probe,
CG14AvailableOptions,
NULL,
- 0
+ 0,
+ CG14DriverFunc
};
typedef enum {
@@ -140,7 +143,7 @@ cg14Setup(pointer module, pointer opts,
if (!setupDone) {
setupDone = TRUE;
- xf86AddDriver(&SUNCG14, module, 0);
+ xf86AddDriver(&SUNCG14, module, HaveDriverFuncs);
/*
* Modules that this driver always requires can be loaded here
@@ -299,7 +302,8 @@ CG14PreInit(ScrnInfoPtr pScrn, int flags
{
Cg14Ptr pCg14;
sbusDevicePtr psdp = NULL;
- int i, from;
+ int i, from, size, len, reg[6], prom;
+ char *ptr;
if (flags & PROBE_DETECT) return FALSE;
@@ -345,8 +349,17 @@ CG14PreInit(ScrnInfoPtr pScrn, int flags
pCg14->memsize = 4 * 1024 * 1024; /* always safe */
if ((psdp->height * psdp->width * 4) > 0x00400000)
pCg14->memsize = 0x00800000;
- if (psdp->size > pCg14->memsize)
- pCg14->memsize = psdp->size;
+ len = 24;
+ prom = sparcPromInit();
+ if (ptr = sparcPromGetProperty(&psdp->node, "reg", &len)) {
+ if (len >= 24) {
+ memcpy(reg, ptr, 24);
+ size = reg[5];
+ xf86Msg(X_DEBUG, "memsize from reg: %d MB\n", size >> 20);
+ if (size > pCg14->memsize)
+ pCg14->memsize = size;
+ }
+ }
xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "found %d MB video memory\n",
pCg14->memsize >> 20);
/*********************
@@ -585,7 +598,7 @@ CG14ScreenInit(SCREEN_INIT_ARGS_DECL)
miSetPixmapDepths ();
if (pCg14->use_shadow) {
- pCg14->shadow = xcalloc(1, pScrn->virtualX * pScrn->virtualY * 4);
+ pCg14->shadow = malloc(pScrn->virtualX * pScrn->virtualY * 4);
if (!pCg14->shadow) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
@@ -865,3 +878,20 @@ CG14ExitCplane24(ScrnInfoPtr pScrn)
ioctl (pCg14->psdp->fd, CG14_SET_PIXELMODE, &bpp);
}
+
+
+static Bool
+CG14DriverFunc(ScrnInfoPtr pScrn, xorgDriverFuncOp op,
+ pointer ptr)
+{
+ xorgHWFlags *flag;
+
+ switch (op) {
+ case GET_REQUIRED_HW_INTERFACES:
+ flag = (CARD32*)ptr;
+ (*flag) = HW_MMIO;
+ return TRUE;
+ default:
+ return FALSE;
+ }
+}