From patchwork Tue Nov 10 15:52:20 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 59075 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nAAFs8Ql009885 for ; Tue, 10 Nov 2009 15:54:08 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9A1FA9EF84; Tue, 10 Nov 2009 07:54:07 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from fmsmga101.fm.intel.com (mga05.intel.com [192.55.52.89]) by gabe.freedesktop.org (Postfix) with ESMTP id ED99E9E826 for ; Tue, 10 Nov 2009 07:54:05 -0800 (PST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 10 Nov 2009 07:49:35 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.44,716,1249282800"; d="scan'208";a="745583694" Received: from unknown (HELO localhost.localdomain) ([10.255.16.76]) by fmsmga001.fm.intel.com with ESMTP; 10 Nov 2009 08:00:32 -0800 From: Chris Wilson To: intel-gfx@lists.freedesktop.org Date: Tue, 10 Nov 2009 15:52:20 +0000 Message-Id: <1257868341-29737-1-git-send-email-chris@chris-wilson.co.uk> X-Mailer: git-send-email 1.6.5.2 Subject: [Intel-gfx] i915 forces the RGB source alpha to 1... X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.9 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org diff --git a/Xext/shm.c b/Xext/shm.c index 8106c40..74a7265 100644 --- a/Xext/shm.c +++ b/Xext/shm.c @@ -539,6 +539,30 @@ doShmPutImage(DrawablePtr dst, GCPtr pGC, PixmapPtr pPixmap; if (format == ZPixmap || depth == 1) { + if (depth == 24) { /* force the xRGB alpha channel to a sane value */ + pixman_image_t *src, *dst; + + src = pixman_image_create_bits (PIXMAN_x8r8g8b8, + w, h, + data, + PixmapBytePad(w, depth)); + dst = pixman_image_create_bits (PIXMAN_a8r8g8b8, + w, h, + data, + PixmapBytePad(w, depth)); + if (src != NULL && dst != NULL) { + pixman_image_composite (PIXMAN_OP_SRC, + src, NULL, dst, + 0, 0, 0, 0, 0, 0, + w, h); + } + + if (src != NULL) + pixman_image_unref (src); + if (dst != NULL) + pixman_image_unref (dst); + } + pPixmap = GetScratchPixmapHeader(dst->pScreen, w, h, depth, BitsPerPixel(depth), PixmapBytePad(w, depth),