summaryrefslogtreecommitdiff
path: root/lib/amdgpu/amd_command_submission.c
AgeCommit message (Collapse)Author
2022-07-06lib/amdgpu/amd_command_submission: Fix -Wuse-after-freeAshutosh Dixit
../lib/amdgpu/amd_command_submission.c: In function ‘amdgpu_command_submission_write_linear_helper’: ../lib/amdgpu/amd_command_submission.c:201:13: warning: pointer ‘ring_context’ used after ‘free’ [-Wuse-after-free] 201 | r = amdgpu_cs_ctx_free(ring_context->context_handle); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../lib/amdgpu/amd_command_submission.c:199:9: note: call to ‘free’ here 199 | free(ring_context); | ^~~~~~~~~~~~~~~~~~ Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
2022-06-01tests/amdgpu: refactoring and update amd_basic testsVitaly Prosyak
1. Create auxiliary directory amdgpu into igt-gpu-tools/lib Put all helpers and reusable functions into this directory using the following assumptions: - group memory alloc/free functions into separate file amd_memory.c and h. - group command submissions helper functions for GFX, COMPUTE and SDMA into separate file amd_command_submission.c and h. - for compute put nop command submission into separate file amd_compute.c and h. - for graphics put command submission into separate file amd_gfx.c and h. - for fence put command submission into separate file amd_fence.c and h. 2. Simplify implementation and reduce the number of local variables and allocations. 3. The file igt-gpu-tools/tests/amdgpu/amd_basic.c has only functions responsible for single sub test: - amdgpu_memory_alloc - amdgpu_userptr_test - amdgpu_command_submission_gfx - amdgpu_command_submission_compute - amdgpu_command_submission_multi_fence - amdgpu_command_submission_sdma - amdgpu_semaphore_test 4. No helper functions into amd_basic.c file. 5. Updated command submissions for secure buffer. Signed-off-by: Vitaly Prosyak <vitaly.prosyak@amd.com> Reviewed-by: Christian Koenig <christian.koenig@amd.com> Reviewed-by: Alexander Deucher <alexander.deucher@amd.com>