[xorg-x11-drv-omap] Add upstream patch to fix page flip bugs
Peter Robinson
pbrobinson at fedoraproject.org
Sat Jun 1 18:42:55 UTC 2013
commit 2708b02ba2058f810daa9a0d9fc8ff13bd526ff1
Author: Peter Robinson <pbrobinson at gmail.com>
Date: Sat Jun 1 19:42:35 2013 +0100
Add upstream patch to fix page flip bugs
xorg-omap-fix-pageflip.patch | 59 ++++++++++++++++++++++++++++++++++++++++++
xorg-x11-drv-omap.spec | 7 ++++-
2 files changed, 65 insertions(+), 1 deletions(-)
---
diff --git a/xorg-omap-fix-pageflip.patch b/xorg-omap-fix-pageflip.patch
new file mode 100644
index 0000000..b46fd6b
--- /dev/null
+++ b/xorg-omap-fix-pageflip.patch
@@ -0,0 +1,59 @@
+diff --git a/src/drmmode_display.c b/src/drmmode_display.c
+index c3cf4f8..77f7575 100644
+--- a/src/drmmode_display.c
++++ b/src/drmmode_display.c
+@@ -1314,6 +1314,7 @@ drmmode_remove_fb(ScrnInfoPtr pScrn)
+ typedef struct {
+ drmmode_ptr mode;
+ uint32_t old_fb_id;
++ int flip_count;
+ void *priv;
+ } drmmode_flipdata_rec, *drmmode_flipdata_ptr;
+
+@@ -1322,9 +1323,11 @@ page_flip_handler(int fd, unsigned int sequence, unsigned int tv_sec,
+ unsigned int tv_usec, void *user_data)
+ {
+ drmmode_flipdata_ptr flipdata = user_data;
+- OMAPDRI2SwapComplete(flipdata->priv);
+- drmModeRmFB(flipdata->mode->fd, flipdata->old_fb_id);
+- free(flipdata);
++ if (--(flipdata->flip_count) <= 0) {
++ OMAPDRI2SwapComplete(flipdata->priv);
++ drmModeRmFB(flipdata->mode->fd, flipdata->old_fb_id);
++ free(flipdata);
++ }
+ }
+
+ static drmEventContext event_context = {
+@@ -1361,6 +1364,7 @@ drmmode_page_flip(DrawablePtr pDraw, PixmapPtr back, void *priv)
+ flipdata->priv = priv;
+ flipdata->mode = mode;
+ flipdata->old_fb_id = old_fb_id;
++ flipdata->flip_count = 0;
+
+ DEBUG_MSG("flip: %d -> %d", mode->fb_id, old_fb_id);
+
+@@ -1368,6 +1372,13 @@ drmmode_page_flip(DrawablePtr pDraw, PixmapPtr back, void *priv)
+ for (i = 0; i < config->num_crtc; i++) {
+ crtc = config->crtc[i]->driver_private;
+
++ if (config->crtc[i]->enabled)
++ flipdata->flip_count++;
++ }
++
++ for (i = 0; i < config->num_crtc; i++) {
++ crtc = config->crtc[i]->driver_private;
++
+ if (!config->crtc[i]->enabled)
+ continue;
+
+@@ -1375,7 +1386,8 @@ drmmode_page_flip(DrawablePtr pDraw, PixmapPtr back, void *priv)
+ mode->fb_id, DRM_MODE_PAGE_FLIP_EVENT, flipdata);
+ if (ret) {
+ WARNING_MSG("flip queue failed: %s", strerror(errno));
+- return FALSE;
++ free(flipdata);
++ goto error;
+ }
+ }
+
diff --git a/xorg-x11-drv-omap.spec b/xorg-x11-drv-omap.spec
index 1a2ba27..0630119 100644
--- a/xorg-x11-drv-omap.spec
+++ b/xorg-x11-drv-omap.spec
@@ -10,12 +10,13 @@
Summary: Xorg X11 omapdrm driver
Name: xorg-x11-drv-omap
Version: 0.4.3
-Release: 6%{?dist}
+Release: 7%{?dist}
URL: http://www.x.org
License: MIT
Group: User Interface/X Hardware Support
Source0: %{tarfile}
+Patch0: xorg-omap-fix-pageflip.patch
ExclusiveArch: %{arm}
@@ -40,6 +41,7 @@ X.Org X11 omapdrm driver for TI OMAP 3/4/5xxx series ARM devices.
%prep
%setup -q
+%patch0 -p1 -b .pageflip
%build
sh autogen.sh
@@ -60,6 +62,9 @@ find $RPM_BUILD_ROOT -regex ".*\.la$" | xargs rm -f --
%{_mandir}/man4/omap.4*
%changelog
+* Sat Jun 1 2013 Peter Robinson <pbrobinson at fedoraproject.org> 0.4.3-7
+- Add upstream patch to fix page flip bugs
+
* Sun Mar 31 2013 Peter Robinson <pbrobinson at fedoraproject.org> 0.4.3-6
- Rebuild
More information about the scm-commits
mailing list