diff options
-rw-r--r-- | src/sna/gen3_render.c | 4 | ||||
-rw-r--r-- | src/sna/sna_accel.c | 7 | ||||
-rw-r--r-- | src/sna/sna_display.c | 16 |
3 files changed, 17 insertions, 10 deletions
diff --git a/src/sna/gen3_render.c b/src/sna/gen3_render.c index b3ee5673..348cb862 100644 --- a/src/sna/gen3_render.c +++ b/src/sna/gen3_render.c @@ -2669,8 +2669,8 @@ gen3_render_reset(struct sna *sna) state->last_vertex_offset = 0; if (sna->render.vbo && !kgem_bo_can_map(&sna->kgem, sna->render.vbo)) { - DBG(("%s: discarding vbo as next access will stall: %d\n", - __FUNCTION__, sna->render.vbo->presumed_offset)); + DBG(("%s: discarding vbo as next access will stall: %lx\n", + __FUNCTION__, (long)sna->render.vbo->presumed_offset)); discard_vbo(sna); } diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index 622d87b3..61453362 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -4241,9 +4241,8 @@ try_upload_blt(PixmapPtr pixmap, RegionRec *region, src_bo->pitch = stride; kgem_bo_mark_unreusable(src_bo); - DBG(("%s: upload(%d, %d, %d, %d) x %d through a temporary map\n", - __FUNCTION__, x, y, w, h, - RegionNumRects(region))); + DBG(("%s: upload(%d, %d, %d, %d) x %ld through a temporary map\n", + __FUNCTION__, x, y, w, h, (long)RegionNumRects(region))); if (sigtrap_get() == 0) { ok = sna->render.copy_boxes(sna, GXcopy, @@ -16502,7 +16501,9 @@ static void sna_accel_debug_memory(struct sna *sna) sna->debug_memory.cpu_bo_allocs, (long)sna->debug_memory.cpu_bo_bytes); +#ifdef VALGRIND_DO_ADDED_LEAK_CHECK VG(VALGRIND_DO_ADDED_LEAK_CHECK); +#endif } #else diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c index ec1367d8..77d34ae0 100644 --- a/src/sna/sna_display.c +++ b/src/sna/sna_display.c @@ -2117,14 +2117,20 @@ sna_output_panel_edid(xf86OutputPtr output, DisplayModePtr modes) static char *canonical_mode_name(DisplayModePtr mode) { - char *str; + char tmp[32], *buf; + int len; - if (asprintf(&str, "%dx%d%s", - mode->HDisplay, mode->VDisplay, - mode->Flags & V_INTERLACE ? "i" : "") < 0) + len = sprintf(tmp, "%dx%d%s", + mode->HDisplay, mode->VDisplay, + mode->Flags & V_INTERLACE ? "i" : ""); + if ((unsigned)len >= sizeof(tmp)) return NULL; - return str; + buf = malloc(len + 1); + if (buf == NULL) + return NULL; + + return memcpy(buf, tmp, len + 1); } static DisplayModePtr |