[cogl] cogl-1.8.2-no-drm-hax.patch: Don't try insane direct DRM vblank wait.
Adam Jackson
ajax at fedoraproject.org
Tue Nov 1 21:11:44 UTC 2011
commit c6fc02e4b0d486c841556a3f5cc7d0b8dd5317f8
Author: Adam Jackson <ajax at redhat.com>
Date: Tue Nov 1 21:10:49 2011 -0400
cogl-1.8.2-no-drm-hax.patch: Don't try insane direct DRM vblank wait.
cogl-1.8.2-no-drm-hax.patch | 84 +++++++++++++++++++++++++++++++++++++++++++
cogl.spec | 8 ++++-
2 files changed, 91 insertions(+), 1 deletions(-)
---
diff --git a/cogl-1.8.2-no-drm-hax.patch b/cogl-1.8.2-no-drm-hax.patch
new file mode 100644
index 0000000..e19a385
--- /dev/null
+++ b/cogl-1.8.2-no-drm-hax.patch
@@ -0,0 +1,84 @@
+No, no, no, no, no. If the driver doesn't give you the events you want,
+fix the driver.
+
+diff -up cogl-1.8.2/cogl/winsys/cogl-winsys-glx.c.jx cogl-1.8.2/cogl/winsys/cogl-winsys-glx.c
+--- cogl-1.8.2/cogl/winsys/cogl-winsys-glx.c.jx 2011-10-17 09:23:13.000000000 -0400
++++ cogl-1.8.2/cogl/winsys/cogl-winsys-glx.c 2011-11-01 18:34:38.731529285 -0400
+@@ -56,12 +56,6 @@
+ #include <GL/glx.h>
+ #include <X11/Xlib.h>
+
+-#ifdef HAVE_DRM
+-#include <drm.h>
+-#include <sys/ioctl.h>
+-#include <errno.h>
+-#endif
+-
+ #define COGL_ONSCREEN_X11_EVENT_MASK StructureNotifyMask
+
+ typedef struct _CoglContextGLX
+@@ -423,20 +417,6 @@ update_winsys_features (CoglContext *con
+ COGL_WINSYS_FEATURE_VBLANK_WAIT,
+ TRUE);
+
+-#ifdef HAVE_DRM
+- /* drm is really an extreme fallback -rumoured to work with Via
+- * chipsets... */
+- if (!glx_renderer->pf_glXWaitVideoSync)
+- {
+- if (glx_renderer->dri_fd < 0)
+- glx_renderer->dri_fd = open("/dev/dri/card0", O_RDWR);
+- if (glx_renderer->dri_fd >= 0)
+- COGL_FLAGS_SET (context->winsys_features,
+- COGL_WINSYS_FEATURE_VBLANK_WAIT,
+- TRUE);
+- }
+-#endif
+-
+ if (glx_renderer->pf_glXCopySubBuffer || context->glBlitFramebuffer)
+ COGL_FLAGS_SET (context->winsys_features,
+ COGL_WINSYS_FEATURE_SWAP_REGION, TRUE);
+@@ -1046,24 +1026,6 @@ _cogl_winsys_onscreen_bind (CoglOnscreen
+ glx_context->current_drawable = drawable;
+ }
+
+-#ifdef HAVE_DRM
+-static int
+-drm_wait_vblank (int fd, drm_wait_vblank_t *vbl)
+-{
+- int ret, rc;
+-
+- do
+- {
+- ret = ioctl (fd, DRM_IOCTL_WAIT_VBLANK, vbl);
+- vbl->request.type &= ~_DRM_VBLANK_RELATIVE;
+- rc = errno;
+- }
+- while (ret && rc == EINTR);
+-
+- return rc;
+-}
+-#endif /* HAVE_DRM */
+-
+ static void
+ _cogl_winsys_wait_for_vblank (void)
+ {
+@@ -1082,18 +1044,6 @@ _cogl_winsys_wait_for_vblank (void)
+ (current_count + 1) % 2,
+ ¤t_count);
+ }
+-#ifdef HAVE_DRM
+- else
+- {
+- drm_wait_vblank_t blank;
+-
+- COGL_NOTE (WINSYS, "Waiting for vblank (drm)");
+- blank.request.type = _DRM_VBLANK_RELATIVE;
+- blank.request.sequence = 1;
+- blank.request.signal = 0;
+- drm_wait_vblank (glx_renderer->dri_fd, &blank);
+- }
+-#endif /* HAVE_DRM */
+ }
+
+ static guint32
diff --git a/cogl.spec b/cogl.spec
index f4f7c2b..1c0ad33 100644
--- a/cogl.spec
+++ b/cogl.spec
@@ -1,6 +1,6 @@
Name: cogl
Version: 1.8.2
-Release: 2%{?dist}
+Release: 3%{?dist}
Summary: A library for using 3D graphics hardware to draw pretty pictures
Group: Development/Libraries
@@ -21,6 +21,8 @@ BuildRequires: mesa-libGL-devel
BuildRequires: pango-devel
BuildRequires: pkgconfig
+Patch0: cogl-1.8.2-no-drm-hax.patch
+
%description
Cogl is a small open source library for using 3D graphics hardware to draw
pretty pictures. The API departs from the flat state machine style of
@@ -60,6 +62,7 @@ This package contains documentation for %{name}.
%prep
%setup -q
+%patch0 -p1 -b .drm
%build
CFLAGS="$RPM_OPT_FLAGS -fPIC"
@@ -96,6 +99,9 @@ find %{buildroot} -name '*.la' -exec rm -f {} ';'
%{_datadir}/gtk-doc/html/cogl-2.0-experimental
%changelog
+* Tue Nov 01 2011 Adam Jackson <ajax at redhat.com> 1.8.2-3
+- cogl-1.8.2-no-drm-hax.patch: Don't try insane direct DRM vblank wait.
+
* Wed Oct 26 2011 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.8.2-2
- Rebuilt for glibc bug#747377
More information about the scm-commits
mailing list