diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2020-02-20 14:04:16 +0000 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2020-02-20 14:04:16 +0000 |
commit | 8cd7325f034e119012dcdf56808a73d0884c706e (patch) | |
tree | c1b924784dc98c8754ec5e7d5ba0b93457fe5990 | |
parent | 672f9d0df10a68a5c5f2b32cbc8284abf9f5ee18 (diff) | |
parent | 90e94c0591687f7f788fc40ac86b5583f30d9513 (diff) | |
download | qemu-8cd7325f034e119012dcdf56808a73d0884c706e.zip |
Merge remote-tracking branch 'remotes/rth/tags/pull-pa-20200218' into staging
Fixes for Dino and Artist.
# gpg: Signature made Tue 18 Feb 2020 19:35:09 GMT
# gpg: using RSA key 7A481E78868B4DB6A85A05C064DF38E8AF7E215F
# gpg: issuer "richard.henderson@linaro.org"
# gpg: Good signature from "Richard Henderson <richard.henderson@linaro.org>" [full]
# Primary key fingerprint: 7A48 1E78 868B 4DB6 A85A 05C0 64DF 38E8 AF7E 215F
* remotes/rth/tags/pull-pa-20200218:
hw/hppa/dino: Do not accept accesses to registers 0x818 and 0x82c
hw/hppa/dino: Fix bitmask for the PCIROR register
hw/hppa/dino: Fix reg800_keep_bits overrun (CID 1419387 1419393 1419394)
hw/hppa/dino: Add comments with register name
hw/display/artist: Remove dead code (CID 1419388 & 1419389)
hw/display/artist: Avoid drawing line when nothing to display
hw/display/artist: Delay some variables initialization
hw/display/artist: Remove pointless initialization
hw/display/artist: Move trace event to draw_line()
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r-- | hw/display/artist.c | 29 | ||||
-rw-r--r-- | hw/hppa/dino.c | 31 |
2 files changed, 26 insertions, 34 deletions
diff --git a/hw/display/artist.c b/hw/display/artist.c index 65be9e3554..753dbb9a77 100644 --- a/hw/display/artist.c +++ b/hw/display/artist.c @@ -558,21 +558,17 @@ static void draw_line(ARTISTState *s, int x1, int y1, int x2, int y2, bool update_start, int skip_pix, int max_pix) { struct vram_buffer *buf; - uint8_t color = artist_get_color(s); + uint8_t color; int dx, dy, t, e, x, y, incy, diago, horiz; bool c1; uint8_t *p; + trace_artist_draw_line(x1, y1, x2, y2); if (update_start) { s->vram_start = (x2 << 16) | y2; } - buf = &s->vram_buffer[ARTIST_BUFFER_AP]; - - c1 = false; - incy = 1; - if (x2 > x1) { dx = x2 - x1; } else { @@ -583,6 +579,11 @@ static void draw_line(ARTISTState *s, int x1, int y1, int x2, int y2, } else { dy = y1 - y2; } + if (!dx || !dy) { + return; + } + + c1 = false; if (dy > dx) { t = y2; y2 = x2; @@ -620,6 +621,8 @@ static void draw_line(ARTISTState *s, int x1, int y1, int x2, int y2, } x = x1; y = y1; + color = artist_get_color(s); + buf = &s->vram_buffer[ARTIST_BUFFER_AP]; do { if (c1) { @@ -654,7 +657,6 @@ static void draw_line_pattern_start(ARTISTState *s) int endy = artist_get_y(s->blockmove_size); int pstart = s->line_pattern_start >> 16; - trace_artist_draw_line(startx, starty, endx, endy); draw_line(s, startx, starty, endx, endy, false, -1, pstart); s->line_pattern_skip = pstart; } @@ -668,7 +670,6 @@ static void draw_line_pattern_next(ARTISTState *s) int endy = artist_get_y(s->blockmove_size); int line_xy = s->line_xy >> 16; - trace_artist_draw_line(startx, starty, endx, endy); draw_line(s, startx, starty, endx, endy, false, s->line_pattern_skip, s->line_pattern_skip + line_xy); s->line_pattern_skip += line_xy; @@ -683,7 +684,6 @@ static void draw_line_size(ARTISTState *s, bool update_start) int endx = artist_get_x(s->line_size); int endy = artist_get_y(s->line_size); - trace_artist_draw_line(startx, starty, endx, endy); draw_line(s, startx, starty, endx, endy, update_start, -1, -1); } @@ -734,16 +734,6 @@ static void draw_line_xy(ARTISTState *s, bool update_start) endy = 0; } - - if (endx < 0) { - return; - } - - if (endy < 0) { - return; - } - - trace_artist_draw_line(startx, starty, endx, endy); draw_line(s, startx, starty, endx, endy, false, -1, -1); } @@ -755,7 +745,6 @@ static void draw_line_end(ARTISTState *s, bool update_start) int endx = artist_get_x(s->line_end); int endy = artist_get_y(s->line_end); - trace_artist_draw_line(startx, starty, endx, endy); draw_line(s, startx, starty, endx, endy, update_start, -1, -1); } diff --git a/hw/hppa/dino.c b/hw/hppa/dino.c index 9797a7f0d9..2b1b38c58a 100644 --- a/hw/hppa/dino.c +++ b/hw/hppa/dino.c @@ -83,20 +83,21 @@ #define DINO_PCI_HOST_BRIDGE(obj) \ OBJECT_CHECK(DinoState, (obj), TYPE_DINO_PCI_HOST_BRIDGE) -#define DINO800_REGS ((DINO_TLTIM - DINO_GMASK) / 4) +#define DINO800_REGS (1 + (DINO_TLTIM - DINO_GMASK) / 4) static const uint32_t reg800_keep_bits[DINO800_REGS] = { - MAKE_64BIT_MASK(0, 1), - MAKE_64BIT_MASK(0, 7), - MAKE_64BIT_MASK(0, 7), - MAKE_64BIT_MASK(0, 8), - MAKE_64BIT_MASK(0, 7), - MAKE_64BIT_MASK(0, 9), - MAKE_64BIT_MASK(0, 32), - MAKE_64BIT_MASK(0, 8), - MAKE_64BIT_MASK(0, 30), - MAKE_64BIT_MASK(0, 25), - MAKE_64BIT_MASK(0, 22), - MAKE_64BIT_MASK(0, 9), + MAKE_64BIT_MASK(0, 1), /* GMASK */ + MAKE_64BIT_MASK(0, 7), /* PAMR */ + MAKE_64BIT_MASK(0, 7), /* PAPR */ + MAKE_64BIT_MASK(0, 8), /* DAMODE */ + MAKE_64BIT_MASK(0, 7), /* PCICMD */ + MAKE_64BIT_MASK(0, 9), /* PCISTS */ + MAKE_64BIT_MASK(0, 32), /* Undefined */ + MAKE_64BIT_MASK(0, 8), /* MLTIM */ + MAKE_64BIT_MASK(0, 30), /* BRDG_FEAT */ + MAKE_64BIT_MASK(0, 24), /* PCIROR */ + MAKE_64BIT_MASK(0, 22), /* PCIWOR */ + MAKE_64BIT_MASK(0, 32), /* Undocumented */ + MAKE_64BIT_MASK(0, 9), /* TLTIM */ }; typedef struct DinoState { @@ -180,7 +181,9 @@ static bool dino_chip_mem_valid(void *opaque, hwaddr addr, case DINO_IO_ADDR_EN: case DINO_PCI_IO_DATA: case DINO_TOC_ADDR: - case DINO_GMASK ... DINO_TLTIM: + case DINO_GMASK ... DINO_PCISTS: + case DINO_MLTIM ... DINO_PCIWOR: + case DINO_TLTIM: ret = true; break; case DINO_PCI_IO_DATA + 2: |