xserver: Branch 'master' - 4 commits

Adam Jackson ajax at kemper.freedesktop.org
Wed Mar 9 14:08:03 UTC 2016


 hw/xfree86/drivers/modesetting/drmmode_display.c |    1 
 hw/xfree86/modes/xf86Crtc.c                      |    6 +++++
 hw/xfree86/modes/xf86Cursors.c                   |   21 ++++++++++++--------
 hw/xfree86/ramdac/xf86Cursor.c                   |   24 +++++++++++++++++++++++
 hw/xfree86/ramdac/xf86Cursor.h                   |    1 
 5 files changed, 44 insertions(+), 9 deletions(-)

New commits:
commit 24042b4e367803dd64f3fcdc1bef7b2bf36c4145
Author: Michel Dänzer <michel.daenzer at amd.com>
Date:   Mon Dec 21 17:54:08 2015 +0900

    modesetting: Allow CRTC transforms to actually take effect
    
    Setting crtc->transformPresent to FALSE was preventing the transform
    from actually taking effect and putting RandR into a confused state.
    
    Now that the RandR 1.2 cursor code handles transforms correctly, we can
    allow them to properly take effect.
    
    Reviewed-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c
index 0d34ca1..262e015 100644
--- a/hw/xfree86/drivers/modesetting/drmmode_display.c
+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
@@ -373,7 +373,6 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
         crtc->x = x;
         crtc->y = y;
         crtc->rotation = rotation;
-        crtc->transformPresent = FALSE;
     }
 
     output_ids = calloc(sizeof(uint32_t), xf86_config->num_output);
commit b04767c84deafc44993723add4b1c5163fc11711
Author: Michel Dänzer <michel.daenzer at amd.com>
Date:   Wed Oct 21 18:33:46 2015 +0900

    xfree86: Re-set current cursor after RandR 1.2 CRTC configuration change
    
    Add xf86CursorResetCursor, which allows switching between HW and SW
    cursor depending on the current state.
    
    Call it from xf86DisableUnusedFunctions, which is called after any CRTC
    configuration change such as setting a mode or disabling a CRTC. This
    makes sure that SW cursor is used e.g. while a transform is in use on
    any CRTC or while there are active PRIME output slaves, and enables HW
    cursor again once none of those conditions are true anymore.
    
    Reviewed-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index 38bc58c..2639a30 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -3121,6 +3121,12 @@ xf86DisableUnusedFunctions(ScrnInfoPtr pScrn)
         xf86_crtc_notify(pScrn->pScreen);
     if (pScrn->ModeSet)
         pScrn->ModeSet(pScrn);
+    if (pScrn->pScreen) {
+        if (pScrn->pScreen->isGPU)
+            xf86CursorResetCursor(pScrn->pScreen->current_master);
+        else
+            xf86CursorResetCursor(pScrn->pScreen);
+    }
 }
 
 #ifdef RANDR_12_INTERFACE
diff --git a/hw/xfree86/ramdac/xf86Cursor.c b/hw/xfree86/ramdac/xf86Cursor.c
index 2a54571..c061b80 100644
--- a/hw/xfree86/ramdac/xf86Cursor.c
+++ b/hw/xfree86/ramdac/xf86Cursor.c
@@ -385,6 +385,30 @@ xf86CursorSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCurs,
     (*ScreenPriv->spriteFuncs->SetCursor) (pDev, pScreen, pCurs, x, y);
 }
 
+/* Re-set the current cursor. This will switch between hardware and software
+ * cursor depending on whether hardware cursor is currently supported
+ * according to the driver.
+ */
+void
+xf86CursorResetCursor(ScreenPtr pScreen)
+{
+    xf86CursorScreenPtr ScreenPriv;
+
+    if (!inputInfo.pointer)
+        return;
+
+    if (!dixPrivateKeyRegistered(xf86CursorScreenKey))
+        return;
+
+    ScreenPriv = (xf86CursorScreenPtr) dixLookupPrivate(&pScreen->devPrivates,
+                                                        xf86CursorScreenKey);
+    if (!ScreenPriv)
+        return;
+
+    xf86CursorSetCursor(inputInfo.pointer, pScreen, ScreenPriv->CurrentCursor,
+                        ScreenPriv->x, ScreenPriv->y);
+}
+
 static void
 xf86CursorMoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
 {
diff --git a/hw/xfree86/ramdac/xf86Cursor.h b/hw/xfree86/ramdac/xf86Cursor.h
index 8c98bb1..6e88240 100644
--- a/hw/xfree86/ramdac/xf86Cursor.h
+++ b/hw/xfree86/ramdac/xf86Cursor.h
@@ -59,6 +59,7 @@ extern _X_EXPORT Bool xf86InitCursor(ScreenPtr pScreen,
                                      xf86CursorInfoPtr infoPtr);
 extern _X_EXPORT xf86CursorInfoPtr xf86CreateCursorInfoRec(void);
 extern _X_EXPORT void xf86DestroyCursorInfoRec(xf86CursorInfoPtr);
+extern _X_EXPORT void xf86CursorResetCursor(ScreenPtr pScreen);
 extern _X_EXPORT void xf86ForceHWCursor(ScreenPtr pScreen, Bool on);
 
 #define HARDWARE_CURSOR_INVERT_MASK 			0x00000001
commit a4ffa8721debb34bd36fd4624890d9c26886c618
Author: Michel Dänzer <michel.daenzer at amd.com>
Date:   Thu Dec 24 12:56:03 2015 +0900

    xfree86/modes: Check for CRTC transforms in xf86_use_hw_cursor(_argb) (v2)
    
    We currently don't handle transforms for the HW cursor image, so return
    FALSE to signal a software cursor must be used if a transform is in use
    on any CRTC.
    
    v2: Check crtc->transformPresent instead of crtc->transform_in_use. The
        latter is TRUE for rotation as well, which we handle correctly.
    
    Reviewed-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/xfree86/modes/xf86Cursors.c b/hw/xfree86/modes/xf86Cursors.c
index d3baf0d..5df1ab7 100644
--- a/hw/xfree86/modes/xf86Cursors.c
+++ b/hw/xfree86/modes/xf86Cursors.c
@@ -515,6 +515,7 @@ xf86_use_hw_cursor(ScreenPtr screen, CursorPtr cursor)
     ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
     xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
     xf86CursorInfoPtr cursor_info = xf86_config->cursor_info;
+    int c;
 
     cursor = RefCursor(cursor);
     if (xf86_config->cursor)
@@ -525,6 +526,16 @@ xf86_use_hw_cursor(ScreenPtr screen, CursorPtr cursor)
         cursor->bits->height > cursor_info->MaxHeight)
         return FALSE;
 
+    for (c = 0; c < xf86_config->num_crtc; c++) {
+        xf86CrtcPtr crtc = xf86_config->crtc[c];
+
+        if (!crtc->enabled)
+            continue;
+
+        if (crtc->transformPresent)
+            return FALSE;
+    }
+
     return TRUE;
 }
 
commit c3e4e9fc5d84bfc17b3ed63f67488ea25ba150ce
Author: Michel Dänzer <michel.daenzer at amd.com>
Date:   Thu Dec 24 16:20:49 2015 +0900

    xfree86/modes: Refactor xf86_use_hw_cursor_argb to use xf86_use_hw_cursor (v2)
    
    This reduces code duplication.
    
    v2: No functional change this time.
    
    Reviewed-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/xfree86/modes/xf86Cursors.c b/hw/xfree86/modes/xf86Cursors.c
index 321cde7..d3baf0d 100644
--- a/hw/xfree86/modes/xf86Cursors.c
+++ b/hw/xfree86/modes/xf86Cursors.c
@@ -535,19 +535,13 @@ xf86_use_hw_cursor_argb(ScreenPtr screen, CursorPtr cursor)
     xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
     xf86CursorInfoPtr cursor_info = xf86_config->cursor_info;
 
-    cursor = RefCursor(cursor);
-    if (xf86_config->cursor)
-        FreeCursor(xf86_config->cursor, None);
-    xf86_config->cursor = cursor;
+    if (!xf86_use_hw_cursor(screen, cursor))
+        return FALSE;
 
     /* Make sure ARGB support is available */
     if ((cursor_info->Flags & HARDWARE_CURSOR_ARGB) == 0)
         return FALSE;
 
-    if (cursor->bits->width > cursor_info->MaxWidth ||
-        cursor->bits->height > cursor_info->MaxHeight)
-        return FALSE;
-
     return TRUE;
 }
 


More information about the xorg-commit mailing list