swr/rast: Convert system memory pointers to gfxptr_t
authorAlok Hota <alok.hota@intel.com>
Thu, 19 Jul 2018 15:32:55 +0000 (10:32 -0500)
committerAlok Hota <alok.hota@intel.com>
Fri, 15 Feb 2019 20:52:32 +0000 (14:52 -0600)
Fulfills an unused internal interface

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
src/gallium/drivers/swr/rasterizer/core/api.cpp
src/gallium/drivers/swr/rasterizer/core/api.h
src/gallium/drivers/swr/rasterizer/core/context.h
src/gallium/drivers/swr/rasterizer/core/frontend.cpp
src/gallium/drivers/swr/swr_context.cpp
src/gallium/drivers/swr/swr_memory.h

index 00f331303eeac5b90e9645272a789a06eb67d02f..acbc7e077b186900693254019af10b6bb8f894a7 100644 (file)
@@ -196,6 +196,7 @@ HANDLE SwrCreateContext(SWR_CREATECONTEXT_INFO* pCreateInfo)
     pContext->pfnLoadTile            = pCreateInfo->pfnLoadTile;
     pContext->pfnStoreTile           = pCreateInfo->pfnStoreTile;
     pContext->pfnClearTile           = pCreateInfo->pfnClearTile;
+    pContext->pfnMakeGfxPtr          = pCreateInfo->pfnMakeGfxPtr;
     pContext->pfnUpdateSoWriteOffset = pCreateInfo->pfnUpdateSoWriteOffset;
     pContext->pfnUpdateStats         = pCreateInfo->pfnUpdateStats;
     pContext->pfnUpdateStatsFE       = pCreateInfo->pfnUpdateStatsFE;
index 9cc5292e7b03c26e909fe0ec78ae3f55a238683a..b33dc96e339a1ab6671ea6613e6a4d3d9cf43073 100644 (file)
@@ -145,6 +145,9 @@ typedef void(SWR_API* PFN_CLEAR_TILE)(HANDLE                      hPrivateContex
                                       uint32_t                    renderTargetArrayIndex,
                                       const float*                pClearColor);
 
+typedef gfxptr_t(SWR_API* PFN_MAKE_GFXPTR)(HANDLE                 hPrivateContext,
+                                           void*                  sysAddr);
+
 //////////////////////////////////////////////////////////////////////////
 /// @brief Callback to allow driver to update their copy of streamout write offset.
 ///        This is call is made for any draw operation that has streamout enabled
@@ -241,6 +244,7 @@ struct SWR_CREATECONTEXT_INFO
     PFN_LOAD_TILE              pfnLoadTile;
     PFN_STORE_TILE             pfnStoreTile;
     PFN_CLEAR_TILE             pfnClearTile;
+    PFN_MAKE_GFXPTR            pfnMakeGfxPtr;
     PFN_UPDATE_SO_WRITE_OFFSET pfnUpdateSoWriteOffset;
     PFN_UPDATE_STATS           pfnUpdateStats;
     PFN_UPDATE_STATS_FE        pfnUpdateStatsFE;
index 6d378ed36e40bfab276a14582a7b07243cc0d4cf..5a9ccfb5ded9fe9a4f42b3310a814522a1047bb5 100644 (file)
@@ -528,6 +528,7 @@ struct SWR_CONTEXT
     PFN_LOAD_TILE              pfnLoadTile;
     PFN_STORE_TILE             pfnStoreTile;
     PFN_CLEAR_TILE             pfnClearTile;
+    PFN_MAKE_GFXPTR            pfnMakeGfxPtr;
     PFN_UPDATE_SO_WRITE_OFFSET pfnUpdateSoWriteOffset;
     PFN_UPDATE_STATS           pfnUpdateStats;
     PFN_UPDATE_STATS_FE        pfnUpdateStatsFE;
index b510feadee90951c80da64ac17daa44cd9a6ed9b..8bc97c743eb6838cb7c216e2adfc348ce60ce690 100644 (file)
@@ -1840,9 +1840,10 @@ void ProcessDraw(SWR_CONTEXT* pContext, DRAW_CONTEXT* pDC, uint32_t workerId, vo
         {
             vIndex = _simd16_add_epi32(_simd16_set1_epi32(work.startVertexID), vScale);
 
-            fetchInfo_lo.xpIndices = (gfxptr_t)&vIndex;
-            fetchInfo_hi.xpIndices =
-                (gfxptr_t)&vIndex + KNOB_SIMD_WIDTH * sizeof(int32_t); // 1/2 of KNOB_SIMD16_WIDTH
+            fetchInfo_lo.xpIndices = 
+                pDC->pContext->pfnMakeGfxPtr(GetPrivateState(pDC), &vIndex);
+            fetchInfo_hi.xpIndices = 
+                pDC->pContext->pfnMakeGfxPtr(GetPrivateState(pDC), &vIndex + KNOB_SIMD_WIDTH * sizeof(int32_t)); // 1/2 of KNOB_SIMD16_WIDTH
         }
 
         fetchInfo_lo.CurInstance = instanceNum;
index b61720cd3000fcca25e1457e0103fcca49342d8e..7aa14d60710e8d0ddc744847e0507a60c33acbe9 100644 (file)
@@ -494,6 +494,7 @@ swr_create_context(struct pipe_screen *p_screen, void *priv, unsigned flags)
    createInfo.pfnClearTile = swr_StoreHotTileClear;
    createInfo.pfnUpdateStats = swr_UpdateStats;
    createInfo.pfnUpdateStatsFE = swr_UpdateStatsFE;
+   createInfo.pfnMakeGfxPtr = swr_MakeGfxPtr;
 
    SWR_THREADING_INFO threadingInfo {0};
 
index bab7800c604e11e5c5d5fd3992a0c9585a1d2c94..7ccbf5a549780a968a7634df109c63b07f3c12a7 100644 (file)
@@ -68,3 +68,10 @@ swr_StoreHotTileClear(HANDLE hPrivateContext,
 
    pDC->pAPI->pfnSwrStoreHotTileClear(hWorkerPrivateData, pDstSurface, renderTargetIndex, x, y, renderTargetArrayIndex, pClearColor);
 }
+
+INLINE gfxptr_t
+swr_MakeGfxPtr(HANDLE hPrivateContext, void* sysAddr)
+{
+    // Fulfill an unused internal interface
+    return (gfxptr_t)sysAddr;
+}