[xorg-x11-drv-omap/f18] Add patch to fix rotation detection
Peter Robinson
pbrobinson at fedoraproject.org
Wed Oct 24 06:48:42 UTC 2012
commit eca578a9f409709713195f66b48e3cdf1667a778
Author: Peter Robinson <pbrobinson at gmail.com>
Date: Wed Oct 24 07:48:32 2012 +0100
Add patch to fix rotation detection
0001-fix-issue-on-pre-rotation-kernel.patch | 82 +++++++++++++++++++++++++++
xorg-x11-drv-omap.spec | 9 +++-
2 files changed, 90 insertions(+), 1 deletions(-)
---
diff --git a/0001-fix-issue-on-pre-rotation-kernel.patch b/0001-fix-issue-on-pre-rotation-kernel.patch
new file mode 100644
index 0000000..6799d40
--- /dev/null
+++ b/0001-fix-issue-on-pre-rotation-kernel.patch
@@ -0,0 +1,82 @@
+From ae0394e687f1a77e966cf72f895da91840dffb8f Mon Sep 17 00:00:00 2001
+From: Rob Clark <rob at ti.com>
+Date: Tue, 23 Oct 2012 16:01:37 -0500
+Subject: [PATCH] fix issue on pre-rotation kernel
+
+If kernel does not support rotation, then we should simply not use
+rotation, rather than just failing.
+
+Signed-off-by: Rob Clark <rob at ti.com>
+---
+ src/drmmode_display.c | 7 ++++++-
+ src/omap_driver.h | 6 ++++--
+ 2 files changed, 10 insertions(+), 3 deletions(-)
+
+diff --git a/src/drmmode_display.c b/src/drmmode_display.c
+index 91c48c5..c3cf4f8 100644
+--- a/src/drmmode_display.c
++++ b/src/drmmode_display.c
+@@ -225,9 +225,11 @@ drmmode_set_rotation(xf86CrtcPtr crtc, Rotation rotation)
+ {
+ #if XF86_CRTC_VERSION >= 4
+ ScrnInfoPtr pScrn = crtc->scrn;
++ OMAPPtr pOMAP = OMAPPTR(pScrn);
+ drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
+
+- if (!(rotation & ~SUPPORTED_ROTATIONS)) {
++ if (has_rotation(pOMAP) &&
++ !(rotation & ~SUPPORTED_ROTATIONS)) {
+ int ret;
+
+ ret = drmModeObjectSetProperty(drmmode_crtc->drmmode->fd,
+@@ -616,6 +618,7 @@ static const xf86CrtcFuncsRec drmmode_crtc_funcs = {
+ static void
+ drmmode_crtc_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int num)
+ {
++ OMAPPtr pOMAP = OMAPPTR(pScrn);
+ drmModeObjectPropertiesPtr props;
+ xf86CrtcPtr crtc;
+ drmmode_crtc_private_ptr drmmode_crtc;
+@@ -631,6 +634,7 @@ drmmode_crtc_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int num)
+ drmmode->mode_res->crtcs[num]);
+ drmmode_crtc->drmmode = drmmode;
+ drmmode_crtc->rotation = RR_Rotate_0;
++ drmmode_crtc->prop_rotation = 0;
+
+ /* find properties that we care about: */
+ props = drmModeObjectGetProperties(drmmode->fd,
+@@ -642,6 +646,7 @@ drmmode_crtc_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int num)
+ prop = drmModeGetProperty(drmmode->fd, props->props[i]);
+ if (!strcmp(prop->name, "rotation")) {
+ drmmode_crtc->prop_rotation = prop->prop_id;
++ pOMAP->rotation_supported = TRUE;
+ }
+ drmModeFreeProperty(prop);
+ }
+diff --git a/src/omap_driver.h b/src/omap_driver.h
+index 850515d..6d2517e 100644
+--- a/src/omap_driver.h
++++ b/src/omap_driver.h
+@@ -149,6 +149,9 @@ typedef struct _OMAPRec
+ int scanout_w, scanout_h;
+ Bool scanout_rotate;
+
++ /** Does kernel support rotation? */
++ Bool rotation_supported;
++
+ /** Pointer to the options for this screen. */
+ OptionInfoPtr pOptionInfo;
+
+@@ -187,8 +190,7 @@ static inline Bool has_dmm(OMAPPtr pOMAP)
+ static inline Bool has_rotation(OMAPPtr pOMAP)
+ {
+ #if XF86_CRTC_VERSION >= 4
+- // TODO .. should somehow check if driver has rotation property..
+- return has_dmm(pOMAP);
++ return has_dmm(pOMAP) && pOMAP->rotation_supported;
+ #else
+ return FALSE;
+ #endif
+--
+1.7.11.7
+
diff --git a/xorg-x11-drv-omap.spec b/xorg-x11-drv-omap.spec
index c579830..0701689 100644
--- a/xorg-x11-drv-omap.spec
+++ b/xorg-x11-drv-omap.spec
@@ -10,11 +10,13 @@
Summary: Xorg X11 omapdrm driver
Name: xorg-x11-drv-omap
Version: 0.4.2
-Release: 1%{?dist}
+Release: 2%{?dist}
URL: http://www.x.org
License: MIT
Group: User Interface/X Hardware Support
+
Source0: %{tarfile}
+Patch1: 0001-fix-issue-on-pre-rotation-kernel.patch
ExclusiveArch: %{arm}
@@ -22,6 +24,7 @@ BuildRequires: kernel-headers >= 2.6.32.3
BuildRequires: pkgconfig(libdrm_omap)
BuildRequires: libudev-devel
BuildRequires: libXext-devel
+BuildRequires: libXrandr-devel
BuildRequires: libXv-devel
BuildRequires: mesa-libGL-devel >= 6.5-9
BuildRequires: xorg-x11-server-devel >= 1.4.99.1-0.15
@@ -38,6 +41,7 @@ X.Org X11 omapdrm driver for TI OMAP 3/4/5xxx series ARM devices.
%prep
%setup -q
+%patch1 -p1 -b
%build
sh autogen.sh
@@ -58,6 +62,9 @@ find $RPM_BUILD_ROOT -regex ".*\.la$" | xargs rm -f --
%{_mandir}/man4/omap.4*
%changelog
+* Wed Oct 24 2012 Peter Robinson <pbrobinson at fedoraproject.org> 0.4.2-2
+- Add patch to fix rotation detection
+
* Tue Oct 23 2012 Peter Robinson <pbrobinson at fedoraproject.org> 0.4.2-1
- Update to the 0.4.2 tagged release
More information about the scm-commits
mailing list