aboutsummaryrefslogtreecommitdiff
path: root/hw/display
diff options
context:
space:
mode:
Diffstat (limited to 'hw/display')
-rw-r--r--hw/display/artist.c29
-rw-r--r--hw/display/qxl.c2
2 files changed, 10 insertions, 21 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/display/qxl.c b/hw/display/qxl.c
index 64884da708..21a43a1d5e 100644
--- a/hw/display/qxl.c
+++ b/hw/display/qxl.c
@@ -1631,7 +1631,7 @@ static void ioport_write(void *opaque, hwaddr addr,
PCIQXLDevice *d = opaque;
uint32_t io_port = addr;
qxl_async_io async = QXL_SYNC;
- uint32_t orig_io_port = io_port;
+ uint32_t orig_io_port;
if (d->guest_bug && io_port != QXL_IO_RESET) {
return;