summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Clark <rob@ti.com>2012-10-23 16:01:37 -0500
committerRob Clark <rob@ti.com>2012-10-23 16:01:37 -0500
commitae0394e687f1a77e966cf72f895da91840dffb8f (patch)
tree0e83667fb0cd3fa1dd3ffcd81aeda0a4de4c9e3b
parent653ccadb38c87be565df3fbf2ff24a0cbe5a5e98 (diff)
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@ti.com>
-rw-r--r--src/drmmode_display.c7
-rw-r--r--src/omap_driver.h6
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