mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 01:33:56 -06:00
hw/display: Use the IEC binary prefix definitions
It eases code review, unit is explicit. Patch generated using: $ git grep -E '(1024|2048|4096|8192|(<<|>>).?(10|20|30))' hw/ include/hw/ and modified manually. Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Message-Id: <20180625124238.25339-15-f4bug@amsat.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
e8400cf385
commit
f0353b0d10
10 changed files with 41 additions and 37 deletions
|
@ -22,6 +22,7 @@
|
|||
* THE SOFTWARE.
|
||||
*/
|
||||
#include "qemu/osdep.h"
|
||||
#include "qemu/units.h"
|
||||
#include "qapi/error.h"
|
||||
#include "hw/hw.h"
|
||||
#include "hw/display/vga.h"
|
||||
|
@ -721,7 +722,7 @@ uint32_t vbe_ioport_read_data(void *opaque, uint32_t addr)
|
|||
val = s->vbe_regs[s->vbe_index];
|
||||
}
|
||||
} else if (s->vbe_index == VBE_DISPI_INDEX_VIDEO_MEMORY_64K) {
|
||||
val = s->vbe_size / (64 * 1024);
|
||||
val = s->vbe_size / (64 * KiB);
|
||||
} else {
|
||||
val = 0;
|
||||
}
|
||||
|
@ -2192,7 +2193,7 @@ void vga_common_init(VGACommonState *s, Object *obj, bool global_vmstate)
|
|||
|
||||
s->vram_size_mb = uint_clamp(s->vram_size_mb, 1, 512);
|
||||
s->vram_size_mb = pow2ceil(s->vram_size_mb);
|
||||
s->vram_size = s->vram_size_mb << 20;
|
||||
s->vram_size = s->vram_size_mb * MiB;
|
||||
|
||||
if (!s->vbe_size) {
|
||||
s->vbe_size = s->vram_size;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue