d3d12: Remove redundant d3d12_promote_to_permanent_residency overload

Reviewed-by: Pohsiang (John) Hsu <pohhsu@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38057>
This commit is contained in:
Silvio Vilerino 2025-10-23 10:41:31 -04:00 committed by Marge Bot
parent 7e1982a7eb
commit 8fdaac83a9
5 changed files with 4 additions and 34 deletions

View file

@ -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);
}

View file

@ -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
);

View file

@ -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;

View file

@ -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)

View file

@ -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();