[xorg-x11-drv-intel/f15] various backports
Adam Jackson
ajax at fedoraproject.org
Tue Jul 5 17:44:27 UTC 2011
commit 0e19e073597da0b7cdecac43081c7c0384cfa0bf
Author: Adam Jackson <ajax at redhat.com>
Date: Tue Jul 5 13:44:14 2011 -0400
various backports
intel-2.15-stable.patch | 600 +++++++++++++++++++++++++++++++++++++++++++++++
xorg-x11-drv-intel.spec | 8 +-
2 files changed, 607 insertions(+), 1 deletions(-)
---
diff --git a/intel-2.15-stable.patch b/intel-2.15-stable.patch
new file mode 100644
index 0000000..1161c00
--- /dev/null
+++ b/intel-2.15-stable.patch
@@ -0,0 +1,600 @@
+Squashed backport series. Refer to the git repo:
+
+http://cgit.freedesktop.org/~ajax/xf86-video-intel
+
+diff --git a/src/i965_video.c b/src/i965_video.c
+index c757681..53a9394 100644
+--- a/src/i965_video.c
++++ b/src/i965_video.c
+@@ -1210,7 +1210,7 @@ I965DisplayVideoTextured(ScrnInfoPtr scrn,
+ intel_batch_submit(scrn);
+ }
+
+- intel_batch_start_atomic(scrn, 100);
++ intel_batch_start_atomic(scrn, 150);
+
+ i965_emit_video_setup(scrn, surface_state_binding_table_bo, n_src_surf, pixmap);
+
+diff --git a/src/intel_batchbuffer.c b/src/intel_batchbuffer.c
+index 289ed2b..95eca43 100644
+--- a/src/intel_batchbuffer.c
++++ b/src/intel_batchbuffer.c
+@@ -175,13 +175,6 @@ void intel_batch_emit_flush(ScrnInfoPtr scrn)
+ intel_batch_do_flush(scrn);
+ }
+
+-static Bool intel_batch_needs_flush(intel_screen_private *intel)
+-{
+- ScreenPtr screen = intel->scrn->pScreen;
+- PixmapPtr pixmap = screen->GetScreenPixmap(screen);
+- return intel_get_pixmap_private(pixmap)->batch_write;
+-}
+-
+ void intel_batch_submit(ScrnInfoPtr scrn)
+ {
+ intel_screen_private *intel = intel_get_screen_private(scrn);
+@@ -241,8 +234,6 @@ void intel_batch_submit(ScrnInfoPtr scrn)
+ }
+ }
+
+- intel->needs_flush |= intel_batch_needs_flush(intel);
+-
+ while (!list_is_empty(&intel->batch_pixmaps)) {
+ struct intel_pixmap *entry;
+
+diff --git a/src/intel_batchbuffer.h b/src/intel_batchbuffer.h
+index 605932a..f5f118e 100644
+--- a/src/intel_batchbuffer.h
++++ b/src/intel_batchbuffer.h
+@@ -50,14 +50,14 @@ static inline int intel_vertex_space(intel_screen_private *intel)
+ }
+
+ static inline void
+-intel_batch_require_space(ScrnInfoPtr scrn, intel_screen_private *intel, unsigned int sz)
++intel_batch_require_space(ScrnInfoPtr scrn, intel_screen_private *intel, int sz)
+ {
+ assert(sz < intel->batch_bo->size - 8);
+ if (intel_batch_space(intel) < sz)
+ intel_batch_submit(scrn);
+ }
+
+-static inline void intel_batch_start_atomic(ScrnInfoPtr scrn, unsigned int sz)
++static inline void intel_batch_start_atomic(ScrnInfoPtr scrn, int sz)
+ {
+ intel_screen_private *intel = intel_get_screen_private(scrn);
+
+@@ -137,6 +137,8 @@ intel_batch_mark_pixmap_domains(intel_screen_private *intel,
+
+ priv->batch_write |= write_domain != 0;
+ priv->busy = 1;
++
++ intel->needs_flush |= write_domain != 0;
+ }
+
+ static inline void
+diff --git a/src/intel_dri.c b/src/intel_dri.c
+index a39b512..49a2d4b 100644
+--- a/src/intel_dri.c
++++ b/src/intel_dri.c
+@@ -182,6 +182,8 @@ static PixmapPtr fixup_shadow(DrawablePtr drawable, PixmapPtr pixmap)
+ /* And redirect the pixmap to the new bo (for 3D). */
+ intel_set_pixmap_private(old, priv);
+ old->refcnt++;
++
++ intel_get_screen_private(xf86Screens[screen->myNum])->needs_flush = TRUE;
+ return old;
+ }
+
+diff --git a/src/intel_video.c b/src/intel_video.c
+index 499614f..021ca5f 100644
+--- a/src/intel_video.c
++++ b/src/intel_video.c
+@@ -1599,6 +1599,7 @@ I830PutImageTextured(ScrnInfoPtr scrn,
+ pixmap);
+ }
+
++ intel_get_screen_private(scrn)->needs_flush = TRUE;
+ DamageDamageRegion(drawable, clipBoxes);
+
+ return Success;
+diff --git a/uxa/uxa-accel.c b/uxa/uxa-accel.c
+index 0650ac2..516834f 100644
+--- a/uxa/uxa-accel.c
++++ b/uxa/uxa-accel.c
+@@ -1,3 +1,4 @@
++
+ /*
+ * Copyright ® 2001 Keith Packard
+ *
+@@ -36,24 +37,6 @@
+ #include "uxa.h"
+ #include "mipict.h"
+
+-static CARD32
+-format_for_depth(int depth)
+-{
+- switch (depth) {
+- case 1: return PICT_a1;
+- case 4: return PICT_a4;
+- case 8: return PICT_a8;
+- case 15: return PICT_x1r5g5b5;
+- case 16: return PICT_r5g6b5;
+- default:
+- case 24: return PICT_x8r8g8b8;
+-#if XORG_VERSION_CURRENT >= 10699900
+- case 30: return PICT_x2r10g10b10;
+-#endif
+- case 32: return PICT_a8r8g8b8;
+- }
+-}
+-
+ static void
+ uxa_fill_spans(DrawablePtr pDrawable, GCPtr pGC, int n,
+ DDXPointPtr ppt, int *pwidth, int fSorted)
+@@ -61,17 +44,11 @@ uxa_fill_spans(DrawablePtr pDrawable, GCPtr pGC, int n,
+ ScreenPtr screen = pDrawable->pScreen;
+ uxa_screen_t *uxa_screen = uxa_get_screen(screen);
+ RegionPtr pClip = fbGetCompositeClip(pGC);
+- PixmapPtr dst_pixmap, src_pixmap = NULL;
+- BoxPtr pextent, pbox;
++ PixmapPtr dst_pixmap;
++ BoxPtr pbox;
+ int nbox;
+- int extentX1, extentX2, extentY1, extentY2;
+- int fullX1, fullX2, fullY1;
+- int partX1, partX2;
++ int x1, x2, y;
+ int off_x, off_y;
+- xRenderColor color;
+- PictFormatPtr format;
+- PicturePtr dst, src;
+- int error;
+
+ if (uxa_screen->swappedOut || uxa_screen->force_fallback)
+ goto fallback;
+@@ -83,129 +60,6 @@ uxa_fill_spans(DrawablePtr pDrawable, GCPtr pGC, int n,
+ if (!dst_pixmap)
+ goto fallback;
+
+- if (pGC->alu != GXcopy || !UXA_PM_IS_SOLID(pDrawable, pGC->planemask))
+- goto solid;
+-
+- format = PictureMatchFormat(screen,
+- dst_pixmap->drawable.depth,
+- format_for_depth(dst_pixmap->drawable.depth));
+- dst = CreatePicture(0, &dst_pixmap->drawable, format, 0, 0, serverClient, &error);
+- if (!dst)
+- goto solid;
+-
+- ValidatePicture(dst);
+-
+- uxa_get_rgba_from_pixel(pGC->fgPixel,
+- &color.red,
+- &color.green,
+- &color.blue,
+- &color.alpha,
+- format_for_depth(dst_pixmap->drawable.depth));
+- src = CreateSolidPicture(0, &color, &error);
+- if (!src) {
+- FreePicture(dst, 0);
+- goto solid;
+- }
+-
+- if (!uxa_screen->info->check_composite(PictOpSrc, src, NULL, dst, 0, 0)) {
+- FreePicture(src, 0);
+- FreePicture(dst, 0);
+- goto solid;
+- }
+-
+- if (!uxa_screen->info->check_composite_texture ||
+- !uxa_screen->info->check_composite_texture(screen, src)) {
+- PicturePtr solid;
+- int src_off_x, src_off_y;
+-
+- solid = uxa_acquire_solid(screen, src->pSourcePict);
+- FreePicture(src, 0);
+- if (!solid) {
+- FreePicture(dst, 0);
+- goto solid;
+- }
+-
+- src = solid;
+- src_pixmap = uxa_get_offscreen_pixmap(src->pDrawable,
+- &src_off_x, &src_off_y);
+- if (!src_pixmap) {
+- FreePicture(src, 0);
+- FreePicture(dst, 0);
+- goto solid;
+- }
+- }
+-
+- if (!uxa_screen->info->prepare_composite(PictOpSrc, src, NULL, dst, src_pixmap, NULL, dst_pixmap)) {
+- FreePicture(src, 0);
+- FreePicture(dst, 0);
+- goto solid;
+- }
+-
+- pextent = REGION_EXTENTS(pGC->screen, pClip);
+- extentX1 = pextent->x1;
+- extentY1 = pextent->y1;
+- extentX2 = pextent->x2;
+- extentY2 = pextent->y2;
+- while (n--) {
+- fullX1 = ppt->x;
+- fullY1 = ppt->y;
+- fullX2 = fullX1 + (int)*pwidth;
+- ppt++;
+- pwidth++;
+-
+- if (fullY1 < extentY1 || extentY2 <= fullY1)
+- continue;
+-
+- if (fullX1 < extentX1)
+- fullX1 = extentX1;
+-
+- if (fullX2 > extentX2)
+- fullX2 = extentX2;
+-
+- if (fullX1 >= fullX2)
+- continue;
+-
+- nbox = REGION_NUM_RECTS(pClip);
+- if (nbox == 1) {
+- uxa_screen->info->composite(dst_pixmap,
+- 0, 0, 0, 0,
+- fullX1 + off_x,
+- fullY1 + off_y,
+- fullX2 - fullX1, 1);
+- } else {
+- pbox = REGION_RECTS(pClip);
+- while (nbox--) {
+- if (pbox->y1 > fullY1)
+- break;
+-
+- if (pbox->y1 <= fullY1) {
+- partX1 = pbox->x1;
+- if (partX1 < fullX1)
+- partX1 = fullX1;
+-
+- partX2 = pbox->x2;
+- if (partX2 > fullX2)
+- partX2 = fullX2;
+-
+- if (partX2 > partX1) {
+- uxa_screen->info->composite(dst_pixmap,
+- 0, 0, 0, 0,
+- partX1 + off_x,
+- fullY1 + off_y,
+- partX2 - partX1, 1);
+- }
+- }
+- pbox++;
+- }
+- }
+- }
+-
+- uxa_screen->info->done_composite(dst_pixmap);
+- FreePicture(src, 0);
+- FreePicture(dst, 0);
+- return;
+-
+-solid:
+ if (uxa_screen->info->check_solid &&
+ !uxa_screen->info->check_solid(pDrawable, pGC->alu, pGC->planemask))
+ goto fallback;
+@@ -216,58 +70,32 @@ solid:
+ pGC->fgPixel))
+ goto fallback;
+
+- pextent = REGION_EXTENTS(pGC->screen, pClip);
+- extentX1 = pextent->x1;
+- extentY1 = pextent->y1;
+- extentX2 = pextent->x2;
+- extentY2 = pextent->y2;
+ while (n--) {
+- fullX1 = ppt->x;
+- fullY1 = ppt->y;
+- fullX2 = fullX1 + (int)*pwidth;
++ x1 = ppt->x;
++ y = ppt->y;
++ x2 = x1 + (int)*pwidth;
+ ppt++;
+ pwidth++;
+
+- if (fullY1 < extentY1 || extentY2 <= fullY1)
+- continue;
++ nbox = REGION_NUM_RECTS(pClip);
++ pbox = REGION_RECTS(pClip);
++ while (nbox--) {
++ if (pbox->y1 > y || pbox->y2 <= y)
++ continue;
+
+- if (fullX1 < extentX1)
+- fullX1 = extentX1;
++ if (x1 < pbox->x1)
++ x1 = pbox->x1;
+
+- if (fullX2 > extentX2)
+- fullX2 = extentX2;
++ if (x2 > pbox->x2)
++ x2 = pbox->x2;
+
+- if (fullX1 >= fullX2)
+- continue;
++ if (x2 <= x1)
++ continue;
+
+- nbox = REGION_NUM_RECTS(pClip);
+- if (nbox == 1) {
+ (*uxa_screen->info->solid) (dst_pixmap,
+- fullX1 + off_x,
+- fullY1 + off_y,
+- fullX2 + off_x,
+- fullY1 + 1 + off_y);
+- } else {
+- pbox = REGION_RECTS(pClip);
+- while (nbox--) {
+- if (pbox->y1 <= fullY1 && fullY1 < pbox->y2) {
+- partX1 = pbox->x1;
+- if (partX1 < fullX1)
+- partX1 = fullX1;
+- partX2 = pbox->x2;
+- if (partX2 > fullX2)
+- partX2 = fullX2;
+- if (partX2 > partX1) {
+- (*uxa_screen->info->
+- solid) (dst_pixmap,
+- partX1 + off_x,
+- fullY1 + off_y,
+- partX2 + off_x,
+- fullY1 + 1 + off_y);
+- }
+- }
+- pbox++;
+- }
++ x1 + off_x, y + off_y,
++ x2 + off_x, y + 1 + off_y);
++ pbox++;
+ }
+ }
+ (*uxa_screen->info->done_solid) (dst_pixmap);
+@@ -839,10 +667,7 @@ uxa_poly_fill_rect(DrawablePtr pDrawable,
+ RegionPtr pClip = fbGetCompositeClip(pGC);
+ PixmapPtr pPixmap;
+ register BoxPtr pbox;
+- BoxPtr pextent;
+- int extentX1, extentX2, extentY1, extentY2;
+ int fullX1, fullX2, fullY1, fullY2;
+- int partX1, partX2, partY1, partY2;
+ int xoff, yoff;
+ int xorg, yorg;
+ int n;
+@@ -904,11 +729,6 @@ fallback:
+ xorg = pDrawable->x;
+ yorg = pDrawable->y;
+
+- pextent = REGION_EXTENTS(pGC->pScreen, pClip);
+- extentX1 = pextent->x1;
+- extentY1 = pextent->y1;
+- extentX2 = pextent->x2;
+- extentY2 = pextent->y2;
+ while (nrect--) {
+ fullX1 = prect->x + xorg;
+ fullY1 = prect->y + yorg;
+@@ -916,62 +736,37 @@ fallback:
+ fullY2 = fullY1 + (int)prect->height;
+ prect++;
+
+- if (fullX1 < extentX1)
+- fullX1 = extentX1;
+-
+- if (fullY1 < extentY1)
+- fullY1 = extentY1;
+-
+- if (fullX2 > extentX2)
+- fullX2 = extentX2;
++ n = REGION_NUM_RECTS(pClip);
++ pbox = REGION_RECTS(pClip);
++ /*
++ * clip the rectangle to each box in the clip region
++ * this is logically equivalent to calling Intersect(),
++ * but rectangles may overlap each other here.
++ */
++ while (n--) {
++ int x1 = fullX1;
++ int x2 = fullX2;
++ int y1 = fullY1;
++ int y2 = fullY2;
++
++ if (pbox->x1 > x1)
++ x1 = pbox->x1;
++ if (pbox->x2 < x2)
++ x2 = pbox->x2;
++ if (pbox->y1 > y1)
++ y1 = pbox->y1;
++ if (pbox->y2 < y2)
++ y2 = pbox->y2;
++ pbox++;
+
+- if (fullY2 > extentY2)
+- fullY2 = extentY2;
++ if (x1 >= x2 || y1 >= y2)
++ continue;
+
+- if ((fullX1 >= fullX2) || (fullY1 >= fullY2))
+- continue;
+- n = REGION_NUM_RECTS(pClip);
+- if (n == 1) {
+ (*uxa_screen->info->solid) (pPixmap,
+- fullX1 + xoff,
+- fullY1 + yoff,
+- fullX2 + xoff,
+- fullY2 + yoff);
+- } else {
+- pbox = REGION_RECTS(pClip);
+- /*
+- * clip the rectangle to each box in the clip region
+- * this is logically equivalent to calling Intersect(),
+- * but rectangles may overlap each other here.
+- */
+- while (n--) {
+- partX1 = pbox->x1;
+- if (partX1 < fullX1)
+- partX1 = fullX1;
+- partY1 = pbox->y1;
+- if (partY1 < fullY1)
+- partY1 = fullY1;
+- partX2 = pbox->x2;
+- if (partX2 > fullX2)
+- partX2 = fullX2;
+- partY2 = pbox->y2;
+- if (partY2 > fullY2)
+- partY2 = fullY2;
+-
+- pbox++;
+-
+- if (partX1 < partX2 && partY1 < partY2) {
+- (*uxa_screen->info->solid) (pPixmap,
+- partX1 +
+- xoff,
+- partY1 +
+- yoff,
+- partX2 +
+- xoff,
+- partY2 +
+- yoff);
+- }
+- }
++ x1 + xoff,
++ y1 + yoff,
++ x2 + xoff,
++ y2 + yoff);
+ }
+ }
+ (*uxa_screen->info->done_solid) (pPixmap);
+@@ -1040,7 +835,7 @@ uxa_fill_region_solid(DrawablePtr pDrawable,
+ PixmapPtr pixmap;
+ int xoff, yoff;
+ int nbox;
+- BoxPtr pBox, extents;
++ BoxPtr pBox;
+ Bool ret = FALSE;
+
+ pixmap = uxa_get_offscreen_pixmap(pDrawable, &xoff, &yoff);
+@@ -1051,105 +846,21 @@ uxa_fill_region_solid(DrawablePtr pDrawable,
+
+ nbox = REGION_NUM_RECTS(pRegion);
+ pBox = REGION_RECTS(pRegion);
+- extents = REGION_EXTENTS(screen, pRegion);
+-
+- /* Using GEM, the relocation costs outweigh the advantages of the blitter */
+- if (nbox == 1 || (alu != GXcopy && alu != GXclear) || !UXA_PM_IS_SOLID(&pixmap->drawable, planemask)) {
+-try_solid:
+- if (uxa_screen->info->check_solid &&
+- !uxa_screen->info->check_solid(&pixmap->drawable, alu, planemask))
+- goto err;
+
+- if (!uxa_screen->info->prepare_solid(pixmap, alu, planemask, pixel))
+- goto err;
+-
+- while (nbox--) {
+- uxa_screen->info->solid(pixmap,
+- pBox->x1, pBox->y1,
+- pBox->x2, pBox->y2);
+- pBox++;
+- }
+-
+- uxa_screen->info->done_solid(pixmap);
+- } else {
+- PicturePtr dst, src;
+- PixmapPtr src_pixmap = NULL;
+- xRenderColor color;
+- int error;
+-
+- dst = CreatePicture(0, &pixmap->drawable,
+- PictureMatchFormat(screen,
+- pixmap->drawable.depth,
+- format_for_depth(pixmap->drawable.depth)),
+- 0, 0, serverClient, &error);
+- if (!dst)
+- goto err;
+-
+- ValidatePicture(dst);
+-
+- uxa_get_rgba_from_pixel(pixel,
+- &color.red,
+- &color.green,
+- &color.blue,
+- &color.alpha,
+- format_for_depth(pixmap->drawable.depth));
+- src = CreateSolidPicture(0, &color, &error);
+- if (!src) {
+- FreePicture(dst, 0);
+- goto err;
+- }
+-
+- if (!uxa_screen->info->check_composite(PictOpSrc, src, NULL, dst,
+- extents->x2 - extents->x1,
+- extents->y2 - extents->y1)) {
+- FreePicture(src, 0);
+- FreePicture(dst, 0);
+- goto try_solid;
+- }
+-
+- if (!uxa_screen->info->check_composite_texture ||
+- !uxa_screen->info->check_composite_texture(screen, src)) {
+- PicturePtr solid;
+- int src_off_x, src_off_y;
+-
+- solid = uxa_acquire_solid(screen, src->pSourcePict);
+- FreePicture(src, 0);
+- if (!solid) {
+- FreePicture(dst, 0);
+- goto err;
+- }
+-
+- src = solid;
+- src_pixmap = uxa_get_offscreen_pixmap(src->pDrawable,
+- &src_off_x, &src_off_y);
+- if (!src_pixmap) {
+- FreePicture(src, 0);
+- FreePicture(dst, 0);
+- goto err;
+- }
+- }
+-
+- if (!uxa_screen->info->prepare_composite(PictOpSrc, src, NULL, dst, src_pixmap, NULL, pixmap)) {
+- FreePicture(src, 0);
+- FreePicture(dst, 0);
+- goto err;
+- }
++ if (uxa_screen->info->check_solid &&
++ !uxa_screen->info->check_solid(&pixmap->drawable, alu, planemask))
++ goto err;
+
+- while (nbox--) {
+- uxa_screen->info->composite(pixmap,
+- 0, 0, 0, 0,
+- pBox->x1,
+- pBox->y1,
+- pBox->x2 - pBox->x1,
+- pBox->y2 - pBox->y1);
+- pBox++;
+- }
++ if (!uxa_screen->info->prepare_solid(pixmap, alu, planemask, pixel))
++ goto err;
+
+- uxa_screen->info->done_composite(pixmap);
+- FreePicture(src, 0);
+- FreePicture(dst, 0);
++ while (nbox--) {
++ uxa_screen->info->solid(pixmap,
++ pBox->x1, pBox->y1,
++ pBox->x2, pBox->y2);
++ pBox++;
+ }
+-
++ uxa_screen->info->done_solid(pixmap);
+ ret = TRUE;
+
+ err:
diff --git a/xorg-x11-drv-intel.spec b/xorg-x11-drv-intel.spec
index 5735f18..6799e08 100644
--- a/xorg-x11-drv-intel.spec
+++ b/xorg-x11-drv-intel.spec
@@ -6,7 +6,7 @@
Summary: Xorg X11 Intel video driver
Name: xorg-x11-drv-intel
Version: 2.15.0
-Release: 3%{?dist}
+Release: 4%{?dist}
URL: http://www.x.org
License: MIT
Group: User Interface/X Hardware Support
@@ -20,6 +20,7 @@ Source4: make-git-snapshot.sh
#Patch2: copy-fb.patch
Patch22: intel-2.11.0-vga-clock-max.patch
+Patch23: intel-2.15-stable.patch
ExclusiveArch: %{ix86} x86_64 ia64
@@ -70,6 +71,7 @@ Debugging tools for Intel graphics chips
%setup -q -n xf86-video-intel-%{dirsuffix} -b3
#patch2 -p1 -b .copy-fb
%patch22 -p1 -b .vga-clock
+%patch23 -p1 -b .stable
%build
@@ -123,6 +125,10 @@ rm -rf $RPM_BUILD_ROOT
%{_mandir}/man1/intel_*.1*
%changelog
+* Tue Jul 05 2011 Adam Jackson <ajax at redhat.com> 2.15.0-4
+- intel-2.15-stable.patch: Non-SNA-related bugfixes from master (#717331,
+ #716494)
+
* Wed Apr 27 2011 Adam Jackson <ajax at redhat.com> 2.15.0-3
- Bump libdrm requires. (#699669)
More information about the scm-commits
mailing list