[PATCH:xf86-input-vmmouse 2/2 v2] Add NetBSD/amd64 support for iopl calls.
Updated patch: move header include lower and be consistent in ifdef vs. if defined Thomas From 6cbbb834ee10b4b840f893d29659e53d3719504c Mon Sep 17 00:00:00 2001 From: Thomas Klausner w...@netbsd.org Date: Fri, 26 Jun 2015 10:31:53 +0200 Subject: [PATCH:xf86-input-vmmouse 2/2] Add NetBSD/amd64 support for iopl calls. While here, correct AC_DEFINE usage. Signed-off-by: Thomas Klausner w...@netbsd.org --- configure.ac | 13 + tools/vmmouse_iopl.c | 50 +++--- 2 files changed, 20 insertions(+), 43 deletions(-) diff --git a/configure.ac b/configure.ac index 55b2345..87ea3ae 100644 --- a/configure.ac +++ b/configure.ac @@ -152,17 +152,17 @@ case $host_cpu in i*86) case $host_os in *freebsd*) AC_DEFINE(USE_DEV_IO) ;; - *netbsd*) AC_DEFINE(USE_I386_IOPL) + *netbsd*) AC_DEFINE([USE_I386_IOPL], [], [BSD i386 iopl]) use_i386_iopl=yes ;; - *openbsd*) AC_DEFINE(USE_I386_IOPL) + *openbsd*) AC_DEFINE([USE_I386_IOPL], [], [BSD i386 iopl]) use_i386_iopl=yes ;; esac ;; x86_64*|amd64*) case $host_os in *freebsd*) AC_DEFINE(USE_DEV_IO, 1, [BSD /dev/io]) ;; - *netbsd*) AC_DEFINE(USE_I386_IOPL, 1, [BSD i386 iopl]) - use_i386_iopl=yes ;; + *netbsd*) AC_DEFINE(USE_X86_64_IOPL, 1, [BSD X86_64 iopl]) + use_x86_64_iopl=yes ;; *openbsd*) AC_DEFINE(USE_AMD64_IOPL, 1, [BSD AMD64 iopl]) use_amd64_iopl=yes ;; esac @@ -179,6 +179,11 @@ if test x$use_amd64_iopl = xyes; then [AC_MSG_ERROR([cannot find library for amd64_iopl])]) fi +if test x$use_x86_64_iopl = xyes; then + AC_CHECK_LIB(x86_64, x86_64_iopl,[], +[AC_MSG_ERROR([cannot find library for x86_64_iopl])]) +fi + PKG_CHECK_MODULES(XORG, [xorg-server = 1.0.1] xproto $REQUIRED_MODULES) PKG_CHECK_EXISTS([xorg-server = 1.1.0], diff --git a/tools/vmmouse_iopl.c b/tools/vmmouse_iopl.c index 8794622..27bbe62 100644 --- a/tools/vmmouse_iopl.c +++ b/tools/vmmouse_iopl.c @@ -44,8 +44,15 @@ #if defined(VMMOUSE_OS_BSD) #include sys/types.h -#ifdef USE_I386_IOPL +#if defined(USE_I386_IOPL) || defined(USE_AMD64_IOPL) || defined(USE_X86_64_IOPL) #include machine/sysarch.h +#if defined(USE_I386_IOPL) +#define IOPL_NAME i386_iopl +#elif defined(USE_AMD64_IOPL) +#define IOPL_NAME amd64_iopl +#elif defined(USE_X86_64_IOPL) +#define IOPL_NAME x86_64_iopl +#endif /***/ /* I/O Permissions section */ /***/ @@ -57,7 +64,7 @@ xf86EnableIO() if (ExtendedEnabled) return true; -if (i386_iopl(1) 0) +if (IOPL_NAME(1) 0) return false; ExtendedEnabled = true; @@ -70,48 +77,13 @@ xf86DisableIO() if (!ExtendedEnabled) return; -i386_iopl(0); +IOPL_NAME(0); ExtendedEnabled = false; return; } -#endif /* USE_I386_IOPL */ - -#ifdef USE_AMD64_IOPL -#include machine/sysarch.h -/***/ -/* I/O Permissions section */ -/***/ - -static bool ExtendedEnabled = false; - -bool -xf86EnableIO() -{ -if (ExtendedEnabled) - return true; - -if (amd64_iopl(1) 0) - return false; - -ExtendedEnabled = true; -return true; -} - -void -xf86DisableIO() -{ -if (!ExtendedEnabled) - return; - -if (amd64_iopl(0) == 0) - ExtendedEnabled = false; - -return; -} - -#endif /* USE_AMD64_IOPL */ +#endif /* defined(USE_I386_IOPL) || defined(USE_AMD64_IOPL) || defined(USE_X86_64_IOPL) */ #ifdef USE_DEV_IO #include sys/stat.h -- 2.4.3 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH 14/16] modesetting: drop unused struct in vblank.c
Am 26.06.2015 01:51, schrieb Dave Airlie: From: Dave Airlie airl...@redhat.com this isn't used anywhere here. Signed-off-by: Dave Airlie airl...@redhat.com --- hw/xfree86/drivers/modesetting/vblank.c | 5 - 1 file changed, 5 deletions(-) diff --git a/hw/xfree86/drivers/modesetting/vblank.c b/hw/xfree86/drivers/modesetting/vblank.c index 776dcef..0b7bf9d 100644 --- a/hw/xfree86/drivers/modesetting/vblank.c +++ b/hw/xfree86/drivers/modesetting/vblank.c @@ -50,11 +50,6 @@ static struct xorg_list ms_drm_queue; static uint32_t ms_drm_seq; -struct ms_pageflip { -ScreenPtr screen; -Bool crtc_for_msc_ust; -}; - looks like max(a,b). Is there a macro somewhere that does the same ? re, wh static void ms_box_intersect(BoxPtr dest, BoxPtr a, BoxPtr b) { dest-x1 = a-x1 b-x1 ? a-x1 : b-x1; ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH:xf86-input-vmmouse 1/2] Replace unportable test(1) operator.
Signed-off-by: Thomas Klausner w...@netbsd.org --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 70ed3a6..55b2345 100644 --- a/configure.ac +++ b/configure.ac @@ -135,7 +135,7 @@ case $host_os in AC_DEFINE(VMMOUSE_OS_BSD, 1, [Building for BSD flavour]) ;; solaris*) -if test x$GCC == xyes; then +if test x$GCC = xyes; then CC=$save_solaris_cc -fms-extensions fi AC_DEFINE(VMMOUSE_OS_SOLARIS, 1, [Building for Solaris flavour]) -- 2.4.3 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH:xf86-input-vmmouse 2/2] Add NetBSD/amd64 support for iopl calls.
While here, correct AC_DEFINE usage. Signed-off-by: Thomas Klausner w...@netbsd.org --- configure.ac | 13 + tools/vmmouse_iopl.c | 50 +++--- 2 files changed, 20 insertions(+), 43 deletions(-) diff --git a/configure.ac b/configure.ac index 55b2345..87ea3ae 100644 --- a/configure.ac +++ b/configure.ac @@ -152,17 +152,17 @@ case $host_cpu in i*86) case $host_os in *freebsd*) AC_DEFINE(USE_DEV_IO) ;; - *netbsd*) AC_DEFINE(USE_I386_IOPL) + *netbsd*) AC_DEFINE([USE_I386_IOPL], [], [BSD i386 iopl]) use_i386_iopl=yes ;; - *openbsd*) AC_DEFINE(USE_I386_IOPL) + *openbsd*) AC_DEFINE([USE_I386_IOPL], [], [BSD i386 iopl]) use_i386_iopl=yes ;; esac ;; x86_64*|amd64*) case $host_os in *freebsd*) AC_DEFINE(USE_DEV_IO, 1, [BSD /dev/io]) ;; - *netbsd*) AC_DEFINE(USE_I386_IOPL, 1, [BSD i386 iopl]) - use_i386_iopl=yes ;; + *netbsd*) AC_DEFINE(USE_X86_64_IOPL, 1, [BSD X86_64 iopl]) + use_x86_64_iopl=yes ;; *openbsd*) AC_DEFINE(USE_AMD64_IOPL, 1, [BSD AMD64 iopl]) use_amd64_iopl=yes ;; esac @@ -179,6 +179,11 @@ if test x$use_amd64_iopl = xyes; then [AC_MSG_ERROR([cannot find library for amd64_iopl])]) fi +if test x$use_x86_64_iopl = xyes; then + AC_CHECK_LIB(x86_64, x86_64_iopl,[], +[AC_MSG_ERROR([cannot find library for x86_64_iopl])]) +fi + PKG_CHECK_MODULES(XORG, [xorg-server = 1.0.1] xproto $REQUIRED_MODULES) PKG_CHECK_EXISTS([xorg-server = 1.1.0], diff --git a/tools/vmmouse_iopl.c b/tools/vmmouse_iopl.c index 8794622..55334da 100644 --- a/tools/vmmouse_iopl.c +++ b/tools/vmmouse_iopl.c @@ -44,8 +44,15 @@ #if defined(VMMOUSE_OS_BSD) #include sys/types.h -#ifdef USE_I386_IOPL #include machine/sysarch.h +#if defined(USE_I386_IOPL) || defined(USE_AMD64_IOPL) || defined(USE_X86_64_IOPL) +#ifdef USE_I386_IOPL +#define IOPL_NAME i386_iopl +#elif defined(USE_AMD64_IOPL) +#define IOPL_NAME amd64_iopl +#elif defined(USE_X86_64_IOPL) +#define IOPL_NAME x86_64_iopl +#endif /***/ /* I/O Permissions section */ /***/ @@ -57,7 +64,7 @@ xf86EnableIO() if (ExtendedEnabled) return true; -if (i386_iopl(1) 0) +if (IOPL_NAME(1) 0) return false; ExtendedEnabled = true; @@ -70,48 +77,13 @@ xf86DisableIO() if (!ExtendedEnabled) return; -i386_iopl(0); +IOPL_NAME(0); ExtendedEnabled = false; return; } -#endif /* USE_I386_IOPL */ - -#ifdef USE_AMD64_IOPL -#include machine/sysarch.h -/***/ -/* I/O Permissions section */ -/***/ - -static bool ExtendedEnabled = false; - -bool -xf86EnableIO() -{ -if (ExtendedEnabled) - return true; - -if (amd64_iopl(1) 0) - return false; - -ExtendedEnabled = true; -return true; -} - -void -xf86DisableIO() -{ -if (!ExtendedEnabled) - return; - -if (amd64_iopl(0) == 0) - ExtendedEnabled = false; - -return; -} - -#endif /* USE_AMD64_IOPL */ +#endif /* defined(USE_I386_IOPL) || defined(USE_AMD64_IOPL) || defined(USE_X86_64_IOPL) */ #ifdef USE_DEV_IO #include sys/stat.h -- 2.4.3 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH:xf86-input-vmmouse 2/2 v2] Add NetBSD/amd64 support for iopl calls.
On Fri, Jun 26, 2015 at 02:16:25PM +0200, Thomas Hellstrom wrote: Thanks for the patches! I've reviewed them and pushed them to git master. Unfortunately it will take a couple of weeks until the next release. I hope that's not too much inconvenience. No, that's no problem. I'll just apply the patches locally in pkgsrc in the meanwhile. Thanks for the quick review and inclusion! Thomas ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH 4/6] modesetting: reverse prime support
On 06/25/2015 03:56 PM, Dave Airlie wrote: + +screenpix = screen-GetScreenPixmap(screen); +screen-width = screenpix-drawable.width = total_width; +screen-height = screenpix-drawable.height = max_height; Directly setting the width/height of a pixmap? That seems suspicious to me. Usually you're using ModifyPixmapHeader(), since you need to change other things (like the pointer/stride) at the same time. Is there an explanation for this being safe? I just pre-existing precedent for this xf86RandR12.c:xf86RandR12ScreenSetSize after it calls the driver resize hook does pScrnPix = (*pScreen-GetScreenPixmap) (pScreen); pScreen-width = pScrnPix-drawable.width = width; pScreen-height = pScrnPix-drawable.height = height; and since I'm doing pretty much the same thing resizing the screen, I used the code from there. Yeah, for things like this, ModifyPixmapHeader() doesn't really do anything useful and gets in the way when you try to do things like set devPrivate.ptr to NULL, since it just skips the pointer write in that case: if (pPixData) pPixmap-devPrivate.ptr = pPixData; Not that you *couldn't* use ModifyPixmapHeader here, though. Dave. -- Aaron ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH 01/16] cursor: drop ARGB_CURSOR
On 06/25/2015 04:51 PM, Dave Airlie wrote: From: Dave Airlie airl...@redhat.com I doubt anyone builds with this turned off or has done for a long time. It helps my eyes bleed slightly less when reading the code, I've left the define in place as some drivers use it. Reviewed-by: Alex Deucher alexander.deuc...@amd.com Signed-off-by: Dave Airlie airl...@redhat.com Yes please. Reviewed-by: Aaron Plattner aplatt...@nvidia.com FWIW, I removed the checks for these from our driver in 2008. --- dix/cursor.c | 8 hw/kdrive/ephyr/ephyrcursor.c | 4 hw/xfree86/modes/xf86Cursors.c | 8 hw/xfree86/ramdac/xf86Cursor.c | 2 -- hw/xfree86/ramdac/xf86Cursor.h | 4 hw/xfree86/ramdac/xf86HWCurs.c | 6 -- hw/xquartz/xpr/xprCursor.c | 2 -- include/cursorstr.h| 2 -- mi/midispcur.c | 20 +--- xfixes/cursor.c| 2 -- 10 files changed, 1 insertion(+), 57 deletions(-) diff --git a/dix/cursor.c b/dix/cursor.c index 1525857..e459456 100644 --- a/dix/cursor.c +++ b/dix/cursor.c @@ -80,9 +80,7 @@ FreeCursorBits(CursorBitsPtr bits) return; free(bits-source); free(bits-mask); -#ifdef ARGB_CURSOR free(bits-argb); -#endif dixFiniPrivates(bits, PRIVATE_CURSOR_BITS); if (bits-refcnt == 0) { GlyphSharePtr *prev, this; @@ -165,7 +163,6 @@ CheckForEmptyMask(CursorBitsPtr bits) while (n--) if (*(msk++) != 0) return; -#ifdef ARGB_CURSOR if (bits-argb) { CARD32 *argb = bits-argb; @@ -174,7 +171,6 @@ CheckForEmptyMask(CursorBitsPtr bits) if (*argb++ 0xff00) return; } -#endif bits-emptyMask = TRUE; } @@ -259,9 +255,7 @@ AllocARGBCursor(unsigned char *psrcbits, unsigned char *pmaskbits, dixInitPrivates(bits, bits + 1, PRIVATE_CURSOR_BITS) bits-source = psrcbits; bits-mask = pmaskbits; -#ifdef ARGB_CURSOR bits-argb = argb; -#endif bits-width = cm-width; bits-height = cm-height; bits-xhot = cm-xhot; @@ -400,9 +394,7 @@ AllocGlyphCursor(Font source, unsigned sourceChar, Font mask, unsigned maskChar, dixInitPrivates(bits, bits + 1, PRIVATE_CURSOR_BITS); bits-source = srcbits; bits-mask = mskbits; -#ifdef ARGB_CURSOR bits-argb = 0; -#endif bits-width = cm.width; bits-height = cm.height; bits-xhot = cm.xhot; diff --git a/hw/kdrive/ephyr/ephyrcursor.c b/hw/kdrive/ephyr/ephyrcursor.c index 852be33..808b3c7 100644 --- a/hw/kdrive/ephyr/ephyrcursor.c +++ b/hw/kdrive/ephyr/ephyrcursor.c @@ -100,7 +100,6 @@ ephyrRealizeCoreCursor(EphyrScrPriv *scr, CursorPtr cursor) xcb_free_pixmap(conn, mask); } -#ifdef ARGB_CURSOR static xcb_render_pictformat_t get_argb_format(void) { @@ -170,7 +169,6 @@ can_argb_cursor(void) return v-major_version == 0 v-minor_version = 5; } -#endif static Bool ephyrRealizeCursor(DeviceIntPtr dev, ScreenPtr screen, CursorPtr cursor) @@ -179,11 +177,9 @@ ephyrRealizeCursor(DeviceIntPtr dev, ScreenPtr screen, CursorPtr cursor) KdScreenInfo *kscr = pScreenPriv-screen; EphyrScrPriv *scr = kscr-driver; -#ifdef ARGB_CURSOR if (cursor-bits-argb can_argb_cursor()) ephyrRealizeARGBCursor(scr, cursor); else -#endif { ephyrRealizeCoreCursor(scr, cursor); } diff --git a/hw/xfree86/modes/xf86Cursors.c b/hw/xfree86/modes/xf86Cursors.c index 379a27a..321cde7 100644 --- a/hw/xfree86/modes/xf86Cursors.c +++ b/hw/xfree86/modes/xf86Cursors.c @@ -258,9 +258,7 @@ xf86_crtc_convert_cursor_to_argb(xf86CrtcPtr crtc, unsigned char *src) CARD32 bits; const Rotation rotation = xf86_crtc_cursor_rotation(crtc); -#ifdef ARGB_CURSOR crtc-cursor_argb = FALSE; -#endif for (y = 0; y cursor_info-MaxHeight; y++) for (x = 0; x cursor_info-MaxWidth; x++) { @@ -458,9 +456,7 @@ xf86_crtc_load_cursor_image(xf86CrtcPtr crtc, CARD8 *src) CARD8 *cursor_image; const Rotation rotation = xf86_crtc_cursor_rotation(crtc); -#ifdef ARGB_CURSOR crtc-cursor_argb = FALSE; -#endif if (rotation == RR_Rotate_0) cursor_image = src; @@ -632,12 +628,10 @@ xf86_cursors_init(ScreenPtr screen, int max_width, int max_height, int flags) cursor_info-HideCursor = xf86_hide_cursors; cursor_info-ShowCursor = xf86_show_cursors; cursor_info-UseHWCursor = xf86_use_hw_cursor; -#ifdef ARGB_CURSOR if (flags HARDWARE_CURSOR_ARGB) { cursor_info-UseHWCursorARGB = xf86_use_hw_cursor_argb; cursor_info-LoadCursorARGBCheck = xf86_load_cursor_argb; } -#endif xf86_config-cursor = NULL; xf86_hide_cursors(scrn); @@ -691,11 +685,9 @@ xf86_reload_cursors(ScreenPtr screen) void *src =
Re: [PATCH 02/16] xf86Rotate: remove unused macros.
On 06/25/2015 04:51 PM, Dave Airlie wrote: From: Dave Airlie airl...@redhat.com These macros aren't used anywhere. Signed-off-by: Dave Airlie airl...@redhat.com --- hw/xfree86/modes/xf86Rotate.c | 5 - 1 file changed, 5 deletions(-) diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c index 9c00a44..01cc764 100644 --- a/hw/xfree86/modes/xf86Rotate.c +++ b/hw/xfree86/modes/xf86Rotate.c @@ -44,11 +44,6 @@ #include X11/Xatom.h /* borrowed from composite extension, move to Render and publish? */ Does this comment apply to those macros? - -#define F(x) IntToxFixed(x) - -#define toF(x) ((float) (x) / 65536.0f) - static void xf86RotateCrtcRedisplay(xf86CrtcPtr crtc, RegionPtr region) { -- Aaron ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH 02/16] xf86Rotate: remove unused macros.
On 27 June 2015 at 07:41, Aaron Plattner aplatt...@nvidia.com wrote: On 06/25/2015 04:51 PM, Dave Airlie wrote: From: Dave Airlie airl...@redhat.com These macros aren't used anywhere. Signed-off-by: Dave Airlie airl...@redhat.com --- hw/xfree86/modes/xf86Rotate.c | 5 - 1 file changed, 5 deletions(-) diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c index 9c00a44..01cc764 100644 --- a/hw/xfree86/modes/xf86Rotate.c +++ b/hw/xfree86/modes/xf86Rotate.c @@ -44,11 +44,6 @@ #include X11/Xatom.h /* borrowed from composite extension, move to Render and publish? */ Does this comment apply to those macros? It probably does. I'll junk it as well. Dave. ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH:xf86-input-vmmouse 2/2 v2] Add NetBSD/amd64 support for iopl calls.
Hi! On 06/26/2015 10:51 AM, Thomas Klausner wrote: Updated patch: move header include lower and be consistent in ifdef vs. if defined Thomas Thanks for the patches! I've reviewed them and pushed them to git master. Unfortunately it will take a couple of weeks until the next release. I hope that's not too much inconvenience. Thanks, Thomas ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel