[libdrm] libdrm-2.4.37-i915-hush.patch: Silence an excessive error message

Adam Jackson ajax at fedoraproject.org
Mon Jul 23 21:22:16 UTC 2012


commit f81f9d3f8c493003d9495c9e82a6b9fd95c31b09
Author: Adam Jackson <ajax at redhat.com>
Date:   Mon Jul 23 17:22:04 2012 -0400

    libdrm-2.4.37-i915-hush.patch: Silence an excessive error message

 libdrm-2.4.37-i915-hush.patch |   38 ++++++++++++++++++++++++++++++++++++++
 libdrm.spec                   |    8 +++++++-
 2 files changed, 45 insertions(+), 1 deletions(-)
---
diff --git a/libdrm-2.4.37-i915-hush.patch b/libdrm-2.4.37-i915-hush.patch
new file mode 100644
index 0000000..2def209
--- /dev/null
+++ b/libdrm-2.4.37-i915-hush.patch
@@ -0,0 +1,38 @@
+From 992e2afd59539d169689bf21d78fac8b5cea4e3c Mon Sep 17 00:00:00 2001
+From: Kenneth Graunke <kenneth at whitecape.org>
+Date: Thu, 12 Jul 2012 20:41:11 +0000
+Subject: intel: Change context create failure message to from fprintf to DBG().
+
+Since there is no getparam for hardware context support, Mesa always
+tries to obtain a context by calling drm_intel_gem_context_create and
+NULL-checking the result.  On an older kernel without context support,
+this caused libdrm to print an unwanted message to stderr:
+
+DRM_IOCTL_I915_GEM_CONTEXT_CREATE failed: Invalid argument
+
+In fact, this caused every Piglit test to fail with a "warn" status due
+to the unrecognized error message.
+
+Change the message to use DBG() rather than fprintf(), so people can
+still get the debug message, but it won't spam normally.
+
+Reviewed-by: Ben Widawsky <ben at bwidawsk.net>
+Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
+---
+diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c
+index a957c28..12a3197 100644
+--- a/intel/intel_bufmgr_gem.c
++++ b/intel/intel_bufmgr_gem.c
+@@ -2851,8 +2851,8 @@ drm_intel_gem_context_create(drm_intel_bufmgr *bufmgr)
+ 
+ 	ret = drmIoctl(bufmgr_gem->fd, DRM_IOCTL_I915_GEM_CONTEXT_CREATE, &create);
+ 	if (ret != 0) {
+-		fprintf(stderr, "DRM_IOCTL_I915_GEM_CONTEXT_CREATE failed: %s\n",
+-			strerror(errno));
++		DBG("DRM_IOCTL_I915_GEM_CONTEXT_CREATE failed: %s\n",
++		    strerror(errno));
+ 		return NULL;
+ 	}
+ 
+--
+cgit v0.9.0.2-2-gbebe
diff --git a/libdrm.spec b/libdrm.spec
index 8b9e70e..e850364 100644
--- a/libdrm.spec
+++ b/libdrm.spec
@@ -3,7 +3,7 @@
 Summary: Direct Rendering Manager runtime library
 Name: libdrm
 Version: 2.4.37
-Release: 1%{?dist}
+Release: 2%{?dist}
 License: MIT
 Group: System Environment/Libraries
 URL: http://dri.sourceforge.net
@@ -32,6 +32,8 @@ Patch3: libdrm-make-dri-perms-okay.patch
 Patch4: libdrm-2.4.0-no-bc.patch
 # make rule to print the list of test programs
 Patch5: libdrm-2.4.25-check-programs.patch
+# backport from upstream
+Patch6: libdrm-2.4.37-i915-hush.patch
 
 %description
 Direct Rendering Manager runtime library
@@ -59,6 +61,7 @@ Utility programs for the kernel DRM interface.  Will void your warranty.
 %patch3 -p1 -b .forceperms
 %patch4 -p1 -b .no-bc
 %patch5 -p1 -b .check
+%patch6 -p1 -b .hush
 
 %build
 autoreconf -v --install || exit 1
@@ -179,6 +182,9 @@ done
 %{_libdir}/pkgconfig/libdrm_nouveau.pc
 
 %changelog
+* Mon Jul 23 2012 Adam Jackson <ajax at redhat.com> 2.4.37-2
+- libdrm-2.4.37-i915-hush.patch: Silence an excessive error message
+
 * Fri Jul 13 2012 Dave Airlie <airlied at redhat.com> 2.4.37-1
 - bump to libdrm 2.4.37
 


More information about the scm-commits mailing list