xserver: Branch 'master' - 3 commits

Eric Anholt anholt at kemper.freedesktop.org
Fri Jun 2 16:33:39 UTC 2017


 configure.ac                     |    2 
 hw/meson.build                   |    4 
 hw/xwin/Makefile.am              |   16 ---
 hw/xwin/dri/meson.build          |   14 ++
 hw/xwin/glx/meson.build          |  100 ++++++++++++++++++++
 hw/xwin/meson.build              |  170 ++++++++++++++++++++++++++++++++++
 hw/xwin/win.h                    |    2 
 hw/xwin/winclipboard/meson.build |   31 ++++++
 hw/xwin/winvideo.c               |  191 ---------------------------------------
 include/meson.build              |   32 +++++-
 include/xwin-config.h.meson.in   |   24 ++++
 meson.build                      |   13 ++
 meson_options.txt                |    5 +
 13 files changed, 392 insertions(+), 212 deletions(-)

New commits:
commit 1f38a31ed3969471cbed69c61edb971f6cff5287
Author: Jon Turney <jon.turney at dronecode.org.uk>
Date:   Sun May 7 20:53:04 2017 +0100

    Add meson.build for XWin server (v2)
    
    This needs a meson with PRs #1784, #1792 and #1794
    
    Future work: remove conditionals which are always on, and simplify redundant
    CYGDEBUG conditionals
    
    Signed-off-by: Jon Turney <jon.turney at dronecode.org.uk>
    Reviewed-by: Eric Anholt <eric at anholt.net>

diff --git a/hw/meson.build b/hw/meson.build
index c389a995b..c0d2db3f5 100644
--- a/hw/meson.build
+++ b/hw/meson.build
@@ -23,3 +23,7 @@ endif
 if build_xwayland
     subdir('xwayland')
 endif
+
+if build_xwin
+    subdir('xwin')
+endif
diff --git a/hw/xwin/dri/meson.build b/hw/xwin/dri/meson.build
new file mode 100644
index 000000000..0d8703c38
--- /dev/null
+++ b/hw/xwin/dri/meson.build
@@ -0,0 +1,14 @@
+srcs_windows_dri = [
+    'windowsdri.c',
+    'windowsdri.h',
+]
+
+xwin_windowsdri = static_library(
+    'WindowsDRI',
+    srcs_windows_dri,
+    include_directories: [ inc, include_directories('../') ],
+    dependencies: [
+        windowsdri_dep,
+        pixman_dep,
+    ],
+)
diff --git a/hw/xwin/glx/meson.build b/hw/xwin/glx/meson.build
new file mode 100644
index 000000000..77ffeda28
--- /dev/null
+++ b/hw/xwin/glx/meson.build
@@ -0,0 +1,100 @@
+python3 = import('python3')
+
+# XWin requires OpenGL spec files in order to generate wrapper code for native GL functions
+py3 = python3.find_python()
+if run_command(py3, '-c', 'import lxml;').returncode() != 0
+    error('python3 lxml module not found')
+endif
+
+khronos_spec_dir = dependency('khronos-opengl-registry').get_pkgconfig_variable('specdir')
+
+gen_gl_wrappers_opts= ['-nodebug']
+gen_gl_wrappers_cmd = ['env', 'PYTHONPATH=' + khronos_spec_dir, py3, files('./gen_gl_wrappers.py'), gen_gl_wrappers_opts]
+
+wgl_wrappers = custom_target(
+    'gen_wgl_wrappers',
+    command: [gen_gl_wrappers_cmd, '-registry', '@INPUT@', '-prefix', 'wgl', '-wrapper', '-preresolve', '-outfile', '@OUTPUT@'],
+    input: join_paths(khronos_spec_dir, 'wgl.xml'),
+    output: 'generated_wgl_wrappers.c',
+    depend_files: join_paths(khronos_spec_dir, 'reg.py'),
+)
+
+gl_shim = custom_target(
+    'gen_gl_shim',
+    command: [gen_gl_wrappers_cmd, '-registry', '@INPUT@', '-shim', '-outfile', '@OUTPUT@'],
+    input: join_paths(khronos_spec_dir, 'gl.xml'),
+    output: 'generated_gl_shim.c',
+    depend_files: join_paths(khronos_spec_dir, 'reg.py'),
+)
+
+gl_thunks = custom_target(
+    'gen_gl_thunks',
+    command: [gen_gl_wrappers_cmd, '-registry', '@INPUT@', '-thunk', '-outfile', '@OUTPUT@'],
+    input: join_paths(khronos_spec_dir, 'gl.xml'),
+    output: 'generated_gl_thunks.c',
+    depend_files: join_paths(khronos_spec_dir, 'reg.py'),
+)
+
+gl_thunks_def = custom_target(
+    'gen_gl_thunks_def',
+    command: [gen_gl_wrappers_cmd, '-registry', '@INPUT@', '-thunkdefs', '-outfile', '@OUTPUT@'],
+    input: join_paths(khronos_spec_dir, 'gl.xml'),
+    output: 'generated_gl_thunks.def',
+    depend_files: join_paths(khronos_spec_dir, 'reg.py'),
+)
+
+srcs_windows_glx = [
+    'winpriv.c',
+    'winpriv.h',
+    'glwindows.h',
+    'glshim.c',
+    'indirect.c',
+    'indirect.h',
+    'wgl_ext_api.c',
+    'wgl_ext_api.h',
+]
+
+if build_windowsdri
+    srcs_windows_glx += [
+        'dri_helpers.c',
+        'dri_helpers.h',
+    ]
+endif
+
+xwin_glx_c_args = []
+xwin_glx_c_args += '-DHAVE_XWIN_CONFIG_H'
+xwin_glx_c_args += '-DXWIN_MULTIWINDOW'
+xwin_glx_c_args += '-DXWIN_GLX_WINDOWS'
+
+xwin_glx = static_library(
+    'XwinGLX',
+    srcs_windows_glx,
+    include_directories: [
+        inc,
+        top_srcdir_inc,
+        include_directories('../'),
+    ],
+    dependencies: pixman_dep,
+    c_args: xwin_glx_c_args,
+)
+
+srcs_wgl_thunk = [
+    'glthunk.c',
+]
+
+WGLthunk = shared_library(
+    'nativeGLthunk',
+    srcs_wgl_thunk,
+    include_directories: [
+        inc,
+        top_srcdir_inc,
+    ],
+    c_args: xwin_glx_c_args + [
+      '-Wno-unused-function',
+      '-Wno-missing-prototypes',
+      '-Wno-missing-declarations',
+    ],
+    link_args: ['-lopengl32'],
+    vs_module_defs: gl_thunks_def,
+    install: true,
+)
diff --git a/hw/xwin/meson.build b/hw/xwin/meson.build
new file mode 100644
index 000000000..7e418206a
--- /dev/null
+++ b/hw/xwin/meson.build
@@ -0,0 +1,170 @@
+windows = import('windows')
+
+windowsdri_dep = dependency('windowsdriproto', required: false)
+
+build_windowsdri = windowsdri_dep.found()
+
+xwin_sys_libs = []
+xwin_sys_libs += '-ldxguid'
+
+if host_machine.system() == 'cygwin'
+    server_name = 'XWin'
+else
+    server_name = 'Xming'
+    xwin_sys_libs += ['-lpthread', '-lws2_32']
+endif
+
+xwin_c_args = []
+xwin_c_args += '-DHAVE_XWIN_CONFIG_H'
+xwin_c_args += '-Wno-bad-function-cast'
+# XXX: these conditionals are always on and can be removed
+xwin_c_args += '-DXWIN_CLIPBOARD'
+xwin_c_args += '-DXWIN_MULTIWINDOW'
+xwin_c_args += '-DXWIN_RANDR'
+
+srcs_windows = [
+    'winclipboardinit.c',
+    'winclipboardwrappers.c',
+]
+subdir('winclipboard')
+
+if build_glx
+    if build_windowsdri
+        xwin_c_args += '-DXWIN_WINDOWS_DRI'
+        subdir('dri')
+    endif
+    xwin_c_args += '-DXWIN_GLX_WINDOWS'
+    xwin_sys_libs += '-lopengl32'
+    subdir('glx')
+endif
+
+srcs_windows += [
+     'winmultiwindowshape.c',
+     'winmultiwindowwindow.c',
+     'winmultiwindowwm.c',
+     'winmultiwindowwndproc.c',
+     'propertystore.h',
+     'winSetAppUserModelID.c',
+]
+xwin_sys_libs += ['-lshlwapi', '-lole32']
+
+srcs_windows += [
+     'winrandr.c',
+]
+
+srcs_windows += [
+    'InitInput.c',
+    'InitOutput.c',
+    'winallpriv.c',
+    'winauth.c',
+    'winblock.c',
+    'wincmap.c',
+    'winconfig.c',
+    'wincreatewnd.c',
+    'wincursor.c',
+    'windialogs.c',
+    'winengine.c',
+    'winerror.c',
+    'winglobals.c',
+    'winkeybd.c',
+    'winkeyhook.c',
+    'winmisc.c',
+    'winmonitors.c',
+    'winmouse.c',
+    'winmsg.c',
+    'winmsgwindow.c',
+    'winmultiwindowclass.c',
+    'winmultiwindowicons.c',
+    'winos.c',
+    'winprefs.c',
+    'winprocarg.c',
+    'winscrinit.c',
+    'winshadddnl.c',
+    'winshadgdi.c',
+    'wintaskbar.c',
+    'wintrayicon.c',
+    'winvalargs.c',
+    'winwakeup.c',
+    'winwindow.c',
+    'winwndproc.c',
+    'ddraw.h',
+    'winconfig.h',
+    'win.h',
+    'winglobals.h',
+    'winkeybd.h',
+    'winkeynames.h',
+    'winlayouts.h',
+    'winmessages.h',
+    'winmonitors.h',
+    'winmsg.h',
+    'winms.h',
+    'winmultiwindowclass.h',
+    'winmultiwindowicons.h',
+    'winprefs.h',
+    'winresource.h',
+    'winwindow.h',
+    'windisplay.c',
+    'windisplay.h',
+    '../../mi/miinitext.c',
+]
+
+rsrc = windows.compile_resources('XWin.rc', include_directories: include_directories('../../include/'))
+srcs_windows += rsrc
+
+flex = find_program('flex')
+bison = find_program('bison')
+
+lgen = generator(
+    flex,
+    output : '@PLAINNAME at .yy.c',
+    arguments : ['-i', '-o', '@OUTPUT@', '@INPUT@']
+)
+
+lfiles = lgen.process('winprefslex.l')
+srcs_windows += lfiles
+
+pgen = generator(
+    bison,
+    output : ['@BASENAME at .c', '@BASENAME at .h'],
+    arguments : ['@INPUT@', '--defines=@OUTPUT1@', '--output=@OUTPUT0@']
+)
+
+pfiles = pgen.process('winprefsyacc.y')
+srcs_windows += pfiles
+
+xwin_dep = [
+    common_dep,
+    dependency('x11-xcb'),
+    dependency('xcb-aux'),
+    dependency('xcb-image'),
+    dependency('xcb-ewmh'),
+    dependency('xcb-icccm'),
+]
+
+executable(
+    server_name,
+    srcs_windows,
+    include_directories: [inc, top_srcdir_inc],
+    dependencies: xwin_dep,
+    link_with: [
+        xwin_windowsdri,
+        xwin_glx,
+        xwin_clipboard,
+        libxserver_fb,
+        libxserver,
+        libxserver_glx,
+        libxserver_xkb_stubs,
+        libxserver_miext_shadow,
+        libxserver_pseudoramix,
+        libxserver_xi_stubs,
+    ],
+    link_args: ['-Wl,--disable-stdcall-fixup', '-Wl,--export-all-symbols'] +  xwin_sys_libs,
+    c_args: xwin_c_args,
+    gui_app: true,
+    install: true,
+)
+
+install_data(
+    'system.XWinrc',
+    install_dir: join_paths(get_option('sysconfdir'), 'X11')
+)
diff --git a/hw/xwin/winclipboard/meson.build b/hw/xwin/winclipboard/meson.build
new file mode 100644
index 000000000..1c784c384
--- /dev/null
+++ b/hw/xwin/winclipboard/meson.build
@@ -0,0 +1,31 @@
+srcs_windows_clipboard = [
+    'winclipboard.h',
+    'textconv.c',
+    'thread.c',
+    'wndproc.c',
+    'xevents.c',
+]
+
+xwin_clipboard = static_library(
+    'XWinclipboard',
+    srcs_windows_clipboard,
+    include_directories: inc,
+    c_args: '-DHAVE_XWIN_CONFIG_H',
+    dependencies: [
+        dependency('x11'),
+        dependency('xfixes'),
+    ],
+)
+
+srcs_xwinclip = [
+    'xwinclip.c',
+    'debug.c',
+]
+
+executable(
+    'xwinclip',
+    srcs_xwinclip,
+    link_with: xwin_clipboard,
+    link_args: ['-lgdi32', '-lpthread'],
+    install: true,
+)
diff --git a/include/meson.build b/include/meson.build
index ef3163d1f..78ec521ac 100644
--- a/include/meson.build
+++ b/include/meson.build
@@ -1,3 +1,10 @@
+version_split = meson.project_version().split('.')
+major = version_split[0].to_int()
+minor = version_split[1].to_int()
+patch = version_split[2].to_int()
+subpatch = version_split[3].to_int()
+
+release = major * 10000000 + minor * 100000 + patch * 1000 + subpatch
 
 dri_dep = dependency('dri', required: build_dri2 or build_dri3)
 
@@ -78,6 +85,7 @@ conf_data.set_quoted('PROJECTROOT', get_option('prefix'))
 conf_data.set_quoted('SYSCONFDIR', join_paths(get_option('prefix'), get_option('sysconfdir')))
 
 # XXX: Stopped enumerating at COMPILEDEFAULTFONTPATH
+conf_data.set('XORG_VERSION_CURRENT', release)
 
 conf_data.set('HASXDMAUTH', get_option('xdm-auth-1'))
 
@@ -190,23 +198,20 @@ conf_data.set_quoted('XVENDORNAME', get_option('vendor_name'))
 conf_data.set_quoted('XVENDORNAMESHORT', get_option('vendor_name_short'))
 conf_data.set_quoted('__VENDORDWEBSUPPORT__', get_option('vendor_web'))
 conf_data.set_quoted('OSVENDOR', get_option('os_vendor'))
+conf_data.set_quoted('BUILDERADDR', get_option('builder_addr'))
+conf_data.set_quoted('BUILDERSTRING', get_option('builder_string'))
 
 configure_file(output : 'dix-config.h',
                configuration : conf_data)
 
-version_split = meson.project_version().split('.')
-major = version_split[0].to_int()
-minor = version_split[1].to_int()
-patch = version_split[2].to_int()
-subpatch = version_split[3].to_int()
 
-release = major * 10000000 + minor * 100000 + patch * 1000 + subpatch
 
 version_data = configuration_data()
 version_data.set('VENDOR_RELEASE', '@0@'.format(release))
 version_data.set_quoted('VENDOR_NAME', get_option('vendor_name'))
 version_data.set_quoted('VENDOR_NAME_SHORT', get_option('vendor_name_short'))
 version_data.set_quoted('VENDOR_WEB', get_option('vendor_web'))
+version_data.set_quoted('VENDOR_MAN_VERSION', 'Version @0 at .@1 at .@2@'.format(major, minor, patch))
 configure_file(output : 'version-config.h',
                configuration : version_data)
 
@@ -269,6 +274,21 @@ configure_file(output : 'xorg-config.h',
                input : 'xorg-config.h.meson.in',
                configuration : xorg_data)
 
+xwin_data = configuration_data()
+xwin_data.set_quoted('DEFAULT_LOGDIR', log_dir)
+xwin_data.set('HAS_WINSOCK', host_machine.system() == 'windows', description: 'Use Windows sockets')
+xwin_data.set('HAS_DEVWINDOWS', host_machine.system() == 'cygwin', description: 'Has /dev/windows for signaling new win32 messages')
+xwin_data.set('RELOCATE_PROJECTROOT', host_machine.system() == 'windows', description: 'Make paths relative to the xserver installation location')
+# XXX: these three are all the same as DEBUG so we should just change to that
+enable_debugging = (get_option('buildtype') == 'debug') or (get_option('buildtype') == 'debugoptimized')
+xwin_data.set10('CYGDEBUG', enable_debugging)
+xwin_data.set10('CYGWINDOWING_DEBUG',enable_debugging)
+xwin_data.set10('CYGMULTIWINDOW_DEBUG', enable_debugging)
+
+configure_file(output : 'xwin-config.h',
+               input : 'xwin-config.h.meson.in',
+               configuration : xwin_data)
+
 if build_xorg
     install_data(
         [
diff --git a/include/xwin-config.h.meson.in b/include/xwin-config.h.meson.in
new file mode 100644
index 000000000..993227398
--- /dev/null
+++ b/include/xwin-config.h.meson.in
@@ -0,0 +1,24 @@
+/*
+ * xwin-config.h.in
+ *
+ * This file has all defines used in the xwin ddx
+ *
+ */
+#include <dix-config.h>
+
+/* Winsock networking */
+#mesondefine HAS_WINSOCK
+
+/* Cygwin has /dev/windows for signaling new win32 messages */
+#mesondefine HAS_DEVWINDOWS
+
+/* Switch on debug messages */
+#mesondefine CYGDEBUG
+#mesondefine CYGWINDOWING_DEBUG
+#mesondefine CYGMULTIWINDOW_DEBUG
+
+/* Default log location */
+#mesondefine DEFAULT_LOGDIR
+
+/* Whether we should re-locate the root to where the executable lives */
+#mesondefine RELOCATE_PROJECTROOT
diff --git a/meson.build b/meson.build
index dab3d4423..f0b1ef0a2 100644
--- a/meson.build
+++ b/meson.build
@@ -135,9 +135,18 @@ if (host_machine.system() != 'darwin' and
     endif
 endif
 
+build_xwin = false
+if get_option('xwin') == 'auto'
+    if (host_machine.system() == 'cygwin' or
+        host_machine.system() == 'windows')
+            build_xwin = true
+    endif
+else
+    build_xwin = get_option('xwin') == 'yes'
+endif
+
 # XXX: Finish these.
 build_xquartz = false
-build_xwin = false
 
 if get_option('ipv6') == 'auto'
     build_ipv6 = cc.has_function('getaddrinfo')
@@ -331,6 +340,8 @@ inc = include_directories(
 
 glx_inc = include_directories('glx')
 
+top_srcdir_inc = include_directories('.')
+
 serverconfigdir = join_paths(get_option('libdir'), '/xorg')
 
 # Include must come first, as it sets up dix-config.h
diff --git a/meson_options.txt b/meson_options.txt
index 88423e25e..56d5afa19 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -10,6 +10,11 @@ option('xnest', type: 'combo', choices: ['yes', 'no', 'auto'], value: 'auto',
        description: 'Enable Xnest nested X server')
 option('dmx', type: 'boolean', value: false,
        description: 'Enable DMX nested X server')
+option('xwin', type: 'combo', choices: ['yes', 'no', 'auto'], value: 'auto',
+       description: 'Enable XWin X server')
+
+option('builder_addr', type: 'string', description: 'Builder address', value: 'xorg at lists.freedesktop.org')
+option('builder_string', type: 'string', description: 'Additional builder string')
 
 option('log_dir', type: 'string')
 option('module_dir', type: 'string',
commit 36b9dac212a0f8a287cdbd35db152a5eb5cbc744
Author: Jon Turney <jon.turney at dronecode.org.uk>
Date:   Tue May 9 12:59:19 2017 +0100

    hw/xwin: Remove pretense of Xv support
    
    Signed-off-by: Jon Turney <jon.turney at dronecode.org.uk>
    Reviewed-by: Eric Anholt <eric at anholt.net>

diff --git a/configure.ac b/configure.ac
index faf0753d6..40ac1e78d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -666,7 +666,6 @@ case $host_os in
 		XF86UTILS=no
 		XF86VIDMODE=no
 		XSELINUX=no
-		XV=no
 		SYMBOL_VISIBILITY=no
 		;;
 	darwin*)
@@ -2198,7 +2197,6 @@ AM_CONDITIONAL(XWIN_CLIPBOARD, [test "x$XWIN" = xyes])
 AM_CONDITIONAL(XWIN_GLX_WINDOWS, [test "x$XWIN" = xyes && test "x$GLX" = xyes])
 AM_CONDITIONAL(XWIN_WINDOWS_DRI, [test "x$XWIN" = xyes && test "x$WINDOWSDRI" = xyes])
 AM_CONDITIONAL(XWIN_RANDR, [test "x$XWIN" = xyes])
-AM_CONDITIONAL(XWIN_XV, [test "x$XWIN" = xyes && test "x$XV" = xyes])
 
 dnl Darwin / OS X DDX
 if test "x$XQUARTZ" = xyes; then
diff --git a/hw/xwin/Makefile.am b/hw/xwin/Makefile.am
index 4d288c959..413722c71 100644
--- a/hw/xwin/Makefile.am
+++ b/hw/xwin/Makefile.am
@@ -52,12 +52,6 @@ SRCS_RANDR = \
 DEFS_RANDR = -DXWIN_RANDR
 endif
 
-if XWIN_XV
-SRCS_XV = \
-	winvideo.c
-DEFS_XV = -DXWIN_XV
-endif
-
 SRCS =	InitInput.c \
 	InitOutput.c \
 	winallpriv.c \
@@ -119,8 +113,7 @@ SRCS =	InitInput.c \
 	$(SRCS_MULTIWINDOWEXTWM) \
 	$(SRCS_NATIVEGDI) \
 	$(SRCS_PRIMARYFB) \
-	$(SRCS_RANDR) \
-	$(SRCS_XV)
+	$(SRCS_RANDR)
 
  DEFS = $(DEFS_CLIPBOARD) \
 	$(DEFS_GLX_WINDOWS) \
@@ -128,8 +121,7 @@ SRCS =	InitInput.c \
 	$(DEFS_MULTIWINDOWEXTWM) \
 	$(DEFS_NATIVEGDI) \
 	$(DEFS_PRIMARYFB) \
-	$(DEFS_RANDR) \
-	$(DEFS_XV)
+	$(DEFS_RANDR)
 
 XWin_SOURCES = $(SRCS)
 
diff --git a/hw/xwin/winvideo.c b/hw/xwin/winvideo.c
deleted file mode 100644
index 151538d10..000000000
--- a/hw/xwin/winvideo.c
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
- *Copyright (C) 2003-2004 Harold L Hunt II All Rights Reserved.
- *
- *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 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 HAROLD L HUNT II 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.
- *
- *Except as contained in this notice, the name of Harold L Hunt II
- *shall not be used in advertising or otherwise to promote the sale, use
- *or other dealings in this Software without prior written authorization
- *from Harold L Hunt II.
- *
- * Authors:	Harold L Hunt II
- */
-
-#ifdef HAVE_XWIN_CONFIG_H
-#include <xwin-config.h>
-#endif
-#include "win.h"
-#include <X11/extensions/Xv.h>
-#include <X11/extensions/Xvproto.h>
-
-void
- winInitVideo(ScreenPtr pScreen);
-
-/*
- * winInitVideo - Initialize support for the X Video (Xv) Extension.
- */
-
-void
-winInitVideo(ScreenPtr pScreen)
-{
-    winScreenPriv(pScreen);
-    winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
-
-    if (pScreenInfo->dwBPP > 8) {
-
-    }
-
-}
-
-#if 0
-#include "../xfree86/common/xf86.h"
-#include "../Xext/xvdix.h"
-#include "../xfree86/common/xf86xv.h"
-#include <X11/extensions/Xv.h>
-#endif
-
-#if 0
-/* client libraries expect an encoding */
-static XF86VideoEncodingRec DummyEncoding[1] = {
-    {
-     0,
-     "XV_IMAGE",
-     IMAGE_MAX_WIDTH, IMAGE_MAX_HEIGHT,
-     {1, 1}
-     }
-};
-
-#define NUM_FORMATS 3
-
-static XF86VideoFormatRec Formats[NUM_FORMATS] = {
-    {15, TrueColor}, {16, TrueColor}, {24, TrueColor}
-};
-
-#define NUM_ATTRIBUTES 3
-
-static XF86AttributeRec Attributes[NUM_ATTRIBUTES] = {
-    {XvSettable | XvGettable, 0, (1 << 24) - 1, "XV_COLORKEY"},
-    {XvSettable | XvGettable, -128, 127, "XV_BRIGHTNESS"},
-    {XvSettable | XvGettable, 0, 255, "XV_CONTRAST"}
-};
-
-#define NUM_IMAGES 4
-
-static XF86ImageRec Images[NUM_IMAGES] = {
-    XVIMAGE_YUY2,
-    XVIMAGE_YV12,
-    XVIMAGE_I420,
-    XVIMAGE_UYVY
-};
-
-/*
- * winInitVideo - Initialize support for the X Video (Xv) Extension.
- */
-
-void
-winInitVideo(ScreenPtr pScreen)
-{
-    winScreenPriv(pScreen);
-    winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
-    XF86VideoAdaptorPtr newAdaptor = NULL;
-
-    if (pScreenInfo->dwBPP > 8) {
-        newAdaptor = I810SetupImageVideo(pScreen);
-        I810InitOffscreenImages(pScreen);
-    }
-
-    xf86XVScreenInit(pScreen, adaptors, 1);
-}
-
-static XF86VideoAdaptorPtr
-winSetupImageVideo(ScreenPtr pScreen)
-{
-    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
-
-#if 0
-    I810Ptr pI810 = I810PTR(pScrn);
-#endif
-    XF86VideoAdaptorPtr adapt;
-
-    if (!(adapt = calloc(1, sizeof(XF86VideoAdaptorRec))))
-        return NULL;
-
-    adapt->type = XvWindowMask | XvInputMask | XvImageMask;
-    adapt->flags = VIDEO_OVERLAID_IMAGES | VIDEO_CLIP_TO_VIEWPORT;
-    adapt->name = PROJECT_NAME " Video Overlay";
-    adapt->nEncodings = 1;
-    adapt->pEncodings = DummyEncoding;
-    adapt->nFormats = NUM_FORMATS;
-    adapt->pFormats = Formats;
-    adapt->nPorts = 1;
-    adapt->pPortPrivates = NULL;
-
-    adapt->pPortPrivates[0].ptr = NULL;
-    adapt->pAttributes = Attributes;
-    adapt->nImages = NUM_IMAGES;
-    adapt->nAttributes = NUM_ATTRIBUTES;
-    adapt->pImages = Images;
-    adapt->PutVideo = NULL;
-    adapt->PutStill = NULL;
-    adapt->GetVideo = NULL;
-    adapt->GetStill = NULL;
-#if 0
-    adapt->StopVideo = I810StopVideo;
-    adapt->SetPortAttribute = I810SetPortAttribute;
-    adapt->GetPortAttribute = I810GetPortAttribute;
-    adapt->QueryBestSize = I810QueryBestSize;
-    adapt->PutImage = I810PutImage;
-    adapt->QueryImageAttributes = I810QueryImageAttributes;
-#endif
-
-#if 0
-    pPriv->colorKey = pI810->colorKey & ((1 << pScrn->depth) - 1);
-#endif
-    pPriv->videoStatus = 0;
-    pPriv->brightness = 0;
-    pPriv->contrast = 64;
-    pPriv->linear = NULL;
-    pPriv->currentBuf = 0;
-
-#if 0
-    /* gotta uninit this someplace */
-    RegionNull(&pPriv->clip);
-#endif
-
-#if 0
-    pI810->adaptor = adapt;
-
-    pI810->BlockHandler = pScreen->BlockHandler;
-    pScreen->BlockHandler = I810BlockHandler;
-#endif
-
-#if 0
-    xvBrightness = MAKE_ATOM("XV_BRIGHTNESS");
-    xvContrast = MAKE_ATOM("XV_CONTRAST");
-    xvColorKey = MAKE_ATOM("XV_COLORKEY");
-#endif
-
-#if 0
-    I810ResetVideo(pScrn);
-#endif
-
-    return adapt;
-}
-#endif
commit 793af4d3f945b1d59eb2f84e625b581ea90b0066
Author: Jon Turney <jon.turney at dronecode.org.uk>
Date:   Sun May 7 20:31:55 2017 +0100

    hw/xwin: Don't unconditionally include rootless.h
    
    Don't unconditionally include rootless.h, and so we don't need to add
    rootless to the include path unless building MWEXTWM.
    
    Signed-off-by: Jon Turney <jon.turney at dronecode.org.uk>
    Reviewed-by: Eric Anholt <eric at anholt.net>

diff --git a/hw/xwin/Makefile.am b/hw/xwin/Makefile.am
index e71240a79..4d288c959 100644
--- a/hw/xwin/Makefile.am
+++ b/hw/xwin/Makefile.am
@@ -43,6 +43,7 @@ SRCS_MULTIWINDOWEXTWM = \
 	winwindowswm.c
 DEFS_MULTIWINDOWEXTWM = -DXWIN_MULTIWINDOWEXTWM
 MULTIWINDOWEXTWM_LIBS = $(top_builddir)/miext/rootless/librootless.la
+MULTIWINDOWEXTWM_CFLAGS = -I$(top_srcdir)/miext/rootless
 endif
 
 if XWIN_RANDR
@@ -132,8 +133,6 @@ SRCS =	InitInput.c \
 
 XWin_SOURCES = $(SRCS)
 
-AM_CPPFLAGS = -I$(top_srcdir)/miext/rootless
-
 XWIN_SYS_LIBS += -ldxguid
 
 XWIN_LIBS += \
@@ -178,6 +177,7 @@ AM_LFLAGS = -i
 AM_CFLAGS = -DHAVE_XWIN_CONFIG_H $(DIX_CFLAGS) \
             $(XWINMODULES_CFLAGS) \
             -I$(top_srcdir) \
+            $(MULTIWINDOWEXTWM_CFLAGS) \
             -Wno-bad-function-cast
 
 xwinconfigdir = $(sysconfdir)/X11
diff --git a/hw/xwin/win.h b/hw/xwin/win.h
index 103c4b9a9..93103c4f8 100644
--- a/hw/xwin/win.h
+++ b/hw/xwin/win.h
@@ -165,7 +165,9 @@
 #include "miline.h"
 #include "shadow.h"
 #include "fb.h"
+#ifdef XWIN_MULTIWINDOWEXTWM
 #include "rootless.h"
+#endif
 
 #include "mipict.h"
 #include "picturestr.h"


More information about the xorg-commit mailing list