initial import
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
From d64d01c7a599dc3c79125701f076a3e459cefdc2 Mon Sep 17 00:00:00 2001
|
||||
From: Hans de Goede <hdegoede@redhat.com>
|
||||
Date: Thu, 29 Sep 2016 19:37:22 +0200
|
||||
Subject: [PATCH] Adapt Block/WakeupHandler signature for ABI 23
|
||||
|
||||
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
||||
Acked-by: Thomas Hellstrom <thellstrom@vmware.com>
|
||||
---
|
||||
src/compat-api.h | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
diff --git a/src/compat-api.h b/src/compat-api.h
|
||||
index 205ac59..02876c5 100644
|
||||
--- a/src/compat-api.h
|
||||
+++ b/src/compat-api.h
|
||||
@@ -75,8 +75,13 @@
|
||||
|
||||
#define SCREEN_INIT_ARGS_DECL ScreenPtr pScreen, int argc, char **argv
|
||||
|
||||
+#if ABI_VIDEODRV_VERSION >= SET_ABI_VERSION(23, 0)
|
||||
+#define BLOCKHANDLER_ARGS_DECL ScreenPtr arg, pointer pTimeout
|
||||
+#define BLOCKHANDLER_ARGS arg, pTimeout
|
||||
+#else
|
||||
#define BLOCKHANDLER_ARGS_DECL ScreenPtr arg, pointer pTimeout, pointer pReadmask
|
||||
#define BLOCKHANDLER_ARGS arg, pTimeout, pReadmask
|
||||
+#endif
|
||||
|
||||
#define CLOSE_SCREEN_ARGS_DECL ScreenPtr pScreen
|
||||
#define CLOSE_SCREEN_ARGS pScreen
|
||||
--
|
||||
2.12.2
|
||||
|
||||
212
xenocara-video-vmware/0002-vmware-Fix-build-warnings.patch
Normal file
212
xenocara-video-vmware/0002-vmware-Fix-build-warnings.patch
Normal file
@@ -0,0 +1,212 @@
|
||||
From d8c2f8501307a9c0c65601e897e7d919e42ba0b3 Mon Sep 17 00:00:00 2001
|
||||
From: Deepak Singh Rawat <drawat@vmware.com>
|
||||
Date: Mon, 7 Aug 2017 15:57:56 -0700
|
||||
Subject: [PATCH] vmware: Fix build warnings
|
||||
|
||||
Due to following commit in xserver there were
|
||||
build warnings, as variables now declared const.
|
||||
|
||||
d89b42bda46d36fc0879611cc3b3566957ce36d0
|
||||
e1e01d2e33c632e395d7e396f73fba8ae606b15a
|
||||
|
||||
Added a compat header file.
|
||||
|
||||
Signed-off-by: Deepak Rawat <drawat@vmware.com>
|
||||
Reviewed-by: Brian Paul <brianp@vmware.com>
|
||||
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>:q
|
||||
---
|
||||
saa/Makefile.am | 2 +-
|
||||
saa/saa_priv.h | 7 ++++---
|
||||
src/common_compat.h | 11 +++++++++++
|
||||
src/vmware.c | 15 +++++++++------
|
||||
src/vmwaremodes.c | 3 ++-
|
||||
vmwgfx/vmwgfx_driver.c | 9 +++++----
|
||||
6 files changed, 32 insertions(+), 15 deletions(-)
|
||||
create mode 100644 src/common_compat.h
|
||||
|
||||
diff --git a/saa/Makefile.am b/saa/Makefile.am
|
||||
index 48c9734..b812815 100644
|
||||
--- a/saa/Makefile.am
|
||||
+++ b/saa/Makefile.am
|
||||
@@ -2,7 +2,7 @@
|
||||
if BUILD_VMWGFX
|
||||
noinst_LTLIBRARIES = libsaa.la
|
||||
|
||||
-libsaa_la_CFLAGS = $(CWARNFLAGS) $(XORG_CFLAGS)
|
||||
+libsaa_la_CFLAGS = $(CWARNFLAGS) $(XORG_CFLAGS) -I$(top_srcdir)/src
|
||||
libsaa_la_LDFLAGS = -static
|
||||
libsaa_la_SOURCES = \
|
||||
saa.c \
|
||||
diff --git a/saa/saa_priv.h b/saa/saa_priv.h
|
||||
index 5d81453..9065fbe 100644
|
||||
--- a/saa/saa_priv.h
|
||||
+++ b/saa/saa_priv.h
|
||||
@@ -59,14 +59,15 @@
|
||||
#include "glyphstr.h"
|
||||
#endif
|
||||
#include "damage.h"
|
||||
+#include "common_compat.h"
|
||||
|
||||
#define SAA_INVALID_ADDRESS \
|
||||
((void *) ((unsigned long) 0xFFFFFFFF - 1024*1024))
|
||||
|
||||
struct saa_gc_priv {
|
||||
/* GC values from the layer below. */
|
||||
- GCOps *saved_ops;
|
||||
- GCFuncs *saved_funcs;
|
||||
+ CONST_ABI_18_0 GCOps *saved_ops;
|
||||
+ CONST_ABI_18_0 GCFuncs *saved_funcs;
|
||||
};
|
||||
|
||||
struct saa_screen_priv {
|
||||
@@ -127,7 +128,7 @@ do { \
|
||||
}
|
||||
|
||||
#define saa_swap(priv, real, mem) {\
|
||||
- void *tmp = (priv)->saved_##mem; \
|
||||
+ CONST_ABI_18_0 void *tmp = (priv)->saved_##mem; \
|
||||
(priv)->saved_##mem = (real)->mem; \
|
||||
(real)->mem = tmp; \
|
||||
}
|
||||
diff --git a/src/common_compat.h b/src/common_compat.h
|
||||
new file mode 100644
|
||||
index 0000000..d7b4867
|
||||
--- /dev/null
|
||||
+++ b/src/common_compat.h
|
||||
@@ -0,0 +1,11 @@
|
||||
+#ifndef _COMMON_COMPAT_H_
|
||||
+#define _COMMOM_COMPAT_H_
|
||||
+
|
||||
+#if (GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) >= 18)
|
||||
+#define CONST_ABI_18_0 const
|
||||
+#else
|
||||
+#define CONST_ABI_18_0
|
||||
+#endif
|
||||
+
|
||||
+#endif
|
||||
+
|
||||
diff --git a/src/vmware.c b/src/vmware.c
|
||||
index 12f12ed..1af20d8 100644
|
||||
--- a/src/vmware.c
|
||||
+++ b/src/vmware.c
|
||||
@@ -36,6 +36,7 @@ char rcsId_vmware[] =
|
||||
#include "svga_modes.h"
|
||||
#include "vmware_bootstrap.h"
|
||||
#include "vmware_common.h"
|
||||
+#include "common_compat.h"
|
||||
|
||||
#ifndef HAVE_XORG_SERVER_1_5_0
|
||||
#include <xf86_ansic.h>
|
||||
@@ -1222,12 +1223,14 @@ VMWAREAddDisplayMode(ScrnInfoPtr pScrn,
|
||||
int height)
|
||||
{
|
||||
DisplayModeRec *mode;
|
||||
+ char * modeName;
|
||||
|
||||
mode = malloc(sizeof(DisplayModeRec));
|
||||
memset(mode, 0, sizeof *mode);
|
||||
|
||||
- mode->name = malloc(strlen(name) + 1);
|
||||
- strcpy(mode->name, name);
|
||||
+ modeName = malloc(strlen(name) + 1);
|
||||
+ strcpy(modeName, name);
|
||||
+ mode->name = modeName;
|
||||
mode->status = MODE_OK;
|
||||
mode->type = M_T_DEFAULT;
|
||||
mode->HDisplay = width;
|
||||
@@ -1324,7 +1327,7 @@ VMWAREScreenInit(SCREEN_INIT_ARGS_DECL)
|
||||
|
||||
|
||||
if (useXinerama && xf86IsOptionSet(options, OPTION_GUI_LAYOUT)) {
|
||||
- char *topology = xf86GetOptValString(options, OPTION_GUI_LAYOUT);
|
||||
+ CONST_ABI_18_0 char *topology = xf86GetOptValString(options, OPTION_GUI_LAYOUT);
|
||||
if (topology) {
|
||||
pVMWARE->xineramaState =
|
||||
VMWAREParseTopologyString(pScrn, topology,
|
||||
@@ -1332,11 +1335,11 @@ VMWAREScreenInit(SCREEN_INIT_ARGS_DECL)
|
||||
|
||||
pVMWARE->xineramaStatic = pVMWARE->xineramaState != NULL;
|
||||
|
||||
- free(topology);
|
||||
+ free((void *)topology);
|
||||
}
|
||||
} else if (useXinerama &&
|
||||
xf86IsOptionSet(options, OPTION_STATIC_XINERAMA)) {
|
||||
- char *topology = xf86GetOptValString(options, OPTION_STATIC_XINERAMA);
|
||||
+ CONST_ABI_18_0 char *topology = xf86GetOptValString(options, OPTION_STATIC_XINERAMA);
|
||||
if (topology) {
|
||||
pVMWARE->xineramaState =
|
||||
VMWAREParseTopologyString(pScrn, topology,
|
||||
@@ -1345,7 +1348,7 @@ VMWAREScreenInit(SCREEN_INIT_ARGS_DECL)
|
||||
|
||||
pVMWARE->xineramaStatic = pVMWARE->xineramaState != NULL;
|
||||
|
||||
- free(topology);
|
||||
+ free((void *)topology);
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/src/vmwaremodes.c b/src/vmwaremodes.c
|
||||
index 41a9b4f..1d296ac 100644
|
||||
--- a/src/vmwaremodes.c
|
||||
+++ b/src/vmwaremodes.c
|
||||
@@ -40,6 +40,7 @@
|
||||
#endif
|
||||
#include "vm_basic_types.h"
|
||||
#include "vmware.h"
|
||||
+#include "common_compat.h"
|
||||
|
||||
#ifndef M_T_DRIVER
|
||||
# define M_T_DRIVER 0x40 /* Supplied by the driver (EDID, etc) */
|
||||
@@ -83,7 +84,7 @@ vmwareAddDefaultMode(ScrnInfoPtr pScrn, uint32 dwidth, uint32 dheight)
|
||||
DisplayModeRec dynamic =
|
||||
{ MODEPREFIX, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, MODESUFFIX };
|
||||
unsigned dispModeCount = 0;
|
||||
- char **dispModeList;
|
||||
+ CONST_ABI_18_0 char **dispModeList;
|
||||
char *dynModeName;
|
||||
char name[80];
|
||||
VMWAREPtr pVMWARE = VMWAREPTR(pScrn);
|
||||
diff --git a/vmwgfx/vmwgfx_driver.c b/vmwgfx/vmwgfx_driver.c
|
||||
index b9ee1db..967dec9 100644
|
||||
--- a/vmwgfx/vmwgfx_driver.c
|
||||
+++ b/vmwgfx/vmwgfx_driver.c
|
||||
@@ -68,6 +68,7 @@
|
||||
#include "../src/vmware_bootstrap.h"
|
||||
#include "../src/vmware_common.h"
|
||||
#include "vmwgfx_hosted.h"
|
||||
+#include "common_compat.h"
|
||||
|
||||
/*
|
||||
* We can't incude svga_types.h due to conflicting types for Bool.
|
||||
@@ -410,23 +411,23 @@ vmwgfx_pre_init_mode(ScrnInfoPtr pScrn, int flags)
|
||||
}
|
||||
|
||||
if (xf86IsOptionSet(ms->Options, OPTION_GUI_LAYOUT)) {
|
||||
- char *topology =
|
||||
+ CONST_ABI_18_0 char *topology =
|
||||
xf86GetOptValString(ms->Options, OPTION_GUI_LAYOUT);
|
||||
|
||||
ret = FALSE;
|
||||
if (topology) {
|
||||
ret = vmwgfx_set_topology(pScrn, topology, "gui");
|
||||
- free(topology);
|
||||
+ free((void *)topology);
|
||||
}
|
||||
|
||||
} else if (xf86IsOptionSet(ms->Options, OPTION_STATIC_XINERAMA)) {
|
||||
- char *topology =
|
||||
+ CONST_ABI_18_0 char *topology =
|
||||
xf86GetOptValString(ms->Options, OPTION_STATIC_XINERAMA);
|
||||
|
||||
ret = FALSE;
|
||||
if (topology) {
|
||||
ret = vmwgfx_set_topology(pScrn, topology, "static Xinerama");
|
||||
- free(topology);
|
||||
+ free((void *)topology);
|
||||
}
|
||||
}
|
||||
|
||||
--
|
||||
2.12.2
|
||||
|
||||
@@ -0,0 +1,263 @@
|
||||
From dc85a6da15768f7a9622677e79c618bfb35ce513 Mon Sep 17 00:00:00 2001
|
||||
From: Thomas Hellstrom <thellstrom@vmware.com>
|
||||
Date: Wed, 14 Feb 2018 10:14:20 +0100
|
||||
Subject: [PATCH] Fix a number of compilation warnings
|
||||
|
||||
There are a number of compilation warnings caused by const char pointers
|
||||
being either explicitly or implicitly cast to char pointers. There
|
||||
are a number of ABI differences that have hindered this so far, but
|
||||
make a new attempt using the common_compat.h defines.
|
||||
|
||||
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
|
||||
Reviewed-by: Brian Paul <brianp@vmware.com>
|
||||
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
|
||||
Reviewed-by: Deepak Rawat <drawat@vmware.com>
|
||||
---
|
||||
src/common_compat.h | 13 +++++++++++++
|
||||
src/vmware_bootstrap.c | 16 +++++++++++-----
|
||||
src/vmwarevideo.c | 14 ++++++++++----
|
||||
vmwgfx/vmwgfx_overlay.c | 8 ++++++--
|
||||
vmwgfx/vmwgfx_tex_video.c | 22 +++++++++++++++-------
|
||||
5 files changed, 55 insertions(+), 18 deletions(-)
|
||||
|
||||
diff --git a/src/common_compat.h b/src/common_compat.h
|
||||
index d7b4867..5c46a73 100644
|
||||
--- a/src/common_compat.h
|
||||
+++ b/src/common_compat.h
|
||||
@@ -7,5 +7,18 @@
|
||||
#define CONST_ABI_18_0
|
||||
#endif
|
||||
|
||||
+#if (GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) >= 16)
|
||||
+#define CONST_ABI_16_0 const
|
||||
+#else
|
||||
+#define CONST_ABI_16_0
|
||||
+#endif
|
||||
+
|
||||
+#if ((GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) >= 16) && \
|
||||
+ (GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 19))
|
||||
+#define CONST_ABI_16_TO_19 const
|
||||
+#else
|
||||
+#define CONST_ABI_16_TO_19
|
||||
+#endif
|
||||
+
|
||||
#endif
|
||||
|
||||
diff --git a/src/vmware_bootstrap.c b/src/vmware_bootstrap.c
|
||||
index d7ab070..4f59e73 100644
|
||||
--- a/src/vmware_bootstrap.c
|
||||
+++ b/src/vmware_bootstrap.c
|
||||
@@ -82,6 +82,10 @@
|
||||
|
||||
#define VMWARE_NAME "vmware"
|
||||
#define VMWARE_DRIVER_NAME "vmware"
|
||||
+
|
||||
+static char vmware_name[] = VMWARE_NAME;
|
||||
+static char vmware_driver_name[] = VMWARE_DRIVER_NAME;
|
||||
+
|
||||
#define VMWARE_DRIVER_VERSION \
|
||||
(PACKAGE_VERSION_MAJOR * 65536 + PACKAGE_VERSION_MINOR * 256 + PACKAGE_VERSION_PATCHLEVEL)
|
||||
#define VMWARE_DRIVER_VERSION_STRING \
|
||||
@@ -255,8 +259,10 @@ VMwarePreinitStub(ScrnInfoPtr pScrn, int flags)
|
||||
if (pciInfo == NULL)
|
||||
return FALSE;
|
||||
|
||||
- pScrn->chipset = (char*)xf86TokenToString(VMWAREChipsets,
|
||||
- DEVICE_ID(pciInfo));
|
||||
+ pScrn->chipset = xstrdup(xf86TokenToString(VMWAREChipsets,
|
||||
+ DEVICE_ID(pciInfo)));
|
||||
+ if (pScrn->chipset == NULL)
|
||||
+ return FALSE;
|
||||
|
||||
return (*pScrn->PreInit)(pScrn, flags);
|
||||
};
|
||||
@@ -274,8 +280,8 @@ VMwarePciProbe (DriverPtr drv,
|
||||
NULL, NULL, NULL, NULL, NULL);
|
||||
if (scrn != NULL) {
|
||||
scrn->driverVersion = VMWARE_DRIVER_VERSION;
|
||||
- scrn->driverName = VMWARE_DRIVER_NAME;
|
||||
- scrn->name = VMWARE_NAME;
|
||||
+ scrn->driverName = vmware_driver_name;
|
||||
+ scrn->name = vmware_name;
|
||||
scrn->Probe = NULL;
|
||||
}
|
||||
|
||||
@@ -509,7 +515,7 @@ VMWareDriverFunc(ScrnInfoPtr pScrn,
|
||||
|
||||
_X_EXPORT DriverRec vmware = {
|
||||
VMWARE_DRIVER_VERSION,
|
||||
- VMWARE_DRIVER_NAME,
|
||||
+ vmware_driver_name,
|
||||
VMWAREIdentify,
|
||||
#if XSERVER_LIBPCIACCESS
|
||||
NULL,
|
||||
diff --git a/src/vmwarevideo.c b/src/vmwarevideo.c
|
||||
index 634af69..3ba1dcd 100644
|
||||
--- a/src/vmwarevideo.c
|
||||
+++ b/src/vmwarevideo.c
|
||||
@@ -44,6 +44,7 @@
|
||||
#include "fourcc.h"
|
||||
#include "svga_escape.h"
|
||||
#include "svga_overlay.h"
|
||||
+#include "common_compat.h"
|
||||
|
||||
#include <X11/extensions/Xv.h>
|
||||
|
||||
@@ -52,6 +53,8 @@
|
||||
#include <xf86_libc.h>
|
||||
#endif
|
||||
|
||||
+static CONST_ABI_16_0 char xv_adapt_name[] = "VMWare Overlay Video Engine";
|
||||
+static CONST_ABI_16_0 char xv_image_name[] = "XV_IMAGE";
|
||||
|
||||
#define HAVE_FILLKEYHELPERDRAWABLE \
|
||||
((GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) >= 2) || \
|
||||
@@ -90,7 +93,7 @@ static XF86VideoEncodingRec vmwareVideoEncodings[] =
|
||||
{
|
||||
{
|
||||
0,
|
||||
- "XV_IMAGE",
|
||||
+ xv_image_name,
|
||||
VMWARE_VID_MAX_WIDTH, VMWARE_VID_MAX_HEIGHT,
|
||||
{1, 1}
|
||||
}
|
||||
@@ -111,6 +114,9 @@ static XF86ImageRec vmwareVideoImages[] =
|
||||
XVIMAGE_UYVY
|
||||
};
|
||||
|
||||
+static CONST_ABI_16_TO_19 char xv_colorkey_name[] = "XV_COLORKEY";
|
||||
+static CONST_ABI_16_TO_19 char xv_autopaint_name[] = "XV_AUTOPAINT_COLORKEY";
|
||||
+
|
||||
#define VMWARE_VID_NUM_ATTRIBUTES 2
|
||||
static XF86AttributeRec vmwareVideoAttributes[] =
|
||||
{
|
||||
@@ -118,13 +124,13 @@ static XF86AttributeRec vmwareVideoAttributes[] =
|
||||
XvGettable | XvSettable,
|
||||
0x000000,
|
||||
0xffffff,
|
||||
- "XV_COLORKEY"
|
||||
+ xv_colorkey_name,
|
||||
},
|
||||
{
|
||||
XvGettable | XvSettable,
|
||||
0,
|
||||
1,
|
||||
- "XV_AUTOPAINT_COLORKEY"
|
||||
+ xv_autopaint_name,
|
||||
}
|
||||
};
|
||||
|
||||
@@ -575,7 +581,7 @@ vmwareVideoSetup(ScrnInfoPtr pScrn)
|
||||
|
||||
adaptor->type = XvInputMask | XvImageMask | XvWindowMask;
|
||||
adaptor->flags = VIDEO_OVERLAID_IMAGES | VIDEO_CLIP_TO_VIEWPORT;
|
||||
- adaptor->name = "VMware Video Engine";
|
||||
+ adaptor->name = xv_adapt_name;
|
||||
adaptor->nEncodings = VMWARE_VID_NUM_ENCODINGS;
|
||||
adaptor->pEncodings = vmwareVideoEncodings;
|
||||
adaptor->nFormats = VMWARE_VID_NUM_FORMATS;
|
||||
diff --git a/vmwgfx/vmwgfx_overlay.c b/vmwgfx/vmwgfx_overlay.c
|
||||
index 49bad73..c35cebd 100644
|
||||
--- a/vmwgfx/vmwgfx_overlay.c
|
||||
+++ b/vmwgfx/vmwgfx_overlay.c
|
||||
@@ -61,6 +61,7 @@ typedef uint8_t uint8;
|
||||
#include "../src/svga_reg.h"
|
||||
#include "../src/svga_escape.h"
|
||||
#include "../src/svga_overlay.h"
|
||||
+#include "../src/common_compat.h"
|
||||
|
||||
#include <X11/extensions/Xv.h>
|
||||
|
||||
@@ -114,6 +115,9 @@ static XF86ImageRec vmwareVideoImages[] =
|
||||
XVIMAGE_UYVY
|
||||
};
|
||||
|
||||
+static CONST_ABI_16_TO_19 char xv_colorkey_name[] = "XV_COLORKEY";
|
||||
+static CONST_ABI_16_TO_19 char xv_autopaint_name[] = "XV_AUTOPAINT_COLORKEY";
|
||||
+
|
||||
#define VMWARE_VID_NUM_ATTRIBUTES 2
|
||||
static XF86AttributeRec vmwareVideoAttributes[] =
|
||||
{
|
||||
@@ -121,13 +125,13 @@ static XF86AttributeRec vmwareVideoAttributes[] =
|
||||
XvGettable | XvSettable,
|
||||
0x000000,
|
||||
0xffffff,
|
||||
- "XV_COLORKEY"
|
||||
+ xv_colorkey_name,
|
||||
},
|
||||
{
|
||||
XvGettable | XvSettable,
|
||||
0,
|
||||
1,
|
||||
- "XV_AUTOPAINT_COLORKEY"
|
||||
+ xv_autopaint_name,
|
||||
}
|
||||
};
|
||||
|
||||
diff --git a/vmwgfx/vmwgfx_tex_video.c b/vmwgfx/vmwgfx_tex_video.c
|
||||
index f2cc813..a767d89 100644
|
||||
--- a/vmwgfx/vmwgfx_tex_video.c
|
||||
+++ b/vmwgfx/vmwgfx_tex_video.c
|
||||
@@ -32,6 +32,7 @@
|
||||
#include "vmwgfx_driver.h"
|
||||
#include "vmwgfx_drmi.h"
|
||||
#include "vmwgfx_saa.h"
|
||||
+#include "../src/common_compat.h"
|
||||
|
||||
#include <xf86xv.h>
|
||||
#include <X11/extensions/Xv.h>
|
||||
@@ -40,7 +41,9 @@
|
||||
#include <xa_context.h>
|
||||
#include <math.h>
|
||||
|
||||
-/*XXX get these from pipe's texture limits */
|
||||
+static CONST_ABI_16_0 char xv_adapt_name[] = "XA G3D Textured Video";
|
||||
+
|
||||
+/*Xxx get these from pipe's texture limits */
|
||||
#define IMAGE_MAX_WIDTH 2048
|
||||
#define IMAGE_MAX_HEIGHT 2048
|
||||
|
||||
@@ -71,13 +74,18 @@ static const float bt_709[] = {
|
||||
};
|
||||
|
||||
static Atom xvBrightness, xvContrast, xvSaturation, xvHue;
|
||||
+static CONST_ABI_16_TO_19 char xv_brightness_name[] = "XV_BRIGHTNESS";
|
||||
+static CONST_ABI_16_TO_19 char xv_contrast_name[] = "XV_CONTRAST";
|
||||
+static CONST_ABI_16_TO_19 char xv_saturation_name[] = "XV_SATURATION";
|
||||
+static CONST_ABI_16_TO_19 char xv_hue_name[] = "XV_HUE";
|
||||
+static CONST_ABI_16_TO_19 char xv_image_name[] = "XV_IMAGE";
|
||||
|
||||
#define NUM_TEXTURED_ATTRIBUTES 4
|
||||
static const XF86AttributeRec TexturedAttributes[NUM_TEXTURED_ATTRIBUTES] = {
|
||||
- {XvSettable | XvGettable, -1000, 1000, "XV_BRIGHTNESS"},
|
||||
- {XvSettable | XvGettable, -1000, 1000, "XV_CONTRAST"},
|
||||
- {XvSettable | XvGettable, -1000, 1000, "XV_SATURATION"},
|
||||
- {XvSettable | XvGettable, -1000, 1000, "XV_HUE"}
|
||||
+ {XvSettable | XvGettable, -1000, 1000, xv_brightness_name},
|
||||
+ {XvSettable | XvGettable, -1000, 1000, xv_contrast_name},
|
||||
+ {XvSettable | XvGettable, -1000, 1000, xv_saturation_name},
|
||||
+ {XvSettable | XvGettable, -1000, 1000, xv_hue_name}
|
||||
};
|
||||
|
||||
#define NUM_FORMATS 3
|
||||
@@ -88,7 +96,7 @@ static XF86VideoFormatRec Formats[NUM_FORMATS] = {
|
||||
static XF86VideoEncodingRec DummyEncoding[1] = {
|
||||
{
|
||||
0,
|
||||
- "XV_IMAGE",
|
||||
+ xv_image_name,
|
||||
IMAGE_MAX_WIDTH, IMAGE_MAX_HEIGHT,
|
||||
{1, 1}
|
||||
}
|
||||
@@ -943,7 +951,7 @@ xorg_setup_textured_adapter(ScreenPtr pScreen)
|
||||
|
||||
adapt->type = XvWindowMask | XvInputMask | XvImageMask;
|
||||
adapt->flags = 0;
|
||||
- adapt->name = "XA G3D Textured Video";
|
||||
+ adapt->name = xv_adapt_name;
|
||||
adapt->nEncodings = 1;
|
||||
adapt->pEncodings = DummyEncoding;
|
||||
adapt->nFormats = NUM_FORMATS;
|
||||
--
|
||||
2.12.2
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
From 0f90e2ed52082c1e2af3b47424a6c7c5d4c0c81e Mon Sep 17 00:00:00 2001
|
||||
From: Adam Jackson <ajax@redhat.com>
|
||||
Date: Wed, 14 Mar 2018 21:49:14 +0100
|
||||
Subject: [PATCH] saa: Build compatibility with xserver 1.20
|
||||
|
||||
fbGetRotatedPixmap went away with 24bpp support, just treat it as NULL
|
||||
and we'll do the right thing.
|
||||
|
||||
Signed-off-by: Adam Jackson <ajax@redhat.com>
|
||||
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
|
||||
---
|
||||
src/common_compat.h | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/src/common_compat.h b/src/common_compat.h
|
||||
index 3cd3139..4efe350 100644
|
||||
--- a/src/common_compat.h
|
||||
+++ b/src/common_compat.h
|
||||
@@ -33,5 +33,9 @@ xf86SaveModeContents(DisplayModePtr intern, const DisplayModeRec *mode)
|
||||
}
|
||||
#endif
|
||||
|
||||
+#ifndef fbGetRotatedPixmap
|
||||
+#define fbGetRotatedPixmap(_pGC) NULL
|
||||
+#endif
|
||||
+
|
||||
#endif
|
||||
|
||||
--
|
||||
2.12.2
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
From 86189966c3dee0e0c10dd4926cebbe478129c6f0 Mon Sep 17 00:00:00 2001
|
||||
From: Thomas Hellstrom <thellstrom@vmware.com>
|
||||
Date: Wed, 9 Jan 2019 08:27:16 +0100
|
||||
Subject: [PATCH] vmwgfx: Limit the number of cliprects in a drm dirtyfb
|
||||
command v3
|
||||
|
||||
The drm dirtyfb command would error if the number of cliprects were larger
|
||||
than DRM_MODE_FB_DIRTY_MAX_CLIPS. If that number is exceeded, split the
|
||||
command up.
|
||||
|
||||
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
|
||||
Reviewed-by: Brian Paul <brianp@vmware.com> #v2
|
||||
Reviewed-by: Deepak Rawat <drawat@vmware.com> #v1
|
||||
---
|
||||
src/common_compat.h | 4 ++++
|
||||
vmwgfx/vmwgfx_driver.c | 39 +++++++++++++++++++++++++--------------
|
||||
2 files changed, 29 insertions(+), 14 deletions(-)
|
||||
|
||||
diff --git a/src/common_compat.h b/src/common_compat.h
|
||||
index 4efe350..fa6adc2 100644
|
||||
--- a/src/common_compat.h
|
||||
+++ b/src/common_compat.h
|
||||
@@ -37,5 +37,9 @@ xf86SaveModeContents(DisplayModePtr intern, const DisplayModeRec *mode)
|
||||
#define fbGetRotatedPixmap(_pGC) NULL
|
||||
#endif
|
||||
|
||||
+#ifndef DRM_MODE_FB_DIRTY_MAX_CLIPS
|
||||
+#define DRM_MODE_FB_DIRTY_MAX_CLIPS 256
|
||||
+#endif
|
||||
+
|
||||
#endif
|
||||
|
||||
diff --git a/vmwgfx/vmwgfx_driver.c b/vmwgfx/vmwgfx_driver.c
|
||||
index e5f0caf..8297d53 100644
|
||||
--- a/vmwgfx/vmwgfx_driver.c
|
||||
+++ b/vmwgfx/vmwgfx_driver.c
|
||||
@@ -650,26 +650,37 @@ drv_pre_init(ScrnInfoPtr pScrn, int flags)
|
||||
static Bool
|
||||
vmwgfx_scanout_update(int drm_fd, int fb_id, RegionPtr dirty)
|
||||
{
|
||||
- unsigned num_cliprects = REGION_NUM_RECTS(dirty);
|
||||
- drmModeClip *clip = alloca(num_cliprects * sizeof(drmModeClip));
|
||||
+ unsigned int num_cliprects = REGION_NUM_RECTS(dirty);
|
||||
+ unsigned int alloc_cliprects = min(num_cliprects,
|
||||
+ DRM_MODE_FB_DIRTY_MAX_CLIPS);
|
||||
+ drmModeClip *clip = alloca(alloc_cliprects * sizeof(drmModeClip));
|
||||
BoxPtr rect = REGION_RECTS(dirty);
|
||||
int i, ret;
|
||||
|
||||
- if (!num_cliprects)
|
||||
- return TRUE;
|
||||
+ while (num_cliprects > 0) {
|
||||
+ unsigned int cur_cliprects = min(num_cliprects,
|
||||
+ DRM_MODE_FB_DIRTY_MAX_CLIPS);
|
||||
+
|
||||
+ memset(clip, 0, alloc_cliprects * sizeof(drmModeClip));
|
||||
|
||||
- for (i = 0; i < num_cliprects; i++, rect++) {
|
||||
- clip[i].x1 = rect->x1;
|
||||
- clip[i].y1 = rect->y1;
|
||||
- clip[i].x2 = rect->x2;
|
||||
- clip[i].y2 = rect->y2;
|
||||
+ for (i = 0; i < cur_cliprects; i++, rect++) {
|
||||
+ clip[i].x1 = rect->x1;
|
||||
+ clip[i].y1 = rect->y1;
|
||||
+ clip[i].x2 = rect->x2;
|
||||
+ clip[i].y2 = rect->y2;
|
||||
+ }
|
||||
+
|
||||
+ ret = drmModeDirtyFB(drm_fd, fb_id, clip, cur_cliprects);
|
||||
+ if (ret) {
|
||||
+ LogMessage(X_ERROR, "%s: failed to send dirty (%i, %s)\n",
|
||||
+ __func__, ret, strerror(-ret));
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+
|
||||
+ num_cliprects -= cur_cliprects;
|
||||
}
|
||||
|
||||
- ret = drmModeDirtyFB(drm_fd, fb_id, clip, num_cliprects);
|
||||
- if (ret)
|
||||
- LogMessage(X_ERROR, "%s: failed to send dirty (%i, %s)\n",
|
||||
- __func__, ret, strerror(-ret));
|
||||
- return (ret == 0);
|
||||
+ return TRUE;
|
||||
}
|
||||
|
||||
static Bool
|
||||
--
|
||||
2.12.2
|
||||
|
||||
68
xenocara-video-vmware/PKGBUILD
Normal file
68
xenocara-video-vmware/PKGBUILD
Normal file
@@ -0,0 +1,68 @@
|
||||
# Maintainer: Jesus E. <heckyel@riseup.net>
|
||||
|
||||
# Based on xf86-video-vmware package
|
||||
|
||||
pkgname=xenocara-video-vmware
|
||||
_openbsdver=6.9
|
||||
pkgver=13.1.0
|
||||
pkgrel=2
|
||||
pkgdesc="Xenocara VMware video driver"
|
||||
arch=('i686' 'x86_64')
|
||||
url="https://www.xenocara.org"
|
||||
license=('X11')
|
||||
depends=('mesa')
|
||||
makedepends=('xenocara-server-devel' 'X-ABI-VIDEODRV_VERSION=24.0' 'xenocara-util-macros')
|
||||
provides=('xf86-video-vmware')
|
||||
conflicts=('xf86-video-vmware' 'xenocara-server<1.20' 'X-ABI-VIDEODRV_VERSION<24' 'X-ABI-VIDEODRV_VERSION>=25')
|
||||
replaces=('xf86-video-vmware' 'xorg-video-vmware')
|
||||
groups=('xenocara-video-drivers' 'xenocara-video' 'xenocara-drivers'
|
||||
'xorg-video-drivers' 'xorg-video' 'xorg-drivers')
|
||||
options=('!emptydirs')
|
||||
source=(https://repo.hyperbola.info:50000/sources/xenocara-libre/$_openbsdver/driver/xf86-video-vmware-$pkgver.tar.lz{,.sig}
|
||||
gcc8.patch
|
||||
0001-Adapt-Block-WakeupHandler-signature-for-ABI-23.patch
|
||||
0002-vmware-Fix-build-warnings.patch
|
||||
0003-Fix-a-number-of-compilation-warnings.patch
|
||||
0004-saa-Build-compatibility-with-xserver-1.20.patch
|
||||
0005-vmwgfx-Limit-the-number-of-cliprects-in-a-drm-dirtyf.patch)
|
||||
sha512sums=('678e33dd28603d113a47085f01d08083978ee6fc63a9a5c20df5dd391698f93fc09665a36930b061c89f73d7e077c79488868caa9dd3e6d880ef5e56ea48e26a'
|
||||
'SKIP'
|
||||
'8de12ceb62039ffb6528b6e6a8a5072846e85921141bde03b21496badc5e193af3b609ad2f50a1d0942b558a07c212ad82144641d5a9e9ff21929b5e20b5ae25'
|
||||
'bdb055f17379bf736dfe81ef049b65ef44297487a508178b34ace9fdb6b81eb69dafa47207780a193ea9b92d1577fc331c8d587367a09aee5f9657b1d093ceb3'
|
||||
'0cb791f517952c8a3bf8ce5c3c9e742b06967342e9282d2ac052c11c91adabea24af21ee71c7f9007cb8d5ecd8d168384527b657cffd0dfcd031d7ff543c0eea'
|
||||
'd13c39250fc83abcd18b348d0a7a26effa86002bddef589665a0691123013142817731236fcae1b3a9b57a7d6ef3eb3942f1c3e6c85fd16dc0c772030fcc7c07'
|
||||
'4077de6e43852e30f3e120e0b279d252f8388747a9acdadc7f5346bfd49fd088bc9337c05bec37bd40ab1790bd7d5a435ba908f0ac844ca5aee430312edef7c3'
|
||||
'63d878af65f7edafee686d422e4463f839674d30284e2b8b6fc60668829f4653c78d33d981f64d93c80526d2de63c02d38109eeb930eeab58cdc16dcbaedafcb')
|
||||
validpgpkeys=('C92BAA713B8D53D3CAE63FC9E6974752F9704456') # André Silva
|
||||
|
||||
prepare() {
|
||||
cd "xenocara-$_openbsdver/driver/xf86-video-vmware"
|
||||
patch -p1 -i "$srcdir/gcc8.patch"
|
||||
patch -p1 -i "$srcdir/0001-Adapt-Block-WakeupHandler-signature-for-ABI-23.patch"
|
||||
patch -p1 -i "$srcdir/0002-vmware-Fix-build-warnings.patch"
|
||||
patch -p1 -i "$srcdir/0003-Fix-a-number-of-compilation-warnings.patch"
|
||||
patch -p1 -i "$srcdir/0004-saa-Build-compatibility-with-xserver-1.20.patch"
|
||||
patch -p1 -i "$srcdir/0005-vmwgfx-Limit-the-number-of-cliprects-in-a-drm-dirtyf.patch"
|
||||
autoreconf -vfi
|
||||
}
|
||||
|
||||
build() {
|
||||
cd "xenocara-$_openbsdver/driver/xf86-video-vmware"
|
||||
|
||||
# Since pacman 5.0.2-2, hardened flags are now enabled in makepkg.conf
|
||||
# With them, module fail to load with undefined symbol.
|
||||
# See https://bugs.archlinux.org/task/55102 / https://bugs.archlinux.org/task/54845
|
||||
export CFLAGS=${CFLAGS/-fno-plt}
|
||||
export CXXFLAGS=${CXXFLAGS/-fno-plt}
|
||||
export LDFLAGS=${LDFLAGS/,-z,now}
|
||||
|
||||
./configure --prefix=/usr --enable-vmwarectrl-client
|
||||
make
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "xenocara-$_openbsdver/driver/xf86-video-vmware"
|
||||
make DESTDIR="$pkgdir" install
|
||||
|
||||
install -Dm644 COPYING "$pkgdir/usr/share/licenses/$pkgname/COPYING"
|
||||
}
|
||||
154
xenocara-video-vmware/gcc8.patch
Normal file
154
xenocara-video-vmware/gcc8.patch
Normal file
@@ -0,0 +1,154 @@
|
||||
diff --git a/src/vmware.c b/src/vmware.c
|
||||
index 12f12ede..aec9b9ee 100644
|
||||
--- a/src/vmware.c
|
||||
+++ b/src/vmware.c
|
||||
@@ -322,7 +322,7 @@ VMWAREPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
SVGA_LEGACY_BASE_PORT + SVGA_VALUE_PORT*sizeof(uint32);
|
||||
} else {
|
||||
/* Note: This setting of valueReg causes unaligned I/O */
|
||||
-#if XSERVER_LIBPCIACCESS
|
||||
+#ifdef XSERVER_LIBPCIACCESS
|
||||
pVMWARE->portIOBase = pVMWARE->PciInfo->regions[0].base_addr;
|
||||
#else
|
||||
pVMWARE->portIOBase = pVMWARE->PciInfo->ioBase[0];
|
||||
@@ -364,7 +364,7 @@ VMWAREPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
}
|
||||
pVMWARE->suspensionSavedRegId = id;
|
||||
|
||||
-#if !XSERVER_LIBPCIACCESS
|
||||
+#ifndef XSERVER_LIBPCIACCESS
|
||||
pVMWARE->PciTag = pciTag(pVMWARE->PciInfo->bus, pVMWARE->PciInfo->device,
|
||||
pVMWARE->PciInfo->func);
|
||||
#endif
|
||||
@@ -708,13 +708,13 @@ static Bool
|
||||
VMWAREMapMem(ScrnInfoPtr pScrn)
|
||||
{
|
||||
VMWAREPtr pVMWARE = VMWAREPTR(pScrn);
|
||||
-#if XSERVER_LIBPCIACCESS
|
||||
+#ifdef XSERVER_LIBPCIACCESS
|
||||
int err;
|
||||
struct pci_device *const device = pVMWARE->PciInfo;
|
||||
void *fbBase;
|
||||
#endif
|
||||
|
||||
-#if XSERVER_LIBPCIACCESS
|
||||
+#ifdef XSERVER_LIBPCIACCESS
|
||||
err = pci_device_map_range(device,
|
||||
pVMWARE->memPhysBase,
|
||||
pVMWARE->videoRam,
|
||||
@@ -751,7 +751,7 @@ VMWAREUnmapMem(ScrnInfoPtr pScrn)
|
||||
|
||||
VmwareLog(("Unmapped: %p/%u\n", pVMWARE->FbBase, pVMWARE->videoRam));
|
||||
|
||||
-#if XSERVER_LIBPCIACCESS
|
||||
+#ifdef XSERVER_LIBPCIACCESS
|
||||
pci_device_unmap_range(pVMWARE->PciInfo, pVMWARE->FbBase, pVMWARE->videoRam);
|
||||
#else
|
||||
xf86UnMapVidMem(pScrn->scrnIndex, pVMWARE->FbBase, pVMWARE->videoRam);
|
||||
@@ -1026,7 +1026,7 @@ static void
|
||||
VMWAREInitFIFO(ScrnInfoPtr pScrn)
|
||||
{
|
||||
VMWAREPtr pVMWARE = VMWAREPTR(pScrn);
|
||||
-#if XSERVER_LIBPCIACCESS
|
||||
+#ifdef XSERVER_LIBPCIACCESS
|
||||
struct pci_device *const device = pVMWARE->PciInfo;
|
||||
int err;
|
||||
void *mmioVirtBase;
|
||||
@@ -1039,7 +1039,7 @@ VMWAREInitFIFO(ScrnInfoPtr pScrn)
|
||||
|
||||
pVMWARE->mmioPhysBase = vmwareReadReg(pVMWARE, SVGA_REG_MEM_START);
|
||||
pVMWARE->mmioSize = vmwareReadReg(pVMWARE, SVGA_REG_MEM_SIZE) & ~3;
|
||||
-#if XSERVER_LIBPCIACCESS
|
||||
+#ifdef XSERVER_LIBPCIACCESS
|
||||
err = pci_device_map_range(device, pVMWARE->mmioPhysBase,
|
||||
pVMWARE->mmioSize,
|
||||
PCI_DEV_MAP_FLAG_WRITABLE,
|
||||
@@ -1080,7 +1080,7 @@ VMWAREStopFIFO(ScrnInfoPtr pScrn)
|
||||
TRACEPOINT
|
||||
|
||||
vmwareWriteReg(pVMWARE, SVGA_REG_CONFIG_DONE, 0);
|
||||
-#if XSERVER_LIBPCIACCESS
|
||||
+#ifdef XSERVER_LIBPCIACCESS
|
||||
pci_device_unmap_range(pVMWARE->PciInfo, pVMWARE->mmioVirtBase, pVMWARE->mmioSize);
|
||||
#else
|
||||
xf86UnMapVidMem(pScrn->scrnIndex, pVMWARE->mmioVirtBase, pVMWARE->mmioSize);
|
||||
diff --git a/src/vmware.h b/src/vmware.h
|
||||
index 028dff35..f08a2830 100644
|
||||
--- a/src/vmware.h
|
||||
+++ b/src/vmware.h
|
||||
@@ -83,7 +83,7 @@ typedef xXineramaScreenInfo VMWAREXineramaRec, *VMWAREXineramaPtr;
|
||||
|
||||
typedef struct {
|
||||
EntityInfoPtr pEnt;
|
||||
-#if XSERVER_LIBPCIACCESS
|
||||
+#ifdef XSERVER_LIBPCIACCESS
|
||||
struct pci_device *PciInfo;
|
||||
#else
|
||||
pciVideoPtr PciInfo;
|
||||
@@ -207,7 +207,7 @@ typedef struct {
|
||||
/* Undefine this to kill all acceleration */
|
||||
#define ACCELERATE_OPS
|
||||
|
||||
-#if XSERVER_LIBPCIACCESS
|
||||
+#ifdef XSERVER_LIBPCIACCESS
|
||||
#define VENDOR_ID(p) (p)->vendor_id
|
||||
#define DEVICE_ID(p) (p)->device_id
|
||||
#define SUBVENDOR_ID(p) (p)->subvendor_id
|
||||
diff --git a/src/vmware_bootstrap.c b/src/vmware_bootstrap.c
|
||||
index a74ef519..7f06cb34 100644
|
||||
--- a/src/vmware_bootstrap.c
|
||||
+++ b/src/vmware_bootstrap.c
|
||||
@@ -120,7 +120,7 @@ static resRange vmwareLegacyRes[] = {
|
||||
#define vmwareLegacyRes NULL
|
||||
#endif
|
||||
|
||||
-#if XSERVER_LIBPCIACCESS
|
||||
+#ifdef XSERVER_LIBPCIACCESS
|
||||
#define VENDOR_ID(p) (p)->vendor_id
|
||||
#define DEVICE_ID(p) (p)->device_id
|
||||
#define SUBVENDOR_ID(p) (p)->subvendor_id
|
||||
@@ -134,7 +134,7 @@ static resRange vmwareLegacyRes[] = {
|
||||
#define CHIP_REVISION(p) (p)->chipRev
|
||||
#endif
|
||||
|
||||
-#if XSERVER_LIBPCIACCESS
|
||||
+#ifdef XSERVER_LIBPCIACCESS
|
||||
|
||||
#define VMWARE_DEVICE_MATCH(d, i) \
|
||||
{PCI_VENDOR_ID_VMWARE, (d), PCI_MATCH_ANY, PCI_MATCH_ANY, 0, 0, (i) }
|
||||
@@ -213,7 +213,7 @@ vmwgfx_hosted_detect(void);
|
||||
static Bool
|
||||
VMwarePreinitStub(ScrnInfoPtr pScrn, int flags)
|
||||
{
|
||||
-#if XSERVER_LIBPCIACCESS
|
||||
+#ifdef XSERVER_LIBPCIACCESS
|
||||
struct pci_device *pciInfo;
|
||||
#else
|
||||
pciVideoPtr pciInfo;
|
||||
@@ -261,7 +261,7 @@ VMwarePreinitStub(ScrnInfoPtr pScrn, int flags)
|
||||
return (*pScrn->PreInit)(pScrn, flags);
|
||||
};
|
||||
|
||||
-#if XSERVER_LIBPCIACCESS
|
||||
+#ifdef XSERVER_LIBPCIACCESS
|
||||
static Bool
|
||||
VMwarePciProbe (DriverPtr drv,
|
||||
int entity_num,
|
||||
@@ -511,7 +511,7 @@ _X_EXPORT DriverRec vmware = {
|
||||
VMWARE_DRIVER_VERSION,
|
||||
VMWARE_DRIVER_NAME,
|
||||
VMWAREIdentify,
|
||||
-#if XSERVER_LIBPCIACCESS
|
||||
+#ifdef XSERVER_LIBPCIACCESS
|
||||
NULL,
|
||||
#else
|
||||
VMWAREProbe,
|
||||
@@ -523,7 +523,7 @@ _X_EXPORT DriverRec vmware = {
|
||||
VMWareDriverFunc,
|
||||
#endif
|
||||
#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) >= 4
|
||||
-#if XSERVER_LIBPCIACCESS
|
||||
+#ifdef XSERVER_LIBPCIACCESS
|
||||
VMwareDeviceMatch,
|
||||
VMwarePciProbe,
|
||||
#else
|
||||
Reference in New Issue
Block a user