From cf6bc1aeaeaf7cf178668b7ee3154b8b84601d1f Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 7 Mar 2011 21:16:34 +0000 Subject: [PATCH] * Apply a patch to prevent the X server from segfaulting if kwin is run with swrast_dri (e.g. with the VGA driver). (NixOS/121) svn path=/nixpkgs/branches/x-updates/; revision=26201 --- pkgs/development/libraries/mesa/default.nix | 2 ++ .../libraries/mesa/swrast-settexbuffer.patch | 24 +++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 pkgs/development/libraries/mesa/swrast-settexbuffer.patch diff --git a/pkgs/development/libraries/mesa/default.nix b/pkgs/development/libraries/mesa/default.nix index c2c61f901a9f..c769bd64c533 100644 --- a/pkgs/development/libraries/mesa/default.nix +++ b/pkgs/development/libraries/mesa/default.nix @@ -14,6 +14,8 @@ stdenv.mkDerivation { md5 = "efe8da4d80c2a5d32a800770b8ce5dfa"; }; + patches = [ ./swrast-settexbuffer.patch ]; + configureFlags = "--disable-gallium" + stdenv.lib.optionalString (stdenv.system == "mips64-linux") diff --git a/pkgs/development/libraries/mesa/swrast-settexbuffer.patch b/pkgs/development/libraries/mesa/swrast-settexbuffer.patch new file mode 100644 index 000000000000..c74daa3aef12 --- /dev/null +++ b/pkgs/development/libraries/mesa/swrast-settexbuffer.patch @@ -0,0 +1,24 @@ +https://build.opensuse.org/package/view_file?file=0001-Fix-crash-in-swrast-when-setting-a-texture-for-a-pix.patch&package=Mesa&project=openSUSE%3AFactory&srcmd5=be25d34ad69853c2bb21ed376061d573 + +diff -ru Mesa-7.10.1-orig//src/mesa/drivers/dri/swrast/swrast.c Mesa-7.10.1//src/mesa/drivers/dri/swrast/swrast.c +--- Mesa-7.10.1-orig//src/mesa/drivers/dri/swrast/swrast.c 2010-12-14 22:43:15.000000000 +0100 ++++ Mesa-7.10.1//src/mesa/drivers/dri/swrast/swrast.c 2011-03-07 18:08:17.062816112 +0100 +@@ -61,6 +61,7 @@ + static void swrastSetTexBuffer2(__DRIcontext *pDRICtx, GLint target, + GLint texture_format, __DRIdrawable *dPriv) + { ++ GET_CURRENT_CONTEXT(ctx); + struct dri_context *dri_ctx; + int x, y, w, h; + __DRIscreen *sPriv = dPriv->driScreenPriv; +@@ -90,6 +91,10 @@ + _mesa_init_teximage_fields(&dri_ctx->Base, target, texImage, + w, h, 1, 0, internalFormat, texFormat); + ++ ctx->Driver.TexImage2D(ctx, target, 0, internalFormat, ++ w, h, 0, texture_format, GL_UNSIGNED_INT_8_8_8_8, ++ NULL, &ctx->Unpack, texObj, texImage); ++ + sPriv->swrast_loader->getImage(dPriv, x, y, w, h, (char *)texImage->Data, + dPriv->loaderPrivate); +