qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 2/3] ati-vga: Support unaligned access to hardwa


From: Gerd Hoffmann
Subject: Re: [Qemu-devel] [PATCH 2/3] ati-vga: Support unaligned access to hardware cursor registers
Date: Wed, 21 Aug 2019 11:08:26 +0200
User-agent: NeoMutt/20180716

  Hi,

> @@ -672,48 +678,71 @@ static void ati_mm_write(void *opaque, hwaddr addr,
>      case 0xf00 ... 0xfff:
>          /* read-only copy of PCI config space so ignore writes */
>          break;
> -    case CUR_OFFSET:
> -        if (s->regs.cur_offset != (data & 0x87fffff0)) {
> -            s->regs.cur_offset = data & 0x87fffff0;
> +    case CUR_OFFSET ... CUR_OFFSET + 3:
> +    {
> +        uint32_t t = s->regs.cur_offset;
> +
> +        ati_reg_write_offs(&t, addr - CUR_OFFSET, data, size);
> +        t &= 0x87fffff0;
> +        if (s->regs.cur_offset != t) {
> +            s->regs.cur_offset = t;

Repeated pattern.  I'd suggest to add a "wmask" parameter to
ati_reg_write_offs.  Maybe also make it return true/false depending
on whenever the value did change or not.

cheers,
  Gerd




reply via email to

[Prev in Thread] Current Thread [Next in Thread]