On Wed, 4 Feb 2026, Chad Jablonski wrote:
ati_2d_blt uses a mixture of locals and direct register access of needed
state. This assigns all values derived from register state to local
variables. It prepares the function for a larger refactor that removes
the dependency on the full device and direct register access entirely.

Signed-off-by: Chad Jablonski <[email protected]>
---
hw/display/ati_2d.c | 97 ++++++++++++++++++++++++---------------------
1 file changed, 52 insertions(+), 45 deletions(-)

diff --git a/hw/display/ati_2d.c b/hw/display/ati_2d.c
index e8b9bf5f70..618aedc3da 100644
--- a/hw/display/ati_2d.c
+++ b/hw/display/ati_2d.c
@@ -65,10 +65,20 @@ void ati_2d_blt(ATIVGAState *s)
{
    /* FIXME it is probably more complex than this and may need to be */
    /* rewritten but for now as a start just to get some output: */
-    unsigned dst_x = (s->regs.dp_cntl & DST_X_LEFT_TO_RIGHT ?
-                      s->regs.dst_x : s->regs.dst_x + 1 - s->regs.dst_width);
-    unsigned dst_y = (s->regs.dp_cntl & DST_Y_TOP_TO_BOTTOM ?
-                      s->regs.dst_y : s->regs.dst_y + 1 - s->regs.dst_height);
+    bool use_pixman_fill = s->use_pixman & BIT(0);
+    bool use_pixman_blt = s->use_pixman & BIT(1);
+    int rop3 = s->regs.dp_mix & GMC_ROP3_MASK;

Next patch has uint32_t rop3 but since GMC_ROP3_MASK masks out sign bit probably does not matter maybe only for consistency.

Reviewed-by: BALATON Zoltan <[email protected]>

Reply via email to