sna/dri2: Add a DBG option to select copy method
authorChris Wilson <chris@chris-wilson.co.uk>
Tue, 1 Jul 2014 15:59:31 +0000 (16:59 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Tue, 1 Jul 2014 16:00:25 +0000 (17:00 +0100)
Often when debugging it is useful to force either use of the BLT or 3D
pipelines for copies.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
src/sna/sna_dri2.c

index 5adbd0b..0b343ce 100644 (file)
@@ -55,6 +55,8 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
 #define DBG_CAN_FLIP 1
 #define DBG_CAN_XCHG 1
 
+#define DBG_FORCE_COPY -1 /* KGEM_BLT or KGEM_3D */
+
 #if DRI2INFOREC_VERSION < 2
 #error DRI2 version supported by the Xserver is too old
 #endif
@@ -772,6 +774,12 @@ static void sna_dri2_select_mode(struct sna *sna, struct kgem_bo *dst, struct kg
                return;
        }
 
+       if (DBG_FORCE_COPY != -1) {
+               DBG(("%s: forcing %d\n", __FUNCTION__, DBG_FORCE_COPY));
+               kgem_set_mode(&sna->kgem, DBG_FORCE_COPY, dst);
+               return;
+       }
+
        if (sna->kgem.mode != KGEM_NONE) {
                DBG(("%s: busy, not switching\n", __FUNCTION__));
                return;