Add 0001-drisw-Modify-drisw_swap_buffers_with_damage-to-swap-.patch Add 0002-Revert-drisw-Copy-entire-buffer-ignoring-damage-regi.patch Resolves: https://issues.redhat.com/browse/RHEL-105157
73 lines
2.8 KiB
Diff
73 lines
2.8 KiB
Diff
From 48799005d7f3b099cb2e93d09ce6dc211f619887 Mon Sep 17 00:00:00 2001
|
|
From: Lucas Fryzek <lfryzek@igalia.com>
|
|
Date: Wed, 3 Dec 2025 19:19:56 -0500
|
|
Subject: [PATCH 2/2] Revert "drisw: Copy entire buffer ignoring damage
|
|
regions"
|
|
|
|
This reverts commit 755e795e4c0d2660129c14998425f7dd3299bdf9.
|
|
|
|
Cc: mesa-stable
|
|
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38817>
|
|
---
|
|
src/gallium/winsys/sw/dri/dri_sw_winsys.c | 38 +++++++++++++++++------
|
|
1 file changed, 29 insertions(+), 9 deletions(-)
|
|
|
|
diff --git a/src/gallium/winsys/sw/dri/dri_sw_winsys.c b/src/gallium/winsys/sw/dri/dri_sw_winsys.c
|
|
index 7d18b6138ea..0b2c8754ec5 100644
|
|
--- a/src/gallium/winsys/sw/dri/dri_sw_winsys.c
|
|
+++ b/src/gallium/winsys/sw/dri/dri_sw_winsys.c
|
|
@@ -352,21 +352,41 @@ 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;
|
|
+ unsigned width, height, x = 0, y = 0;
|
|
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.
|
|
*/
|
|
- 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;
|
|
+ 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);
|
|
+ }
|
|
+ }
|
|
}
|
|
|
|
static void
|
|
--
|
|
2.52.0
|
|
|