mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 07:28:11 +02:00
drisw: Copy entire buffer ignoring damage regions
swapping buffers with damage is supposed to swap the entire buffer
and only pass the damage region as a hint to compositor as to what
updated. This change forces drisw to copy the entire buffer as there
is no method right now to check what was updated.
Fixes: cda627eb48
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31210>
This commit is contained in:
parent
60c53f5e63
commit
755e795e4c
1 changed files with 9 additions and 29 deletions
|
|
@ -357,41 +357,21 @@ dri_sw_displaytarget_display(struct sw_winsys *ws,
|
|||
struct dri_sw_winsys *dri_sw_ws = dri_sw_winsys(ws);
|
||||
struct dri_sw_displaytarget *dri_sw_dt = dri_sw_displaytarget(dt);
|
||||
struct dri_drawable *dri_drawable = (struct dri_drawable *)context_private;
|
||||
unsigned width, height, x = 0, y = 0;
|
||||
unsigned width, height;
|
||||
unsigned blsize = util_format_get_blocksize(dri_sw_dt->format);
|
||||
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 (!nboxes) {
|
||||
width = dri_sw_dt->stride / blsize;
|
||||
height = dri_sw_dt->height;
|
||||
if (is_shm)
|
||||
dri_sw_ws->lf->put_image_shm(dri_drawable, dri_sw_dt->shmid, dri_sw_dt->data, 0, 0,
|
||||
0, 0, width, height, dri_sw_dt->stride);
|
||||
else
|
||||
dri_sw_ws->lf->put_image(dri_drawable, dri_sw_dt->data, width, height);
|
||||
return;
|
||||
}
|
||||
for (unsigned i = 0; i < nboxes; i++) {
|
||||
unsigned offset = dri_sw_dt->stride * box[i].y;
|
||||
unsigned offset_x = box[i].x * blsize;
|
||||
char *data = dri_sw_dt->data + offset;
|
||||
x = box[i].x;
|
||||
y = box[i].y;
|
||||
width = box[i].width;
|
||||
height = box[i].height;
|
||||
if (is_shm) {
|
||||
/* don't add x offset for shm, the put_image_shm will deal with it */
|
||||
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);
|
||||
} else {
|
||||
data += offset_x;
|
||||
dri_sw_ws->lf->put_image2(dri_drawable, data,
|
||||
x, y, width, height, dri_sw_dt->stride);
|
||||
}
|
||||
}
|
||||
width = dri_sw_dt->stride / blsize;
|
||||
height = dri_sw_dt->height;
|
||||
if (is_shm)
|
||||
dri_sw_ws->lf->put_image_shm(dri_drawable, dri_sw_dt->shmid, dri_sw_dt->data, 0, 0,
|
||||
0, 0, width, height, dri_sw_dt->stride);
|
||||
else
|
||||
dri_sw_ws->lf->put_image(dri_drawable, dri_sw_dt->data, width, height);
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue