From 0ec823ce5b72bcf3be3923f2f23e5386feb0107b Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 16 Dec 2008 12:30:14 -0800 Subject: [PATCH] Add build infrastructure for glamor. --- Makefile.am | 2 ++ configure.ac | 1 + glamor/Makefile.am | 18 +++++++++++ glamor/glamor.c | 37 +++++++++++++++++++++ glamor/glamor.h | 26 +++++++++++++++ hw/kdrive/ephyr/Makefile.am | 5 ++- hw/kdrive/ephyr/ephyr.h | 6 ++++ hw/kdrive/ephyr/ephyr_glamor.c | 59 ++++++++++++++++++++++++++++++++++ hw/kdrive/ephyr/ephyrinit.c | 9 ++++++ 9 files changed, 162 insertions(+), 1 deletion(-) create mode 100644 glamor/Makefile.am create mode 100644 glamor/glamor.c create mode 100644 glamor/glamor.h create mode 100644 hw/kdrive/ephyr/ephyr_glamor.c diff --git a/Makefile.am b/Makefile.am index cea140bea..0c701633d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -38,6 +38,7 @@ SUBDIRS = \ $(COMPOSITE_DIR) \ $(GLX_DIR) \ exa \ + glamor \ config \ hw \ test @@ -88,6 +89,7 @@ DIST_SUBDIRS = \ composite \ glx \ exa \ + glamor \ config \ hw \ test diff --git a/configure.ac b/configure.ac index b0d26435a..85d5b706f 100644 --- a/configure.ac +++ b/configure.ac @@ -2133,6 +2133,7 @@ Xext/Makefile Xi/Makefile xfixes/Makefile exa/Makefile +glamor/Makefile hw/Makefile hw/xfree86/Makefile hw/xfree86/common/Makefile diff --git a/glamor/Makefile.am b/glamor/Makefile.am new file mode 100644 index 000000000..8f4c60758 --- /dev/null +++ b/glamor/Makefile.am @@ -0,0 +1,18 @@ +noinst_LTLIBRARIES = libglamor.la + +# Override these since glamor doesn't need them and the needed files aren't +# built (in hw/xfree86/os-support/solaris) until after glamor is built +SOLARIS_ASM_CFLAGS="" + +if XORG +sdk_HEADERS = glamor.h +endif + +INCLUDES = \ + $(XORG_INCS) + +AM_CFLAGS = $(XORG_CFLAGS) $(DIX_CFLAGS) + +libglamor_la_SOURCES = \ + glamor.c \ + glamor.h diff --git a/glamor/glamor.c b/glamor/glamor.c new file mode 100644 index 000000000..718cce3cf --- /dev/null +++ b/glamor/glamor.c @@ -0,0 +1,37 @@ +/* + * Copyright © 2008 Intel Corporation + * + * 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. + * + * Authors: + * Eric Anholt + * + */ + +/** @file + * This file covers the initialization and teardown of glamor, and has various + * functions not responsible for performing rendering. + */ + +#ifdef HAVE_DIX_CONFIG_H +#include +#endif + +#include diff --git a/glamor/glamor.h b/glamor/glamor.h new file mode 100644 index 000000000..7aa4a73dc --- /dev/null +++ b/glamor/glamor.h @@ -0,0 +1,26 @@ +/* + * Copyright © 2008 Intel Corporation + * + * 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. + * + * Authors: + * Eric Anholt + * + */ diff --git a/hw/kdrive/ephyr/Makefile.am b/hw/kdrive/ephyr/Makefile.am index 9d9b64ee5..79e950bb5 100644 --- a/hw/kdrive/ephyr/Makefile.am +++ b/hw/kdrive/ephyr/Makefile.am @@ -7,7 +7,8 @@ INCLUDES = \ @XEPHYR_CFLAGS@ \ @DRIPROTO_CFLAGS@ \ -I$(top_srcdir) \ - -I$(top_srcdir)/exa + -I$(top_srcdir)/exa \ + -I$(top_srcdir)/glamor if XV LIBXEPHYR_HOSTXV=libxephyr-hostxv.la @@ -47,6 +48,7 @@ XEPHYR_SRCS = \ ephyr.h \ ephyrlog.h \ ephyr_draw.c \ + ephyr_glamor.c \ os.c libxephyr_hostx_la_SOURCES = $(HOSTX_SRCS) @@ -70,6 +72,7 @@ Xephyr_LDADD = \ $(LIBXEPHYR_HOSTXV) \ $(LIBXEPHYR_HOSTDRI) \ $(top_builddir)/exa/libexa.la \ + $(top_builddir)/glamor/libglamor.la \ @KDRIVE_LIBS@ \ @XEPHYR_LIBS@ diff --git a/hw/kdrive/ephyr/ephyr.h b/hw/kdrive/ephyr/ephyr.h index 23848004c..cd1521209 100644 --- a/hw/kdrive/ephyr/ephyr.h +++ b/hw/kdrive/ephyr/ephyr.h @@ -196,6 +196,12 @@ ephyrDrawDisable(ScreenPtr pScreen); void ephyrDrawFini(ScreenPtr pScreen); +/* ephyr_glamor.c */ +Bool ephyr_glamor_init(ScreenPtr pScreen); +void ephyr_glamor_enable(ScreenPtr pScreen); +void ephyr_glamor_disable(ScreenPtr pScreen); +void ephyr_glamor_fini(ScreenPtr pScreen); + /*ephyvideo.c*/ Bool ephyrInitVideo(ScreenPtr pScreen) ; diff --git a/hw/kdrive/ephyr/ephyr_glamor.c b/hw/kdrive/ephyr/ephyr_glamor.c new file mode 100644 index 000000000..f4fb3df05 --- /dev/null +++ b/hw/kdrive/ephyr/ephyr_glamor.c @@ -0,0 +1,59 @@ +/* + * Copyright © 2006 Intel Corporation + * + * 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. + * + * Authors: + * Eric Anholt + * + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include "ephyr.h" +/*#include "glamor.h"*/ + +/** + * This function initializes EXA to use the fake acceleration implementation + * which just falls through to software. The purpose is to have a reliable, + * correct driver with which to test changes to the EXA core. + */ +Bool +ephyr_glamor_init(ScreenPtr pScreen) +{ + return TRUE; +} + +void +ephyr_glamor_enable(ScreenPtr pScreen) +{ +} + +void +ephyr_glamor_disable(ScreenPtr pScreen) +{ +} + +void +ephyr_glamor_fini(ScreenPtr pScreen) +{ +} diff --git a/hw/kdrive/ephyr/ephyrinit.c b/hw/kdrive/ephyr/ephyrinit.c index b674bb8d0..4b291813a 100644 --- a/hw/kdrive/ephyr/ephyrinit.c +++ b/hw/kdrive/ephyr/ephyrinit.c @@ -117,6 +117,7 @@ ddxUseMsg (void) ErrorF("-host-cursor Re-use exisiting X host server cursor\n"); ErrorF("-fullscreen Attempt to run Xephyr fullscreen\n"); ErrorF("-grayscale Simulate 8bit grayscale\n"); + ErrorF("-glamor Enable 2D acceleration using glamor\n"); ErrorF("-fakexa Simulate acceleration using software rendering\n"); ErrorF("-verbosity Set log verbosity level\n"); #ifdef GLXEXT @@ -220,6 +221,14 @@ ddxProcessArgument (int argc, char **argv, int i) EphyrWantGrayScale = 1; return 1; } + else if (!strcmp (argv[i], "-glamor")) + { + ephyrFuncs.initAccel = ephyr_glamor_init; + ephyrFuncs.enableAccel = ephyr_glamor_enable; + ephyrFuncs.disableAccel = ephyr_glamor_disable; + ephyrFuncs.finiAccel = ephyr_glamor_fini; + return 1; + } else if (!strcmp (argv[i], "-fakexa")) { ephyrFuncs.initAccel = ephyrDrawInit;