summaryrefslogtreecommitdiffstats
path: root/src/glx
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2018-12-27 14:26:33 +1000
committerDave Airlie <[email protected]>2019-01-25 04:27:45 +1000
commit00af91ca463a2486c043c635d94d9958fb1e8700 (patch)
tree4df5f37c228a5126d550af9dd0f04f362bad31c7 /src/glx
parentdb83a2b40f95fa3b9a741e9797dbf3e18f065a71 (diff)
glx: add support for putimageshm2 path (v2)
v2: pass x,0 in as the offset coords at glx level not earlier Cc: <[email protected]> Reviewed-by: Adam Jackson <[email protected]>
Diffstat (limited to 'src/glx')
-rw-r--r--src/glx/drisw_glx.c30
1 files changed, 23 insertions, 7 deletions
diff --git a/src/glx/drisw_glx.c b/src/glx/drisw_glx.c
index 7b99e49f000..00c7fa100ab 100644
--- a/src/glx/drisw_glx.c
+++ b/src/glx/drisw_glx.c
@@ -201,7 +201,8 @@ bytes_per_line(unsigned pitch_bits, unsigned mul)
static void
swrastXPutImage(__DRIdrawable * draw, int op,
- int x, int y, int w, int h, int stride,
+ int srcx, int srcy, int x, int y,
+ int w, int h, int stride,
int shmid, char *data, void *loaderPrivate)
{
struct drisw_drawable *pdp = loaderPrivate;
@@ -235,12 +236,12 @@ swrastXPutImage(__DRIdrawable * draw, int op,
if (pdp->shminfo.shmid >= 0) {
ximage->width = ximage->bytes_per_line / ((ximage->bits_per_pixel + 7)/ 8);
ximage->height = h;
- XShmPutImage(dpy, drawable, gc, ximage, 0, 0, x, y, w, h, False);
+ XShmPutImage(dpy, drawable, gc, ximage, srcx, srcy, x, y, w, h, False);
XSync(dpy, False);
} else {
ximage->width = w;
ximage->height = h;
- XPutImage(dpy, drawable, gc, ximage, 0, 0, x, y, w, h);
+ XPutImage(dpy, drawable, gc, ximage, srcx, srcy, x, y, w, h);
}
ximage->data = NULL;
}
@@ -254,7 +255,21 @@ swrastPutImageShm(__DRIdrawable * draw, int op,
struct drisw_drawable *pdp = loaderPrivate;
pdp->shminfo.shmaddr = shmaddr;
- swrastXPutImage(draw, op, x, y, w, h, stride, shmid,
+ swrastXPutImage(draw, op, 0, 0, x, y, w, h, stride, shmid,
+ shmaddr + offset, loaderPrivate);
+}
+
+static void
+swrastPutImageShm2(__DRIdrawable * draw, int op,
+ int x, int y,
+ int w, int h, int stride,
+ int shmid, char *shmaddr, unsigned offset,
+ void *loaderPrivate)
+{
+ struct drisw_drawable *pdp = loaderPrivate;
+
+ pdp->shminfo.shmaddr = shmaddr;
+ swrastXPutImage(draw, op, x, 0, x, y, w, h, stride, shmid,
shmaddr + offset, loaderPrivate);
}
@@ -263,7 +278,7 @@ swrastPutImage2(__DRIdrawable * draw, int op,
int x, int y, int w, int h, int stride,
char *data, void *loaderPrivate)
{
- swrastXPutImage(draw, op, x, y, w, h, stride, -1,
+ swrastXPutImage(draw, op, 0, 0, x, y, w, h, stride, -1,
data, loaderPrivate);
}
@@ -272,7 +287,7 @@ swrastPutImage(__DRIdrawable * draw, int op,
int x, int y, int w, int h,
char *data, void *loaderPrivate)
{
- swrastXPutImage(draw, op, x, y, w, h, 0, -1,
+ swrastXPutImage(draw, op, 0, 0, x, y, w, h, 0, -1,
data, loaderPrivate);
}
@@ -340,7 +355,7 @@ swrastGetImageShm(__DRIdrawable * read,
}
static const __DRIswrastLoaderExtension swrastLoaderExtension_shm = {
- .base = {__DRI_SWRAST_LOADER, 4 },
+ .base = {__DRI_SWRAST_LOADER, 5 },
.getDrawableInfo = swrastGetDrawableInfo,
.putImage = swrastPutImage,
@@ -349,6 +364,7 @@ static const __DRIswrastLoaderExtension swrastLoaderExtension_shm = {
.getImage2 = swrastGetImage2,
.putImageShm = swrastPutImageShm,
.getImageShm = swrastGetImageShm,
+ .putImageShm2 = swrastPutImageShm2,
};
static const __DRIextension *loader_extensions_shm[] = {