summaryrefslogtreecommitdiffstats
path: root/xorg
diff options
context:
space:
mode:
authorJay Sorg <jay.sorg@gmail.com>2014-09-28 15:27:08 -0700
committerJay Sorg <jay.sorg@gmail.com>2014-09-28 15:27:08 -0700
commitf14caed95b44567675169bc293c37460322d14ae (patch)
tree5f33a42e5fb00ca35887de293c01658d01a69c7b /xorg
parent1956bc88e11391f7faa973092270647340b40c5b (diff)
downloadxrdp-proprietary-f14caed95b44567675169bc293c37460322d14ae.tar.gz
xrdp-proprietary-f14caed95b44567675169bc293c37460322d14ae.zip
Xorg: align memory in Xv
Diffstat (limited to 'xorg')
-rw-r--r--xorg/server/module/rdp.h1
-rw-r--r--xorg/server/module/rdpXv.c22
-rw-r--r--xorg/server/module/x86/yv12_to_rgb32_x86_sse2.asm27
3 files changed, 37 insertions, 13 deletions
diff --git a/xorg/server/module/rdp.h b/xorg/server/module/rdp.h
index 2909c7bc..538e92c8 100644
--- a/xorg/server/module/rdp.h
+++ b/xorg/server/module/rdp.h
@@ -78,6 +78,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define RDPMAX(_val1, _val2) ((_val1) < (_val2) ? (_val2) : (_val1))
#define RDPCLAMP(_val, _lo, _hi) \
(_val) < (_lo) ? (_lo) : (_val) > (_hi) ? (_hi) : (_val)
+#define RDPALIGN(_val, _al) ((((long)(_val)) + ((_al) - 1)) & ~((_al) - 1))
#define XRDP_CD_NODRAW 0
#define XRDP_CD_NOCLIP 1
diff --git a/xorg/server/module/rdpXv.c b/xorg/server/module/rdpXv.c
index 3638b2ea..dc6d5418 100644
--- a/xorg/server/module/rdpXv.c
+++ b/xorg/server/module/rdpXv.c
@@ -440,6 +440,7 @@ xrdpVidPutImage(ScrnInfoPtr pScrn,
int jndex;
int num_clips;
int error;
+ void *mem;
RegionRec dreg;
BoxRec box;
@@ -447,15 +448,16 @@ xrdpVidPutImage(ScrnInfoPtr pScrn,
LLOGLN(10, ("xrdpVidPutImage: src_x %d srcy_y %d", src_x, src_y));
dev = XRDPPTR(pScrn);
- index = width * height * 4 + drw_w * drw_h * 4;
- rgborg32 = (int *) g_malloc(index, 0);
- if (rgborg32 == NULL)
+ index = width * height * 4 + drw_w * drw_h * 4 + 64;
+ mem = g_malloc(index, 0);
+ if (mem == NULL)
{
LLOGLN(0, ("xrdpVidPutImage: memory alloc error"));
return Success;
}
+ rgborg32 = (int *) RDPALIGN(mem, 16);
rgbend32 = rgborg32 + width * height;
-
+ rgbend32 = (int *) RDPALIGN(rgbend32, 16);
error = 0;
switch (format)
{
@@ -469,20 +471,20 @@ xrdpVidPutImage(ScrnInfoPtr pScrn,
break;
case FOURCC_YUY2:
LLOGLN(10, ("xrdpVidPutImage: FOURCC_YUY2"));
- error = YUY2_to_RGB32(buf, width, height, rgborg32);
+ error = dev->yuy2_to_rgb32(buf, width, height, rgborg32);
break;
case FOURCC_UYVY:
LLOGLN(10, ("xrdpVidPutImage: FOURCC_UYVY"));
- error = UYVY_to_RGB32(buf, width, height, rgborg32);
+ error = dev->uyvy_to_rgb32(buf, width, height, rgborg32);
break;
default:
LLOGLN(0, ("xrdpVidPutImage: unknown format 0x%8.8x", format));
- g_free(rgborg32);
+ g_free(mem);
return Success;
}
if (error != 0)
{
- g_free(rgborg32);
+ g_free(mem);
return Success;
}
error = stretch_RGB32_RGB32(rgborg32, width, height,
@@ -490,7 +492,7 @@ xrdpVidPutImage(ScrnInfoPtr pScrn,
rgbend32, drw_w, drw_h);
if (error != 0)
{
- g_free(rgborg32);
+ g_free(mem);
return Success;
}
@@ -529,7 +531,7 @@ xrdpVidPutImage(ScrnInfoPtr pScrn,
rdpClientConAddAllReg(dev, &dreg, dst);
rdpRegionUninit(&dreg);
- g_free(rgborg32);
+ g_free(mem);
return Success;
}
diff --git a/xorg/server/module/x86/yv12_to_rgb32_x86_sse2.asm b/xorg/server/module/x86/yv12_to_rgb32_x86_sse2.asm
index 4d7638ef..1145f9fd 100644
--- a/xorg/server/module/x86/yv12_to_rgb32_x86_sse2.asm
+++ b/xorg/server/module/x86/yv12_to_rgb32_x86_sse2.asm
@@ -1,4 +1,25 @@
-
+;
+;Copyright 2014 Jay Sorg
+;
+;Permission to use, copy, modify, distribute, and sell this software and its
+;documentation for any purpose is hereby granted without fee, provided that
+;the above copyright notice appear in all copies and that both that
+;copyright notice and this permission notice appear in supporting
+;documentation.
+;
+;The above copyright notice and this permission notice 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 NONINFRINGEMENT. IN NO EVENT SHALL THE
+;OPEN GROUP 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.
+;
+;YV12 to RGB32
+;x86 SSE2 32 bit
+;
; RGB to YUV
; 0.299 0.587 0.114
; -0.14713 -0.28886 0.436
@@ -87,10 +108,10 @@ do8:
movdqa xmm4, xmm3
punpcklwd xmm3, xmm5 ; argb
- movdqu [edi], xmm3
+ movdqa [edi], xmm3
add edi, 16
punpckhwd xmm4, xmm5 ; argb
- movdqu [edi], xmm4
+ movdqa [edi], xmm4
add edi, 16
ret;