xf86-video-intel: 2 commits - configure.ac NEWS src/intel_device.c src/intel_driver.h src/intel_xmir.h src/Makefile.am src/sna/Makefile.am src/sna/sna_dri.c src/sna/sna_driver.c src/sna/sna.h src/sna/sna_xmir.c

Chris Wilson ickle at kemper.freedesktop.org
Sat Sep 7 00:50:03 PDT 2013


 NEWS                 |    6 +
 configure.ac         |    2 
 src/Makefile.am      |    1 
 src/intel_device.c   |   24 ------
 src/intel_driver.h   |    4 -
 src/intel_xmir.h     |   15 ----
 src/sna/Makefile.am  |    1 
 src/sna/sna.h        |   35 +--------
 src/sna/sna_dri.c    |   14 ---
 src/sna/sna_driver.c |   19 -----
 src/sna/sna_xmir.c   |  179 ---------------------------------------------------
 11 files changed, 15 insertions(+), 285 deletions(-)

New commits:
commit 58a7611ccfda88c7cbcc62b25b787d6b0fa64081
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sat Sep 7 08:45:12 2013 +0100

    2.99.902 snapshot

diff --git a/NEWS b/NEWS
index 83a7c82..f97e03e 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,9 @@
+Snapshot 2.99.902 (2013-08-07)
+==============================
+We do not condone or support Canonical in the course of action they have
+chosen, and will not carry XMir patches upstream.
+-The Management
+
 Snapshot 2.99.901 (2013-08-04)
 ==============================
 What's this? A pre-release snapshot of an upcoming 3.0 major release?
diff --git a/configure.ac b/configure.ac
index 27a3354..500eb10 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-video-intel],
-        [2.99.901],
+        [2.99.902],
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         [xf86-video-intel])
 AC_CONFIG_SRCDIR([Makefile.am])
commit 0c697aee9b3767be7d1e04e4e4f9d304f23b188a
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sat Sep 7 08:42:26 2013 +0100

    Revert "sna: Add XMir support"
    
    This reverts commit 42d94356f65972eb7fb8991234a4e9388c4c2031.
    
    Ordered-by: The Management.

diff --git a/src/Makefile.am b/src/Makefile.am
index 126bde2..b0781ca 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -59,7 +59,6 @@ intel_drv_la_SOURCES = \
 	intel_driver.h \
 	intel_options.c \
 	intel_module.c \
-	intel_xmir.h \
 	compat-api.h \
 	$(NULL)
 
diff --git a/src/intel_device.c b/src/intel_device.c
index 710348e..b3926df 100644
--- a/src/intel_device.c
+++ b/src/intel_device.c
@@ -144,34 +144,10 @@ static int fd_set_nonblock(int fd)
 	return fd;
 }
 
-static int __intel_open_xmir(const struct pci_device *pci,
-			     char **path)
-{
-	char id[20];
-	int fd;
-
-	snprintf(id, sizeof(id),
-		 "pci:%04x:%02x:%02x.%d",
-		 pci->domain, pci->bus, pci->dev, pci->func);
-	fd = xmir_get_drm_fd(id);
-	if (fd == -1)
-		return -1;
-
-	if (*path == NULL) /* XXX Fix Xmir - it knows both the fd and path */
-		*path = drmGetDeviceNameFromFd(fd);
-	if (*path == NULL)
-		fd = -1;
-
-	return fd;
-}
-
 static int __intel_open_device(const struct pci_device *pci, char **path)
 {
 	int fd;
 
-	if (xorgMir)
-		return __intel_open_xmir(pci, path);
-
 	if (*path == NULL) {
 		char id[20];
 		int ret;
diff --git a/src/intel_driver.h b/src/intel_driver.h
index 0c5e4ae..e54054f 100644
--- a/src/intel_driver.h
+++ b/src/intel_driver.h
@@ -1,8 +1,6 @@
 #ifndef INTEL_DRIVER_H
 #define INTEL_DRIVER_H
 
-#include "intel_xmir.h"
-
 #define INTEL_VERSION 4000
 #define INTEL_NAME "intel"
 #define INTEL_DRIVER_NAME "intel"
@@ -131,6 +129,6 @@ void intel_put_device(ScrnInfoPtr scrn);
 
 void __intel_uxa_release_device(ScrnInfoPtr scrn);
 
-#define hosted() (xorgMir)
+#define hosted() (0)
 
 #endif /* INTEL_DRIVER_H */
diff --git a/src/intel_xmir.h b/src/intel_xmir.h
deleted file mode 100644
index 2e3c85a..0000000
--- a/src/intel_xmir.h
+++ /dev/null
@@ -1,15 +0,0 @@
-#ifndef INTEL_XMIR_H
-#define INTEL_XMIR_H
-
-#include <xorg-server.h>
-
-#if XMIR
-#include <xf86Priv.h>
-#include <xmir.h>
-#else
-typedef struct xmir_screen xmir_screen;
-#define xorgMir 0
-#define xmir_get_drm_fd(id) -1
-#endif
-
-#endif /* INTEL_XMIR_H */
diff --git a/src/sna/Makefile.am b/src/sna/Makefile.am
index 5cf1cbf..030869d 100644
--- a/src/sna/Makefile.am
+++ b/src/sna/Makefile.am
@@ -76,7 +76,6 @@ libsna_la_SOURCES = \
 	sna_video_overlay.c \
 	sna_video_sprite.c \
 	sna_video_textured.c \
-	sna_xmir.c \
 	gen2_render.c \
 	gen2_render.h \
 	gen3_render.c \
diff --git a/src/sna/sna.h b/src/sna/sna.h
index a081c0e..a4037c6 100644
--- a/src/sna/sna.h
+++ b/src/sna/sna.h
@@ -290,7 +290,6 @@ struct sna {
 	EntityInfoPtr pEnt;
 	struct pci_device *PciInfo;
 	const struct intel_device_info *info;
-	xmir_screen *xmir;
 
 	ScreenBlockHandlerProcPtr BlockHandler;
 	ScreenWakeupHandlerProcPtr WakeupHandler;
@@ -436,24 +435,14 @@ CARD32 sna_render_format_for_depth(int depth);
 void sna_debug_flush(struct sna *sna);
 
 static inline bool
-get_window_deltas(PixmapPtr pixmap, int16_t *x, int16_t *y)
-{
-#ifdef COMPOSITE
-	*x = -pixmap->screen_x;
-	*y = -pixmap->screen_y;
-	return pixmap->screen_x | pixmap->screen_y;
-#else
-	*x = *y = 0;
-	return false;
-#endif
-}
-
-static inline bool
 get_drawable_deltas(DrawablePtr drawable, PixmapPtr pixmap, int16_t *x, int16_t *y)
 {
 #ifdef COMPOSITE
-	if (drawable->type == DRAWABLE_WINDOW)
-		return get_window_deltas(pixmap, x, y);
+	if (drawable->type == DRAWABLE_WINDOW) {
+		*x = -pixmap->screen_x;
+		*y = -pixmap->screen_y;
+		return pixmap->screen_x | pixmap->screen_y;
+	}
 #endif
 	*x = *y = 0;
 	return false;
@@ -977,18 +966,4 @@ void sna_image_composite(pixman_op_t        op,
 			 uint16_t           width,
 			 uint16_t           height);
 
-/* sna_xmir.c */
-
-#if XMIR
-bool sna_xmir_create(struct sna *sna);
-bool sna_xmir_pre_init(struct sna *sna);
-void sna_xmir_init(struct sna *sna, ScreenPtr screen);
-void sna_xmir_post_damage(struct sna *sna);
-#else
-inline static bool sna_xmir_create(struct sna *sna) { return true; }
-inline static bool sna_xmir_pre_init(struct sna *sna) { return true; }
-inline static void sna_xmir_init(struct sna *sna, ScreenPtr screen) { }
-inline static void sna_xmir_post_damage(struct sna *sna) { }
-#endif
-
 #endif /* _SNA_H */
diff --git a/src/sna/sna_dri.c b/src/sna/sna_dri.c
index f3a5d9c..25f66b3 100644
--- a/src/sna/sna_dri.c
+++ b/src/sna/sna_dri.c
@@ -2251,13 +2251,6 @@ out_complete:
 }
 #endif
 
-#if DRI2INFOREC_VERSION >= 8 && XMIR
-static int sna_dri_auth_magic2(ScreenPtr screen, uint32_t magic)
-{
-	return xmir_auth_drm_magic(to_sna_from_screen(screen)->xmir, magic);
-}
-#endif
-
 static bool has_i830_dri(void)
 {
 	return access(DRI_DRIVER_PATH "/i830_dri.so", R_OK) == 0;
@@ -2333,13 +2326,6 @@ bool sna_dri_open(struct sna *sna, ScreenPtr screen)
 	info.ReuseBufferNotify = NULL;
 #endif
 
-#if DRI2INFOREC_VERSION >= 8 && XMIR
-	if (sna->xmir) {
-		info.version = 8;
-		info.AuthMagic2 = sna_dri_auth_magic2;
-	}
-#endif
-
 #if USE_ASYNC_SWAP
 	info.version = 10;
 	info.scheduleSwap0 = 1;
diff --git a/src/sna/sna_driver.c b/src/sna/sna_driver.c
index 4624998..4da6cbb 100644
--- a/src/sna/sna_driver.c
+++ b/src/sna/sna_driver.c
@@ -443,9 +443,6 @@ static Bool sna_pre_init(ScrnInfoPtr scrn, int flags)
 		goto cleanup;
 	}
 
-	if (!sna_xmir_create(sna))
-		goto cleanup;
-
 	/* Sanity check */
 	if (hosted() && (sna->flags & SNA_IS_HOSTED) == 0) {
 		xf86DrvMsg(scrn->scrnIndex, X_ERROR,
@@ -453,14 +450,9 @@ static Bool sna_pre_init(ScrnInfoPtr scrn, int flags)
 		goto cleanup;
 	}
 
-	if (sna->xmir) {
-		/* XXX query depth from xmir */
+	preferred_depth = sna->info->gen < 030 ? 15 : 24;
+	if (!fb_supports_depth(fd, preferred_depth))
 		preferred_depth = 24;
-	} else {
-		preferred_depth = sna->info->gen < 030 ? 15 : 24;
-		if (!fb_supports_depth(fd, preferred_depth))
-			preferred_depth = 24;
-	}
 
 	if (!xf86SetDepthBpp(scrn, preferred_depth, 0, 0,
 			     Support32bppFb |
@@ -497,9 +489,6 @@ static Bool sna_pre_init(ScrnInfoPtr scrn, int flags)
 
 	intel_detect_chipset(scrn, sna->pEnt, sna->PciInfo);
 
-	if (!sna_xmir_pre_init(sna))
-		goto cleanup;
-
 	kgem_init(&sna->kgem, fd, sna->PciInfo, sna->info->gen);
 	if (xf86ReturnOptValBool(sna->Options, OPTION_ACCEL_DISABLE, FALSE) ||
 	    !sna_option_cast_to_bool(sna, OPTION_ACCEL_METHOD, TRUE)) {
@@ -585,8 +574,6 @@ sna_block_handler(BLOCKHANDLER_ARGS_DECL)
 
 	if (*tv == NULL || ((*tv)->tv_usec | (*tv)->tv_sec))
 		sna_accel_block_handler(sna, tv);
-
-	sna_xmir_post_damage(sna);
 }
 
 static void
@@ -936,8 +923,6 @@ sna_screen_init(SCREEN_INIT_ARGS_DECL)
 	if (!miDCInitialize(screen, xf86GetPointerScreenFuncs()))
 		return FALSE;
 
-	sna_xmir_init(sna, screen); /* after DirectCursor is initialised */
-
 	if ((sna->flags & SNA_IS_HOSTED) == 0 &&
 	    xf86_cursors_init(screen, SNA_CURSOR_X, SNA_CURSOR_Y,
 			       HARDWARE_CURSOR_TRUECOLOR_AT_8BPP |
diff --git a/src/sna/sna_xmir.c b/src/sna/sna_xmir.c
deleted file mode 100644
index ddce984..0000000
--- a/src/sna/sna_xmir.c
+++ /dev/null
@@ -1,179 +0,0 @@
-/***************************************************************************
-
- Copyright 2013 Intel Corporation.  All Rights Reserved.
-
- Permission is hereby granted, free of charge, to any person obtaining a
- copy of this software and associated documentation files (the
- "Software"), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sub license, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice (including the
- next paragraph) shall be included in all copies or substantial portions
- of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- IN NO EVENT SHALL INTEL, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
- THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
- **************************************************************************/
-
-#include <assert.h>
-
-#include "sna.h"
-
-#if XMIR
-
-/* Theory of Operation
- * -------------------
- *
- *  1. Clients render to their pixmaps and Windows aggregating damage.
- *  2. Before blocking, we walk the list of dirty Windows and submit
- *     any damage to Mir. This consumes the xfer buffer.
- *  3. Clients continue to render and we accumulate damage. However,
- *     as there is now no xfer buffer free, damage accumulates.
- *  4. Mir reports that its exchange has complete and gives us a new
- *     transport buffer.
- *  5. Before going to sleep, we iterate over dirty Windows and copy
- *     their damage into the xfer buffer and send back to Mir.
- *
- *  Clients render uninterrupted, but we only send damage to Mir once
- *  every frame.
- */
-
-#define FORCE_FULL_REDRAW 0
-
-static void
-sna_xmir_copy_to_mir(xmir_window *xmir_win, RegionPtr region)
-{
-	PixmapPtr src = get_window_pixmap(xmir_window_to_windowptr(xmir_win));
-	struct sna *sna = to_sna_from_pixmap(src);
-	const BoxRec *dst_box = xmir_window_get_drawable_region(xmir_win);
-	struct sna_pixmap *priv;
-	struct kgem_bo *bo;
-	BoxRec *box;
-	const int pitch = xmir_window_get_stride(xmir_win);
-	int16_t sx, sy, dx, dy;
-	int n;
-
-#if FORCE_FULL_REDRAW
-	RegionRec whole = { { 0, 0, src->drawable.width, src->drawable.height } };
-	region = &whole;
-#endif
-
-	assert(region);
-
-	DBG(("%s: copying region (%d, %d), (%d, %d) x %d, dst box=(%d, %d), (%d, %d), pitch=%d, fd=%d\n",
-	     __FUNCTION__,
-	     region->extents.x1, region->extents.y1,
-	     region->extents.x2, region->extents.y2,
-	     REGION_NUM_RECTS(region),
-	     dst_box->x1, dst_box->y1,
-	     dst_box->x2, dst_box->y2,
-	     pitch, xmir_window_get_fd(xmir_win)));
-
-	box = REGION_RECTS(region);
-	n = REGION_NUM_RECTS(region);
-	if (n == 0)
-		return;
-
-	/* XXX size is bogus, but only used for sanity checks */
-	bo = kgem_create_for_prime(&sna->kgem,
-				   xmir_window_get_fd(xmir_win),
-				   pitch * (dst_box->y2 - dst_box->y1));
-	if (bo == NULL)
-		return;
-
-	bo->pitch = pitch;
-	bo->scanout = true; /* presume the worst (almost always true) */
-
-	if (get_window_deltas(src, &sx, &sy))
-		RegionTranslate(region, sx, sy);
-
-	dx = sx + dst_box->x1;
-	dy = sy + dst_box->y1;
-
-	priv = sna_pixmap_move_area_to_gpu(src, &region->extents, MOVE_READ);
-	if (priv && sna->render.copy_boxes(sna, GXcopy,
-					   src, priv->gpu_bo, 0, 0,
-					   src, bo, -dx, -dy,
-					   box, n, COPY_LAST)) {
-		kgem_submit(&sna->kgem);
-		n = 0;
-	} else {
-		void *dst = kgem_bo_map__gtt(&sna->kgem, bo);
-		if (dst && sna_drawable_move_region_to_cpu(&src->drawable,
-							   region, MOVE_READ)) {
-			kgem_bo_sync__gtt(&sna->kgem, bo);
-			do {
-				memcpy_blt(src->devPrivate.ptr, dst,
-					   src->drawable.bitsPerPixel,
-					   src->devKind, bo->pitch,
-					   box->x1, box->y1,
-					   box->x1 - dx, box->y1 - dy,
-					   box->x2 - box->x1,
-					   box->y2 - box->y1);
-			} while (--n);
-		}
-	}
-
-	if (sx | sy)
-		RegionTranslate(region, -sx, -sy);
-
-	if (n == 0)
-		xmir_submit_rendering_for_window(xmir_win, region);
-
-	bo->scanout = false; /* but don't confuse our caching! */
-	kgem_bo_destroy(&sna->kgem, bo);
-}
-
-static xmir_driver sna_xmir_driver = {
-	XMIR_DRIVER_VERSION,
-	sna_xmir_copy_to_mir
-};
-
-bool sna_xmir_create(struct sna *sna)
-{
-	if (!xorgMir)
-		return true;
-
-	sna->xmir = xmir_screen_create(sna->scrn);
-	if (sna->xmir == NULL)
-		return false;
-
-	sna->flags |= SNA_IS_HOSTED;
-	return true;
-}
-
-bool sna_xmir_pre_init(struct sna *sna)
-{
-	if (sna->xmir == NULL)
-		return true;
-
-	return xmir_screen_pre_init(sna->scrn, sna->xmir, &sna_xmir_driver);
-}
-
-void sna_xmir_init(struct sna *sna, ScreenPtr screen)
-{
-	if (sna->xmir == NULL)
-		return;
-
-	xmir_screen_init(screen, sna->xmir);
-}
-
-void sna_xmir_post_damage(struct sna *sna)
-{
-	if (sna->xmir == NULL)
-		return;
-
-	xmir_screen_for_each_damaged_window(sna->xmir,
-					    sna_xmir_copy_to_mir);
-}
-
-#endif


More information about the xorg-commit mailing list