diff options
| author | Alon Levy <alevy@redhat.com> | 2012-05-23 20:46:34 +0300 |
|---|---|---|
| committer | Alon Levy <alevy@redhat.com> | 2012-06-15 10:34:57 +0300 |
| commit | 9d929ae1d1bb2e7f03221fcc4d70e761b6ff9242 (patch) | |
| tree | dbeb0ce953832667842915a8ed56e3d807e3fec9 | |
| parent | 6aa3ceb2d3f25726424b03a68ef949deadf7125a (diff) | |
qxl_driver: abort on mspace error, don't spin (default abort function)
| -rw-r--r-- | src/qxl_driver.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/qxl_driver.c b/src/qxl_driver.c index 2e24746..2c36a6b 100644 --- a/src/qxl_driver.c +++ b/src/qxl_driver.c @@ -41,6 +41,7 @@ #include <xf86Crtc.h> +#include "mspace.h" #include "qxl.h" #include "assert.h" #include "qxl_option_helpers.h" @@ -430,6 +431,21 @@ qxl_unmap_memory(qxl_screen_t *qxl) qxl->modes = NULL; } +static void __attribute__ ((__noreturn__)) qxl_mspace_abort_func(void *user_data) +{ + abort(); +} + +static void __attribute__((format(gnu_printf, 2, 3))) +qxl_mspace_print_func(void *user_data, const char *format, ...) +{ + va_list args; + + va_start(args, format); + VErrorF(format, args); + va_end(args); +} + static Bool qxl_map_memory(qxl_screen_t *qxl, int scrnIndex) { @@ -459,6 +475,9 @@ qxl_map_memory(qxl_screen_t *qxl, int scrnIndex) qxl->rom->num_pages * getpagesize() - qxl->surface0_size); qxl->surf_mem = qxl_mem_create ((void *)((unsigned long)qxl->vram), qxl->vram_size); + mspace_set_abort_func(qxl_mspace_abort_func); + mspace_set_print_func(qxl_mspace_print_func); + return TRUE; } |
