summaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys/sw
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/winsys/sw
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/winsys/sw')
-rw-r--r--src/gallium/winsys/sw/dri/dri_sw_winsys.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/gallium/winsys/sw/dri/dri_sw_winsys.c b/src/gallium/winsys/sw/dri/dri_sw_winsys.c
index cd44b036c6f..c0200f939b6 100644
--- a/src/gallium/winsys/sw/dri/dri_sw_winsys.c
+++ b/src/gallium/winsys/sw/dri/dri_sw_winsys.c
@@ -244,15 +244,20 @@ dri_sw_displaytarget_display(struct sw_winsys *ws,
unsigned width, height, x = 0, y = 0;
unsigned blsize = util_format_get_blocksize(dri_sw_dt->format);
unsigned offset = 0;
+ unsigned offset_x = 0;
char *data = dri_sw_dt->data;
-
+ bool is_shm = dri_sw_dt->shmid != -1;
/* Set the width to 'stride / cpp'.
*
* PutImage correctly clips to the width of the dst drawable.
*/
if (box) {
- offset = (dri_sw_dt->stride * box->y) + box->x * blsize;
+ offset = dri_sw_dt->stride * box->y;
+ offset_x = box->x * blsize;
data += offset;
+ /* don't add x offset for shm, the put_image_shm will deal with it */
+ if (!is_shm)
+ data += offset_x;
x = box->x;
y = box->y;
width = box->width;
@@ -262,8 +267,8 @@ dri_sw_displaytarget_display(struct sw_winsys *ws,
height = dri_sw_dt->height;
}
- if (dri_sw_dt->shmid != -1) {
- dri_sw_ws->lf->put_image_shm(dri_drawable, dri_sw_dt->shmid, dri_sw_dt->data, offset,
+ if (is_shm) {
+ dri_sw_ws->lf->put_image_shm(dri_drawable, dri_sw_dt->shmid, dri_sw_dt->data, offset, offset_x,
x, y, width, height, dri_sw_dt->stride);
return;
}