From 0ebcd32e91486caccc041c8ca23e39e160b24702 Mon Sep 17 00:00:00 2001 From: marha Date: Mon, 24 Sep 2012 08:28:39 +0200 Subject: mesa pixman xserver git update 24 sep 2012 xserver: 7722bcbab2507d263c7685b15cccbfdd52fc3a24 pixman: c4b69e706e63e01fbc70e0026c2079007c89de14 mesa: c432c86e6aeebeb46c028af940224c59faa16e88 --- mesalib/docs/GL3.txt | 5 +- mesalib/docs/autoconf.html | 127 +++++----- mesalib/docs/contents.html | 9 +- mesalib/docs/egl.html | 88 ++++--- mesalib/docs/faq.html | 32 +-- mesalib/docs/games.html | 72 ------ mesalib/docs/gears.png | Bin 1608 -> 3467 bytes mesalib/docs/libraries.html | 65 ----- mesalib/docs/lists.html | 7 +- mesalib/docs/modelers.html | 72 ------ mesalib/docs/osmesa.html | 3 +- mesalib/docs/science.html | 78 ------ mesalib/docs/utility.html | 43 ---- mesalib/docs/xlibdriver.html | 8 +- mesalib/src/mesa/drivers/common/meta.c | 141 ++++++----- mesalib/src/mesa/main/fbobject.c | 3 +- mesalib/src/mesa/main/ff_fragment_shader.cpp | 8 +- mesalib/src/mesa/main/teximage.c | 2 +- mesalib/src/mesa/main/texparam.c | 12 + pixman/pixman/pixman-arm-neon.c | 89 ++----- pixman/pixman/pixman-fast-path.c | 8 +- pixman/pixman/pixman-general.c | 46 +--- pixman/pixman/pixman-glyph.c | 4 +- pixman/pixman/pixman-implementation.c | 276 ++++++++++++++------- pixman/pixman/pixman-mips-dspr2.c | 89 ++----- pixman/pixman/pixman-mmx.c | 119 +++------ pixman/pixman/pixman-noop.c | 14 +- pixman/pixman/pixman-private.h | 36 +-- pixman/pixman/pixman-sse2.c | 146 ++++------- pixman/pixman/pixman-utils.c | 112 --------- pixman/pixman/pixman.c | 2 +- pixman/test/scaling-test.c | 40 ++- xorg-server/dix/devices.c | 3 + xorg-server/dix/window.c | 129 ++++------ xorg-server/exa/exa_priv.h | 1 - xorg-server/fb/fb.h | 1 - xorg-server/hw/dmx/doc/dmx.xml | 12 +- xorg-server/hw/kdrive/src/kdrive.h | 1 - xorg-server/hw/vfb/InitInput.c | 1 - xorg-server/hw/vfb/InitOutput.c | 1 - xorg-server/hw/xfree86/common/xf86.h | 1 + xorg-server/hw/xfree86/common/xf86Bus.c | 15 -- xorg-server/hw/xfree86/common/xf86Configure.c | 27 +- xorg-server/hw/xfree86/common/xf86Init.c | 27 +- xorg-server/hw/xfree86/common/xf86Priv.h | 1 - xorg-server/hw/xfree86/doc/ddxDesign.xml | 20 -- .../hw/xfree86/os-support/linux/lnx_video.c | 89 ++++--- xorg-server/hw/xfree86/sdksyms.sh | 1 - xorg-server/hw/xnest/Screen.c | 1 - xorg-server/hw/xnest/Visual.c | 1 - xorg-server/hw/xquartz/darwin.c | 1 - xorg-server/hw/xquartz/xpr/dri.c | 6 + xorg-server/hw/xquartz/xpr/xprFrame.c | 28 +++ xorg-server/hw/xwin/win.h | 1 - xorg-server/include/window.h | 3 - xorg-server/mi/Makefile.am | 127 +++++----- xorg-server/mi/mibstore.c | 43 ---- xorg-server/mi/mibstore.h | 23 -- xorg-server/miext/damage/damage.c | 30 ++- xorg-server/xkeyboard-config/symbols/lv | 17 +- 60 files changed, 895 insertions(+), 1472 deletions(-) delete mode 100644 mesalib/docs/games.html delete mode 100644 mesalib/docs/libraries.html delete mode 100644 mesalib/docs/modelers.html delete mode 100644 mesalib/docs/science.html delete mode 100644 mesalib/docs/utility.html delete mode 100644 xorg-server/mi/mibstore.c delete mode 100644 xorg-server/mi/mibstore.h diff --git a/mesalib/docs/GL3.txt b/mesalib/docs/GL3.txt index 24b70a1a2..876165fe9 100644 --- a/mesalib/docs/GL3.txt +++ b/mesalib/docs/GL3.txt @@ -138,10 +138,7 @@ ARB_ES3_compatibility not started ARB_clear_buffer_object not started ARB_compute_shader started (gallium) ARB_copy_image not started -ARB_debug_group not started -ARB_debug_label not started -ARB_debug_output DONE -ARB_debug_output2 not started +KHR_debug some work done (ARB_debug_output) ARB_explicit_uniform_location not started ARB_fragment_layer_viewport not started ARB_framebuffer_no_attachments not started diff --git a/mesalib/docs/autoconf.html b/mesalib/docs/autoconf.html index 0210bd1b2..a07a3ee14 100644 --- a/mesalib/docs/autoconf.html +++ b/mesalib/docs/autoconf.html @@ -24,7 +24,6 @@
  • DRI Driver Options
  • OSMesa Driver Options
  • -
  • Demo Program Options @@ -63,83 +62,107 @@ configuration run make realclean before rebuilding.

    Some of the generic autoconf options are used with Mesa: - -

    +directories.

    + +

    There are also a few general options for altering the Mesa build: -

    +architectures.

    + +

    2. Driver Options

    @@ -222,26 +245,6 @@ libraries that will be built. More details on the specific GL libraries can be found in the basic installation instructions. - -

    4. Demo Program Options

    - -

    -There are many demonstration programs in the MesaDemos tarball. If the -programs are available when ./configure is run, a subset of -the programs will be built depending on the driver and library options -chosen. See the directory progs for the full set of demos. - -

    -
    --with-demos=DEMOS,DEMOS,... -

    This option allows a -specific set of demo programs to be built. For example, ---with-demos="xdemos,slang". Beware that if this option is -used, it will not be ensured that the necessary GL libraries will be -available. -

    --without-demos

    This completely disables building the -demo programs. It is equivalent to --with-demos=no. -

    - diff --git a/mesalib/docs/contents.html b/mesalib/docs/contents.html index 94b538da1..b9a892201 100644 --- a/mesalib/docs/contents.html +++ b/mesalib/docs/contents.html @@ -41,6 +41,10 @@ @@ -85,11 +89,6 @@
  • OpenGL website
  • DRI website
  • freedesktop.org -
  • Games and Entertainment -
  • Libraries and Toolkits -
  • Modeling and Rendering -
  • Science and Technical -
  • Utilities Hosted by: diff --git a/mesalib/docs/egl.html b/mesalib/docs/egl.html index a77c12fe2..240cec53a 100644 --- a/mesalib/docs/egl.html +++ b/mesalib/docs/egl.html @@ -60,28 +60,32 @@ or more EGL drivers.

    There are several options that control the build of EGL at configuration time

    - +

    Use EGL

    @@ -132,8 +140,9 @@ mesa/demos repository.

    There are several environment variables that control the behavior of EGL at runtime

    - + +

    EGL Drivers

    - + +

    Packaging

    diff --git a/mesalib/docs/faq.html b/mesalib/docs/faq.html index 97b6491a7..dd4e7de0d 100644 --- a/mesalib/docs/faq.html +++ b/mesalib/docs/faq.html @@ -16,7 +16,7 @@

    Mesa Frequently Asked Questions

    -Last updated: 19 September 2012 +Last updated: 20 September 2012

    @@ -52,14 +52,18 @@ Mesa 9.x supports the OpenGL 3.1 specification.

    1.2 Does Mesa support/use graphics hardware?

    Yes. Specifically, Mesa serves as the OpenGL core for the open-source DRI -drivers for XFree86/X.org. See the DRI -website for more information. -

    -

    -There have been other hardware drivers for Mesa over the years (such as -the 3Dfx Glide/Voodoo driver, an old S3 driver, etc) but the DRI drivers -are the modern ones. +drivers for X.org.

    +

    1.3 What purpose does Mesa serve today?

    @@ -68,7 +72,7 @@ operating systems today. Still, Mesa serves at least these purposes:

    -After installing XFree86/X.org and the DRI drivers, some of these files +After installing X.org and the DRI drivers, some of these files may be symlinks into the /usr/X11R6/ tree.

    @@ -267,7 +271,7 @@ hardware it has detected.

    If your DRI-based driver isn't working, go to the -DRI website for trouble-shooting information. +DRI website for trouble-shooting information.

    diff --git a/mesalib/docs/games.html b/mesalib/docs/games.html deleted file mode 100644 index 0cdbec1df..000000000 --- a/mesalib/docs/games.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - - Games - - - - -
    -

    The Mesa 3D Graphics Library

    -
    - - -
    - -

    Games

    - - - -
    - - diff --git a/mesalib/docs/gears.png b/mesalib/docs/gears.png index 4052b30ed..34393892c 100644 Binary files a/mesalib/docs/gears.png and b/mesalib/docs/gears.png differ diff --git a/mesalib/docs/libraries.html b/mesalib/docs/libraries.html deleted file mode 100644 index 779cf69fc..000000000 --- a/mesalib/docs/libraries.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - Libraries and Toolkits - - - - -
    -

    The Mesa 3D Graphics Library

    -
    - - -
    - -

    Libraries and Toolkits

    - -
      -
    • Apprentice - free OpenInventor work-alike -
    • Coin - OSS Open Inventor clone -
    • Ch - OpenGL bindings for the Ch C/C++ interpreter -
    • FOX - GUI Library -
    • GL4Java - a Java wrapper for OpenGL -
    • GtkGLArea - OpenGL Gtk widget -
    • GtkGLArea-- - OpenGL Gtk-- widget for C++ -
    • GTKpas - OpenGL Gtk widget for FreePascal -
    • FreeGLUT - a GLUT work-alike -
    • Fortran77/90 bindings for OpenGL and Mesa - by William Mitchell -
    • GLOW - a GUI toolkit for GLUT and OpenGL -
    • Glt - an OpenGL C++ toolkit -
    • GLUT (GL Utility Toolkit) - by Mark Kilgard -
    • GuileGL - OpenGL and GtkGLArea language bindings for Guile -
    • IDL - Interactive Data Language -
    • JX - C++ application framework and GUI library -
    • MAM/VRS - object-oriented toolkit for 3D graphics -
    • MINOS - GUI library -
    • OglCLib - C++ wrapper for OpenGL -
    • Open Inventor - the Open Inventor toolkit from SGI -
    • Open Inventor - the Open Inventor toolkit from Template Graphics Software, Inc. -
    • OpenRM -- Open Source, multithreaded, parallel scene graph API -
    • -Open SG PLUS - a scene-graph library -
    • Open Scene Graph - - a scene-graph library -
    • OpenVRML -- a VRML parsing/display library with "lookat" - an example VRML browser -
    • PLIB - A collection of portable games libraries, including an OpenGL GUI and a simple Scene Graph API -
    • Pryan - an OpenInventor-like toolkit -
    • PyOpenGL - OpenGL interface for Python -
    • Quesa - QuickDraw3D-compatible library based on OpenGL, Mesa or Direct3D -
    • repGL - IRIS GL emulated with OpenGL -
    • SciTech MGL - A multiplatform (Windows, Linux, OS/2, DOS, QNX, SMX, RT-Target & more) graphics library -
    • SGL - a 3D Scene Graph Library -
    • SoFree - a free implementation of Open Inventor -
    • Togl - Tcl/Tk widget for OpenGL -
    • View3D Widget - 3-D GUI widget -
    • VTK - Visualization Toolkit -
    • YAJOGL - Yet Another Java GL Binding. -
    - -
    - - diff --git a/mesalib/docs/lists.html b/mesalib/docs/lists.html index 1c35037e7..0ac07faf4 100644 --- a/mesalib/docs/lists.html +++ b/mesalib/docs/lists.html @@ -68,7 +68,12 @@ kernels, see the

    -
    +

    IRC

    + +

    join #dri-devel channel +on irc.freenode.net +

    +

    OpenGL Forums

    diff --git a/mesalib/docs/modelers.html b/mesalib/docs/modelers.html deleted file mode 100644 index 924a7b570..000000000 --- a/mesalib/docs/modelers.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - - Modelers, Renderers and Viewers - - - - -
    -

    The Mesa 3D Graphics Library

    -
    - - -
    - -

    Modelers, Renderers and Viewers

    - - - -
    - - diff --git a/mesalib/docs/osmesa.html b/mesalib/docs/osmesa.html index 0ec67c44b..b0609cf88 100644 --- a/mesalib/docs/osmesa.html +++ b/mesalib/docs/osmesa.html @@ -34,8 +34,7 @@ more information about the API functions.

    -There are several examples of OSMesa in the progs/osdemos/ -directory. +There are several examples of OSMesa in the mesa/demos repository.

    diff --git a/mesalib/docs/science.html b/mesalib/docs/science.html deleted file mode 100644 index 74a24457e..000000000 --- a/mesalib/docs/science.html +++ /dev/null @@ -1,78 +0,0 @@ - - - - - Science and Technical - - - - -
    -

    The Mesa 3D Graphics Library

    -
    - - -
    - -

    Science and Technical

    - -
      -
    • Ch - OpenGL bindings for the Ch C/C++ interpreter -
    • DINO - Visualizing - Structural Biology -
    • General - Mesh Viewer (GMV) - scientific vis. -
    • GiD - finite element - analysis -
    • glpoisson - A finite - element analysis program that simulates wave in an arbitrary region. -
    • GLWaves - - Electromagnetic wave visualization -
    • Gmsh - - finite element mesh generator / viewer -
    • gOpenMol - - computational chemistry -
    • GPS 3D - GPS-based map visualization -
    • Hitchhiker - - virtual solar system -
    • Hydra - physics - and engineering pkg -
    • Light Speed - - a real-time, interactive relativistic simulator -
    • LinkWinds - scientific - vis -
    • MathGL3d - Mathematica viewer -
    • Mathworks - - mathematics and visualization -
    • Medit - 3D surface mesh viewer -
    • MOLMOL - - molecular modeling and analysis -
    • Molscript - molecular - modeling -
    • -
    • OpenDX - Data visualization - system -
    • -
    • ORSA - An interactive tool for Celestial Mechanics -
    • -
    • ParaView - Scientific visualization package -
    • ROOT - Object Oriented Data - Analysis Framework -
    • SLFFEA - GNU finite element - package -
    • Spock - molecular - modeling -
    • Ssystem - solar - system simulation -
    • Vis5D - - atmospheric visualization -
    • VMD - molecular - modeling -
    • Webots - 3-D mobile - robot simulator -
    • -
    - -
    - - diff --git a/mesalib/docs/utility.html b/mesalib/docs/utility.html deleted file mode 100644 index 14216d4d6..000000000 --- a/mesalib/docs/utility.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - Utilities - - - - -
    -

    The Mesa 3D Graphics Library

    -
    - - -
    - -

    Utilities

    - - - -
    - - diff --git a/mesalib/docs/xlibdriver.html b/mesalib/docs/xlibdriver.html index da72662c1..6b7b02903 100644 --- a/mesalib/docs/xlibdriver.html +++ b/mesalib/docs/xlibdriver.html @@ -150,10 +150,10 @@ Examples: % export MESA_GAMMA="2.0" // same gamma for R,G,B

    -The progs/demos/gamma.c program may help you to determine reasonable gamma -value for your display. With correct gamma values, the color intensities -displayed in the top row (drawn by dithering) should nearly match those -in the bottom row (drawn as grays). +The demos/gamma.c program in mesa/demos repository may help +you to determine reasonable gamma value for your display. With correct +gamma values, the color intensities displayed in the top row (drawn by +dithering) should nearly match those in the bottom row (drawn as grays).

    diff --git a/mesalib/src/mesa/drivers/common/meta.c b/mesalib/src/mesa/drivers/common/meta.c index 3b13ad7f1..28a79b0a0 100644 --- a/mesalib/src/mesa/drivers/common/meta.c +++ b/mesalib/src/mesa/drivers/common/meta.c @@ -269,6 +269,16 @@ struct bitmap_state struct temp_texture Tex; /**< separate texture from other meta ops */ }; +/** + * State for GLSL texture sampler which is used to generate fragment + * shader in _mesa_meta_generate_mipmap(). + */ +struct glsl_sampler { + const char *type; + const char *func; + const char *texcoords; + GLuint shader_prog; +}; /** * State for _mesa_meta_generate_mipmap() @@ -281,16 +291,12 @@ struct gen_mipmap_state GLuint Sampler; GLuint ShaderProg; GLuint IntegerShaderProg; -}; - -/** - * State for GLSL texture sampler which is used to generate fragment - * shader in _mesa_meta_generate_mipmap(). - */ -struct glsl_sampler { - const char *type; - const char *func; - const char *texcoords; + struct glsl_sampler sampler_1d; + struct glsl_sampler sampler_2d; + struct glsl_sampler sampler_3d; + struct glsl_sampler sampler_cubemap; + struct glsl_sampler sampler_1d_array; + struct glsl_sampler sampler_2d_array; }; /** @@ -2977,46 +2983,47 @@ setup_ff_generate_mipmap(struct gl_context *ctx, } -static void -setup_texture_sampler(GLenum target, struct glsl_sampler *sampler) +static struct glsl_sampler * +setup_texture_sampler(GLenum target, struct gen_mipmap_state *mipmap) { switch(target) { case GL_TEXTURE_1D: - sampler->type = "sampler1D"; - sampler->func = "texture1D"; - sampler->texcoords = "texCoords.x"; - break; + mipmap->sampler_1d.type = "sampler1D"; + mipmap->sampler_1d.func = "texture1D"; + mipmap->sampler_1d.texcoords = "texCoords.x"; + return &mipmap->sampler_1d; case GL_TEXTURE_2D: - sampler->type = "sampler2D"; - sampler->func = "texture2D"; - sampler->texcoords = "texCoords.xy"; - break; + mipmap->sampler_2d.type = "sampler2D"; + mipmap->sampler_2d.func = "texture2D"; + mipmap->sampler_2d.texcoords = "texCoords.xy"; + return &mipmap->sampler_2d; case GL_TEXTURE_3D: /* Code for mipmap generation with 3D textures is not used yet. * It's a sw fallback. */ - sampler->type = "sampler3D"; - sampler->func = "texture3D"; - sampler->texcoords = "texCoords"; - break; + mipmap->sampler_3d.type = "sampler3D"; + mipmap->sampler_3d.func = "texture3D"; + mipmap->sampler_3d.texcoords = "texCoords"; + return &mipmap->sampler_3d; case GL_TEXTURE_CUBE_MAP: - sampler->type = "samplerCube"; - sampler->func = "textureCube"; - sampler->texcoords = "texCoords"; - break; + mipmap->sampler_cubemap.type = "samplerCube"; + mipmap->sampler_cubemap.func = "textureCube"; + mipmap->sampler_cubemap.texcoords = "texCoords"; + return &mipmap->sampler_cubemap; case GL_TEXTURE_1D_ARRAY: - sampler->type = "sampler1DArray"; - sampler->func = "texture1DArray"; - sampler->texcoords = "texCoords.xy"; - break; + mipmap->sampler_1d_array.type = "sampler1DArray"; + mipmap->sampler_1d_array.func = "texture1DArray"; + mipmap->sampler_1d_array.texcoords = "texCoords.xy"; + return &mipmap->sampler_1d_array; case GL_TEXTURE_2D_ARRAY: - sampler->type = "sampler2DArray"; - sampler->func = "texture2DArray"; - sampler->texcoords = "texCoords"; - break; + mipmap->sampler_2d_array.type = "sampler2DArray"; + mipmap->sampler_2d_array.func = "texture2DArray"; + mipmap->sampler_2d_array.texcoords = "texCoords"; + return &mipmap->sampler_2d_array; default: _mesa_problem(NULL, "Unexpected texture target 0x%x in" " setup_texture_sampler()\n", target); + return NULL; } } @@ -3029,7 +3036,7 @@ setup_glsl_generate_mipmap(struct gl_context *ctx, struct vertex { GLfloat x, y, tex[3]; }; - struct glsl_sampler sampler; + struct glsl_sampler *sampler; const char *vs_source; const char *fs_template; @@ -3099,24 +3106,31 @@ setup_glsl_generate_mipmap(struct gl_context *ctx, } /* Check if already initialized */ - if (mipmap->ArrayObj != 0) - return; - /* create vertex array object */ - _mesa_GenVertexArrays(1, &mipmap->ArrayObj); - _mesa_BindVertexArray(mipmap->ArrayObj); + if (mipmap->ArrayObj == 0) { - /* create vertex array buffer */ - _mesa_GenBuffersARB(1, &mipmap->VBO); - _mesa_BindBufferARB(GL_ARRAY_BUFFER_ARB, mipmap->VBO); + /* create vertex array object */ + _mesa_GenVertexArrays(1, &mipmap->ArrayObj); + _mesa_BindVertexArray(mipmap->ArrayObj); - /* setup vertex arrays */ - _mesa_VertexAttribPointerARB(0, 2, GL_FLOAT, GL_FALSE, - sizeof(struct vertex), OFFSET(x)); - _mesa_VertexAttribPointerARB(1, 3, GL_FLOAT, GL_FALSE, - sizeof(struct vertex), OFFSET(tex)); + /* create vertex array buffer */ + _mesa_GenBuffersARB(1, &mipmap->VBO); + _mesa_BindBufferARB(GL_ARRAY_BUFFER_ARB, mipmap->VBO); + + /* setup vertex arrays */ + _mesa_VertexAttribPointerARB(0, 2, GL_FLOAT, GL_FALSE, + sizeof(struct vertex), OFFSET(x)); + _mesa_VertexAttribPointerARB(1, 3, GL_FLOAT, GL_FALSE, + sizeof(struct vertex), OFFSET(tex)); + } /* Generate a fragment shader program appropriate for the texture target */ - setup_texture_sampler(target, &sampler); + sampler = setup_texture_sampler(target, mipmap); + assert(sampler != NULL); + if (sampler->shader_prog != 0) { + mipmap->ShaderProg = sampler->shader_prog; + return; + } + mem_ctx = ralloc_context(NULL); if (ctx->Const.GLSLVersion < 130) { @@ -3125,13 +3139,13 @@ setup_glsl_generate_mipmap(struct gl_context *ctx, "require" : "disable"; fs_source = ralloc_asprintf(mem_ctx, fs_template, - extension_mode, sampler.type, - sampler.func, sampler.texcoords); + extension_mode, sampler->type, + sampler->func, sampler->texcoords); } else { fs_source = ralloc_asprintf(mem_ctx, fs_template, - sampler.type, "vec4", - sampler.texcoords); + sampler->type, "vec4", + sampler->texcoords); } vs = compile_shader_with_debug(ctx, GL_VERTEX_SHADER, vs_source); @@ -3147,6 +3161,7 @@ setup_glsl_generate_mipmap(struct gl_context *ctx, _mesa_EnableVertexAttribArrayARB(0); _mesa_EnableVertexAttribArrayARB(1); link_program_with_debug(ctx, mipmap->ShaderProg); + sampler->shader_prog = mipmap->ShaderProg; ralloc_free(mem_ctx); if ((_mesa_is_desktop_gl(ctx) && ctx->Const.GLSLVersion >= 130) || @@ -3181,8 +3196,20 @@ meta_glsl_generate_mipmap_cleanup(struct gl_context *ctx, mipmap->ArrayObj = 0; _mesa_DeleteBuffersARB(1, &mipmap->VBO); mipmap->VBO = 0; - _mesa_DeleteObjectARB(mipmap->ShaderProg); - mipmap->ShaderProg = 0; + + _mesa_DeleteObjectARB(mipmap->sampler_1d.shader_prog); + _mesa_DeleteObjectARB(mipmap->sampler_2d.shader_prog); + _mesa_DeleteObjectARB(mipmap->sampler_3d.shader_prog); + _mesa_DeleteObjectARB(mipmap->sampler_cubemap.shader_prog); + _mesa_DeleteObjectARB(mipmap->sampler_1d_array.shader_prog); + _mesa_DeleteObjectARB(mipmap->sampler_2d_array.shader_prog); + + mipmap->sampler_1d.shader_prog = 0; + mipmap->sampler_2d.shader_prog = 0; + mipmap->sampler_3d.shader_prog = 0; + mipmap->sampler_cubemap.shader_prog = 0; + mipmap->sampler_1d_array.shader_prog = 0; + mipmap->sampler_2d_array.shader_prog = 0; if (mipmap->IntegerShaderProg) { _mesa_DeleteObjectARB(mipmap->IntegerShaderProg); diff --git a/mesalib/src/mesa/main/fbobject.c b/mesalib/src/mesa/main/fbobject.c index 1736899cb..9cde52ae6 100644 --- a/mesalib/src/mesa/main/fbobject.c +++ b/mesalib/src/mesa/main/fbobject.c @@ -2792,7 +2792,8 @@ compatible_resolve_formats(const struct gl_renderbuffer *colorReadRb, { /* The simple case where we know the backing formats are the same. */ - if (colorReadRb->Format == colorDrawRb->Format) { + if (_mesa_get_srgb_format_linear(colorReadRb->Format) == + _mesa_get_srgb_format_linear(colorDrawRb->Format)) { return GL_TRUE; } diff --git a/mesalib/src/mesa/main/ff_fragment_shader.cpp b/mesalib/src/mesa/main/ff_fragment_shader.cpp index e850d47dd..f21cf80ae 100644 --- a/mesalib/src/mesa/main/ff_fragment_shader.cpp +++ b/mesalib/src/mesa/main/ff_fragment_shader.cpp @@ -890,10 +890,10 @@ emit_texenv(struct texenv_fragment_program *p, GLuint unit) } else { float const_data[4] = { - 1 << rgb_shift, - 1 << rgb_shift, - 1 << rgb_shift, - 1 << alpha_shift + float(1 << rgb_shift), + float(1 << rgb_shift), + float(1 << rgb_shift), + float(1 << alpha_shift) }; shift = new(p->mem_ctx) ir_constant(glsl_type::vec4_type, (ir_constant_data *)const_data); diff --git a/mesalib/src/mesa/main/teximage.c b/mesalib/src/mesa/main/teximage.c index 83e79a5a3..08af66893 100644 --- a/mesalib/src/mesa/main/teximage.c +++ b/mesalib/src/mesa/main/teximage.c @@ -2746,7 +2746,7 @@ _mesa_choose_texture_format(struct gl_context *ctx, /* If the application requested compression to an S3TC format but we don't * have the DTXn library, force a generic compressed format instead. */ - if (internalFormat != format) { + if (internalFormat != format && format != GL_NONE) { const GLenum before = internalFormat; switch (internalFormat) { diff --git a/mesalib/src/mesa/main/texparam.c b/mesalib/src/mesa/main/texparam.c index 63a63b732..f73e2b5f0 100644 --- a/mesalib/src/mesa/main/texparam.c +++ b/mesalib/src/mesa/main/texparam.c @@ -1440,6 +1440,12 @@ _mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params ) *params = (GLfloat) obj->Immutable; break; + case GL_TEXTURE_SRGB_DECODE_EXT: + if (!ctx->Extensions.EXT_texture_sRGB_decode) + goto invalid_pname; + *params = (GLfloat) obj->Sampler.sRGBDecode; + break; + default: goto invalid_pname; } @@ -1612,6 +1618,12 @@ _mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params ) *params = obj->RequiredTextureImageUnits; break; + case GL_TEXTURE_SRGB_DECODE_EXT: + if (!ctx->Extensions.EXT_texture_sRGB_decode) + goto invalid_pname; + *params = obj->Sampler.sRGBDecode; + break; + default: goto invalid_pname; } diff --git a/pixman/pixman/pixman-arm-neon.c b/pixman/pixman/pixman-arm-neon.c index ca139de0b..60e9c78d2 100644 --- a/pixman/pixman/pixman-arm-neon.c +++ b/pixman/pixman/pixman-arm-neon.c @@ -183,14 +183,15 @@ pixman_composite_src_n_8888_asm_neon (int32_t w, uint32_t src); static pixman_bool_t -pixman_fill_neon (uint32_t *bits, - int stride, - int bpp, - int x, - int y, - int width, - int height, - uint32_t _xor) +arm_neon_fill (pixman_implementation_t *imp, + uint32_t * bits, + int stride, + int bpp, + int x, + int y, + int width, + int height, + uint32_t _xor) { /* stride is always multiple of 32bit units in pixman */ uint32_t byte_stride = stride * sizeof(uint32_t); @@ -227,18 +228,19 @@ pixman_fill_neon (uint32_t *bits, } static pixman_bool_t -pixman_blt_neon (uint32_t *src_bits, - uint32_t *dst_bits, - int src_stride, - int dst_stride, - int src_bpp, - int dst_bpp, - int src_x, - int src_y, - int dest_x, - int dest_y, - int width, - int height) +arm_neon_blt (pixman_implementation_t *imp, + uint32_t * src_bits, + uint32_t * dst_bits, + int src_stride, + int dst_stride, + int src_bpp, + int dst_bpp, + int src_x, + int src_y, + int dest_x, + int dest_y, + int width, + int height) { if (src_bpp != dst_bpp) return FALSE; @@ -422,53 +424,6 @@ static const pixman_fast_path_t arm_neon_fast_paths[] = { PIXMAN_OP_NONE }, }; -static pixman_bool_t -arm_neon_blt (pixman_implementation_t *imp, - uint32_t * src_bits, - uint32_t * dst_bits, - int src_stride, - int dst_stride, - int src_bpp, - int dst_bpp, - int src_x, - int src_y, - int dest_x, - int dest_y, - int width, - int height) -{ - if (!pixman_blt_neon ( - src_bits, dst_bits, src_stride, dst_stride, src_bpp, dst_bpp, - src_x, src_y, dest_x, dest_y, width, height)) - - { - return _pixman_implementation_blt ( - imp->delegate, - src_bits, dst_bits, src_stride, dst_stride, src_bpp, dst_bpp, - src_x, src_y, dest_x, dest_y, width, height); - } - - return TRUE; -} - -static pixman_bool_t -arm_neon_fill (pixman_implementation_t *imp, - uint32_t * bits, - int stride, - int bpp, - int x, - int y, - int width, - int height, - uint32_t xor) -{ - if (pixman_fill_neon (bits, stride, bpp, x, y, width, height, xor)) - return TRUE; - - return _pixman_implementation_fill ( - imp->delegate, bits, stride, bpp, x, y, width, height, xor); -} - #define BIND_COMBINE_U(name) \ void \ pixman_composite_scanline_##name##_mask_asm_neon (int32_t w, \ diff --git a/pixman/pixman/pixman-fast-path.c b/pixman/pixman/pixman-fast-path.c index 9778b0cbe..86ed821d6 100644 --- a/pixman/pixman/pixman-fast-path.c +++ b/pixman/pixman/pixman-fast-path.c @@ -1258,7 +1258,7 @@ fast_composite_tiled_repeat (pixman_implementation_t *imp, mask_flags = FAST_PATH_IS_OPAQUE; } - if (_pixman_lookup_composite_function ( + if (_pixman_implementation_lookup_composite ( imp->toplevel, info->op, src_image->common.extended_format_code, src_flags, mask_format, mask_flags, @@ -1458,7 +1458,7 @@ fetch_nearest (pixman_repeat_t src_repeat, { if (repeat (src_repeat, &x, src_width)) { - if (format == PIXMAN_x8r8g8b8) + if (format == PIXMAN_x8r8g8b8 || format == PIXMAN_x8b8g8r8) return *(src + x) | 0xff000000; else return *(src + x); @@ -2192,9 +2192,7 @@ fast_path_fill (pixman_implementation_t *imp, break; default: - return _pixman_implementation_fill ( - imp->delegate, bits, stride, bpp, x, y, width, height, xor); - break; + return FALSE; } return TRUE; diff --git a/pixman/pixman/pixman-general.c b/pixman/pixman/pixman-general.c index d4b2daa37..42a84a0b4 100644 --- a/pixman/pixman/pixman-general.c +++ b/pixman/pixman/pixman-general.c @@ -37,7 +37,7 @@ #include #include "pixman-private.h" -static void +static pixman_bool_t general_src_iter_init (pixman_implementation_t *imp, pixman_iter_t *iter) { pixman_image_t *image = iter->image; @@ -54,18 +54,24 @@ general_src_iter_init (pixman_implementation_t *imp, pixman_iter_t *iter) _pixman_bits_image_src_iter_init (image, iter); else _pixman_log_error (FUNC, "Pixman bug: unknown image type\n"); + + return TRUE; } -static void +static pixman_bool_t general_dest_iter_init (pixman_implementation_t *imp, pixman_iter_t *iter) { if (iter->image->type == BITS) { _pixman_bits_image_dest_iter_init (iter->image, iter); + + return TRUE; } else { _pixman_log_error (FUNC, "Trying to write to a non-writable image"); + + return FALSE; } } @@ -200,40 +206,6 @@ static const pixman_fast_path_t general_fast_path[] = { PIXMAN_OP_NONE } }; -static pixman_bool_t -general_blt (pixman_implementation_t *imp, - uint32_t * src_bits, - uint32_t * dst_bits, - int src_stride, - int dst_stride, - int src_bpp, - int dst_bpp, - int src_x, - int src_y, - int dest_x, - int dest_y, - int width, - int height) -{ - /* We can't blit unless we have sse2 or mmx */ - - return FALSE; -} - -static pixman_bool_t -general_fill (pixman_implementation_t *imp, - uint32_t * bits, - int stride, - int bpp, - int x, - int y, - int width, - int height, - uint32_t xor) -{ - return FALSE; -} - pixman_implementation_t * _pixman_implementation_create_general (void) { @@ -242,8 +214,6 @@ _pixman_implementation_create_general (void) _pixman_setup_combiner_functions_32 (imp); _pixman_setup_combiner_functions_64 (imp); - imp->blt = general_blt; - imp->fill = general_fill; imp->src_iter_init = general_src_iter_init; imp->dest_iter_init = general_dest_iter_init; diff --git a/pixman/pixman/pixman-glyph.c b/pixman/pixman/pixman-glyph.c index cbc3637fa..30a409908 100644 --- a/pixman/pixman/pixman-glyph.c +++ b/pixman/pixman/pixman-glyph.c @@ -464,7 +464,7 @@ pixman_composite_glyphs_no_mask (pixman_op_t op, glyph_format = glyph_img->common.extended_format_code; glyph_flags = glyph_img->common.flags; - _pixman_lookup_composite_function ( + _pixman_implementation_lookup_composite ( get_implementation(), op, src->common.extended_format_code, src->common.flags, glyph_format, glyph_flags | extra, @@ -576,7 +576,7 @@ add_glyphs (pixman_glyph_cache_t *cache, white_src = TRUE; } - _pixman_lookup_composite_function ( + _pixman_implementation_lookup_composite ( get_implementation(), PIXMAN_OP_ADD, src_format, info.src_flags, mask_format, info.mask_flags, diff --git a/pixman/pixman/pixman-implementation.c b/pixman/pixman/pixman-implementation.c index 77d0906c8..5dd050199 100644 --- a/pixman/pixman/pixman-implementation.c +++ b/pixman/pixman/pixman-implementation.c @@ -27,92 +27,141 @@ #include #include "pixman-private.h" -static pixman_bool_t -delegate_blt (pixman_implementation_t * imp, - uint32_t * src_bits, - uint32_t * dst_bits, - int src_stride, - int dst_stride, - int src_bpp, - int dst_bpp, - int src_x, - int src_y, - int dest_x, - int dest_y, - int width, - int height) +pixman_implementation_t * +_pixman_implementation_create (pixman_implementation_t *fallback, + const pixman_fast_path_t *fast_paths) { - return _pixman_implementation_blt ( - imp->delegate, src_bits, dst_bits, src_stride, dst_stride, - src_bpp, dst_bpp, src_x, src_y, dest_x, dest_y, - width, height); -} + pixman_implementation_t *imp; -static pixman_bool_t -delegate_fill (pixman_implementation_t *imp, - uint32_t * bits, - int stride, - int bpp, - int x, - int y, - int width, - int height, - uint32_t xor) -{ - return _pixman_implementation_fill ( - imp->delegate, bits, stride, bpp, x, y, width, height, xor); -} + assert (fast_paths); -static void -delegate_src_iter_init (pixman_implementation_t *imp, - pixman_iter_t * iter) -{ - imp->delegate->src_iter_init (imp->delegate, iter); + if ((imp = malloc (sizeof (pixman_implementation_t)))) + { + pixman_implementation_t *d; + + memset (imp, 0, sizeof *imp); + + imp->fallback = fallback; + imp->fast_paths = fast_paths; + + /* Make sure the whole fallback chain has the right toplevel */ + for (d = imp; d != NULL; d = d->fallback) + d->toplevel = imp; + } + + return imp; } -static void -delegate_dest_iter_init (pixman_implementation_t *imp, - pixman_iter_t * iter) +#define N_CACHED_FAST_PATHS 8 + +typedef struct { - imp->delegate->dest_iter_init (imp->delegate, iter); -} + struct + { + pixman_implementation_t * imp; + pixman_fast_path_t fast_path; + } cache [N_CACHED_FAST_PATHS]; +} cache_t; -pixman_implementation_t * -_pixman_implementation_create (pixman_implementation_t *delegate, - const pixman_fast_path_t *fast_paths) +PIXMAN_DEFINE_THREAD_LOCAL (cache_t, fast_path_cache); + +pixman_bool_t +_pixman_implementation_lookup_composite (pixman_implementation_t *toplevel, + pixman_op_t op, + pixman_format_code_t src_format, + uint32_t src_flags, + pixman_format_code_t mask_format, + uint32_t mask_flags, + pixman_format_code_t dest_format, + uint32_t dest_flags, + pixman_implementation_t **out_imp, + pixman_composite_func_t *out_func) { - pixman_implementation_t *imp = malloc (sizeof (pixman_implementation_t)); - pixman_implementation_t *d; + pixman_implementation_t *imp; + cache_t *cache; int i; - if (!imp) - return NULL; + /* Check cache for fast paths */ + cache = PIXMAN_GET_THREAD_LOCAL (fast_path_cache); - assert (fast_paths); + for (i = 0; i < N_CACHED_FAST_PATHS; ++i) + { + const pixman_fast_path_t *info = &(cache->cache[i].fast_path); + + /* Note that we check for equality here, not whether + * the cached fast path matches. This is to prevent + * us from selecting an overly general fast path + * when a more specific one would work. + */ + if (info->op == op && + info->src_format == src_format && + info->mask_format == mask_format && + info->dest_format == dest_format && + info->src_flags == src_flags && + info->mask_flags == mask_flags && + info->dest_flags == dest_flags && + info->func) + { + *out_imp = cache->cache[i].imp; + *out_func = cache->cache[i].fast_path.func; - /* Make sure the whole delegate chain has the right toplevel */ - imp->delegate = delegate; - for (d = imp; d != NULL; d = d->delegate) - d->toplevel = imp; + goto update_cache; + } + } + + for (imp = toplevel; imp != NULL; imp = imp->fallback) + { + const pixman_fast_path_t *info = imp->fast_paths; + + while (info->op != PIXMAN_OP_NONE) + { + if ((info->op == op || info->op == PIXMAN_OP_any) && + /* Formats */ + ((info->src_format == src_format) || + (info->src_format == PIXMAN_any)) && + ((info->mask_format == mask_format) || + (info->mask_format == PIXMAN_any)) && + ((info->dest_format == dest_format) || + (info->dest_format == PIXMAN_any)) && + /* Flags */ + (info->src_flags & src_flags) == info->src_flags && + (info->mask_flags & mask_flags) == info->mask_flags && + (info->dest_flags & dest_flags) == info->dest_flags) + { + *out_imp = imp; + *out_func = info->func; - /* Fill out function pointers with ones that just delegate - */ - imp->blt = delegate_blt; - imp->fill = delegate_fill; - imp->src_iter_init = delegate_src_iter_init; - imp->dest_iter_init = delegate_dest_iter_init; + /* Set i to the last spot in the cache so that the + * move-to-front code below will work + */ + i = N_CACHED_FAST_PATHS - 1; - imp->fast_paths = fast_paths; + goto update_cache; + } - for (i = 0; i < PIXMAN_N_OPERATORS; ++i) + ++info; + } + } + return FALSE; + +update_cache: + if (i) { - imp->combine_32[i] = NULL; - imp->combine_64[i] = NULL; - imp->combine_32_ca[i] = NULL; - imp->combine_64_ca[i] = NULL; + while (i--) + cache->cache[i + 1] = cache->cache[i]; + + cache->cache[0].imp = *out_imp; + cache->cache[0].fast_path.op = op; + cache->cache[0].fast_path.src_format = src_format; + cache->cache[0].fast_path.src_flags = src_flags; + cache->cache[0].fast_path.mask_format = mask_format; + cache->cache[0].fast_path.mask_flags = mask_flags; + cache->cache[0].fast_path.dest_format = dest_format; + cache->cache[0].fast_path.dest_flags = dest_flags; + cache->cache[0].fast_path.func = *out_func; } - return imp; + return TRUE; } pixman_combine_32_func_t @@ -121,25 +170,36 @@ _pixman_implementation_lookup_combiner (pixman_implementation_t *imp, pixman_bool_t component_alpha, pixman_bool_t narrow) { - pixman_combine_32_func_t f; - - do + while (imp) { - pixman_combine_32_func_t (*combiners[]) = + pixman_combine_32_func_t f = NULL; + + switch ((narrow << 1) | component_alpha) { - (pixman_combine_32_func_t *)imp->combine_64, - (pixman_combine_32_func_t *)imp->combine_64_ca, - imp->combine_32, - imp->combine_32_ca, - }; + case 0: /* not narrow, not component alpha */ + f = (pixman_combine_32_func_t)imp->combine_64[op]; + break; + + case 1: /* not narrow, component_alpha */ + f = (pixman_combine_32_func_t)imp->combine_64_ca[op]; + break; + + case 2: /* narrow, not component alpha */ + f = imp->combine_32[op]; + break; + + case 3: /* narrow, component_alpha */ + f = imp->combine_32_ca[op]; + break; + } - f = combiners[component_alpha | (narrow << 1)][op]; + if (f) + return f; - imp = imp->delegate; + imp = imp->fallback; } - while (!f); - return f; + return NULL; } pixman_bool_t @@ -157,9 +217,20 @@ _pixman_implementation_blt (pixman_implementation_t * imp, int width, int height) { - return (*imp->blt) (imp, src_bits, dst_bits, src_stride, dst_stride, - src_bpp, dst_bpp, src_x, src_y, dest_x, dest_y, - width, height); + while (imp) + { + if (imp->blt && + (*imp->blt) (imp, src_bits, dst_bits, src_stride, dst_stride, + src_bpp, dst_bpp, src_x, src_y, dest_x, dest_y, + width, height)) + { + return TRUE; + } + + imp = imp->fallback; + } + + return FALSE; } pixman_bool_t @@ -173,10 +244,21 @@ _pixman_implementation_fill (pixman_implementation_t *imp, int height, uint32_t xor) { - return (*imp->fill) (imp, bits, stride, bpp, x, y, width, height, xor); + while (imp) + { + if (imp->fill && + ((*imp->fill) (imp, bits, stride, bpp, x, y, width, height, xor))) + { + return TRUE; + } + + imp = imp->fallback; + } + + return FALSE; } -void +pixman_bool_t _pixman_implementation_src_iter_init (pixman_implementation_t *imp, pixman_iter_t *iter, pixman_image_t *image, @@ -197,10 +279,18 @@ _pixman_implementation_src_iter_init (pixman_implementation_t *imp, iter->iter_flags = iter_flags; iter->image_flags = image_flags; - (*imp->src_iter_init) (imp, iter); + while (imp) + { + if (imp->src_iter_init && (*imp->src_iter_init) (imp, iter)) + return TRUE; + + imp = imp->fallback; + } + + return FALSE; } -void +pixman_bool_t _pixman_implementation_dest_iter_init (pixman_implementation_t *imp, pixman_iter_t *iter, pixman_image_t *image, @@ -221,7 +311,15 @@ _pixman_implementation_dest_iter_init (pixman_implementation_t *imp, iter->iter_flags = iter_flags; iter->image_flags = image_flags; - (*imp->dest_iter_init) (imp, iter); + while (imp) + { + if (imp->dest_iter_init && (*imp->dest_iter_init) (imp, iter)) + return TRUE; + + imp = imp->fallback; + } + + return FALSE; } pixman_bool_t diff --git a/pixman/pixman/pixman-mips-dspr2.c b/pixman/pixman/pixman-mips-dspr2.c index 63a0225a2..1a9e6103a 100644 --- a/pixman/pixman/pixman-mips-dspr2.c +++ b/pixman/pixman/pixman-mips-dspr2.c @@ -85,14 +85,15 @@ PIXMAN_MIPS_BIND_SCALED_BILINEAR_SRC_A8_DST (SKIP_ZERO_SRC, 8888_8_8888, ADD, uint32_t, uint32_t) static pixman_bool_t -pixman_fill_mips (uint32_t *bits, - int stride, - int bpp, - int x, - int y, - int width, - int height, - uint32_t _xor) +mips_dspr2_fill (pixman_implementation_t *imp, + uint32_t * bits, + int stride, + int bpp, + int x, + int y, + int width, + int height, + uint32_t _xor) { uint8_t *byte_line; uint32_t byte_width; @@ -130,18 +131,19 @@ pixman_fill_mips (uint32_t *bits, } static pixman_bool_t -pixman_blt_mips (uint32_t *src_bits, - uint32_t *dst_bits, - int src_stride, - int dst_stride, - int src_bpp, - int dst_bpp, - int src_x, - int src_y, - int dest_x, - int dest_y, - int width, - int height) +mips_dspr2_blt (pixman_implementation_t *imp, + uint32_t * src_bits, + uint32_t * dst_bits, + int src_stride, + int dst_stride, + int src_bpp, + int dst_bpp, + int src_x, + int src_y, + int dest_x, + int dest_y, + int width, + int height) { if (src_bpp != dst_bpp) return FALSE; @@ -266,53 +268,6 @@ static const pixman_fast_path_t mips_dspr2_fast_paths[] = { PIXMAN_OP_NONE }, }; -static pixman_bool_t -mips_dspr2_blt (pixman_implementation_t *imp, - uint32_t * src_bits, - uint32_t * dst_bits, - int src_stride, - int dst_stride, - int src_bpp, - int dst_bpp, - int src_x, - int src_y, - int dest_x, - int dest_y, - int width, - int height) -{ - if (!pixman_blt_mips ( - src_bits, dst_bits, src_stride, dst_stride, src_bpp, dst_bpp, - src_x, src_y, dest_x, dest_y, width, height)) - - { - return _pixman_implementation_blt ( - imp->delegate, - src_bits, dst_bits, src_stride, dst_stride, src_bpp, dst_bpp, - src_x, src_y, dest_x, dest_y, width, height); - } - - return TRUE; -} - -static pixman_bool_t -mips_dspr2_fill (pixman_implementation_t *imp, - uint32_t * bits, - int stride, - int bpp, - int x, - int y, - int width, - int height, - uint32_t xor) -{ - if (pixman_fill_mips (bits, stride, bpp, x, y, width, height, xor)) - return TRUE; - - return _pixman_implementation_fill ( - imp->delegate, bits, stride, bpp, x, y, width, height, xor); -} - pixman_implementation_t * _pixman_implementation_create_mips_dspr2 (pixman_implementation_t *fallback) { diff --git a/pixman/pixman/pixman-mmx.c b/pixman/pixman/pixman-mmx.c index b3a4c5f75..fccba9d63 100644 --- a/pixman/pixman/pixman-mmx.c +++ b/pixman/pixman/pixman-mmx.c @@ -2055,15 +2055,16 @@ mmx_composite_over_n_8_8888 (pixman_implementation_t *imp, _mm_empty (); } -pixman_bool_t -pixman_fill_mmx (uint32_t *bits, - int stride, - int bpp, - int x, - int y, - int width, - int height, - uint32_t xor) +static pixman_bool_t +mmx_fill (pixman_implementation_t *imp, + uint32_t * bits, + int stride, + int bpp, + int x, + int y, + int width, + int height, + uint32_t xor) { uint64_t fill; __m64 vfill; @@ -2281,9 +2282,9 @@ mmx_composite_src_n_8_8888 (pixman_implementation_t *imp, srca = src >> 24; if (src == 0) { - pixman_fill_mmx (dest_image->bits.bits, dest_image->bits.rowstride, - PIXMAN_FORMAT_BPP (dest_image->bits.format), - dest_x, dest_y, width, height, 0); + mmx_fill (imp, dest_image->bits.bits, dest_image->bits.rowstride, + PIXMAN_FORMAT_BPP (dest_image->bits.format), + dest_x, dest_y, width, height, 0); return; } @@ -3240,18 +3241,19 @@ mmx_composite_add_8888_8888 (pixman_implementation_t *imp, } static pixman_bool_t -pixman_blt_mmx (uint32_t *src_bits, - uint32_t *dst_bits, - int src_stride, - int dst_stride, - int src_bpp, - int dst_bpp, - int src_x, - int src_y, - int dest_x, - int dest_y, - int width, - int height) +mmx_blt (pixman_implementation_t *imp, + uint32_t * src_bits, + uint32_t * dst_bits, + int src_stride, + int dst_stride, + int src_bpp, + int dst_bpp, + int src_x, + int src_y, + int dest_x, + int dest_y, + int width, + int height) { uint8_t * src_bytes; uint8_t * dst_bytes; @@ -3396,13 +3398,13 @@ mmx_composite_copy_area (pixman_implementation_t *imp, { PIXMAN_COMPOSITE_ARGS (info); - pixman_blt_mmx (src_image->bits.bits, - dest_image->bits.bits, - src_image->bits.rowstride, - dest_image->bits.rowstride, - PIXMAN_FORMAT_BPP (src_image->bits.format), - PIXMAN_FORMAT_BPP (dest_image->bits.format), - src_x, src_y, dest_x, dest_y, width, height); + mmx_blt (imp, src_image->bits.bits, + dest_image->bits.bits, + src_image->bits.rowstride, + dest_image->bits.rowstride, + PIXMAN_FORMAT_BPP (src_image->bits.format), + PIXMAN_FORMAT_BPP (dest_image->bits.format), + src_x, src_y, dest_x, dest_y, width, height); } static void @@ -3913,7 +3915,7 @@ static const fetcher_info_t fetchers[] = { PIXMAN_null } }; -static void +static pixman_bool_t mmx_src_iter_init (pixman_implementation_t *imp, pixman_iter_t *iter) { pixman_image_t *image = iter->image; @@ -3938,12 +3940,12 @@ mmx_src_iter_init (pixman_implementation_t *imp, pixman_iter_t *iter) iter->stride = s; iter->get_scanline = f->get_scanline; - return; + return TRUE; } } } - imp->delegate->src_iter_init (imp->delegate, iter); + return FALSE; } static const pixman_fast_path_t mmx_fast_paths[] = @@ -4042,55 +4044,6 @@ static const pixman_fast_path_t mmx_fast_paths[] = { PIXMAN_OP_NONE }, }; -static pixman_bool_t -mmx_blt (pixman_implementation_t *imp, - uint32_t * src_bits, - uint32_t * dst_bits, - int src_stride, - int dst_stride, - int src_bpp, - int dst_bpp, - int src_x, - int src_y, - int dest_x, - int dest_y, - int width, - int height) -{ - if (!pixman_blt_mmx ( - src_bits, dst_bits, src_stride, dst_stride, src_bpp, dst_bpp, - src_x, src_y, dest_x, dest_y, width, height)) - - { - return _pixman_implementation_blt ( - imp->delegate, - src_bits, dst_bits, src_stride, dst_stride, src_bpp, dst_bpp, - src_x, src_y, dest_x, dest_y, width, height); - } - - return TRUE; -} - -static pixman_bool_t -mmx_fill (pixman_implementation_t *imp, - uint32_t * bits, - int stride, - int bpp, - int x, - int y, - int width, - int height, - uint32_t xor) -{ - if (!pixman_fill_mmx (bits, stride, bpp, x, y, width, height, xor)) - { - return _pixman_implementation_fill ( - imp->delegate, bits, stride, bpp, x, y, width, height, xor); - } - - return TRUE; -} - pixman_implementation_t * _pixman_implementation_create_mmx (pixman_implementation_t *fallback) { diff --git a/pixman/pixman/pixman-noop.c b/pixman/pixman/pixman-noop.c index 7b017e8ec..7b9759ffb 100644 --- a/pixman/pixman/pixman-noop.c +++ b/pixman/pixman/pixman-noop.c @@ -59,7 +59,7 @@ get_scanline_null (pixman_iter_t *iter, const uint32_t *mask) return NULL; } -static void +static pixman_bool_t noop_src_iter_init (pixman_implementation_t *imp, pixman_iter_t *iter) { pixman_image_t *image = iter->image; @@ -117,11 +117,13 @@ noop_src_iter_init (pixman_implementation_t *imp, pixman_iter_t *iter) } else { - (* imp->delegate->src_iter_init) (imp->delegate, iter); + return FALSE; } + + return TRUE; } -static void +static pixman_bool_t noop_dest_iter_init (pixman_implementation_t *imp, pixman_iter_t *iter) { pixman_image_t *image = iter->image; @@ -138,10 +140,12 @@ noop_dest_iter_init (pixman_implementation_t *imp, pixman_iter_t *iter) iter->get_scanline = _pixman_iter_get_scanline_noop; iter->write_back = dest_write_back_direct; + + return TRUE; } else { - (* imp->delegate->dest_iter_init) (imp->delegate, iter); + return FALSE; } } @@ -156,7 +160,7 @@ _pixman_implementation_create_noop (pixman_implementation_t *fallback) { pixman_implementation_t *imp = _pixman_implementation_create (fallback, noop_fast_paths); - + imp->src_iter_init = noop_src_iter_init; imp->dest_iter_init = noop_dest_iter_init; diff --git a/pixman/pixman/pixman-private.h b/pixman/pixman/pixman-private.h index dbfa82952..b9c8319df 100644 --- a/pixman/pixman/pixman-private.h +++ b/pixman/pixman/pixman-private.h @@ -445,8 +445,8 @@ typedef pixman_bool_t (*pixman_fill_func_t) (pixman_implementation_t *imp, int width, int height, uint32_t xor); -typedef void (*pixman_iter_init_func_t) (pixman_implementation_t *imp, - pixman_iter_t *iter); +typedef pixman_bool_t (*pixman_iter_init_func_t) (pixman_implementation_t *imp, + pixman_iter_t *iter); void _pixman_setup_combiner_functions_32 (pixman_implementation_t *imp); void _pixman_setup_combiner_functions_64 (pixman_implementation_t *imp); @@ -466,7 +466,7 @@ typedef struct struct pixman_implementation_t { pixman_implementation_t * toplevel; - pixman_implementation_t * delegate; + pixman_implementation_t * fallback; const pixman_fast_path_t * fast_paths; pixman_blt_func_t blt; @@ -486,9 +486,21 @@ _pixman_image_get_solid (pixman_implementation_t *imp, pixman_format_code_t format); pixman_implementation_t * -_pixman_implementation_create (pixman_implementation_t *delegate, +_pixman_implementation_create (pixman_implementation_t *fallback, const pixman_fast_path_t *fast_paths); +pixman_bool_t +_pixman_implementation_lookup_composite (pixman_implementation_t *toplevel, + pixman_op_t op, + pixman_format_code_t src_format, + uint32_t src_flags, + pixman_format_code_t mask_format, + uint32_t mask_flags, + pixman_format_code_t dest_format, + uint32_t dest_flags, + pixman_implementation_t **out_imp, + pixman_composite_func_t *out_func); + pixman_combine_32_func_t _pixman_implementation_lookup_combiner (pixman_implementation_t *imp, pixman_op_t op, @@ -521,7 +533,7 @@ _pixman_implementation_fill (pixman_implementation_t *imp, int height, uint32_t xor); -void +pixman_bool_t _pixman_implementation_src_iter_init (pixman_implementation_t *imp, pixman_iter_t *iter, pixman_image_t *image, @@ -533,7 +545,7 @@ _pixman_implementation_src_iter_init (pixman_implementation_t *imp, iter_flags_t flags, uint32_t image_flags); -void +pixman_bool_t _pixman_implementation_dest_iter_init (pixman_implementation_t *imp, pixman_iter_t *iter, pixman_image_t *image, @@ -770,18 +782,6 @@ pixman_contract (uint32_t * dst, const uint64_t *src, int width); -pixman_bool_t -_pixman_lookup_composite_function (pixman_implementation_t *toplevel, - pixman_op_t op, - pixman_format_code_t src_format, - uint32_t src_flags, - pixman_format_code_t mask_format, - uint32_t mask_flags, - pixman_format_code_t dest_format, - uint32_t dest_flags, - pixman_implementation_t **out_imp, - pixman_composite_func_t *out_func); - /* Region Helpers */ pixman_bool_t pixman_region32_copy_from_region16 (pixman_region32_t *dst, diff --git a/pixman/pixman/pixman-sse2.c b/pixman/pixman/pixman-sse2.c index 665eeadbe..e273a951e 100644 --- a/pixman/pixman/pixman-sse2.c +++ b/pixman/pixman/pixman-sse2.c @@ -3309,18 +3309,22 @@ sse2_composite_over_n_8_8888 (pixman_implementation_t *imp, } +#if defined(__GNUC__) && !defined(__x86_64__) && !defined(__amd64__) +__attribute__((__force_align_arg_pointer__)) +#endif static pixman_bool_t -pixman_fill_sse2 (uint32_t *bits, - int stride, - int bpp, - int x, - int y, - int width, - int height, - uint32_t data) +sse2_fill (pixman_implementation_t *imp, + uint32_t * bits, + int stride, + int bpp, + int x, + int y, + int width, + int height, + uint32_t xor) { uint32_t byte_width; - uint8_t *byte_line; + uint8_t *byte_line; __m128i xmm_def; @@ -3334,9 +3338,9 @@ pixman_fill_sse2 (uint32_t *bits, byte_width = width; stride *= 1; - b = data & 0xff; + b = xor & 0xff; w = (b << 8) | b; - data = (w << 16) | w; + xor = (w << 16) | w; } else if (bpp == 16) { @@ -3345,7 +3349,7 @@ pixman_fill_sse2 (uint32_t *bits, byte_width = 2 * width; stride *= 2; - data = (data & 0xffff) * 0x00010001; + xor = (xor & 0xffff) * 0x00010001; } else if (bpp == 32) { @@ -3359,7 +3363,7 @@ pixman_fill_sse2 (uint32_t *bits, return FALSE; } - xmm_def = create_mask_2x32_128 (data, data); + xmm_def = create_mask_2x32_128 (xor, xor); while (height--) { @@ -3370,21 +3374,21 @@ pixman_fill_sse2 (uint32_t *bits, if (w >= 1 && ((unsigned long)d & 1)) { - *(uint8_t *)d = data; + *(uint8_t *)d = xor; w -= 1; d += 1; } while (w >= 2 && ((unsigned long)d & 3)) { - *(uint16_t *)d = data; + *(uint16_t *)d = xor; w -= 2; d += 2; } while (w >= 4 && ((unsigned long)d & 15)) { - *(uint32_t *)d = data; + *(uint32_t *)d = xor; w -= 4; d += 4; @@ -3435,7 +3439,7 @@ pixman_fill_sse2 (uint32_t *bits, while (w >= 4) { - *(uint32_t *)d = data; + *(uint32_t *)d = xor; w -= 4; d += 4; @@ -3443,14 +3447,14 @@ pixman_fill_sse2 (uint32_t *bits, if (w >= 2) { - *(uint16_t *)d = data; + *(uint16_t *)d = xor; w -= 2; d += 2; } if (w >= 1) { - *(uint8_t *)d = data; + *(uint8_t *)d = xor; w -= 1; d += 1; } @@ -3479,9 +3483,9 @@ sse2_composite_src_n_8_8888 (pixman_implementation_t *imp, srca = src >> 24; if (src == 0) { - pixman_fill_sse2 (dest_image->bits.bits, dest_image->bits.rowstride, - PIXMAN_FORMAT_BPP (dest_image->bits.format), - dest_x, dest_y, width, height, 0); + sse2_fill (imp, dest_image->bits.bits, dest_image->bits.rowstride, + PIXMAN_FORMAT_BPP (dest_image->bits.format), + dest_x, dest_y, width, height, 0); return; } @@ -4523,18 +4527,19 @@ sse2_composite_add_8888_8888 (pixman_implementation_t *imp, } static pixman_bool_t -pixman_blt_sse2 (uint32_t *src_bits, - uint32_t *dst_bits, - int src_stride, - int dst_stride, - int src_bpp, - int dst_bpp, - int src_x, - int src_y, - int dest_x, - int dest_y, - int width, - int height) +sse2_blt (pixman_implementation_t *imp, + uint32_t * src_bits, + uint32_t * dst_bits, + int src_stride, + int dst_stride, + int src_bpp, + int dst_bpp, + int src_x, + int src_y, + int dest_x, + int dest_y, + int width, + int height) { uint8_t * src_bytes; uint8_t * dst_bytes; @@ -4640,7 +4645,6 @@ pixman_blt_sse2 (uint32_t *src_bits, } } - return TRUE; } @@ -4649,13 +4653,13 @@ sse2_composite_copy_area (pixman_implementation_t *imp, pixman_composite_info_t *info) { PIXMAN_COMPOSITE_ARGS (info); - pixman_blt_sse2 (src_image->bits.bits, - dest_image->bits.bits, - src_image->bits.rowstride, - dest_image->bits.rowstride, - PIXMAN_FORMAT_BPP (src_image->bits.format), - PIXMAN_FORMAT_BPP (dest_image->bits.format), - src_x, src_y, dest_x, dest_y, width, height); + sse2_blt (imp, src_image->bits.bits, + dest_image->bits.bits, + src_image->bits.rowstride, + dest_image->bits.rowstride, + PIXMAN_FORMAT_BPP (src_image->bits.format), + PIXMAN_FORMAT_BPP (dest_image->bits.format), + src_x, src_y, dest_x, dest_y, width, height); } static void @@ -5878,58 +5882,6 @@ static const pixman_fast_path_t sse2_fast_paths[] = { PIXMAN_OP_NONE }, }; -static pixman_bool_t -sse2_blt (pixman_implementation_t *imp, - uint32_t * src_bits, - uint32_t * dst_bits, - int src_stride, - int dst_stride, - int src_bpp, - int dst_bpp, - int src_x, - int src_y, - int dest_x, - int dest_y, - int width, - int height) -{ - if (!pixman_blt_sse2 ( - src_bits, dst_bits, src_stride, dst_stride, src_bpp, dst_bpp, - src_x, src_y, dest_x, dest_y, width, height)) - - { - return _pixman_implementation_blt ( - imp->delegate, - src_bits, dst_bits, src_stride, dst_stride, src_bpp, dst_bpp, - src_x, src_y, dest_x, dest_y, width, height); - } - - return TRUE; -} - -#if defined(__GNUC__) && !defined(__x86_64__) && !defined(__amd64__) -__attribute__((__force_align_arg_pointer__)) -#endif -static pixman_bool_t -sse2_fill (pixman_implementation_t *imp, - uint32_t * bits, - int stride, - int bpp, - int x, - int y, - int width, - int height, - uint32_t xor) -{ - if (!pixman_fill_sse2 (bits, stride, bpp, x, y, width, height, xor)) - { - return _pixman_implementation_fill ( - imp->delegate, bits, stride, bpp, x, y, width, height, xor); - } - - return TRUE; -} - static uint32_t * sse2_fetch_x8r8g8b8 (pixman_iter_t *iter, const uint32_t *mask) { @@ -6072,7 +6024,7 @@ static const fetcher_info_t fetchers[] = { PIXMAN_null } }; -static void +static pixman_bool_t sse2_src_iter_init (pixman_implementation_t *imp, pixman_iter_t *iter) { pixman_image_t *image = iter->image; @@ -6097,12 +6049,12 @@ sse2_src_iter_init (pixman_implementation_t *imp, pixman_iter_t *iter) iter->stride = s; iter->get_scanline = f->get_scanline; - return; + return TRUE; } } } - imp->delegate->src_iter_init (imp->delegate, iter); + return FALSE; } #if defined(__GNUC__) && !defined(__x86_64__) && !defined(__amd64__) diff --git a/pixman/pixman/pixman-utils.c b/pixman/pixman/pixman-utils.c index 93c061ad2..5633f8f79 100644 --- a/pixman/pixman/pixman-utils.c +++ b/pixman/pixman/pixman-utils.c @@ -30,118 +30,6 @@ #include "pixman-private.h" -#define N_CACHED_FAST_PATHS 8 - -typedef struct -{ - struct - { - pixman_implementation_t * imp; - pixman_fast_path_t fast_path; - } cache [N_CACHED_FAST_PATHS]; -} cache_t; - -PIXMAN_DEFINE_THREAD_LOCAL (cache_t, fast_path_cache); - -pixman_bool_t -_pixman_lookup_composite_function (pixman_implementation_t *toplevel, - pixman_op_t op, - pixman_format_code_t src_format, - uint32_t src_flags, - pixman_format_code_t mask_format, - uint32_t mask_flags, - pixman_format_code_t dest_format, - uint32_t dest_flags, - pixman_implementation_t **out_imp, - pixman_composite_func_t *out_func) -{ - pixman_implementation_t *imp; - cache_t *cache; - int i; - - /* Check cache for fast paths */ - cache = PIXMAN_GET_THREAD_LOCAL (fast_path_cache); - - for (i = 0; i < N_CACHED_FAST_PATHS; ++i) - { - const pixman_fast_path_t *info = &(cache->cache[i].fast_path); - - /* Note that we check for equality here, not whether - * the cached fast path matches. This is to prevent - * us from selecting an overly general fast path - * when a more specific one would work. - */ - if (info->op == op && - info->src_format == src_format && - info->mask_format == mask_format && - info->dest_format == dest_format && - info->src_flags == src_flags && - info->mask_flags == mask_flags && - info->dest_flags == dest_flags && - info->func) - { - *out_imp = cache->cache[i].imp; - *out_func = cache->cache[i].fast_path.func; - - goto update_cache; - } - } - - for (imp = toplevel; imp != NULL; imp = imp->delegate) - { - const pixman_fast_path_t *info = imp->fast_paths; - - while (info->op != PIXMAN_OP_NONE) - { - if ((info->op == op || info->op == PIXMAN_OP_any) && - /* Formats */ - ((info->src_format == src_format) || - (info->src_format == PIXMAN_any)) && - ((info->mask_format == mask_format) || - (info->mask_format == PIXMAN_any)) && - ((info->dest_format == dest_format) || - (info->dest_format == PIXMAN_any)) && - /* Flags */ - (info->src_flags & src_flags) == info->src_flags && - (info->mask_flags & mask_flags) == info->mask_flags && - (info->dest_flags & dest_flags) == info->dest_flags) - { - *out_imp = imp; - *out_func = info->func; - - /* Set i to the last spot in the cache so that the - * move-to-front code below will work - */ - i = N_CACHED_FAST_PATHS - 1; - - goto update_cache; - } - - ++info; - } - } - return FALSE; - -update_cache: - if (i) - { - while (i--) - cache->cache[i + 1] = cache->cache[i]; - - cache->cache[0].imp = *out_imp; - cache->cache[0].fast_path.op = op; - cache->cache[0].fast_path.src_format = src_format; - cache->cache[0].fast_path.src_flags = src_flags; - cache->cache[0].fast_path.mask_format = mask_format; - cache->cache[0].fast_path.mask_flags = mask_flags; - cache->cache[0].fast_path.dest_format = dest_format; - cache->cache[0].fast_path.dest_flags = dest_flags; - cache->cache[0].fast_path.func = *out_func; - } - - return TRUE; -} - pixman_bool_t _pixman_multiply_overflows_size (size_t a, size_t b) { diff --git a/pixman/pixman/pixman.c b/pixman/pixman/pixman.c index 994ef388c..739cc7994 100644 --- a/pixman/pixman/pixman.c +++ b/pixman/pixman/pixman.c @@ -669,7 +669,7 @@ pixman_image_composite32 (pixman_op_t op, */ op = optimize_operator (op, src_flags, mask_flags, dest_flags); - if (_pixman_lookup_composite_function ( + if (_pixman_implementation_lookup_composite ( get_implementation (), op, src_format, src_flags, mask_format, mask_flags, dest_format, dest_flags, &imp, &func)) diff --git a/pixman/test/scaling-test.c b/pixman/test/scaling-test.c index 44c4f3de4..273612395 100644 --- a/pixman/test/scaling-test.c +++ b/pixman/test/scaling-test.c @@ -20,6 +20,31 @@ /* * Composite operation with pseudorandom images */ + +static pixman_format_code_t +get_format (int bpp) +{ + if (bpp == 4) + { + switch (lcg_rand_n (4)) + { + default: + case 0: + return PIXMAN_a8r8g8b8; + case 1: + return PIXMAN_x8r8g8b8; + case 2: + return PIXMAN_a8b8g8r8; + case 3: + return PIXMAN_x8b8g8r8; + } + } + else + { + return PIXMAN_r5g6b5; + } +} + uint32_t test_composite (int testnum, int verbose) @@ -124,11 +149,8 @@ test_composite (int testnum, for (i = 0; i < dst_stride * dst_height; i++) *((uint8_t *)dstbuf + i) = lcg_rand_n (256); - src_fmt = src_bpp == 4 ? (lcg_rand_n (2) == 0 ? - PIXMAN_a8r8g8b8 : PIXMAN_x8r8g8b8) : PIXMAN_r5g6b5; - - dst_fmt = dst_bpp == 4 ? (lcg_rand_n (2) == 0 ? - PIXMAN_a8r8g8b8 : PIXMAN_x8r8g8b8) : PIXMAN_r5g6b5; + src_fmt = get_format (src_bpp); + dst_fmt = get_format (dst_bpp); src_img = pixman_image_create_bits ( src_fmt, src_width, src_height, srcbuf, src_stride); @@ -322,7 +344,7 @@ test_composite (int testnum, pixman_image_composite (op, src_img, mask_img, dst_img, src_x, src_y, mask_x, mask_y, dst_x, dst_y, w, h); - if (dst_fmt == PIXMAN_x8r8g8b8) + if (dst_fmt == PIXMAN_x8r8g8b8 || dst_fmt == PIXMAN_x8b8g8r8) { /* ignore unused part */ for (i = 0; i < dst_stride * dst_height / 4; i++) @@ -358,11 +380,11 @@ test_composite (int testnum, } #if BILINEAR_INTERPOLATION_BITS == 8 -#define CHECKSUM 0x80DF1CB2 +#define CHECKSUM 0x8D3A7539 #elif BILINEAR_INTERPOLATION_BITS == 7 -#define CHECKSUM 0x2818D5FB +#define CHECKSUM 0x03A23E0C #elif BILINEAR_INTERPOLATION_BITS == 4 -#define CHECKSUM 0x387540A5 +#define CHECKSUM 0xE96D1A5E #else #define CHECKSUM 0x00000000 #endif diff --git a/xorg-server/dix/devices.c b/xorg-server/dix/devices.c index 9cf04ed3f..66d440683 100644 --- a/xorg-server/dix/devices.c +++ b/xorg-server/dix/devices.c @@ -306,6 +306,9 @@ AddInputDevice(ClientPtr client, DeviceProc deviceProc, Bool autoStart) /* unity matrix */ memset(transform, 0, sizeof(transform)); transform[0] = transform[4] = transform[8] = 1.0f; + dev->transform.m[0][0] = 1.0; + dev->transform.m[1][1] = 1.0; + dev->transform.m[2][2] = 1.0; XIChangeDeviceProperty(dev, XIGetKnownProperty(XI_PROP_TRANSFORM), XIGetKnownProperty(XATOM_FLOAT), 32, diff --git a/xorg-server/dix/window.c b/xorg-server/dix/window.c index cdd12dca6..e70531af6 100644 --- a/xorg-server/dix/window.c +++ b/xorg-server/dix/window.c @@ -1886,8 +1886,7 @@ AnyWindowOverlapsMe(WindowPtr pWin, WindowPtr pHead, BoxPtr box) if (pSib->mapped) { sbox = WindowExtents(pSib, &sboxrec); if (BOXES_OVERLAP(sbox, box) - && ShapeOverlap(pWin, box, pSib, sbox) - ) + && ShapeOverlap(pWin, box, pSib, sbox)) return TRUE; } } @@ -1905,8 +1904,7 @@ IOverlapAnyWindow(WindowPtr pWin, BoxPtr box) if (pSib->mapped) { sbox = WindowExtents(pSib, &sboxrec); if (BOXES_OVERLAP(sbox, box) - && ShapeOverlap(pWin, box, pSib, sbox) - ) + && ShapeOverlap(pWin, box, pSib, sbox)) return TRUE; } } @@ -2174,8 +2172,7 @@ ConfigureWindow(WindowPtr pWin, Mask mask, XID *vlist, ClientPtr client) else pSib = pWin->nextSib; - if ((!pWin->overrideRedirect) && (RedirectSend(pParent) - )) { + if ((!pWin->overrideRedirect) && (RedirectSend(pParent))) { xEvent event = { .u.configureRequest.window = pWin->drawable.id, .u.configureRequest.sibling = (mask & CWSibling) ? sibwid : None, @@ -2508,28 +2505,29 @@ RealizeTree(WindowPtr pWin) } } -static WindowPtr windowDisableMapUnmapEvents; - -void -DisableMapUnmapEvents(WindowPtr pWin) -{ - assert(windowDisableMapUnmapEvents == NULL); - - windowDisableMapUnmapEvents = pWin; -} - -void -EnableMapUnmapEvents(WindowPtr pWin) +static Bool +MaybeDeliverMapRequest(WindowPtr pWin, WindowPtr pParent, ClientPtr client) { - assert(windowDisableMapUnmapEvents != NULL); + xEvent event = { + .u.mapRequest.window = pWin->drawable.id, + .u.mapRequest.parent = pParent->drawable.id + }; + event.u.u.type = MapRequest; - windowDisableMapUnmapEvents = NULL; + return MaybeDeliverEventsToClient(pParent, &event, 1, + SubstructureRedirectMask, + client) == 1; } -static Bool -MapUnmapEventsEnabled(WindowPtr pWin) +static void +DeliverMapNotify(WindowPtr pWin) { - return pWin != windowDisableMapUnmapEvents; + xEvent event = { + .u.mapNotify.window = pWin->drawable.id, + .u.mapNotify.override = pWin->overrideRedirect, + }; + event.u.u.type = MapNotify; + DeliverEvents(pWin, &event, 1, NullWindow); } /***** @@ -2551,7 +2549,7 @@ MapWindow(WindowPtr pWin, ClientPtr client) if (pWin->mapped) return Success; - /* general check for permission to map window */ + /* general check for permission to map window */ if (XaceHook(XACE_RESOURCE_ACCESS, client, pWin->drawable.id, RT_WINDOW, pWin, RT_NONE, NULL, DixShowAccess) != Success) return Success; @@ -2560,29 +2558,13 @@ MapWindow(WindowPtr pWin, ClientPtr client) if ((pParent = pWin->parent)) { Bool anyMarked; - if ((!pWin->overrideRedirect) && (RedirectSend(pParent) - )) { - xEvent event = { - .u.mapRequest.window = pWin->drawable.id, - .u.mapRequest.parent = pParent->drawable.id - }; - event.u.u.type = MapRequest; - - if (MaybeDeliverEventsToClient(pParent, &event, 1, - SubstructureRedirectMask, - client) == 1) + if ((!pWin->overrideRedirect) && (RedirectSend(pParent))) + if (MaybeDeliverMapRequest(pWin, pParent, client)) return Success; - } pWin->mapped = TRUE; - if (SubStrSend(pWin, pParent) && MapUnmapEventsEnabled(pWin)) { - xEvent event = { - .u.mapNotify.window = pWin->drawable.id, - .u.mapNotify.override = pWin->overrideRedirect, - }; - event.u.u.type = MapNotify; - DeliverEvents(pWin, &event, 1, NullWindow); - } + if (SubStrSend(pWin, pParent)) + DeliverMapNotify(pWin); if (!pParent->realized) return Success; @@ -2644,28 +2626,13 @@ MapSubwindows(WindowPtr pParent, ClientPtr client) anyMarked = FALSE; for (pWin = pParent->firstChild; pWin; pWin = pWin->nextSib) { if (!pWin->mapped) { - if (parentRedirect && !pWin->overrideRedirect) { - xEvent event = { - .u.mapRequest.window = pWin->drawable.id, - .u.mapRequest.parent = pParent->drawable.id - }; - event.u.u.type = MapRequest; - - if (MaybeDeliverEventsToClient(pParent, &event, 1, - SubstructureRedirectMask, - client) == 1) + if (parentRedirect && !pWin->overrideRedirect) + if (MaybeDeliverMapRequest(pWin, pParent, client)) continue; - } pWin->mapped = TRUE; - if (parentNotify || StrSend(pWin)) { - xEvent event = { - .u.mapNotify.window = pWin->drawable.id, - .u.mapNotify.override = pWin->overrideRedirect - }; - event.u.u.type = MapNotify; - DeliverEvents(pWin, &event, 1, NullWindow); - } + if (parentNotify || StrSend(pWin)) + DeliverMapNotify(pWin); if (!pFirstMapped) pFirstMapped = pWin; @@ -2726,8 +2693,7 @@ UnrealizeTree(WindowPtr pWin, Bool fromConfigure) } #endif (*Unrealize) (pChild); - if (MapUnmapEventsEnabled(pWin)) - DeleteWindowFromAnyEvents(pChild, FALSE); + DeleteWindowFromAnyEvents(pChild, FALSE); if (pChild->viewable) { pChild->viewable = FALSE; (*MarkUnrealizedWindow) (pChild, pWin, fromConfigure); @@ -2746,6 +2712,17 @@ UnrealizeTree(WindowPtr pWin, Bool fromConfigure) } } +static void +DeliverUnmapNotify(WindowPtr pWin, Bool fromConfigure) +{ + xEvent event = { + .u.unmapNotify.window = pWin->drawable.id, + .u.unmapNotify.fromConfigure = fromConfigure + }; + event.u.u.type = UnmapNotify; + DeliverEvents(pWin, &event, 1, NullWindow); +} + /***** * UnmapWindow * If the window is already unmapped, this request has no effect. @@ -2764,14 +2741,8 @@ UnmapWindow(WindowPtr pWin, Bool fromConfigure) if ((!pWin->mapped) || (!(pParent = pWin->parent))) return Success; - if (SubStrSend(pWin, pParent) && MapUnmapEventsEnabled(pWin)) { - xEvent event = { - .u.unmapNotify.window = pWin->drawable.id, - .u.unmapNotify.fromConfigure = fromConfigure - }; - event.u.u.type = UnmapNotify; - DeliverEvents(pWin, &event, 1, NullWindow); - } + if (SubStrSend(pWin, pParent)) + DeliverUnmapNotify(pWin, fromConfigure); if (wasViewable && !fromConfigure) { pWin->valdata = UnmapValData; (*pScreen->MarkOverlappedWindows) (pWin, pWin->nextSib, &pLayerWin); @@ -2822,14 +2793,8 @@ UnmapSubwindows(WindowPtr pWin) for (pChild = pWin->lastChild; pChild != pHead; pChild = pChild->prevSib) { if (pChild->mapped) { - if (parentNotify || StrSend(pChild)) { - xEvent event = { - .u.unmapNotify.window = pChild->drawable.id, - .u.unmapNotify.fromConfigure = xFalse - }; - event.u.u.type = UnmapNotify; - DeliverEvents(pChild, &event, 1, NullWindow); - } + if (parentNotify || StrSend(pChild)) + DeliverUnmapNotify(pChild, xFalse); if (pChild->viewable) { pChild->valdata = UnmapValData; anyMarked = TRUE; @@ -2956,8 +2921,6 @@ SendVisibilityNotify(WindowPtr pWin) xEvent event; unsigned int visibility = pWin->visibility; - if (!MapUnmapEventsEnabled(pWin)) - return; #ifdef PANORAMIX /* This is not quite correct yet, but it's close */ if (!noPanoramiXExtension) { diff --git a/xorg-server/exa/exa_priv.h b/xorg-server/exa/exa_priv.h index ea7e7faff..70075786a 100644 --- a/xorg-server/exa/exa_priv.h +++ b/xorg-server/exa/exa_priv.h @@ -41,7 +41,6 @@ #include "pixmapstr.h" #include "windowstr.h" #include "servermd.h" -#include "mibstore.h" #include "colormapst.h" #include "gcstruct.h" #include "input.h" diff --git a/xorg-server/fb/fb.h b/xorg-server/fb/fb.h index 40a7e38db..75596c58e 100644 --- a/xorg-server/fb/fb.h +++ b/xorg-server/fb/fb.h @@ -39,7 +39,6 @@ #include "privates.h" #include "mi.h" #include "migc.h" -#include "mibstore.h" #include "picturestr.h" #ifdef FB_ACCESS_WRAPPER diff --git a/xorg-server/hw/dmx/doc/dmx.xml b/xorg-server/hw/dmx/doc/dmx.xml index 793aacea0..6d7df4133 100644 --- a/xorg-server/hw/dmx/doc/dmx.xml +++ b/xorg-server/hw/dmx/doc/dmx.xml @@ -1214,14 +1214,6 @@ function pointers from the other layer are stored in a screen private area. Common functions to wrap are CloseScreen() and SaveScreen(). - -miInitializeBackingStore() - -This MI function initializes the -screen's backing storage functions, which are used to save areas of -windows that are currently covered by other windows. - - miDCInitialize() @@ -1320,8 +1312,8 @@ initialize each of its screens. Xnest's ScreenInit() function is called xnestOpenScreen(). This function initializes its screen's depth and visual information, and then calls miScreenInit() to set up the default -screen functions. It then calls miInitializeBackingStore() and -miDCInitialize() to initialize backing store and the software cursor. +screen functions. It then calls miDCInitialize() to initialize the +software cursor. Finally, it replaces many of the screen functions with its own functions that repackage and send the requests to the real X server to which Xnest is attached. diff --git a/xorg-server/hw/kdrive/src/kdrive.h b/xorg-server/hw/kdrive/src/kdrive.h index b37041f9b..4829e1a1b 100644 --- a/xorg-server/hw/kdrive/src/kdrive.h +++ b/xorg-server/hw/kdrive/src/kdrive.h @@ -32,7 +32,6 @@ #include "pixmapstr.h" #include "windowstr.h" #include "servermd.h" -#include "mibstore.h" #include "colormapst.h" #include "gcstruct.h" #include "input.h" diff --git a/xorg-server/hw/vfb/InitInput.c b/xorg-server/hw/vfb/InitInput.c index 9d0fd9866..52cde72f0 100644 --- a/xorg-server/hw/vfb/InitInput.c +++ b/xorg-server/hw/vfb/InitInput.c @@ -36,7 +36,6 @@ from The Open Group. #include "scrnintstr.h" #include "inputstr.h" #include -#include "mibstore.h" #include "mipointer.h" #include "xkbsrv.h" #include diff --git a/xorg-server/hw/vfb/InitOutput.c b/xorg-server/hw/vfb/InitOutput.c index 955624f3d..07ea8ea93 100644 --- a/xorg-server/hw/vfb/InitOutput.c +++ b/xorg-server/hw/vfb/InitOutput.c @@ -41,7 +41,6 @@ from The Open Group. #include "servermd.h" #define PSZ 8 #include "fb.h" -#include "mibstore.h" #include "colormapst.h" #include "gcstruct.h" #include "input.h" diff --git a/xorg-server/hw/xfree86/common/xf86.h b/xorg-server/hw/xfree86/common/xf86.h index bb2903da0..179b87cf5 100644 --- a/xorg-server/hw/xfree86/common/xf86.h +++ b/xorg-server/hw/xfree86/common/xf86.h @@ -55,6 +55,7 @@ extern _X_EXPORT int xf86DoConfigure; extern _X_EXPORT int xf86DoShowOptions; extern _X_EXPORT Bool xf86DoConfigurePass1; +extern _X_EXPORT Bool xorgHWAccess; extern _X_EXPORT DevPrivateKeyRec xf86ScreenKeyRec; diff --git a/xorg-server/hw/xfree86/common/xf86Bus.c b/xorg-server/hw/xfree86/common/xf86Bus.c index 4ffbf7e46..e1015379b 100644 --- a/xorg-server/hw/xfree86/common/xf86Bus.c +++ b/xorg-server/hw/xfree86/common/xf86Bus.c @@ -117,27 +117,12 @@ xf86BusConfig(void) screenLayoutPtr layout; int i, j; - /* Enable full I/O access */ - if (xorgHWAccess) - xorgHWAccess = xf86EnableIO(); - /* * Now call each of the Probe functions. Each successful probe will * result in an extra entry added to the xf86Screens[] list for each * instance of the hardware found. */ for (i = 0; i < xf86NumDrivers; i++) { - xorgHWFlags flags; - - if (!xorgHWAccess) { - if (!xf86DriverList[i]->driverFunc - || !xf86DriverList[i]->driverFunc(NULL, - GET_REQUIRED_HW_INTERFACES, - &flags) - || NEED_IO_ENABLED(flags)) - continue; - } - xf86CallDriverProbe(xf86DriverList[i], FALSE); } diff --git a/xorg-server/hw/xfree86/common/xf86Configure.c b/xorg-server/hw/xfree86/common/xf86Configure.c index 6f69117d3..6c5e35919 100644 --- a/xorg-server/hw/xfree86/common/xf86Configure.c +++ b/xorg-server/hw/xfree86/common/xf86Configure.c @@ -545,41 +545,16 @@ DoConfigure(void) free(vlist); - for (i = 0; i < xf86NumDrivers; i++) { - xorgHWFlags flags; - - if (!xf86DriverList[i]->driverFunc - || !xf86DriverList[i]->driverFunc(NULL, - GET_REQUIRED_HW_INTERFACES, - &flags) - || NEED_IO_ENABLED(flags)) { - xorgHWAccess = TRUE; - break; - } - } - /* Enable full I/O access */ - if (xorgHWAccess) { - if (!xf86EnableIO()) - /* oops, we have failed */ - xorgHWAccess = FALSE; - } + xorgHWAccess = xf86EnableIO(); /* Create XF86Config file structure */ xf86config = calloc(1, sizeof(XF86ConfigRec)); /* Call all of the probe functions, reporting the results. */ for (CurrentDriver = 0; CurrentDriver < xf86NumDrivers; CurrentDriver++) { - xorgHWFlags flags; Bool found_screen; DriverRec *const drv = xf86DriverList[CurrentDriver]; - if (!xorgHWAccess) { - if (!drv->driverFunc - || !drv->driverFunc(NULL, GET_REQUIRED_HW_INTERFACES, &flags) - || NEED_IO_ENABLED(flags)) - continue; - } - found_screen = xf86CallDriverProbe(drv, TRUE); if (found_screen && drv->Identify) { (*drv->Identify) (0); diff --git a/xorg-server/hw/xfree86/common/xf86Init.c b/xorg-server/hw/xfree86/common/xf86Init.c index e4a6b8613..1695dbf74 100644 --- a/xorg-server/hw/xfree86/common/xf86Init.c +++ b/xorg-server/hw/xfree86/common/xf86Init.c @@ -402,6 +402,7 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv) Bool pix24Fail = FALSE; Bool autoconfig = FALSE; Bool sigio_blocked = FALSE; + Bool want_hw_access = FALSE; GDevPtr configured_device; xf86Initialising = TRUE; @@ -530,23 +531,21 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv) */ for (i = 0; i < xf86NumDrivers; i++) { + xorgHWFlags flags = HW_IO; + if (xf86DriverList[i]->Identify != NULL) xf86DriverList[i]->Identify(0); - if (!xorgHWAccess || !xorgHWOpenConsole) { - xorgHWFlags flags; + if (xf86DriverList[i]->driverFunc) + xf86DriverList[i]->driverFunc(NULL, + GET_REQUIRED_HW_INTERFACES, + &flags); - if (!xf86DriverList[i]->driverFunc - || !xf86DriverList[i]->driverFunc(NULL, - GET_REQUIRED_HW_INTERFACES, - &flags)) - flags = HW_IO; + if (NEED_IO_ENABLED(flags)) + want_hw_access = TRUE; - if (NEED_IO_ENABLED(flags)) - xorgHWAccess = TRUE; - if (!(flags & HW_SKIP_CONSOLE)) - xorgHWOpenConsole = TRUE; - } + if (!(flags & HW_SKIP_CONSOLE)) + xorgHWOpenConsole = TRUE; } if (xorgHWOpenConsole) @@ -554,6 +553,10 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv) else xf86Info.dontVTSwitch = TRUE; + /* Enable full I/O access */ + if (want_hw_access) + xorgHWAccess = xf86EnableIO(); + if (xf86BusConfig() == FALSE) return; diff --git a/xorg-server/hw/xfree86/common/xf86Priv.h b/xorg-server/hw/xfree86/common/xf86Priv.h index c9f2e7eb8..58cfe0a1a 100644 --- a/xorg-server/hw/xfree86/common/xf86Priv.h +++ b/xorg-server/hw/xfree86/common/xf86Priv.h @@ -91,7 +91,6 @@ extern _X_EXPORT int xf86NumScreens; extern _X_EXPORT const char *xf86VisualNames[]; extern _X_EXPORT int xf86Verbose; /* verbosity level */ extern _X_EXPORT int xf86LogVerbose; /* log file verbosity level */ -extern _X_EXPORT Bool xorgHWAccess; extern _X_EXPORT RootWinPropPtr *xf86RegisteredPropertiesTable; diff --git a/xorg-server/hw/xfree86/doc/ddxDesign.xml b/xorg-server/hw/xfree86/doc/ddxDesign.xml index 4c2ca47da..7c2c20ff3 100644 --- a/xorg-server/hw/xfree86/doc/ddxDesign.xml +++ b/xorg-server/hw/xfree86/doc/ddxDesign.xml @@ -3560,13 +3560,6 @@ The following include files are typically required by video drivers: - - All drivers implementing backing store need this: - - "mibstore.h" - - - All drivers using the mi colourmap code need this: @@ -8091,13 +8084,6 @@ visible symbols. - - All drivers implementing backing store need this: - - "mibstore.h" - - - All drivers using the mi colourmap code need this: @@ -9102,12 +9088,6 @@ ZZZScreenInit(ScreenPtr pScreen, int argc, char **argv) pScrn->displayWidth, pBankInfo)) return FALSE; - /* - * If backing store is to be supported (as is usually the case), - * initialise it. - */ - miInitializeBackingStore(pScreen); - /* * Set initial black & white colourmap indices. */ diff --git a/xorg-server/hw/xfree86/os-support/linux/lnx_video.c b/xorg-server/hw/xfree86/os-support/linux/lnx_video.c index 3526a21d4..d9a5da184 100644 --- a/xorg-server/hw/xfree86/os-support/linux/lnx_video.c +++ b/xorg-server/hw/xfree86/os-support/linux/lnx_video.c @@ -479,45 +479,39 @@ volatile unsigned char *ioBase = NULL; #define __NR_pciconfig_iobase 200 #endif -#endif - -Bool -xf86EnableIO(void) +static Bool +hwEnableIO(void) { -#if defined(__powerpc__) int fd; - unsigned int ioBase_phys; -#endif - - if (ExtendedEnabled) - return TRUE; - -#if defined(__powerpc__) - ioBase_phys = syscall(__NR_pciconfig_iobase, 2, 0, 0); + unsigned int ioBase_phys = syscall(__NR_pciconfig_iobase, 2, 0, 0); fd = open("/dev/mem", O_RDWR); if (ioBase == NULL) { ioBase = (volatile unsigned char *) mmap(0, 0x20000, PROT_READ | PROT_WRITE, MAP_SHARED, fd, ioBase_phys); -/* Should this be fatal or just a warning? */ -#if 0 - if (ioBase == MAP_FAILED) { - xf86Msg(X_WARNING, - "xf86EnableIOPorts: Failed to map iobase (%s)\n", - strerror(errno)); - return FALSE; - } -#endif } close(fd); -#elif !defined(__mc68000__) && !defined(__sparc__) && !defined(__mips__) && !defined(__sh__) && !defined(__hppa__) && !defined(__s390__) && !defined(__arm__) && !defined(__m32r__) && !defined(__nds32__) + + return ioBase != MAP_FAILED; +} + +static void +hwDisableIO(void) +{ + munmap(ioBase, 0x20000); + ioBase = NULL; +} + +#elif defined(__i386__) || defined(__x86_64__) || defined(__ia64__) || \ + defined(__alpha__) + +static Bool +hwEnableIO(void) +{ if (ioperm(0, 1024, 1) || iopl(3)) { - if (errno == ENODEV) - ErrorF("xf86EnableIOPorts: no I/O ports found\n"); - else - FatalError("xf86EnableIOPorts: failed to set IOPL" - " for I/O (%s)\n", strerror(errno)); + ErrorF("xf86EnableIOPorts: failed to set IOPL for I/O (%s)\n", + strerror(errno)); return FALSE; } #if !defined(__alpha__) @@ -526,27 +520,44 @@ xf86EnableIO(void) ioperm(0x40, 4, 0); /* trap access to the timer chip */ ioperm(0x60, 4, 0); /* trap access to the keyboard controller */ #endif -#endif - ExtendedEnabled = TRUE; return TRUE; } +static void +hwDisableIO(void) +{ + iopl(0); + ioperm(0, 1024, 0); +} + +#else /* non-IO architectures */ + +#define hwEnableIO() TRUE +#define hwDisableIO() do {} while (0) + +#endif + +Bool +xf86EnableIO(void) +{ + if (ExtendedEnabled) + return TRUE; + + ExtendedEnabled = hwEnableIO(); + + return ExtendedEnabled; +} + void xf86DisableIO(void) { if (!ExtendedEnabled) return; -#if defined(__powerpc__) - munmap(ioBase, 0x20000); - ioBase = NULL; -#elif !defined(__mc68000__) && !defined(__sparc__) && !defined(__mips__) && !defined(__sh__) && !defined(__hppa__) && !defined(__arm__) && !defined(__s390__) && !defined(__m32r__) && !defined(__nds32__) - iopl(0); - ioperm(0, 1024, 0); -#endif - ExtendedEnabled = FALSE; - return; + hwDisableIO(); + + ExtendedEnabled = FALSE; } #if defined (__alpha__) diff --git a/xorg-server/hw/xfree86/sdksyms.sh b/xorg-server/hw/xfree86/sdksyms.sh index 07372ad1c..fa1989379 100644 --- a/xorg-server/hw/xfree86/sdksyms.sh +++ b/xorg-server/hw/xfree86/sdksyms.sh @@ -207,7 +207,6 @@ cat > sdksyms.c << EOF #include "miline.h" #include "mipointer.h" #include "mi.h" -#include "mibstore.h" #include "migc.h" #include "mipointrst.h" #include "mizerarc.h" diff --git a/xorg-server/hw/xnest/Screen.c b/xorg-server/hw/xnest/Screen.c index 7b3c1b361..58b5a1199 100644 --- a/xorg-server/hw/xnest/Screen.c +++ b/xorg-server/hw/xnest/Screen.c @@ -21,7 +21,6 @@ is" without express or implied warranty. #include "scrnintstr.h" #include "dix.h" #include "mi.h" -#include "mibstore.h" #include "micmap.h" #include "colormapst.h" #include "resource.h" diff --git a/xorg-server/hw/xnest/Visual.c b/xorg-server/hw/xnest/Visual.c index 63198ba4f..11673c44a 100644 --- a/xorg-server/hw/xnest/Visual.c +++ b/xorg-server/hw/xnest/Visual.c @@ -21,7 +21,6 @@ is" without express or implied warranty. #include "scrnintstr.h" #include "dix.h" #include "mi.h" -#include "mibstore.h" #include "Xnest.h" #include "Display.h" diff --git a/xorg-server/hw/xquartz/darwin.c b/xorg-server/hw/xquartz/darwin.c index d26f18a12..bf511801d 100644 --- a/xorg-server/hw/xquartz/darwin.c +++ b/xorg-server/hw/xquartz/darwin.c @@ -38,7 +38,6 @@ #include "servermd.h" #include "inputstr.h" #include "scrnintstr.h" -#include "mibstore.h" // mi backing store implementation #include "mipointer.h" // mi software cursor #include "micmap.h" // mi colormap code #include "fb.h" // fb framebuffer code diff --git a/xorg-server/hw/xquartz/xpr/dri.c b/xorg-server/hw/xquartz/xpr/dri.c index 03af163f7..adba69cca 100644 --- a/xorg-server/hw/xquartz/xpr/dri.c +++ b/xorg-server/hw/xquartz/xpr/dri.c @@ -64,6 +64,7 @@ #include "mi.h" #include "mipointer.h" #include "rootless.h" +#include "rootlessCommon.h" #include "x-hash.h" #include "x-hook.h" #include "driWrap.h" @@ -380,6 +381,11 @@ DRICreateSurface(ScreenPtr pScreen, Drawable id, DRIDrawablePrivPtr pDRIDrawablePriv; if (pDrawable->type == DRAWABLE_WINDOW) { + /* + * http://bugs.winehq.org/show_bug.cgi?id=31751 + */ + RootlessStopDrawing((WindowPtr)pDrawable, FALSE); + pDRIDrawablePriv = CreateSurfaceForWindow(pScreen, (WindowPtr)pDrawable, &wid); diff --git a/xorg-server/hw/xquartz/xpr/xprFrame.c b/xorg-server/hw/xquartz/xpr/xprFrame.c index 01f1def20..aad375b52 100644 --- a/xorg-server/hw/xquartz/xpr/xprFrame.c +++ b/xorg-server/hw/xquartz/xpr/xprFrame.c @@ -49,6 +49,10 @@ #include #endif +#ifdef DEBUG_XP_LOCK_WINDOW +#include +#endif + #define DEFINE_ATOM_HELPER(func, atom_name) \ static Atom func(void) { \ static int generation; \ @@ -376,6 +380,18 @@ xprStartDrawing(RootlessFrameID wid, char **pixelData, int *bytesPerRow) unsigned int rowbytes[2]; xp_error err; +#ifdef DEBUG_XP_LOCK_WINDOW + void* callstack[128]; + int i, frames = backtrace(callstack, 128); + char** strs = backtrace_symbols(callstack, frames); + + ErrorF("=== LOCK %d ===\n", (int)x_cvt_vptr_to_uint(wid)); + for (i = 0; i < frames; ++i) { + ErrorF(" %s\n", strs[i]); + } + free(strs); +#endif + err = xp_lock_window(x_cvt_vptr_to_uint( wid), NULL, NULL, data, rowbytes, NULL); if (err != Success) @@ -395,6 +411,18 @@ xprStopDrawing(RootlessFrameID wid, Bool flush) { xp_error err; +#ifdef DEBUG_XP_LOCK_WINDOW + void* callstack[128]; + int i, frames = backtrace(callstack, 128); + char** strs = backtrace_symbols(callstack, frames); + + ErrorF("=== UNLOCK %d ===\n", (int)x_cvt_vptr_to_uint(wid)); + for (i = 0; i < frames; ++i) { + ErrorF(" %s\n", strs[i]); + } + free(strs); +#endif + err = xp_unlock_window(x_cvt_vptr_to_uint(wid), flush); /* This should be a FatalError, but we started tripping over it. Make it a * FatalError after http://xquartz.macosforge.org/trac/ticket/482 is fixed. diff --git a/xorg-server/hw/xwin/win.h b/xorg-server/hw/xwin/win.h index 89e2a38c9..08d0d3f92 100644 --- a/xorg-server/hw/xwin/win.h +++ b/xorg-server/hw/xwin/win.h @@ -169,7 +169,6 @@ #include "micmap.h" #include "mifillarc.h" #include "mifpoly.h" -#include "mibstore.h" #include "input.h" #include "mipointer.h" #include "X11/keysym.h" diff --git a/xorg-server/include/window.h b/xorg-server/include/window.h index f8fc2a5fe..b6d61c339 100644 --- a/xorg-server/include/window.h +++ b/xorg-server/include/window.h @@ -221,9 +221,6 @@ extern _X_EXPORT RegionPtr CreateBoundingShape(WindowPtr /* pWin */ ); extern _X_EXPORT RegionPtr CreateClipShape(WindowPtr /* pWin */ ); -extern _X_EXPORT void DisableMapUnmapEvents(WindowPtr /* pWin */ ); -extern _X_EXPORT void EnableMapUnmapEvents(WindowPtr /* pWin */ ); - extern _X_EXPORT void SetRootClip(ScreenPtr pScreen, Bool enable); extern _X_EXPORT void PrintWindowTree(void); diff --git a/xorg-server/mi/Makefile.am b/xorg-server/mi/Makefile.am index daf272814..0cef7798f 100644 --- a/xorg-server/mi/Makefile.am +++ b/xorg-server/mi/Makefile.am @@ -1,64 +1,63 @@ -noinst_LTLIBRARIES = libmi.la - -if XORG -sdk_HEADERS = micmap.h miline.h mipointer.h mi.h mibstore.h \ - migc.h mipointrst.h mizerarc.h micoord.h mifillarc.h \ - mispans.h miwideline.h mistruct.h mifpoly.h mioverlay.h -endif - -AM_CFLAGS = $(DIX_CFLAGS) - -libmi_la_SOURCES = \ - mi.h \ - miarc.c \ - mibitblt.c \ - mibstore.h \ - micmap.c \ - micmap.h \ - micoord.h \ - micopy.c \ - micursor.c \ - midash.c \ - midispcur.c \ - mieq.c \ - miexpose.c \ - mifillarc.c \ - mifillarc.h \ - mifillrct.c \ - mifpolycon.c \ - mifpoly.h \ - migc.c \ - migc.h \ - miglblt.c \ - miline.h \ - mioverlay.c \ - mioverlay.h \ - mipointer.c \ - mipointer.h \ - mipointrst.h \ - mipoly.c \ - mipoly.h \ - mipolycon.c \ - mipolygen.c \ - mipolypnt.c \ - mipolyrect.c \ - mipolyseg.c \ - mipolytext.c \ - mipolyutil.c \ - mipushpxl.c \ - miscanfill.h \ - miscrinit.c \ - mispans.c \ - mispans.h \ - misprite.c \ - misprite.h \ - mistruct.h \ - mivaltree.c \ - mivalidate.h \ - miwideline.c \ - miwideline.h \ - miwindow.c \ - mizerarc.c \ - mizerarc.h \ - mizerclip.c \ - mizerline.c +noinst_LTLIBRARIES = libmi.la + +if XORG +sdk_HEADERS = micmap.h miline.h mipointer.h mi.h \ + migc.h mipointrst.h mizerarc.h micoord.h mifillarc.h \ + mispans.h miwideline.h mistruct.h mifpoly.h mioverlay.h +endif + +AM_CFLAGS = $(DIX_CFLAGS) + +libmi_la_SOURCES = \ + mi.h \ + miarc.c \ + mibitblt.c \ + micmap.c \ + micmap.h \ + micoord.h \ + micopy.c \ + micursor.c \ + midash.c \ + midispcur.c \ + mieq.c \ + miexpose.c \ + mifillarc.c \ + mifillarc.h \ + mifillrct.c \ + mifpolycon.c \ + mifpoly.h \ + migc.c \ + migc.h \ + miglblt.c \ + miline.h \ + mioverlay.c \ + mioverlay.h \ + mipointer.c \ + mipointer.h \ + mipointrst.h \ + mipoly.c \ + mipoly.h \ + mipolycon.c \ + mipolygen.c \ + mipolypnt.c \ + mipolyrect.c \ + mipolyseg.c \ + mipolytext.c \ + mipolyutil.c \ + mipushpxl.c \ + miscanfill.h \ + miscrinit.c \ + mispans.c \ + mispans.h \ + misprite.c \ + misprite.h \ + mistruct.h \ + mivaltree.c \ + mivalidate.h \ + miwideline.c \ + miwideline.h \ + miwindow.c \ + mizerarc.c \ + mizerarc.h \ + mizerclip.c \ + mizerline.c diff --git a/xorg-server/mi/mibstore.c b/xorg-server/mi/mibstore.c deleted file mode 100644 index 6cadb2b8f..000000000 --- a/xorg-server/mi/mibstore.c +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2007 Red Hat, Inc. - * - * 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. - */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif -#include "scrnintstr.h" -#include "mibstore.h" - -/* - * There is no longer an mi implementation of backing store. This function - * is only for source compatibility with old drivers. - * - * Note though that you do get backing store for free if your server has - * Composite enabled, since the automatic redirection mechanism provides - * essentially the same functionality. See compChangeWindowAttributes() - * for the implementation. - */ - -void -miInitializeBackingStore(ScreenPtr pScreen) -{ -} diff --git a/xorg-server/mi/mibstore.h b/xorg-server/mi/mibstore.h deleted file mode 100644 index f8ed4446d..000000000 --- a/xorg-server/mi/mibstore.h +++ /dev/null @@ -1,23 +0,0 @@ -/*- - * mibstore.h -- - * Header file for users of the MI backing-store scheme. - * - * Copyright (c) 1987 by the Regents of the University of California - * - * Permission to use, copy, modify, and distribute this - * software and its documentation for any purpose and without - * fee is hereby granted, provided that the above copyright - * notice appear in all copies. The University of California - * makes no representations about the suitability of this - * software for any purpose. It is provided "as is" without - * express or implied warranty. - */ - -#ifndef _MIBSTORE_H -#define _MIBSTORE_H - -#include "screenint.h" - -#define miInitializeBackingStore(x) do {} while (0) - -#endif /* _MIBSTORE_H */ diff --git a/xorg-server/miext/damage/damage.c b/xorg-server/miext/damage/damage.c index 2d2b4228f..a98c20ec0 100644 --- a/xorg-server/miext/damage/damage.c +++ b/xorg-server/miext/damage/damage.c @@ -436,9 +436,13 @@ damageCreateGC(GCPtr pGC) static void damageValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable) { + drawableDamage(pDrawable); DAMAGE_GC_FUNC_PROLOGUE(pGC); (*pGC->funcs->ValidateGC) (pGC, changes, pDrawable); - pGCPriv->ops = pGC->ops; /* just so it's not NULL */ + if (pDamage) + pGCPriv->ops = pGC->ops; /* so it's not NULL, so FUNC_EPILOGUE does work */ + else + pGCPriv->ops = NULL; DAMAGE_GC_FUNC_EPILOGUE(pGC); } @@ -1663,14 +1667,38 @@ miDamageCreate(DamagePtr pDamage) { } +/* + * We only wrap into the GC when there's a registered listener. For windows, + * damage includes damage to children. So if there's a GC validated against + * a subwindow and we then register a damage on the parent, we need to bump + * the serial numbers of the children to re-trigger validation. + * + * Since we can't know if a GC has been validated against one of the affected + * children, just bump them all to be safe. + */ +static int +damageRegisterVisit(WindowPtr pWin, void *data) +{ + pWin->drawable.serialNumber = NEXT_SERIAL_NUMBER; + return WT_WALKCHILDREN; +} + void miDamageRegister(DrawablePtr pDrawable, DamagePtr pDamage) { + if (pDrawable->type == DRAWABLE_WINDOW) + TraverseTree((WindowPtr)pDrawable, damageRegisterVisit, NULL); + else + pDrawable->serialNumber = NEXT_SERIAL_NUMBER; } void miDamageUnregister(DrawablePtr pDrawable, DamagePtr pDamage) { + if (pDrawable->type == DRAWABLE_WINDOW) + TraverseTree((WindowPtr)pDrawable, damageRegisterVisit, NULL); + else + pDrawable->serialNumber = NEXT_SERIAL_NUMBER; } void diff --git a/xorg-server/xkeyboard-config/symbols/lv b/xorg-server/xkeyboard-config/symbols/lv index 6bd15e60d..567caa658 100644 --- a/xorg-server/xkeyboard-config/symbols/lv +++ b/xorg-server/xkeyboard-config/symbols/lv @@ -1,3 +1,4 @@ +// $XKeyboardConfig$ // Latvian keymap version 1.1 // Copyright (C) Dmitry Golubev , 2003-2004 // @@ -279,10 +280,10 @@ xkb_symbols "modern" { key {[ emacron, Emacron, emacron, Emacron ]}; key {[ o, O, omacron, Omacron ]}; key {[ amacron, Amacron, amacron, Amacron ]}; - key {[ p, P, p, P ]}; - key {[ b, B, b, B ]}; - key {[ j, J, j, J ]}; - key {[ d, D, d, D ]}; + key {[ p, P, question, P ]}; + key {[ b, B, exclam, B ]}; + key {[ j, J, emdash, J ]}; + key {[ d, D, endash, D ]}; key {[ imacron, Imacron, imacron, Imacron ]}; key {[ l, L, lcedilla, Lcedilla ]}; key {[ g, G, gcedilla, Gcedilla ]}; @@ -306,10 +307,10 @@ xkb_symbols "modern" { key {[ x, X, q, Q ]}; key {[ z, Z, zcaron, Zcaron ]}; key {[ c, C, ccaron, Ccaron ]}; - key {[ v, V, period, V ]}; - key {[ w, W, slash, W ]}; - key {[ f, F, bar, F ]}; - key {[ y, Y, backslash, Y ]}; + key {[ v, V, bar, V ]}; + key {[ w, W, backslash, W ]}; + key {[ f, F, period, F ]}; + key {[ y, Y, slash, Y ]}; key {[ h, H, U263A, U2639 ]}; key {[ comma, semicolon, less, multiply ]}; key {[ period, colon, greater, division ]}; -- cgit v1.2.3