Hello community, here is the log from the commit of package xgl checked in at Sat Jun 3 01:01:11 CEST 2006. -------- --- xgl/xgl.changes 2006-05-30 01:22:10.000000000 +0200 +++ xgl/xgl.changes 2006-06-02 15:15:29.000000000 +0200 @@ -1,0 +2,9 @@ +Fri Jun 2 15:11:14 CEST 2006 - dreveman@suse.de + +- Fix integer overflow in xglfill.c (bnc #151836) +- Add workaround to get java apps working. (bnc #151836) +- Add some basic YUY2 conversion code. (bnc #180807) +- Compute stride for other formats than YV12 correctly. + (bnc #180807) + +------------------------------------------------------------------- New: ---- xgl-java-wmhack.diff xgl-overflow-fix.diff xgl-yuy2.diff ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ xgl.spec ++++++ --- /var/tmp/diff_new_pack.SkgimT/_old 2006-06-03 01:00:49.000000000 +0200 +++ /var/tmp/diff_new_pack.SkgimT/_new 2006-06-03 01:00:49.000000000 +0200 @@ -24,7 +24,7 @@ Requires: xgl-hardware-list Autoreqprov: on Version: cvs_060522 -Release: 3 +Release: 4 Summary: Xserver that uses OpenGL for its drawing operations. BuildRoot: %{_tmppath}/%{name}-%{version}-build ExclusiveArch: %ix86 x86_64 ppc ppc64 ia64 @@ -44,6 +44,9 @@ Patch3: xgl-maprules-tolower-fix.diff Patch4: 178214.diff Patch5: 178234-2.diff +Patch6: xgl-java-wmhack.diff +Patch7: xgl-overflow-fix.diff +Patch8: xgl-yuy2.diff %description Xgl is an Xserver that uses OpenGL for its drawing operations. Some @@ -83,6 +86,9 @@ patch -d xorg-* -p0 < $RPM_SOURCE_DIR/xgl-maprules-tolower-fix.diff || exit 1 patch -d xorg-* -p0 < $RPM_SOURCE_DIR/178214.diff || exit 1 patch -d xorg-* -p0 < $RPM_SOURCE_DIR/178234-2.diff || exit 1 +patch -d xorg-* -p0 < $RPM_SOURCE_DIR/xgl-java-wmhack.diff || exit 1 +patch -d xorg-* -p0 < $RPM_SOURCE_DIR/xgl-overflow-fix.diff || exit 1 +patch -d xorg-* -p0 < $RPM_SOURCE_DIR/xgl-yuy2.diff || exit 1 %build PREFIX=$RPM_BUILD_ROOT/usr/X11R6/lib/xgl @@ -145,6 +151,12 @@ /var/adm/fillup-templates/sysconfig.displaymanager-%name %changelog -n xgl +* Fri Jun 02 2006 - dreveman@suse.de +- Fix integer overflow in xglfill.c (bnc #151836) +- Add workaround to get java apps working. (bnc #151836) +- Add some basic YUY2 conversion code. (bnc #180807) +- Compute stride for other formats than YV12 correctly. + (bnc #180807) * Tue May 30 2006 - dreveman@suse.de - Fix typo in xglFillSegment. (bnc #178234) * Fri May 26 2006 - dreveman@suse.de ++++++ xgl-java-wmhack.diff ++++++ --- dix/window.c 2006/05/29 18:12:27 1.1 +++ dix/window.c 2006/05/29 18:15:15 @@ -1265,8 +1265,12 @@ result = EventSelectForWindow(pWin, client, (Mask )*pVlist); if (result) { - error = result; - goto PatchUp; + if (vmask != CWEventMask || + (Mask)*pVlist != SubstructureRedirectMask) + { + error = result; + goto PatchUp; + } } pVlist++; break; ++++++ xgl-overflow-fix.diff ++++++ --- hw/xgl/xglfill.c 29 May 2006 23:04:38 -0000 1.9.2.2 +++ hw/xgl/xglfill.c 31 May 2006 01:21:06 -0000 @@ -172,6 +172,7 @@ RegionPtr pClip = pGC->pCompositeClip; BoxPtr pClipBox; BoxPtr pExtent = REGION_EXTENTS (pGC->pScreen, pClip); + int fullX1, fullX2, fullY1, fullY2; BoxRec part, full; BoxPtr heapBox = NULL; BoxRec stackBox[N_STACK_BOX]; @@ -181,21 +182,26 @@ while (nrect--) { - full.x1 = prect->x + pDrawable->x; - full.y1 = prect->y + pDrawable->y; - full.x2 = full.x1 + (int) prect->width; - full.y2 = full.y1 + (int) prect->height; + fullX1 = prect->x + pDrawable->x; + fullY1 = prect->y + pDrawable->y; + fullX2 = fullX1 + (int) prect->width; + fullY2 = fullY1 + (int) prect->height; prect++; - if (full.x1 < pExtent->x1) - full.x1 = pExtent->x1; - if (full.y1 < pExtent->y1) - full.y1 = pExtent->y1; - if (full.x2 > pExtent->x2) - full.x2 = pExtent->x2; - if (full.y2 > pExtent->y2) - full.y2 = pExtent->y2; + if (fullX1 < pExtent->x1) + fullX1 = pExtent->x1; + if (fullY1 < pExtent->y1) + fullY1 = pExtent->y1; + if (fullX2 > pExtent->x2) + fullX2 = pExtent->x2; + if (fullY2 > pExtent->y2) + fullY2 = pExtent->y2; + + full.x1 = fullX1; + full.y1 = fullY1; + full.x2 = fullX2; + full.y2 = fullY2; if (full.x1 >= full.x2 || full.y1 >= full.y2) continue; @@ -246,6 +252,7 @@ RegionPtr pClip = pGC->pCompositeClip; BoxPtr pClipBox; BoxPtr pExtent = REGION_EXTENTS (pGC->pScreen, pClip); + int fullX1, fullX2, fullY1, fullY2; BoxRec part, full; BoxPtr heapBox = NULL; BoxRec stackBox[N_STACK_BOX]; @@ -255,22 +262,27 @@ while (n--) { - full.x1 = ppt->x; - full.y1 = ppt->y; - full.x2 = full.x1 + *pwidth; - full.y2 = full.y1 + 1; + fullX1 = ppt->x; + fullY1 = ppt->y; + fullX2 = fullX1 + *pwidth; + fullY2 = fullY1 + 1; pwidth++; ppt++; - if (full.x1 < pExtent->x1) - full.x1 = pExtent->x1; - if (full.y1 < pExtent->y1) - full.y1 = pExtent->y1; - if (full.x2 > pExtent->x2) - full.x2 = pExtent->x2; - if (full.y2 > pExtent->y2) - full.y2 = pExtent->y2; + if (fullX1 < pExtent->x1) + fullX1 = pExtent->x1; + if (fullY1 < pExtent->y1) + fullY1 = pExtent->y1; + if (fullX2 > pExtent->x2) + fullX2 = pExtent->x2; + if (fullY2 > pExtent->y2) + fullY2 = pExtent->y2; + + full.x1 = fullX1; + full.y1 = fullY1; + full.x2 = fullX2; + full.y2 = fullY2; if (full.x1 >= full.x2 || full.y1 >= full.y2) continue; @@ -373,6 +385,7 @@ if (horizontalAndVertical) { BoxPtr pClipBox; + int fullX1, fullX2, fullY1, fullY2; BoxRec part, full; BoxPtr heapBox = NULL; BoxRec stackBox[N_STACK_BOX]; @@ -403,49 +416,49 @@ { if (dx > 0) { - full.x1 = pt.x + pDrawable->x; + fullX1 = pt.x + pDrawable->x; if (npt || coincidentEndpoints) - full.x2 = full.x1 + dx; + fullX2 = fullX1 + dx; else - full.x2 = full.x1 + dx + 1; + fullX2 = fullX1 + dx + 1; } else { - full.x2 = pt.x + pDrawable->x + 1; + fullX2 = pt.x + pDrawable->x + 1; if (npt || coincidentEndpoints) - full.x1 = full.x2 + dx; + fullX1 = fullX2 + dx; else - full.x1 = full.x2 + dx - 1; + fullX1 = fullX2 + dx - 1; } - full.y1 = pt.y + pDrawable->y; - full.y2 = full.y1 + 1; + fullY1 = pt.y + pDrawable->y; + fullY2 = fullY1 + 1; } else { if (dy > 0) { - full.y1 = pt.y + pDrawable->y; + fullY1 = pt.y + pDrawable->y; if (npt || coincidentEndpoints) - full.y2 = full.y1 + dy; + fullY2 = fullY1 + dy; else - full.y2 = full.y1 + dy + 1; + fullY2 = fullY1 + dy + 1; } else { - full.y2 = pt.y + pDrawable->y + 1; + fullY2 = pt.y + pDrawable->y + 1; if (npt || coincidentEndpoints) - full.y1 = full.y2 + dy; + fullY1 = fullY2 + dy; else - full.y1 = full.y2 + dy - 1; + fullY1 = fullY2 + dy - 1; } - full.x1 = pt.x + pDrawable->x; - full.x2 = full.x1 + 1; + fullX1 = pt.x + pDrawable->x; + fullX2 = fullX1 + 1; } pt.x += dx; @@ -453,14 +466,19 @@ ppt++; - if (full.x1 < pExtent->x1) - full.x1 = pExtent->x1; - if (full.y1 < pExtent->y1) - full.y1 = pExtent->y1; - if (full.x2 > pExtent->x2) - full.x2 = pExtent->x2; - if (full.y2 > pExtent->y2) - full.y2 = pExtent->y2; + if (fullX1 < pExtent->x1) + fullX1 = pExtent->x1; + if (fullY1 < pExtent->y1) + fullY1 = pExtent->y1; + if (fullX2 > pExtent->x2) + fullX2 = pExtent->x2; + if (fullY2 > pExtent->y2) + fullY2 = pExtent->y2; + + full.x1 = fullX1; + full.y1 = fullY1; + full.x2 = fullX2; + full.y2 = fullY2; if (full.x1 >= full.x2 || full.y1 >= full.y2) continue; @@ -570,6 +588,7 @@ if (horizontalAndVertical) { BoxPtr pClipBox; + int fullX1, fullX2, fullY1, fullY2; BoxRec part, full; BoxPtr heapBox = NULL; BoxRec stackBox[N_STACK_BOX]; @@ -583,57 +602,62 @@ { if (pSegInit->x1 < pSegInit->x2) { - full.x1 = pSegInit->x1; - full.x2 = pSegInit->x2; + fullX1 = pSegInit->x1; + fullX2 = pSegInit->x2; if (pGC->capStyle != CapNotLast) - full.x2++; + fullX2++; } else { - full.x1 = pSegInit->x2; - full.x2 = pSegInit->x1 + 1; + fullX1 = pSegInit->x2; + fullX2 = pSegInit->x1 + 1; if (pGC->capStyle == CapNotLast) - full.x1++; + fullX1++; } - full.x1 += pDrawable->x; - full.x2 += pDrawable->x; - full.y1 = pSegInit->y1 + pDrawable->y; - full.y2 = full.y1 + 1; + fullX1 += pDrawable->x; + fullX2 += pDrawable->x; + fullY1 = pSegInit->y1 + pDrawable->y; + fullY2 = fullY1 + 1; } else { if (pSegInit->y1 < pSegInit->y2) { - full.y1 = pSegInit->y1; - full.y2 = pSegInit->y2; + fullY1 = pSegInit->y1; + fullY2 = pSegInit->y2; if (pGC->capStyle != CapNotLast) - full.y2++; + fullY2++; } else { - full.y1 = pSegInit->y2; - full.y2 = pSegInit->y1 + 1; + fullY1 = pSegInit->y2; + fullY2 = pSegInit->y1 + 1; if (pGC->capStyle == CapNotLast) - full.y1++; + fullY1++; } - full.y1 += pDrawable->y; - full.y2 += pDrawable->y; - full.x1 = pSegInit->x1 + pDrawable->x; - full.x2 = full.x1 + 1; + fullY1 += pDrawable->y; + fullY2 += pDrawable->y; + fullX1 = pSegInit->x1 + pDrawable->x; + fullX2 = fullX1 + 1; } pSegInit++; - if (full.x1 < pExtent->x1) - full.x1 = pExtent->x1; - if (full.y1 < pExtent->y1) - full.y1 = pExtent->y1; - if (full.x2 > pExtent->x2) - full.x2 = pExtent->x2; - if (full.y2 > pExtent->y2) - full.y2 = pExtent->y2; + if (fullX1 < pExtent->x1) + fullX1 = pExtent->x1; + if (fullY1 < pExtent->y1) + fullY1 = pExtent->y1; + if (fullX2 > pExtent->x2) + fullX2 = pExtent->x2; + if (fullY2 > pExtent->y2) + fullY2 = pExtent->y2; + + full.x1 = fullX1; + full.y1 = fullY1; + full.x2 = fullX2; + full.y2 = fullY2; if (full.x1 >= full.x2 || full.y1 >= full.y2) continue; ++++++ xgl-yuy2.diff ++++++ --- fb/fbmmx.c 18 Apr 2006 20:54:02 -0000 1.21.6.4 +++ fb/fbmmx.c 2 Jun 2006 10:07:40 -0000 @@ -2416,9 +2416,9 @@ } static __inline__ CARD32 -loadyv12 (CARD8 *py, - CARD8 *pu, - CARD8 *pv) +loadyuv (CARD8 *py, + CARD8 *pu, + CARD8 *pv) { INT16 y, u, v; INT32 r, g, b; @@ -2560,7 +2560,7 @@ while (w && (unsigned long) py & 7) { - *((CARD32 *) pd) = loadyv12 (py, pu, pv); + *((CARD32 *) pd) = loadyuv (py, pu, pv); pd += 4; py += 1; @@ -2589,7 +2589,7 @@ while (w) { - *((CARD32 *) pd) = loadyv12 (py, pu, pv); + *((CARD32 *) pd) = loadyuv (py, pu, pv); pd += 4; py += 1; @@ -2606,6 +2606,51 @@ return slb->line[i]; } +static __inline__ CARD8 * +loadyuy2_scanline (ScanlineBuf *slb, + int y, + CARD8 *src, + int stride, + int x, + int width) +{ + CARD8 *py, *pu, *pv, *pd; + int i, w; + + y = _y_to_scanline (slb, y); + + for (i = 0; slb->lock[i]; i++); + + slb->y[i] = y; + slb->lock[i] = TRUE; + + py = src + stride * (y >> 0); + pu = py + 1; + pv = py + 3; + + pd = slb->line[i]; + + w = width; + + while (w) + { + *((CARD32 *) pd) = loadyuv (py, pu, pv); + + pd += 4; + py += 2; + + if (w & 1) + { + pu += 4; + pv += 4; + } + + w--; + } + + return slb->line[i]; +} + static __inline__ CARD8 interpolate_bilinear (int distx, int idistx, @@ -2857,7 +2902,7 @@ while (w && (unsigned long) py & 7) { - *((CARD32 *) pd) = loadyv12 (py, pu, pv); + *((CARD32 *) pd) = loadyuv (py, pu, pv); pd += 4; py += 1; @@ -2886,7 +2931,7 @@ while (w) { - *((CARD32 *) pd) = loadyv12 (py, pu, pv); + *((CARD32 *) pd) = loadyuv (py, pu, pv); pd += 4; py += 1; @@ -2916,5 +2961,215 @@ _mm_empty (); } +/* TODO: MMX code for yuy2 */ +void +fbCompositeSrc_yuy2x8888mmx (CARD8 op, + PicturePtr pSrc, + PicturePtr pMask, + PicturePtr pDst, + INT16 xSrc, + INT16 ySrc, + INT16 xMask, + INT16 yMask, + INT16 xDst, + INT16 yDst, + CARD16 width, + CARD16 height) +{ + PictTransform *transform = pSrc->transform; + CARD8 *dst, *src; + FbBits *srcBits; + FbStride srcStride; + int srcXoff; + int srcYoff; + FbBits *dstBits; + FbStride dstStride; + int dstXoff; + int dstYoff; + int bpp, offset, w; + CARD8 *pd; + + fbGetDrawable (pSrc->pDrawable, srcBits, srcStride, bpp, srcXoff, srcYoff); + fbGetDrawable (pDst->pDrawable, dstBits, dstStride, bpp, dstXoff, dstYoff); + + dst = (CARD8 *) dstBits; + dstStride *= sizeof (FbBits); + + src = (CARD8 *) srcBits; + srcStride *= sizeof (FbBits); + + if (transform) + { + /* transformation is a Y coordinate flip, this is achieved by + moving start offsets for each plane and changing sign of stride */ + if (pSrc->transform->matrix[0][0] == (1 << 16) && + pSrc->transform->matrix[1][1] == -(1 << 16) && + pSrc->transform->matrix[0][2] == 0 && + pSrc->transform->matrix[1][2] == (pSrc->pDrawable->height << 16)) + { + src = src + (pSrc->pDrawable->height - 1) * srcStride; + + srcStride = -srcStride; + + transform = 0; + } + } + + dst += dstStride * (yDst + dstYoff) + ((xDst + dstXoff) << 2); + + if (transform) + { + ScanlineBuf slb; + CARD8 _scanline_buf[8192]; + CARD8 *ps, *ps0, *ps1; + int x, x0, y, line, xStep, yStep; + int distx, idistx, disty, idisty; + int srcEnd = pSrc->pDrawable->width << 16; + + x0 = pSrc->transform->matrix[0][2] + ((xSrc + srcXoff) << 16); + y = pSrc->transform->matrix[1][2] + ((ySrc + srcYoff) << 16); + + xStep = pSrc->transform->matrix[0][0]; + yStep = pSrc->transform->matrix[1][1]; + + init_scanline_buffer (&slb, + _scanline_buf, sizeof (_scanline_buf), + pSrc->pDrawable->width << 2, + pSrc->pDrawable->height); + + while (height--) + { + disty = (y >> 8) & 0xff; + idisty = 256 - disty; + line = y >> 16; + + ps0 = get_scanline (&slb, line); + ps1 = get_scanline (&slb, line + 1); + + if (!ps0) + ps0 = loadyuy2_scanline (&slb, line, + src, srcStride, + 0, pSrc->pDrawable->width); + + if (!ps1) + ps1 = loadyuy2_scanline (&slb, line + 1, + src, srcStride, + 0, pSrc->pDrawable->width); + + pd = dst; + + x = x0; + w = width; + + if (pSrc->filter == PictFilterBilinear) + { + while (w && x < 0) + { + interpolate_bilinear_8888 (0, 256, disty, idisty, + ps0, ps1, 0, pd); + + x += xStep; + pd += 4; + w -= 1; + } + + while (w && x < srcEnd) + { + distx = (x >> 8) & 0xff; + idistx = 256 - distx; + + interpolate_bilinear_8888 (distx, idistx, disty, idisty, + ps0, ps1, (x >> 14) & ~3, pd); + + x += xStep; + pd += 4; + w -= 1; + } + + while (w) + { + interpolate_bilinear_8888 (256, 0, disty, idisty, + ps0, ps1, (x >> 14) & ~3, pd); + + pd += 4; + w -= 1; + } + } + else + { + while (w && x < 0) + { + *(CARD32 *) pd = *(CARD32 *) ps0; + + x += xStep; + pd += 4; + w -= 1; + } + + while (w && x < srcEnd) + { + *(CARD32 *) pd = ((CARD32 *) ps0)[x >> 16]; + + x += xStep; + pd += 4; + w -= 1; + } + + while (w) + { + *(CARD32 *) pd = ((CARD32 *) ps0)[x >> 16]; + + pd += 4; + w -= 1; + } + } + + y += yStep; + dst += dstStride; + + release_scanlines (&slb); + } + + fini_scanline_buffer (&slb); + } + else + { + CARD8 *py, *pu, *pv; + + src += srcStride * (ySrc >> 0) + srcYoff + (xSrc + srcXoff); + + while (height) + { + py = src; + pu = src + 1; + pv = src + 3; + pd = dst; + + w = width; + + while (w) + { + *((CARD32 *) pd) = loadyuv (py, pu, pv); + + pd += 4; + py += 2; + + if (w & 1) + { + pu += 4; + pv += 4; + } + + w--; + } + + dst += dstStride; + src += srcStride; + + height--; + } + } +} + #endif /* RENDER */ #endif /* USE_MMX */ --- fb/fbmmx.h 13 Apr 2006 13:28:27 -0000 1.8.8.1 +++ fb/fbmmx.h 2 Jun 2006 10:07:40 -0000 @@ -231,4 +231,18 @@ CARD16 width, CARD16 height); +void +fbCompositeSrc_yuy2x8888mmx (CARD8 op, + PicturePtr pSrc, + PicturePtr pMask, + PicturePtr pDst, + INT16 xSrc, + INT16 ySrc, + INT16 xMask, + INT16 yMask, + INT16 xDst, + INT16 yDst, + CARD16 width, + CARD16 height); + #endif /* USE_MMX */ --- fb/fbpict.c 13 Apr 2006 13:28:27 -0000 1.20.6.4 +++ fb/fbpict.c 2 Jun 2006 10:07:40 -0000 @@ -874,8 +874,8 @@ maskAlphaMap = pMask->alphaMap != 0; } - /* YV12 is only used internally for XVideo */ - if (pSrc->format == PICT_yv12) + /* YUV is only used internally for XVideo */ + if (pSrc->format == PICT_yv12 || pSrc->format == PICT_yuy2) { #ifdef USE_MMX /* non rotating transformation */ @@ -890,7 +890,12 @@ case PICT_a8r8g8b8: case PICT_x8r8g8b8: if (fbHaveMMX()) - func = fbCompositeSrc_yv12x8888mmx; + { + if (pSrc->format == PICT_yv12) + func = fbCompositeSrc_yv12x8888mmx; + else + func = fbCompositeSrc_yuy2x8888mmx; + } break; } } Index: hw/xgl/xglxv.c =================================================================== RCS file: /cvs/xorg/xserver/xorg/hw/xgl/xglxv.c,v retrieving revision 1.1.2.3 diff -u -r1.1.2.3 xglxv.c --- hw/xgl/xglxv.c 19 May 2006 12:36:26 -0000 1.1.2.3 +++ hw/xgl/xglxv.c 2 Jun 2006 10:07:40 -0000 @@ -298,7 +298,7 @@ ScreenPtr pScreen = pDrawable->pScreen; PicturePtr pSrc; PictTransform transform; - int depth, bpp, noVisual = FALSE; + int depth, bpp, stride, noVisual = FALSE; CARD32 format; XGL_SCREEN_PRIV (pScreen); @@ -306,11 +306,14 @@ XGL_DRAWABLE_PIXMAP (pDrawable); XGL_PIXMAP_PRIV (pPixmap); + stride = ((srcWidth + 7) & ~7); + switch (pImage->id) { case GLITZ_FOURCC_YUY2: bpp = depth = 16; format = PICT_yuy2; noVisual = !pScreenPriv->pXvVisual[XGL_XV_FORMAT_YUY2].format.surface; + stride *= 2; break; case GLITZ_FOURCC_YV12: depth = bpp = 12; @@ -321,6 +324,7 @@ depth = 24; bpp = 32; format = PICT_x8r8g8b8; + stride *= 4; break; default: return BadImplementation; @@ -339,7 +343,7 @@ srcWidth, srcHeight, depth, bpp, -1, (pointer) data); - XGL_GET_PIXMAP_PRIV (pPortPriv->pPixmap)->stride = -((srcWidth + 7) & ~7); + XGL_GET_PIXMAP_PRIV (pPortPriv->pPixmap)->stride = -stride; pPortPriv->pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER; @@ -594,11 +598,6 @@ pAdaptor->nImages = sizeof (xvImages) / sizeof (XvImageRec); pAdaptor->pImages = xvImages; - /* XXX: Disable YUY2 format as it's not accelerated and the software - fallback got issues. */ - pAdaptor->nImages = sizeof (xvImages) / sizeof (XvImageRec) - 1; - pAdaptor->pImages = &xvImages[1]; - /* TODO: Currently no attributes */ pAdaptor->nAttributes = 0; pAdaptor->pAttributes = 0; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit-unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit-help@opensuse.org
participants (1)
-
root@suse.de