summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2013-11-16 23:29:30 -0800
committerKeith Packard <keithp@keithp.com>2014-01-12 10:14:50 -0800
commit017307f0b41476c3c73a9414a7ce9eb42373c3f4 (patch)
treed8ef510db191271a17853e1aa403f55a2c812118 /hw
parent22592855e90d23013ba7f9e945d567725cb44bf3 (diff)
xfree86/dri: Mark DRIDrvMsg and dri_drm_debug_print _X_ATTRIBUTE_PRINTF
And fix resulting warnings. v2: (Adam Jackson) Cast handles through uintptr_t to avoid size change warnings Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/xfree86/dri/dri.c33
1 files changed, 21 insertions, 12 deletions
diff --git a/hw/xfree86/dri/dri.c b/hw/xfree86/dri/dri.c
index 6292e87cc..bfa3e3680 100644
--- a/hw/xfree86/dri/dri.c
+++ b/hw/xfree86/dri/dri.c
@@ -100,6 +100,11 @@ drmServerInfo DRIDRMServerInfo;
* easily changed here.
*/
#define DRI_MSG_VERBOSITY 1
+
+static void
+DRIDrvMsg(int scrnIndex, MessageType type, const char *format, ...)
+ _X_ATTRIBUTE_PRINTF(3,4);
+
static void
DRIDrvMsg(int scrnIndex, MessageType type, const char *format, ...)
{
@@ -400,7 +405,7 @@ DRIScreenInit(ScreenPtr pScreen, DRIInfoPtr pDRIInfo, int *pDRMFD)
}
DRIDrvMsg(pScreen->myNum, X_INFO,
"[drm] added %d byte SAREA at %p\n",
- pDRIPriv->pDriverInfo->SAREASize, pDRIPriv->hSAREA);
+ (int) pDRIPriv->pDriverInfo->SAREASize, (void *) (uintptr_t) pDRIPriv->hSAREA);
/* Backwards compat. */
if (drmMap(pDRIPriv->drmFD,
@@ -414,7 +419,7 @@ DRIScreenInit(ScreenPtr pScreen, DRIInfoPtr pDRIInfo, int *pDRMFD)
return FALSE;
}
DRIDrvMsg(pScreen->myNum, X_INFO, "[drm] mapped SAREA %p to %p\n",
- pDRIPriv->hSAREA, pDRIPriv->pSAREA);
+ (void *) (uintptr_t) pDRIPriv->hSAREA, pDRIPriv->pSAREA);
memset(pDRIPriv->pSAREA, 0, pDRIPriv->pDriverInfo->SAREASize);
}
else {
@@ -442,7 +447,7 @@ DRIScreenInit(ScreenPtr pScreen, DRIInfoPtr pDRIInfo, int *pDRMFD)
return FALSE;
}
DRIDrvMsg(pScreen->myNum, X_INFO, "[drm] framebuffer handle = %p\n",
- pDRIPriv->pDriverInfo->hFrameBuffer);
+ (void *) (uintptr_t) pDRIPriv->pDriverInfo->hFrameBuffer);
}
else {
DRIDrvMsg(pScreen->myNum, X_INFO,
@@ -513,7 +518,7 @@ DRIScreenInit(ScreenPtr pScreen, DRIInfoPtr pDRIInfo, int *pDRMFD)
pDRIPriv->myContextPriv = pDRIContextPriv;
DRIDrvMsg(pScreen->myNum, X_INFO,
- "X context handle = %p\n", pDRIPriv->myContext);
+ "X context handle = %p\n", (void *) (uintptr_t) pDRIPriv->myContext);
/* Now that we have created the X server's context, we can grab the
* hardware lock for the X server.
@@ -731,13 +736,13 @@ DRICloseScreen(ScreenPtr pScreen)
if (closeMaster || pDRIPriv->hSAREA != pDRIEntPriv->hLSAREA) {
DRIDrvMsg(pScreen->myNum, X_INFO,
"[drm] unmapping %d bytes of SAREA %p at %p\n",
- pDRIInfo->SAREASize, pDRIPriv->hSAREA, pDRIPriv->pSAREA);
+ (int) pDRIInfo->SAREASize, (void *) (uintptr_t) pDRIPriv->hSAREA, pDRIPriv->pSAREA);
if (drmUnmap(pDRIPriv->pSAREA, pDRIInfo->SAREASize)) {
DRIDrvMsg(pScreen->myNum, X_ERROR,
"[drm] unable to unmap %d bytes"
" of SAREA %p at %p\n",
- pDRIInfo->SAREASize,
- pDRIPriv->hSAREA, pDRIPriv->pSAREA);
+ (int) pDRIInfo->SAREASize,
+ (void *) (uintptr_t) pDRIPriv->hSAREA, pDRIPriv->pSAREA);
}
}
else {
@@ -761,6 +766,10 @@ DRICloseScreen(ScreenPtr pScreen)
static int
dri_drm_debug_print(const char *format, va_list ap)
+ _X_ATTRIBUTE_PRINTF(1,0);
+
+static int
+dri_drm_debug_print(const char *format, va_list ap)
{
xf86VDrvMsgVerb(-1, X_NONE, DRM_MSG_VERBOSITY, format, ap);
return 0;
@@ -2214,9 +2223,9 @@ DRILock(ScreenPtr pScreen, int flags)
else if (*pDRIPriv->pLockingContext != pDRIPriv->myContext) {
DRIDrvMsg(pScreen->myNum, X_ERROR,
"[DRI] Locking deadlock.\n"
- "\tAlready locked with context %d,\n"
- "\ttrying to lock with context %d.\n",
- pDRIPriv->pLockingContext, pDRIPriv->myContext);
+ "\tAlready locked with context %p,\n"
+ "\ttrying to lock with context %p.\n",
+ pDRIPriv->pLockingContext, (void *) (uintptr_t) pDRIPriv->myContext);
}
(*pDRIPriv->pLockRefCount)++;
}
@@ -2233,8 +2242,8 @@ DRIUnlock(ScreenPtr pScreen)
if (pDRIPriv->myContext != *pDRIPriv->pLockingContext) {
DRIDrvMsg(pScreen->myNum, X_ERROR,
"[DRI] Unlocking inconsistency:\n"
- "\tContext %d trying to unlock lock held by context %d\n",
- pDRIPriv->pLockingContext, pDRIPriv->myContext);
+ "\tContext %p trying to unlock lock held by context %p\n",
+ pDRIPriv->pLockingContext, (void *) (uintptr_t) pDRIPriv->myContext);
}
(*pDRIPriv->pLockRefCount)--;
}