diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-06-07 11:18:27 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-06-07 11:18:27 +0100 |
commit | c58d137d3eeb0e97bfd53e68404e04d9012b5697 (patch) | |
tree | 47e10cf582e2c5cb1ebcd8092943dc2b946424a0 /src/sna/sna_display.c | |
parent | 3f5b94f3d1625b06840c6441a0b175604ee3d2f9 (diff) |
sna: Suppress DBG prints along potential SIGIO paths
As ErrorF/fprintf is not re-entrant due to its mutex we can not use DBG
from code that could be called by a signal handler. X's SIGIO handler
attempts to move the cursor from within the handler (eek!) and so we
need to be careful not to take any locks, such in as the aforementioned
fprintf, along the cursor paths.
Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
References: https://bugs.freedesktop.org/show_bug.cgi?id=50744
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_display.c')
-rw-r--r-- | src/sna/sna_display.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c index fbf35cc6..7926f8f3 100644 --- a/src/sna/sna_display.c +++ b/src/sna/sna_display.c @@ -53,6 +53,12 @@ #define DBG(x) ErrorF x #endif +#if 0 +#define __DBG DBG +#else +#define __DBG(x) +#endif + struct sna_crtc { struct drm_mode_modeinfo kmode; PixmapPtr shadow; @@ -766,7 +772,7 @@ sna_crtc_hide_cursor(xf86CrtcPtr crtc) struct sna_crtc *sna_crtc = crtc->driver_private; struct drm_mode_cursor arg; - DBG(("%s: CRTC:%d\n", __FUNCTION__, crtc_id(sna_crtc))); + __DBG(("%s: CRTC:%d\n", __FUNCTION__, crtc_id(sna_crtc))); VG_CLEAR(arg); arg.flags = DRM_MODE_CURSOR_BO; @@ -784,7 +790,7 @@ sna_crtc_show_cursor(xf86CrtcPtr crtc) struct sna_crtc *sna_crtc = crtc->driver_private; struct drm_mode_cursor arg; - DBG(("%s: CRTC:%d\n", __FUNCTION__, crtc_id(sna_crtc))); + __DBG(("%s: CRTC:%d\n", __FUNCTION__, crtc_id(sna_crtc))); VG_CLEAR(arg); arg.flags = DRM_MODE_CURSOR_BO; @@ -798,6 +804,8 @@ sna_crtc_show_cursor(xf86CrtcPtr crtc) static void sna_crtc_set_cursor_colors(xf86CrtcPtr crtc, int bg, int fg) { + __DBG(("%s: CRTC:%d (bg=%x, fg=%x)\n", __FUNCTION__, + crtc_id(crtc->driver_private), bg, fg)); } static void @@ -807,7 +815,7 @@ sna_crtc_set_cursor_position(xf86CrtcPtr crtc, int x, int y) struct sna_crtc *sna_crtc = crtc->driver_private; struct drm_mode_cursor arg; - DBG(("%s: CRTC:%d (%d, %d)\n", __FUNCTION__, crtc_id(sna_crtc), x, y)); + __DBG(("%s: CRTC:%d (%d, %d)\n", __FUNCTION__, crtc_id(sna_crtc), x, y)); VG_CLEAR(arg); arg.flags = DRM_MODE_CURSOR_MOVE; @@ -826,6 +834,8 @@ sna_crtc_load_cursor_argb(xf86CrtcPtr crtc, CARD32 *image) struct sna_crtc *sna_crtc = crtc->driver_private; struct drm_i915_gem_pwrite pwrite; + __DBG(("%s: CRTC:%d\n", __FUNCTION__, crtc_id(sna_crtc))); + VG_CLEAR(pwrite); pwrite.handle = sna_crtc->cursor; pwrite.offset = 0; @@ -1005,6 +1015,8 @@ sna_crtc_init(ScrnInfoPtr scrn, struct sna_mode *mode, int num) crtc->driver_private = sna_crtc; sna_crtc->cursor = gem_create(sna->kgem.fd, 64*64*4); + DBG(("%s: created handle=%d for cursor on CRTC:%d\n", + __FUNCTION__, sna_crtc->cursor, sna_crtc->id)); list_add(&sna_crtc->link, &mode->crtcs); |