aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2018-12-27 14:26:49 +1000
committerDave Airlie <[email protected]>2019-01-25 04:27:45 +1000
commit1f6b92b47652e7f48f03ef6a4228a19537022d23 (patch)
treeb9ee40dabee18b1175c5e27e8494a265b6d41bf4 /src/gallium/state_trackers
parent00af91ca463a2486c043c635d94d9958fb1e8700 (diff)
gallium: use put image shm2 path (v2)
This fixes the drisw paths to use the new shm2 interface, so that we don't trigger the X server overflow checks when the x offset is non-zero. This just hides the versioning in drisw, and either passes the src_x or adds the offset fixup for the fallback path. Cc: <[email protected]> Reviewed-by: Adam Jackson <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r--src/gallium/state_trackers/dri/drisw.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/gallium/state_trackers/dri/drisw.c b/src/gallium/state_trackers/dri/drisw.c
index 5a0d2e1354d..927ac39ce65 100644
--- a/src/gallium/state_trackers/dri/drisw.c
+++ b/src/gallium/state_trackers/dri/drisw.c
@@ -79,15 +79,21 @@ put_image2(__DRIdrawable *dPriv, void *data, int x, int y,
static inline void
put_image_shm(__DRIdrawable *dPriv, int shmid, char *shmaddr,
- unsigned offset, int x, int y,
+ unsigned offset, unsigned offset_x, int x, int y,
unsigned width, unsigned height, unsigned stride)
{
__DRIscreen *sPriv = dPriv->driScreenPriv;
const __DRIswrastLoaderExtension *loader = sPriv->swrast_loader;
- loader->putImageShm(dPriv, __DRI_SWRAST_IMAGE_OP_SWAP,
- x, y, width, height, stride,
- shmid, shmaddr, offset, dPriv->loaderPrivate);
+ /* if we have the newer interface, don't have to add the offset_x here. */
+ if (loader->base.version > 4 && loader->putImageShm2)
+ loader->putImageShm2(dPriv, __DRI_SWRAST_IMAGE_OP_SWAP,
+ x, y, width, height, stride,
+ shmid, shmaddr, offset, dPriv->loaderPrivate);
+ else
+ loader->putImageShm(dPriv, __DRI_SWRAST_IMAGE_OP_SWAP,
+ x, y, width, height, stride,
+ shmid, shmaddr, offset + offset_x, dPriv->loaderPrivate);
}
static inline void
@@ -179,12 +185,13 @@ drisw_put_image2(struct dri_drawable *drawable,
static inline void
drisw_put_image_shm(struct dri_drawable *drawable,
int shmid, char *shmaddr, unsigned offset,
+ unsigned offset_x,
int x, int y, unsigned width, unsigned height,
unsigned stride)
{
__DRIdrawable *dPriv = drawable->dPriv;
- put_image_shm(dPriv, shmid, shmaddr, offset, x, y, width, height, stride);
+ put_image_shm(dPriv, shmid, shmaddr, offset, offset_x, x, y, width, height, stride);
}
static inline void