summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorTim Rowley <[email protected]>2017-08-07 20:33:24 -0500
committerAndres Gomez <[email protected]>2017-08-19 17:39:35 +0300
commited594f19d76f8ba0c010bf978e5fe542edc777d5 (patch)
tree341eb52e418b7387e364d1400eca23810a0b0704 /src/gallium
parent4e993fc542c47434a7d3d6998141df607867a30f (diff)
swr/rast: Fix invalid casting for calls to Interlocked* functions
CID: 1416243, 1416244, 1416255 CC: [email protected] Reviewed-by: Bruce Cherniak <[email protected]> (cherry picked from commit b333bc753e2dd1ed1a676606046a4289e7d58187) [Andres Gomez: resolve trivial conflicts] Signed-off-by: Andres Gomez <[email protected]> Conflicts: src/gallium/drivers/swr/rasterizer/core/api.cpp src/gallium/drivers/swr/rasterizer/core/threads.cpp
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/swr/rasterizer/core/api.cpp2
-rw-r--r--src/gallium/drivers/swr/rasterizer/core/context.h8
-rw-r--r--src/gallium/drivers/swr/rasterizer/core/threads.cpp4
3 files changed, 7 insertions, 7 deletions
diff --git a/src/gallium/drivers/swr/rasterizer/core/api.cpp b/src/gallium/drivers/swr/rasterizer/core/api.cpp
index 2423aa7378f..84abf1e9040 100644
--- a/src/gallium/drivers/swr/rasterizer/core/api.cpp
+++ b/src/gallium/drivers/swr/rasterizer/core/api.cpp
@@ -192,7 +192,7 @@ void QueueWork(SWR_CONTEXT *pContext)
if (IsDraw)
{
- InterlockedIncrement((volatile LONG*)&pContext->drawsOutstandingFE);
+ InterlockedIncrement(&pContext->drawsOutstandingFE);
}
_ReadWriteBarrier();
diff --git a/src/gallium/drivers/swr/rasterizer/core/context.h b/src/gallium/drivers/swr/rasterizer/core/context.h
index 94085e59998..971367c2488 100644
--- a/src/gallium/drivers/swr/rasterizer/core/context.h
+++ b/src/gallium/drivers/swr/rasterizer/core/context.h
@@ -408,12 +408,12 @@ struct DRAW_CONTEXT
bool dependent; // Backend work is dependent on all previous BE
bool isCompute; // Is this DC a compute context?
bool cleanupState; // True if this is the last draw using an entry in the state ring.
- volatile bool doneFE; // Is FE work done for this draw?
FE_WORK FeWork;
+ volatile OSALIGNLINE(bool) doneFE; // Is FE work done for this draw?
volatile OSALIGNLINE(uint32_t) FeLock;
- volatile int32_t threadsDone;
+ volatile OSALIGNLINE(uint32_t) threadsDone;
SYNC_DESC retireCallback; // Call this func when this DC is retired.
@@ -504,9 +504,9 @@ struct SWR_CONTEXT
// Scratch space for workers.
uint8_t** ppScratch;
- volatile int32_t drawsOutstandingFE;
+ volatile OSALIGNLINE(uint32_t) drawsOutstandingFE;
- CachingAllocator cachingArenaAllocator;
+ OSALIGNLINE(CachingAllocator) cachingArenaAllocator;
uint32_t frameCount;
uint32_t lastFrameChecked;
diff --git a/src/gallium/drivers/swr/rasterizer/core/threads.cpp b/src/gallium/drivers/swr/rasterizer/core/threads.cpp
index 4c223171be5..682f0539e06 100644
--- a/src/gallium/drivers/swr/rasterizer/core/threads.cpp
+++ b/src/gallium/drivers/swr/rasterizer/core/threads.cpp
@@ -393,7 +393,7 @@ INLINE void ExecuteCallbacks(SWR_CONTEXT* pContext, uint32_t workerId, DRAW_CONT
// inlined-only version
INLINE int32_t CompleteDrawContextInl(SWR_CONTEXT* pContext, uint32_t workerId, DRAW_CONTEXT* pDC)
{
- int32_t result = InterlockedDecrement((volatile LONG*)&pDC->threadsDone);
+ int32_t result = static_cast<int32_t>(InterlockedDecrement(&pDC->threadsDone));
SWR_ASSERT(result >= 0);
AR_FLUSH(pDC->drawId);
@@ -639,7 +639,7 @@ INLINE void CompleteDrawFE(SWR_CONTEXT* pContext, uint32_t workerId, DRAW_CONTEX
_mm_mfence();
pDC->doneFE = true;
- InterlockedDecrement((volatile LONG*)&pContext->drawsOutstandingFE);
+ InterlockedDecrement(&pContext->drawsOutstandingFE);
}
void WorkOnFifoFE(SWR_CONTEXT *pContext, uint32_t workerId, uint32_t &curDrawFE)