@samitouri / QOSamiQemu / commits / 5c531f80f6

ati-vga: Read aliased values from DP_GUI_MASTER_CNTL

DP_GUI_MASTER_CNTL aliases several fields from DP_DATATYPE and DP_MIX. These were being written correctly but not returned on a read of DP_GUI_MASTER_CNTL. Signed-off-by: Chad Jablonski <chad@jablonski.xyz> Reviewed-by: BALATON Zoltan <balaton@eik.bme.hu> Message-ID: <20260303024730.1489136-4-chad@jablonski.xyz> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>

Chad Jablonski committed Mar 2, 2026 at 21:47 UTC 5c531f80f6ba3fc905ed9c9bc0b7158a9f715589
2 files changed +12 -1
hw/display/ati.c
+7 -1
@@ -460,7 +460,13 @@ static uint64_t ati_mm_read(void *opaque, hwaddr addr, unsigned int size)
460 val = s->regs.dst_y;
461 break;
462 case DP_GUI_MASTER_CNTL:
463 - val = s->regs.dp_gui_master_cntl;
463 + /* DP_GUI_MASTER_CNTL aliases fields from DP_MIX and DP_DATATYPE */
464 + val = s->regs.dp_gui_master_cntl |
465 + ((s->regs.dp_datatype & DP_BRUSH_DATATYPE) >> 4) |
466 + ((s->regs.dp_datatype & DP_DST_DATATYPE) << 8) |
467 + ((s->regs.dp_datatype & DP_SRC_DATATYPE) >> 4) |
468 + (s->regs.dp_mix & DP_ROP3) |
469 + ((s->regs.dp_mix & DP_SRC_SOURCE) << 16);
470 break;
471 case SRC_OFFSET:
472 val = s->regs.src_offset;
hw/display/ati_regs.h
+5
@@ -386,6 +386,9 @@
386 #define DST_16BPP 0x00000004
387 #define DST_24BPP 0x00000005
388 #define DST_32BPP 0x00000006
389 +#define DP_DST_DATATYPE 0x0000000f
390 +#define DP_BRUSH_DATATYPE 0x00000f00
391 +#define DP_SRC_DATATYPE 0x00030000
392
393 #define BRUSH_SOLIDCOLOR 0x00000d00
394
@@ -437,6 +440,8 @@
440 #define DP_SRC_RECT 0x00000200
441 #define DP_SRC_HOST 0x00000300
442 #define DP_SRC_HOST_BYTEALIGN 0x00000400
443 +#define DP_SRC_SOURCE 0x00000700
444 +#define DP_ROP3 0x00ff0000
445
446 /* LVDS_GEN_CNTL constants */
447 #define LVDS_BL_MOD_LEVEL_MASK 0x0000ff00