From de61a5e6cf3af18d57fad9f1fcad873e8bc01ed6 Mon Sep 17 00:00:00 2001 From: Pauli Nieminen Date: Fri, 2 Mar 2012 00:40:35 +0200 Subject: [PATCH] gfx: pvr: Expose helper macro to compare synchronization values To make it simpler to compare synchronization values safetily expose the helper macro in a header. Signed-off-by: Pauli Nieminen Signed-off-by: Kirill A. Shutemov --- drivers/staging/mrst/pvr/services4/srvkm/env/linux/ossync.c | 6 ++---- drivers/staging/mrst/pvr/services4/srvkm/include/ossync.h | 2 ++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/mrst/pvr/services4/srvkm/env/linux/ossync.c b/drivers/staging/mrst/pvr/services4/srvkm/env/linux/ossync.c index c5d7cd7..b232d0e 100644 --- a/drivers/staging/mrst/pvr/services4/srvkm/env/linux/ossync.c +++ b/drivers/staging/mrst/pvr/services4/srvkm/env/linux/ossync.c @@ -30,19 +30,17 @@ static DEFINE_SPINLOCK(sync_lock); static LIST_HEAD(sync_list); -#define ops_after(a, b) ((s32)(b) - (s32)(a) < 0) - static bool pending_ops_completed(PVRSRV_KERNEL_SYNC_INFO *sync_info, unsigned int flags, u32 pending_read_ops, u32 pending_write_ops) { if (flags & PVRSRV_SYNC_READ && - ops_after(pending_read_ops, sync_info->psSyncData->ui32ReadOpsComplete)) + pvr_ops_after(pending_read_ops, sync_info->psSyncData->ui32ReadOpsComplete)) return false; if (flags & PVRSRV_SYNC_WRITE && - ops_after(pending_write_ops, sync_info->psSyncData->ui32WriteOpsComplete)) + pvr_ops_after(pending_write_ops, sync_info->psSyncData->ui32WriteOpsComplete)) return false; return true; diff --git a/drivers/staging/mrst/pvr/services4/srvkm/include/ossync.h b/drivers/staging/mrst/pvr/services4/srvkm/include/ossync.h index d056ac7..6d8c2ce 100644 --- a/drivers/staging/mrst/pvr/services4/srvkm/include/ossync.h +++ b/drivers/staging/mrst/pvr/services4/srvkm/include/ossync.h @@ -27,6 +27,8 @@ #define PVRSRV_SYNC_READ (1 << 0) #define PVRSRV_SYNC_WRITE (1 << 1) +#define pvr_ops_after(a, b) ((s32)(b) - (s32)(a) < 0) + struct pvr_pending_sync; typedef void (*pvr_sync_callback)(struct pvr_pending_sync *pending_sync, bool from_misr); -- 2.7.4