diff --git a/src/gallium/drivers/d3d12/d3d12_residency.cpp b/src/gallium/drivers/d3d12/d3d12_residency.cpp index 63c1ad4b232..24c9ad86cf1 100644 --- a/src/gallium/drivers/d3d12/d3d12_residency.cpp +++ b/src/gallium/drivers/d3d12/d3d12_residency.cpp @@ -357,25 +357,3 @@ d3d12_promote_to_permanent_residency( flush_batch(screen, pageables_to_make_resident, num_to_make_resident, pResidencyFence, pResidencyFenceValue); mtx_unlock(&screen->submit_mutex); } - -void -d3d12_promote_to_permanent_residency( - struct d3d12_screen *screen, - struct d3d12_resource* resource, - ID3D12Fence* pResidencyFence, /* NULL implies usage of synchronous MakeResident */ - uint64_t *pResidencyFenceValue /* Out: value to wait on for residency for this call */ -) -{ - // Early out for null resource or if the bo is already permanently resident - if (!resource) - return; - - if (resource->bo) { - uint64_t offset; - struct d3d12_bo *base_bo = d3d12_bo_get_base(resource->bo, &offset); - if (base_bo->residency_status == d3d12_permanently_resident) - return; - } - - d3d12_promote_to_permanent_residency(screen, &resource, 1, pResidencyFence, pResidencyFenceValue); -} diff --git a/src/gallium/drivers/d3d12/d3d12_residency.h b/src/gallium/drivers/d3d12/d3d12_residency.h index 884db79c7b6..5c421fcc046 100644 --- a/src/gallium/drivers/d3d12/d3d12_residency.h +++ b/src/gallium/drivers/d3d12/d3d12_residency.h @@ -43,11 +43,3 @@ d3d12_promote_to_permanent_residency( ID3D12Fence* pResidencyFence = NULL, uint64_t *pResidencyFenceValue = NULL ); - -void -d3d12_promote_to_permanent_residency( - struct d3d12_screen *screen, - struct d3d12_resource* resource, - ID3D12Fence* pResidencyFence = NULL, - uint64_t *pResidencyFenceValue = NULL -); diff --git a/src/gallium/drivers/d3d12/d3d12_video_buffer.cpp b/src/gallium/drivers/d3d12/d3d12_video_buffer.cpp index 36382feeaf5..51bfab40a00 100644 --- a/src/gallium/drivers/d3d12/d3d12_video_buffer.cpp +++ b/src/gallium/drivers/d3d12/d3d12_video_buffer.cpp @@ -140,7 +140,7 @@ d3d12_video_buffer_create_impl(struct pipe_context *pipe, goto failed; } - d3d12_promote_to_permanent_residency((struct d3d12_screen*) pipe->screen, pD3D12VideoBuffer->texture); + d3d12_promote_to_permanent_residency((struct d3d12_screen*) pipe->screen, &pD3D12VideoBuffer->texture, 1); pD3D12VideoBuffer->num_planes = util_format_get_num_planes(pD3D12VideoBuffer->texture->overall_format); return &pD3D12VideoBuffer->base; diff --git a/src/gallium/drivers/d3d12/d3d12_video_dec.cpp b/src/gallium/drivers/d3d12/d3d12_video_dec.cpp index a463d1975ff..5584c89143f 100644 --- a/src/gallium/drivers/d3d12/d3d12_video_dec.cpp +++ b/src/gallium/drivers/d3d12/d3d12_video_dec.cpp @@ -1054,7 +1054,7 @@ d3d12_video_decoder_prepare_for_decode_frame(struct d3d12_video_decoder *pD3D12D if (pD3D12Dec->m_spDPBManager->is_pipe_buffer_underlying_output_decode_allocation()) { assert(d3d12_resource_resource(vidBuffer->texture) == *ppOutTexture2D); // Make it permanently resident for video use - d3d12_promote_to_permanent_residency(pD3D12Dec->m_pD3D12Screen, vidBuffer->texture); + d3d12_promote_to_permanent_residency(pD3D12Dec->m_pD3D12Screen, &vidBuffer->texture, 1); } // Get the reference only texture for the current frame to be decoded (if applicable) diff --git a/src/gallium/drivers/d3d12/d3d12_video_proc.cpp b/src/gallium/drivers/d3d12/d3d12_video_proc.cpp index d55f58eca61..495a4cafebd 100644 --- a/src/gallium/drivers/d3d12/d3d12_video_proc.cpp +++ b/src/gallium/drivers/d3d12/d3d12_video_proc.cpp @@ -339,14 +339,14 @@ d3d12_video_processor_flush(struct pipe_video_codec * codec) pD3D12Proc->m_OutputArguments.buffer->texture); // Make the resources permanently resident for video use - d3d12_promote_to_permanent_residency(pD3D12Proc->m_pD3D12Screen, pD3D12Proc->m_OutputArguments.buffer->texture); + d3d12_promote_to_permanent_residency(pD3D12Proc->m_pD3D12Screen, &pD3D12Proc->m_OutputArguments.buffer->texture, 1); for(auto curInput : pD3D12Proc->m_InputBuffers) { debug_printf("[d3d12_video_processor] d3d12_video_processor_flush - Promoting the input texture %p to d3d12_permanently_resident.\n", curInput->texture); // Make the resources permanently resident for video use - d3d12_promote_to_permanent_residency(pD3D12Proc->m_pD3D12Screen, curInput->texture); + d3d12_promote_to_permanent_residency(pD3D12Proc->m_pD3D12Screen, &curInput->texture, 1); } HRESULT hr = pD3D12Proc->m_pD3D12Screen->dev->GetDeviceRemovedReason();