Media-libs/mesa: add a patch to fix artifacts in several benchmarks.

Adding an upstream as an epatch file to fix artifacts in several benchmark
 tests. Following is the commit added:

	d523fef i965: Prefer Meta over the BLT for BlitFramebuffer.

BUG=chrome-os-partner:36184,chrome-os-partner:34760,chrome-os-partner:36557
TEST=smooth rendering on auron, yuna

Change-Id: I02b24a496f1fbd235c3c211630edb8f246895801
Signed-off-by: ravikira <ravi.k.yerraguntla@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/253750
Reviewed-by: James Ausmus <james.ausmus@intel.com>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Queue: Stéphane Marchesin <marcheu@chromium.org>
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
(cherry picked from commit f341de3bdd49801514109ad493259dfebd70950d)
Reviewed-on: https://chromium-review.googlesource.com/255691
Reviewed-by: Bernie Thompson <bhthompson@chromium.org>
Commit-Queue: Bernie Thompson <bhthompson@chromium.org>
Tested-by: Bernie Thompson <bhthompson@chromium.org>
diff --git a/media-libs/mesa/files/10.5-i965-Prefer-Meta-over-the-BLT-for-BlitFrame.patch b/media-libs/mesa/files/10.5-i965-Prefer-Meta-over-the-BLT-for-BlitFrame.patch
new file mode 100644
index 0000000..8321e9f
--- /dev/null
+++ b/media-libs/mesa/files/10.5-i965-Prefer-Meta-over-the-BLT-for-BlitFrame.patch
@@ -0,0 +1,69 @@
+From ee4d189489da730cc4778b7a50d950fae2816aed Mon Sep 17 00:00:00 2001
+From: Kenneth Graunke <kenneth@whitecape.org>
+Date: Thu, 15 Jan 2015 01:41:14 -0800
+Subject: [PATCH] [BACKPORT]i965: Prefer Meta over the BLT for
+ BlitFramebuffer.
+
+There's some debate about whether we should use Meta or BLORP,
+but either should run circles around the BLT engine.
+
+In particular, this means that Gen8+ will use the 3D engine for blits,
+like we do on Gen6-7.
+
+Improves performance in "copypixrate -blit -back" (from Mesa demos)
+by 232.037% +/- 3.15795% (n=10) on Broadwell GT3e.
+
+v2: Rebase on Laura's changes.
+
+BUG=chrome-os-partner:36184
+TEST=smooth rendering on auron, yuna
+
+Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
+Reviewed-by: Matt Turner <mattst88@gmail.com>
+Cc: "10.5" <mesa-stable@lists.freedesktop.org>
+
+Conflicts:
+
+	src/mesa/drivers/dri/i965/intel_fbo.c
+
+Change-Id: Ifb10923ee8938a24284407d1c33f592c5f2f6a71
+Signed-off-by: ravikira <ravi.k.yerraguntla@intel.com>
+---
+ src/mesa/drivers/dri/i965/intel_fbo.c |   14 +++++++-------
+ 1 file changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/src/mesa/drivers/dri/i965/intel_fbo.c b/src/mesa/drivers/dri/i965/intel_fbo.c
+index 4a03b57..0a68f45 100644
+--- a/src/mesa/drivers/dri/i965/intel_fbo.c
++++ b/src/mesa/drivers/dri/i965/intel_fbo.c
+@@ -881,6 +881,13 @@ intel_blit_framebuffer(struct gl_context *ctx,
+    if (mask == 0x0)
+       return;
+ 
++   mask = _mesa_meta_BlitFramebuffer(ctx,
++                                     srcX0, srcY0, srcX1, srcY1,
++                                     dstX0, dstY0, dstX1, dstY1,
++                                     mask, filter);
++   if (mask == 0x0)
++      return;
++
+    if (brw->gen >= 8 && (mask & GL_STENCIL_BUFFER_BIT)) {
+       brw_meta_fbo_stencil_blit(brw_context(ctx),
+                                 srcX0, srcY0, srcX1, srcY1,
+@@ -898,13 +905,6 @@ intel_blit_framebuffer(struct gl_context *ctx,
+    if (mask == 0x0)
+       return;
+ 
+-   mask = _mesa_meta_BlitFramebuffer(ctx,
+-                                     srcX0, srcY0, srcX1, srcY1,
+-                                     dstX0, dstY0, dstX1, dstY1,
+-                                     mask, filter);
+-   if (mask == 0x0)
+-      return;
+-
+    _swrast_BlitFramebuffer(ctx,
+                            srcX0, srcY0, srcX1, srcY1,
+                            dstX0, dstY0, dstX1, dstY1,
+-- 
+1.7.9.5
+
diff --git a/media-libs/mesa/mesa-10.3-r23.ebuild b/media-libs/mesa/mesa-10.3-r24.ebuild
similarity index 98%
rename from media-libs/mesa/mesa-10.3-r23.ebuild
rename to media-libs/mesa/mesa-10.3-r24.ebuild
index 4a102fc..cefcb5b 100644
--- a/media-libs/mesa/mesa-10.3-r23.ebuild
+++ b/media-libs/mesa/mesa-10.3-r24.ebuild
@@ -152,6 +152,7 @@
 	epatch "${FILESDIR}"/10.3-egl-dri2-platform_drm-should-also-try-rende.patch
 	epatch "${FILESDIR}"/10.3-dri-add-swrast-support-on-top-of-prime-imported.patch
 	epatch "${FILESDIR}"/10.3-intel-fix-EGLImage-renderbuffer-_BaseFormat.patch
+	epatch "${FILESDIR}"/10.5-i965-Prefer-Meta-over-the-BLT-for-BlitFrame.patch
 
 	base_src_prepare
 
diff --git a/media-libs/mesa/mesa-9999.ebuild b/media-libs/mesa/mesa-9999.ebuild
index 676f8e8..a772ce2 100644
--- a/media-libs/mesa/mesa-9999.ebuild
+++ b/media-libs/mesa/mesa-9999.ebuild
@@ -148,6 +148,7 @@
 	epatch "${FILESDIR}"/10.3-egl-dri2-platform_drm-should-also-try-rende.patch
 	epatch "${FILESDIR}"/10.3-dri-add-swrast-support-on-top-of-prime-imported.patch
 	epatch "${FILESDIR}"/10.3-intel-fix-EGLImage-renderbuffer-_BaseFormat.patch
+	epatch "${FILESDIR}"/10.5-i965-Prefer-Meta-over-the-BLT-for-BlitFrame.patch
 
 	base_src_prepare