[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

xserver-xorg-video-intel: Changes to 'ubuntu'



 NEWS                               |   38 
 configure.ac                       |   16 
 debian/changelog                   |   20 
 debian/patches/xmir.patch          |  308 +
 src/compat-api.h                   |    4 
 src/intel_device.c                 |   99 
 src/intel_driver.h                 |   13 
 src/intel_module.c                 |   44 
 src/legacy/i810/i810_driver.c      |    2 
 src/sna/Makefile.am                |    5 
 src/sna/gen3_render.c              |   70 
 src/sna/gen4_render.c              |   28 
 src/sna/gen4_vertex.c              |   26 
 src/sna/gen4_vertex.h              |    1 
 src/sna/gen5_render.c              |   34 
 src/sna/gen6_render.c              |   48 
 src/sna/gen7_render.c              |   99 
 src/sna/kgem.c                     |   77 
 src/sna/kgem.h                     |    2 
 src/sna/sna.h                      |    1 
 src/sna/sna_accel.c                |   35 
 src/sna/sna_composite.c            |  187 
 src/sna/sna_display.c              |   75 
 src/sna/sna_dri.c                  |   13 
 src/sna/sna_driver.c               |   15 
 src/sna/sna_gradient.c             |    9 
 src/sna/sna_render.c               |    9 
 src/sna/sna_render.h               |    2 
 src/sna/sna_threads.c              |    2 
 src/sna/sna_trapezoids.c           | 7554 ++-----------------------------------
 src/sna/sna_trapezoids.h           |  342 +
 src/sna/sna_trapezoids_boxes.c     | 1461 +++++++
 src/sna/sna_trapezoids_imprecise.c | 3916 +++++++++++++++++++
 src/sna/sna_trapezoids_mono.c      | 1428 ++++++
 src/sna/sna_trapezoids_precise.c   | 3302 ++++++++++++++++
 src/sna/sna_video.c                |   11 
 src/sna/sna_video.h                |    1 
 src/sna/sna_video_hwmc.c           |   12 
 src/sna/sna_video_sprite.c         |    5 
 src/uxa/intel_driver.c             |    2 
 tools/virtual.c                    |    2 
 41 files changed, 11858 insertions(+), 7460 deletions(-)

New commits:
commit bf7d059cf65f0e35cd0eb28eeb2672685b74e5bc
Author: Timo Aaltonen <tjaalton@ubuntu.com>
Date:   Wed Oct 9 19:44:10 2013 +0300

    refresh xmir.patch

diff --git a/debian/changelog b/debian/changelog
index 2f82b5f..69c21ca 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+xserver-xorg-video-intel (2:2.99.904-0ubuntu1) UNRELEASED; urgency=low
+
+  * Merge from unreleased debian git
+    - new release candidate (LP: #1218839, #1157458, #1216252, #1232546)
+  * xmir.patch: refreshed.
+
+ -- Timo Aaltonen <tjaalton@ubuntu.com>  Wed, 09 Oct 2013 19:40:51 +0300
+
 xserver-xorg-video-intel (2:2.99.904-1) UNRELEASED; urgency=low
 
   * New upstream prerelease.
diff --git a/debian/patches/xmir.patch b/debian/patches/xmir.patch
index 3636e58..af283b3 100644
--- a/debian/patches/xmir.patch
+++ b/debian/patches/xmir.patch
@@ -13,8 +13,6 @@ Date:   Wed Jul 24 01:44:30 2013 +0100
     Signed-off-by: Christopher James Halse Rogers <raof@ubuntu.com>
     Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
 
-diff --git a/src/Makefile.am b/src/Makefile.am
-index b0781ca..126bde2 100644
 --- a/src/Makefile.am
 +++ b/src/Makefile.am
 @@ -59,6 +59,7 @@ intel_drv_la_SOURCES = \
@@ -25,11 +23,9 @@ index b0781ca..126bde2 100644
  	compat-api.h \
  	$(NULL)
  
-diff --git a/src/intel_device.c b/src/intel_device.c
-index 92472c5..2dd1625 100644
 --- a/src/intel_device.c
 +++ b/src/intel_device.c
-@@ -146,10 +146,34 @@ static int fd_set_nonblock(int fd)
+@@ -175,10 +175,34 @@ static int fd_set_nonblock(int fd)
  	return fd;
  }
  
@@ -64,8 +60,6 @@ index 92472c5..2dd1625 100644
  	if (*path == NULL) {
  		char id[20];
  		int ret;
-diff --git a/src/intel_driver.h b/src/intel_driver.h
-index e54054f..0c5e4ae 100644
 --- a/src/intel_driver.h
 +++ b/src/intel_driver.h
 @@ -1,6 +1,8 @@
@@ -74,10 +68,10 @@ index e54054f..0c5e4ae 100644
  
 +#include "intel_xmir.h"
 +
+ struct xf86_platform_device;
+ 
  #define INTEL_VERSION 4000
- #define INTEL_NAME "intel"
- #define INTEL_DRIVER_NAME "intel"
-@@ -129,6 +131,6 @@ void intel_put_device(ScrnInfoPtr scrn);
+@@ -134,6 +136,6 @@ void intel_put_device(ScrnInfoPtr scrn);
  
  void __intel_uxa_release_device(ScrnInfoPtr scrn);
  
@@ -85,9 +79,6 @@ index e54054f..0c5e4ae 100644
 +#define hosted() (xorgMir)
  
  #endif /* INTEL_DRIVER_H */
-diff --git a/src/intel_xmir.h b/src/intel_xmir.h
-new file mode 100644
-index 0000000..2e3c85a
 --- /dev/null
 +++ b/src/intel_xmir.h
 @@ -0,0 +1,15 @@
@@ -106,11 +97,9 @@ index 0000000..2e3c85a
 +#endif
 +
 +#endif /* INTEL_XMIR_H */
-diff --git a/src/sna/Makefile.am b/src/sna/Makefile.am
-index 030869d..5cf1cbf 100644
 --- a/src/sna/Makefile.am
 +++ b/src/sna/Makefile.am
-@@ -76,6 +76,7 @@ libsna_la_SOURCES = \
+@@ -81,6 +81,7 @@ libsna_la_SOURCES = \
  	sna_video_overlay.c \
  	sna_video_sprite.c \
  	sna_video_textured.c \
@@ -118,19 +107,17 @@ index 030869d..5cf1cbf 100644
  	gen2_render.c \
  	gen2_render.h \
  	gen3_render.c \
-diff --git a/src/sna/sna.h b/src/sna/sna.h
-index f7c5315..494baa8 100644
 --- a/src/sna/sna.h
 +++ b/src/sna/sna.h
-@@ -290,6 +290,7 @@ struct sna {
+@@ -289,6 +289,7 @@ struct sna {
+ 
  	EntityInfoPtr pEnt;
- 	struct pci_device *PciInfo;
  	const struct intel_device_info *info;
 +	xmir_screen *xmir;
  
  	ScreenBlockHandlerProcPtr BlockHandler;
  	ScreenWakeupHandlerProcPtr WakeupHandler;
-@@ -988,4 +989,18 @@ static inline void sigtrap_put(void)
+@@ -987,4 +988,18 @@ static inline void sigtrap_put(void)
  	sigtrap_assert();
  }
  
@@ -149,11 +136,259 @@ index f7c5315..494baa8 100644
 +#endif
 +
  #endif /* _SNA_H */
-diff --git a/src/sna/sna_dri.c b/src/sna/sna_dri.c
-index 00a65a9..88d0869 100644
 --- a/src/sna/sna_dri.c
 +++ b/src/sna/sna_dri.c
-@@ -2322,6 +2322,13 @@ out_complete:
+@@ -596,7 +596,6 @@ static void sna_dri_select_mode(struct s
+ 	if (busy.busy & (1 << 17))
+ 		mode = KGEM_BLT;
+ 	kgem_bo_mark_busy(busy.handle == src->handle ? src : dst, mode);
+-	_kgem_set_mode(&sna->kgem, mode);
+ }
+ 
+ static void
+@@ -1107,10 +1106,10 @@ sna_dri_page_flip(struct sna *sna, struc
+ }
+ 
+ static bool
+-can_flip(struct sna * sna,
+-	 DrawablePtr draw,
+-	 DRI2BufferPtr front,
+-	 DRI2BufferPtr back)
++can_exchange(struct sna * sna,
++	     DrawablePtr draw,
++	     DRI2BufferPtr front,
++	     DRI2BufferPtr back)
+ {
+ 	WindowPtr win = (WindowPtr)draw;
+ 	PixmapPtr pixmap;
+@@ -1120,15 +1119,12 @@ can_flip(struct sna * sna,
+ 	if (draw->type == DRAWABLE_PIXMAP)
+ 		return false;
+ 
+-	if (!sna->scrn->vtSema) {
+-		DBG(("%s: no, not attached to VT\n", __FUNCTION__));
++	if ((sna->flags & SNA_IS_HOSTED) == 0) {
++		DBG(("%s: no, not hosted\n", __FUNCTION__));
+ 		return false;
+ 	}
+ 
+-	if (sna->flags & SNA_NO_FLIP) {
+-		DBG(("%s: no, pageflips disabled\n", __FUNCTION__));
+-		return false;
+-	}
++	assert(!sna->mode.shadow_active);
+ 
+ 	if (front->format != back->format) {
+ 		DBG(("%s: no, format mismatch, front = %d, back = %d\n",
+@@ -1144,11 +1140,6 @@ can_flip(struct sna * sna,
+ 		return false;
+ 	}
+ 
+-	if (sna->mode.shadow_active) {
+-		DBG(("%s: no, shadow enabled\n", __FUNCTION__));
+-		return false;
+-	}
+-
+ 	pixmap = get_window_pixmap(win);
+ 	if (pixmap != sna->front) {
+ 		DBG(("%s: no, window (pixmap=%ld) is not attached to the front buffer (pixmap=%ld)\n",
+@@ -1226,21 +1217,6 @@ can_flip(struct sna * sna,
+ 	return true;
+ }
+ 
+-inline static uint32_t pipe_select(int pipe)
+-{
+-	/* The third pipe was introduced with IvyBridge long after
+-	 * multiple pipe support was added to the kernel, hence
+-	 * we can safely ignore the capability check - if we have more
+-	 * than two pipes, we can assume that they are fully supported.
+-	 */
+-	if (pipe > 1)
+-		return pipe << DRM_VBLANK_HIGH_CRTC_SHIFT;
+-	else if (pipe > 0)
+-		return DRM_VBLANK_SECONDARY;
+-	else
+-		return 0;
+-}
+-
+ static void
+ sna_dri_exchange_buffers(DrawablePtr draw,
+ 			 DRI2BufferPtr front,
+@@ -1284,6 +1260,160 @@ sna_dri_exchange_buffers(DrawablePtr dra
+ 	back->name = tmp;
+ }
+ 
++static bool
++sna_dri_exchange_flip(ClientPtr client, DrawablePtr draw,
++		      DRI2BufferPtr front, DRI2BufferPtr back,
++		      CARD64 *target_msc, CARD64 divisor, CARD64 remainder,
++		      DRI2SwapEventPtr func, void *data)
++{
++	DBG(("%s: target_msc=%u, divisor=%u\n", __FUNCTION__,
++	     (uint32_t)*target_msc, (uint32_t)divisor));
++
++	/* XXX delay */
++
++	sna_dri_exchange_buffers(draw, front, back);
++
++	/* XXX ratelimit */
++
++	DRI2SwapComplete(client, draw, 0, 0, 0, DRI2_EXCHANGE_COMPLETE, func, data);
++	*target_msc = 0;
++
++	return true;
++}
++
++static bool
++can_flip(struct sna * sna,
++	 DrawablePtr draw,
++	 DRI2BufferPtr front,
++	 DRI2BufferPtr back)
++{
++	WindowPtr win = (WindowPtr)draw;
++	PixmapPtr pixmap;
++
++	if (draw->type == DRAWABLE_PIXMAP)
++		return false;
++
++	if (!sna->scrn->vtSema) {
++		DBG(("%s: no, not attached to VT\n", __FUNCTION__));
++		return false;
++	}
++
++	if (sna->flags & SNA_NO_FLIP) {
++		DBG(("%s: no, pageflips disabled\n", __FUNCTION__));
++		return false;
++	}
++
++	if (front->format != back->format) {
++		DBG(("%s: no, format mismatch, front = %d, back = %d\n",
++		     __FUNCTION__, front->format, back->format));
++		return false;
++	}
++
++	if (front->attachment != DRI2BufferFrontLeft) {
++		DBG(("%s: no, front attachment [%d] is not FrontLeft [%d]\n",
++		     __FUNCTION__,
++		     front->attachment,
++		     DRI2BufferFrontLeft));
++		return false;
++	}
++
++	if (sna->mode.shadow_active) {
++		DBG(("%s: no, shadow enabled\n", __FUNCTION__));
++		return false;
++	}
++
++	pixmap = get_window_pixmap(win);
++	if (pixmap != sna->front) {
++		DBG(("%s: no, window is not attached to the front buffer\n",
++		     __FUNCTION__));
++		return false;
++	}
++
++	if (sna_pixmap_get_buffer(pixmap) != front) {
++		DBG(("%s: no, DRI2 drawable is no longer attached (old name=%d, new name=%d) to pixmap=%ld\n",
++		     __FUNCTION__, front->name,
++		     sna_pixmap_get_buffer(pixmap) ? ((DRI2BufferPtr)sna_pixmap_get_buffer(pixmap))->name : 0,
++		     pixmap->drawable.serialNumber));
++		return false;
++	}
++
++	assert(get_private(front)->pixmap == sna->front);
++	assert(sna_pixmap(sna->front)->gpu_bo == get_private(front)->bo);
++
++	if (!get_private(back)->scanout) {
++		DBG(("%s: no, DRI2 drawable was too small at time of creation)\n",
++		     __FUNCTION__));
++		return false;
++	}
++
++	if (get_private(back)->size != get_private(front)->size) {
++		DBG(("%s: no, DRI2 drawable does not fit into scanout\n",
++		     __FUNCTION__));
++		return false;
++	}
++
++	DBG(("%s: window size: %dx%d, clip=(%d, %d), (%d, %d) x %d\n",
++	     __FUNCTION__,
++	     win->drawable.width, win->drawable.height,
++	     win->clipList.extents.x1, win->clipList.extents.y1,
++	     win->clipList.extents.x2, win->clipList.extents.y2,
++	     RegionNumRects(&win->clipList)));
++	if (!RegionEqual(&win->clipList, &draw->pScreen->root->winSize)) {
++		DBG(("%s: no, window is clipped: clip region=(%d, %d), (%d, %d), root size=(%d, %d), (%d, %d)\n",
++		     __FUNCTION__,
++		     win->clipList.extents.x1,
++		     win->clipList.extents.y1,
++		     win->clipList.extents.x2,
++		     win->clipList.extents.y2,
++		     draw->pScreen->root->winSize.extents.x1,
++		     draw->pScreen->root->winSize.extents.y1,
++		     draw->pScreen->root->winSize.extents.x2,
++		     draw->pScreen->root->winSize.extents.y2));
++		return false;
++	}
++
++	if (draw->x != 0 || draw->y != 0 ||
++#ifdef COMPOSITE
++	    draw->x != pixmap->screen_x ||
++	    draw->y != pixmap->screen_y ||
++#endif
++	    draw->width != pixmap->drawable.width ||
++	    draw->height != pixmap->drawable.height) {
++		DBG(("%s: no, window is not full size (%dx%d)!=(%dx%d)\n",
++		     __FUNCTION__,
++		     draw->width, draw->height,
++		     pixmap->drawable.width,
++		     pixmap->drawable.height));
++		return false;
++	}
++
++	/* prevent an implicit tiling mode change */
++	if (get_private(front)->bo->tiling != get_private(back)->bo->tiling) {
++		DBG(("%s -- no, tiling mismatch: front %d, back=%d\n",
++		     __FUNCTION__,
++		     get_private(front)->bo->tiling,
++		     get_private(back)->bo->tiling));
++		return false;
++	}
++
++	return true;
++}
++
++inline static uint32_t pipe_select(int pipe)
++{
++	/* The third pipe was introduced with IvyBridge long after
++	 * multiple pipe support was added to the kernel, hence
++	 * we can safely ignore the capability check - if we have more
++	 * than two pipes, we can assume that they are fully supported.
++	 */
++	if (pipe > 1)
++		return pipe << DRM_VBLANK_HIGH_CRTC_SHIFT;
++	else if (pipe > 0)
++		return DRM_VBLANK_SECONDARY;
++	else
++		return 0;
++}
++
+ static void chain_swap(struct sna *sna,
+ 		       DrawablePtr draw,
+ 		       int frame, unsigned int tv_sec, unsigned int tv_usec,
+@@ -2033,6 +2163,12 @@ sna_dri_schedule_swap(ClientPtr client,
+ 
+ 	assert(sna_pixmap_from_drawable(draw)->flush);
+ 
++	if (can_exchange(sna, draw, front, back) &&
++	    sna_dri_exchange_flip(client, draw, front, back,
++				  target_msc, divisor, remainder,
++				  func, data))
++		return TRUE;
++
+ 	/* Drawable not displayed... just complete the swap */
+ 	pipe = -1;
+ 	if ((sna->flags & SNA_NO_WAIT) == 0)
+@@ -2325,6 +2461,13 @@ out_complete:
  void sna_dri_destroy_window(WindowPtr win) { }
  #endif
  
@@ -167,7 +402,7 @@ index 00a65a9..88d0869 100644
  static bool has_i830_dri(void)
  {
  	return access(DRI_DRIVER_PATH "/i830_dri.so", R_OK) == 0;
-@@ -2471,6 +2478,13 @@ bool sna_dri_open(struct sna *sna, ScreenPtr screen)
+@@ -2474,6 +2617,13 @@ bool sna_dri_open(struct sna *sna, Scree
  	info.ReuseBufferNotify = NULL;
  #endif
  
@@ -181,11 +416,9 @@ index 00a65a9..88d0869 100644
  #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 6d4420f..5cc52d3 100644
 --- a/src/sna/sna_driver.c
 +++ b/src/sna/sna_driver.c
-@@ -514,6 +514,9 @@ static Bool sna_pre_init(ScrnInfoPtr scrn, int flags)
+@@ -512,6 +512,9 @@ static Bool sna_pre_init(ScrnInfoPtr scr
  		goto cleanup;
  	}
  
@@ -195,7 +428,7 @@ index 6d4420f..5cc52d3 100644
  	/* Sanity check */
  	if (hosted() && (sna->flags & SNA_IS_HOSTED) == 0) {
  		xf86DrvMsg(scrn->scrnIndex, X_ERROR,
-@@ -521,9 +524,14 @@ static Bool sna_pre_init(ScrnInfoPtr scrn, int flags)
+@@ -519,9 +522,14 @@ static Bool sna_pre_init(ScrnInfoPtr scr
  		goto cleanup;
  	}
  
@@ -212,17 +445,21 @@ index 6d4420f..5cc52d3 100644
  
  	if (!xf86SetDepthBpp(scrn, preferred_depth, 0, 0,
  			     Support32bppFb |
-@@ -560,6 +568,9 @@ static Bool sna_pre_init(ScrnInfoPtr scrn, int flags)
+@@ -558,9 +566,13 @@ static Bool sna_pre_init(ScrnInfoPtr scr
  
- 	intel_detect_chipset(scrn, sna->pEnt, sna->PciInfo);
+ 	intel_detect_chipset(scrn, pEnt);
  
 +	if (!sna_xmir_pre_init(sna))
 +		goto cleanup;
 +
- 	kgem_init(&sna->kgem, fd, sna->PciInfo, sna->info->gen);
+ 	kgem_init(&sna->kgem, fd,
+ 		  xf86GetPciInfoForEntity(pEnt->index),
+ 		  sna->info->gen);
++
  	if (xf86ReturnOptValBool(sna->Options, OPTION_ACCEL_DISABLE, FALSE) ||
  	    !sna_option_cast_to_bool(sna, OPTION_ACCEL_METHOD, TRUE)) {
-@@ -659,6 +670,8 @@ sna_block_handler(BLOCKHANDLER_ARGS_DECL)
+ 		xf86DrvMsg(sna->scrn->scrnIndex, X_CONFIG,
+@@ -659,6 +671,8 @@ sna_block_handler(BLOCKHANDLER_ARGS_DECL
  
  	if (*tv == NULL || ((*tv)->tv_usec | (*tv)->tv_sec))
  		sna_accel_block_handler(sna, tv);
@@ -231,7 +468,7 @@ index 6d4420f..5cc52d3 100644
  }
  
  static void
-@@ -1010,6 +1023,8 @@ sna_screen_init(SCREEN_INIT_ARGS_DECL)
+@@ -1015,6 +1029,8 @@ sna_screen_init(SCREEN_INIT_ARGS_DECL)
  	if (!miDCInitialize(screen, xf86GetPointerScreenFuncs()))
  		return FALSE;
  
@@ -240,9 +477,6 @@ index 6d4420f..5cc52d3 100644
  	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
-new file mode 100644
-index 0000000..edfe298
 --- /dev/null
 +++ b/src/sna/sna_xmir.c
 @@ -0,0 +1,186 @@

commit 3bfafcdfbdb0de1f041c1b9d358398750a341fe1
Author: Timo Aaltonen <tjaalton@ubuntu.com>
Date:   Wed Oct 9 19:28:49 2013 +0300

    update the changelog

diff --git a/debian/changelog b/debian/changelog
index 0a1167d..2cf0521 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-xserver-xorg-video-intel (2:2.99.903-1) UNRELEASED; urgency=low
+xserver-xorg-video-intel (2:2.99.904-1) UNRELEASED; urgency=low
 
   * New upstream prerelease.
 

commit b9ad5b625e8935a3c115760bdd4738d4432542e3
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Wed Oct 9 17:18:43 2013 +0100

    2.99.904 snapshot

diff --git a/NEWS b/NEWS
index 159c67c..3fb057e 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,41 @@
+Snapshot 2.99.904 (2013-10-09)
+==============================
+There is one more feature planned to be completed for 3.0, so time for a
+snapshot beforehand to push out the bug fixes from the last week.
+
+ * Fix video output using sprites when changing the image size
+
+ * Apply more restrictive tile constaints for 915g class devices
+   https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/1232546
+
+ * Ensure all overlapping rectangles are drawn for XRenderFillRectangles
+   https://bugs.freedesktop.org/show_bug.cgi?id=66313
+
+ * Fix trapezoid clipping against the left-edge
+   https://bugs.freedesktop.org/show_bug.cgi?id=69469
+
+ * Prevent discarding active upload buffers, causing glitches in chromium
+   https://bugs.freedesktop.org/show_bug.cgi?id=66990
+
+ * Prevent specifying a negative timeout to select if the BlockHandler
+   takes too long to update the display
+
+ * Promote the Ironlake pipecontrol to be a full pipeline flush to
+   prevent render cache corruption
+   https://bugs.freedesktop.org/show_bug.cgi?id=51422
+
+ * Never pass an invalid trapezoid to pixman
+   https://bugs.launchpad.net/ubuntu/+source/xorg-server/+bug/1197921
+
+ * Prevent out-of-bounds access by overassigning work amongst threads
+   https://bugs.freedesktop.org/show_bug.cgi?id=70204
+
+ * Make sure the current mode is always listed amongst the output modes
+   https://bugs.freedesktop.org/show_bug.cgi?id=70132
+
+ * Build fixes for 1.14.99.2
+
+
 Snapshot 2.99.903 (2013-09-28)
 ==============================
 Lots more stabilization work, not yet peaceful enough to christen 3.0. We
diff --git a/configure.ac b/configure.ac
index 6445373..b58bb79 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-video-intel],
-        [2.99.903],
+        [2.99.904],
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         [xf86-video-intel])
 AC_CONFIG_SRCDIR([Makefile.am])

commit d1aa2ac5dddf6b8c8c1333aae415abda9ad72d85
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Wed Oct 9 16:22:59 2013 +0100

    sna: Steal the current mode name
    
    Rather than duplicating a string, we can simply transfer ownership from
    the temporary mode to the mode list.
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index e893bcd..71c4c60 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -2112,7 +2112,8 @@ sna_output_get_modes(xf86OutputPtr output)
 		Mode = calloc(1, sizeof(DisplayModeRec));
 		if (Mode) {
 			*Mode = current;
-			Mode->name = strdup(Mode->name);
+			current.name = NULL;
+
 			output->probed_modes =
 				xf86ModesAdd(output->probed_modes, Mode);
 		}

commit 6fda305e2f2f991b39d09e67d0b17c8c3d50f9a4
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Wed Oct 9 15:59:42 2013 +0100

    sna: Append the current mode to the output list if not found
    
    If for some reason the current mode on the CRTC (inherited most likely
    from fastboot) doesn't match any of the modes reported by the output, we
    end up with a stray mode that the client cannot control.
    
    Reported-by: Jiri Slaby <jirislaby@gmail.com>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70132
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index dddc6d7..e893bcd 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -2039,21 +2039,46 @@ sna_output_get_modes(xf86OutputPtr output)
 {
 	struct sna_output *sna_output = output->driver_private;
 	DisplayModePtr Modes = NULL;
+	DisplayModeRec current;
+	bool has_current = false;
 	int i;
 
-	DBG(("%s\n", __FUNCTION__));
+	DBG(("%s(%s)\n", __FUNCTION__, output->name));
 
 	sna_output_attach_edid(output);
 
+	memset(&current, 0, sizeof(current));
+	if (output->crtc) {
+		struct drm_mode_crtc mode;
+
+		VG_CLEAR(mode);
+		mode.crtc_id = to_sna_crtc(output->crtc)->id;
+
+		if (drmIoctl(to_sna(output->scrn)->kgem.fd, DRM_IOCTL_MODE_GETCRTC, &mode) == 0) {
+			DBG(("%s: CRTC:%d, pipe=%d: has mode?=%d\n", __FUNCTION__,
+			     to_sna_crtc(output->crtc)->id,
+			     to_sna_crtc(output->crtc)->pipe,
+			     mode.mode_valid && mode.mode.clock));
+
+			if (mode.mode_valid && mode.mode.clock)
+				mode_from_kmode(output->scrn, &mode.mode, &current);
+		}
+	}
+
 	for (i = 0; i < sna_output->num_modes; i++) {
 		DisplayModePtr Mode;
 
 		Mode = calloc(1, sizeof(DisplayModeRec));
-		if (Mode)
-			Modes = xf86ModesAdd(Modes,
-					     mode_from_kmode(output->scrn,
-							     &sna_output->modes[i],
-							     Mode));
+		if (Mode) {
+			Mode = mode_from_kmode(output->scrn,
+					       &sna_output->modes[i],
+					       Mode);
+
+			if (!has_current && xf86ModesEqual(Mode, &current))
+				has_current = true;
+
+			Modes = xf86ModesAdd(Modes, Mode);
+		}
 	}
 
 	/*
@@ -2081,6 +2106,19 @@ sna_output_get_modes(xf86OutputPtr output)
 		Modes = sna_output_panel_edid(output, Modes);
 	}
 
+	if (!has_current && current.Clock) {
+		DisplayModePtr Mode;
+
+		Mode = calloc(1, sizeof(DisplayModeRec));
+		if (Mode) {
+			*Mode = current;
+			Mode->name = strdup(Mode->name);
+			output->probed_modes =
+				xf86ModesAdd(output->probed_modes, Mode);
+		}
+	}
+	free(current.name);
+
 	return Modes;
 }
 

commit d1cb39d0a86390b7ef704422a5b91f9a012d24a5
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Wed Oct 9 10:32:02 2013 +0100

    sna/gen3+: Flush vertex buffer after computing resize
    
    Upon aligning the buffer, we may enlarge the vbo to accomodate the
    vertex alignment and push the current index past the end of the buffer.
    Move the space check from before the alignment computation to
    afterwards.
    
    Reported-by: Jiri Slaby <jirislaby@gmail.com>
    References: https://bugs.freedesktop.org/show_bug.cgi?id=47597
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/src/sna/gen3_render.c b/src/sna/gen3_render.c
index ebe108d..2445b91 100644
--- a/src/sna/gen3_render.c
+++ b/src/sna/gen3_render.c
@@ -3123,20 +3123,29 @@ static void
 gen3_align_vertex(struct sna *sna,
 		  const struct sna_composite_op *op)
 {
-	if (op->floats_per_vertex != sna->render_state.gen3.last_floats_per_vertex) {
-		if (sna->render.vertex_size - sna->render.vertex_used < 2*op->floats_per_rect)
-			gen3_vertex_finish(sna);
-
-		DBG(("aligning vertex: was %d, now %d floats per vertex, %d->%d\n",
-		     sna->render_state.gen3.last_floats_per_vertex,
-		     op->floats_per_vertex,
-		     sna->render.vertex_index,
-		     (sna->render.vertex_used + op->floats_per_vertex - 1) / op->floats_per_vertex));
-		sna->render.vertex_index = (sna->render.vertex_used + op->floats_per_vertex - 1) / op->floats_per_vertex;
-		sna->render.vertex_used = sna->render.vertex_index * op->floats_per_vertex;
-		assert(sna->render.vertex_used < sna->render.vertex_size - op->floats_per_rect);
-		sna->render_state.gen3.last_floats_per_vertex = op->floats_per_vertex;
+	int vertex_index;
+
+	if (op->floats_per_vertex == sna->render_state.gen3.last_floats_per_vertex)
+		return;
+
+	DBG(("aligning vertex: was %d, now %d floats per vertex\n",
+	     sna->render_state.gen3.last_floats_per_vertex,
+	     op->floats_per_vertex));
+
+	assert(op->floats_per_rect == 3*op->floats_per_vertex);
+
+	vertex_index = (sna->render.vertex_used + op->floats_per_vertex - 1) / op->floats_per_vertex;
+	if ((int)sna->render.vertex_size - vertex_index * op->floats_per_vertex < 2*op->floats_per_rect) {
+		DBG(("%s: flushing vertex buffer: new index=%d, max=%d\n",
+		     __FUNCTION__, vertex_index, sna->render.vertex_size / op->floats_per_vertex));
+		if (gen3_vertex_finish(sna) < op->floats_per_vertex)
+			kgem_submit(&sna->kgem);
+
+		vertex_index = (sna->render.vertex_used + op->floats_per_vertex - 1) / op->floats_per_vertex;
 	}
+
+	sna->render.vertex_index = vertex_index;
+	sna->render.vertex_used = vertex_index * op->floats_per_vertex;
 }
 
 static bool
@@ -3806,8 +3815,8 @@ gen3_render_composite(struct sna *sna,
 			goto cleanup_mask;
 	}
 
-	gen3_emit_composite_state(sna, tmp);
 	gen3_align_vertex(sna, tmp);
+	gen3_emit_composite_state(sna, tmp);
 	return true;
 
 cleanup_mask:
@@ -5021,8 +5030,8 @@ gen3_render_composite_spans(struct sna *sna,
 			goto cleanup_src;
 	}
 
-	gen3_emit_composite_state(sna, &tmp->base);
 	gen3_align_vertex(sna, &tmp->base);
+	gen3_emit_composite_state(sna, &tmp->base);
 	return true;
 
 cleanup_src:
@@ -5665,8 +5674,8 @@ fallback_blt:
 	dst_dy += tmp.dst.y;
 	tmp.dst.x = tmp.dst.y = 0;
 
-	gen3_emit_composite_state(sna, &tmp);
 	gen3_align_vertex(sna, &tmp);
+	gen3_emit_composite_state(sna, &tmp);
 
 	do {
 		int n_this_time;
@@ -5803,8 +5812,8 @@ fallback:
 	tmp->blt  = gen3_render_copy_blt;
 	tmp->done = gen3_render_copy_done;
 
-	gen3_emit_composite_state(sna, &tmp->base);
 	gen3_align_vertex(sna, &tmp->base);
+	gen3_emit_composite_state(sna, &tmp->base);
 	return true;
 }
 
@@ -5943,8 +5952,8 @@ gen3_render_fill_boxes(struct sna *sna,
 		assert(kgem_check_bo(&sna->kgem, dst_bo, NULL));
 	}
 
-	gen3_emit_composite_state(sna, &tmp);
 	gen3_align_vertex(sna, &tmp);
+	gen3_emit_composite_state(sna, &tmp);
 
 	do {
 		int n_this_time;
@@ -6094,8 +6103,8 @@ gen3_render_fill(struct sna *sna, uint8_t alu,
 	tmp->boxes = gen3_render_fill_op_boxes;
 	tmp->done  = gen3_render_fill_op_done;
 
-	gen3_emit_composite_state(sna, &tmp->base);
 	gen3_align_vertex(sna, &tmp->base);
+	gen3_emit_composite_state(sna, &tmp->base);
 	return true;
 }
 
@@ -6172,8 +6181,8 @@ gen3_render_fill_one(struct sna *sna, PixmapPtr dst, struct kgem_bo *bo,
 			return true;
 	}
 
-	gen3_emit_composite_state(sna, &tmp);
 	gen3_align_vertex(sna, &tmp);
+	gen3_emit_composite_state(sna, &tmp);
 	gen3_get_rectangles(sna, &tmp, 1);
 	DBG(("	(%d, %d), (%d, %d): %x\n", x1, y1, x2, y2, color));
 	OUT_VERTEX(x2);
diff --git a/src/sna/gen4_render.c b/src/sna/gen4_render.c
index 416452b..48a8852 100644
--- a/src/sna/gen4_render.c
+++ b/src/sna/gen4_render.c
@@ -827,16 +827,10 @@ gen4_align_vertex(struct sna *sna, const struct sna_composite_op *op)
 {
 	assert(op->floats_per_rect == 3*op->floats_per_vertex);
 	if (op->floats_per_vertex != sna->render_state.gen4.floats_per_vertex) {
-		if (sna->render.vertex_size - sna->render.vertex_used < 2*op->floats_per_rect)
-			gen4_vertex_finish(sna);
-
-		DBG(("aligning vertex: was %d, now %d floats per vertex, %d->%d\n",
+		DBG(("aligning vertex: was %d, now %d floats per vertex\n",
 		     sna->render_state.gen4.floats_per_vertex,
-		     op->floats_per_vertex,
-		     sna->render.vertex_index,
-		     (sna->render.vertex_used + op->floats_per_vertex - 1) / op->floats_per_vertex));
-		sna->render.vertex_index = (sna->render.vertex_used + op->floats_per_vertex - 1) / op->floats_per_vertex;
-		sna->render.vertex_used = sna->render.vertex_index * op->floats_per_vertex;
+		     op->floats_per_vertex));
+		gen4_vertex_align(sna, op);
 		sna->render_state.gen4.floats_per_vertex = op->floats_per_vertex;
 	}
 }
@@ -1396,8 +1390,8 @@ gen4_render_video(struct sna *sna,
 		assert(kgem_check_bo(&sna->kgem, tmp.dst.bo, frame->bo, NULL));
 	}
 
-	gen4_video_bind_surfaces(sna, &tmp);
 	gen4_align_vertex(sna, &tmp);
+	gen4_video_bind_surfaces(sna, &tmp);
 
 	/* Set up the offset for translating from the given region (in screen
 	 * coordinates) to the backing pixmap.
@@ -1987,8 +1981,8 @@ gen4_render_composite(struct sna *sna,
 			goto cleanup_mask;
 	}
 
-	gen4_bind_surfaces(sna, tmp);
 	gen4_align_vertex(sna, tmp);
+	gen4_bind_surfaces(sna, tmp);
 	return true;
 
 cleanup_mask:
@@ -2226,8 +2220,8 @@ gen4_render_composite_spans(struct sna *sna,
 			goto cleanup_src;
 	}
 
-	gen4_bind_surfaces(sna, &tmp->base);
 	gen4_align_vertex(sna, &tmp->base);
+	gen4_bind_surfaces(sna, &tmp->base);
 	return true;
 
 cleanup_src:
@@ -2428,8 +2422,8 @@ fallback_blt:
 	src_dx += tmp.src.offset[0];
 	src_dy += tmp.src.offset[1];
 
-	gen4_copy_bind_surfaces(sna, &tmp);
 	gen4_align_vertex(sna, &tmp);
+	gen4_copy_bind_surfaces(sna, &tmp);
 
 	do {
 		gen4_render_copy_one(sna, &tmp,
@@ -2558,8 +2552,8 @@ fallback:
 			return true;
 	}
 
-	gen4_copy_bind_surfaces(sna, &op->base);
 	gen4_align_vertex(sna, &op->base);
+	gen4_copy_bind_surfaces(sna, &op->base);
 
 	op->blt  = gen4_render_copy_blt;
 	op->done = gen4_render_copy_done;
@@ -2664,8 +2658,8 @@ gen4_render_fill_boxes(struct sna *sna,
 		assert(kgem_check_bo(&sna->kgem, dst_bo, NULL));
 	}
 
-	gen4_bind_surfaces(sna, &tmp);
 	gen4_align_vertex(sna, &tmp);
+	gen4_bind_surfaces(sna, &tmp);
 
 	do {
 		gen4_render_fill_rectangle(sna, &tmp,
@@ -2769,8 +2763,8 @@ gen4_render_fill(struct sna *sna, uint8_t alu,
 		assert(kgem_check_bo(&sna->kgem, dst_bo, NULL));
 	}
 
-	gen4_bind_surfaces(sna, &op->base);
 	gen4_align_vertex(sna, &op->base);
+	gen4_bind_surfaces(sna, &op->base);
 
 	op->blt   = gen4_render_fill_op_blt;
 	op->box   = gen4_render_fill_op_box;
@@ -2853,8 +2847,8 @@ gen4_render_fill_one(struct sna *sna, PixmapPtr dst, struct kgem_bo *bo,
 		}
 	}
 
-	gen4_bind_surfaces(sna, &tmp);
 	gen4_align_vertex(sna, &tmp);
+	gen4_bind_surfaces(sna, &tmp);
 
 	gen4_render_fill_rectangle(sna, &tmp, x1, y1, x2 - x1, y2 - y1);
 
diff --git a/src/sna/gen4_vertex.c b/src/sna/gen4_vertex.c
index e2a4808..0585c4c 100644
--- a/src/sna/gen4_vertex.c
+++ b/src/sna/gen4_vertex.c
@@ -38,6 +38,29 @@
 #define sse2
 #endif
 
+void gen4_vertex_align(struct sna *sna, const struct sna_composite_op *op)
+{
+	int vertex_index;
+
+	assert(op->floats_per_rect == 3*op->floats_per_vertex);
+
+	vertex_index = (sna->render.vertex_used + op->floats_per_vertex - 1) / op->floats_per_vertex;
+	if ((int)sna->render.vertex_size - vertex_index * op->floats_per_vertex < 2*op->floats_per_rect) {
+		DBG(("%s: flushing vertex buffer: new index=%d, max=%d\n",
+		     __FUNCTION__, vertex_index, sna->render.vertex_size / op->floats_per_vertex));
+		if (gen4_vertex_finish(sna) < op->floats_per_rect) {
+			kgem_submit(&sna->kgem);
+			_kgem_set_mode(&sna->kgem, KGEM_RENDER);
+		}
+
+		vertex_index = (sna->render.vertex_used + op->floats_per_vertex - 1) / op->floats_per_vertex;
+		assert(vertex_index * op->floats_per_vertex <= sna->render.vertex_size);
+	}
+
+	sna->render.vertex_index = vertex_index;
+	sna->render.vertex_used = vertex_index * op->floats_per_vertex;
+}
+
 void gen4_vertex_flush(struct sna *sna)
 {
 	DBG(("%s[%x] = %d\n", __FUNCTION__,
diff --git a/src/sna/gen4_vertex.h b/src/sna/gen4_vertex.h
index 1494ba1..03ba2f8 100644
--- a/src/sna/gen4_vertex.h
+++ b/src/sna/gen4_vertex.h
@@ -6,6 +6,7 @@
 #include "sna.h"
 #include "sna_render.h"
 
+void gen4_vertex_align(struct sna *sna, const struct sna_composite_op *op);
 void gen4_vertex_flush(struct sna *sna);
 int gen4_vertex_finish(struct sna *sna);
 void gen4_vertex_close(struct sna *sna);
diff --git a/src/sna/gen5_render.c b/src/sna/gen5_render.c
index 2bd818a..ca41a9a 100644
--- a/src/sna/gen5_render.c
+++ b/src/sna/gen5_render.c
@@ -796,16 +796,10 @@ gen5_align_vertex(struct sna *sna, const struct sna_composite_op *op)
 {
 	assert(op->floats_per_rect == 3*op->floats_per_vertex);
 	if (op->floats_per_vertex != sna->render_state.gen5.floats_per_vertex) {
-		if (sna->render.vertex_size - sna->render.vertex_used < 2*op->floats_per_rect)
-			gen4_vertex_finish(sna);
-
-		DBG(("aligning vertex: was %d, now %d floats per vertex, %d->%d\n",
+		DBG(("aligning vertex: was %d, now %d floats per vertex\n",
 		     sna->render_state.gen5.floats_per_vertex,
-		     op->floats_per_vertex,
-		     sna->render.vertex_index,


Reply to: