[rocprofv3] signal handler fix (#332)

* rocprofv3: LD_PRELOAD for signal and sigaction

- wrappers around `signal` and `sigaction` to prevent applications which install signal handlers to replace the rocprofv3 signal handlers
- minor tweaks to buffer sizes (use page_size instead of
KiB)

* [DO NOT COMMIT] extra logging

* Switch git submodule url for perfetto

- use GitHub URL as this is more accessible

* Update ring_buffer<Tp>

- account for alignment padding

* Update buffered_output

- track number of bytes stored
- add nullptr checks

* Update tmp_file_buffer

- track number of bytes
- read_tmp_file does not create tmp file if it does not already exist

* Update tmp_file

- add exists member function for checking whether temporary file already exists
- tweak remove() implementation

* Update config.hpp

- add option to enable/disable signal handlers
- add option for minimum_output_bytes

* Make signal, sigaction functions visible

* rocprofv3 tool updates

- chained signals
- override the signal handler(s) installed by the application
- improve cleanup of temporary files
- support minimum output bytes

* Add commandline support

* fixing test

* minor fix

* minor fix

* fix clang issue

* fix

* Adding docs

* review comments

* review changes

* review

* YUV pulldown additions to rocdecode

* More rocdecode changes

---------

Co-authored-by: Jonathan R. Madsen <jonathanrmadsen@gmail.com>
Co-authored-by: Jonathan R. Madsen <Jonathan.Madsen@amd.com>
Co-authored-by: Benjamin Welton <bewelton@amd.com>
This commit is contained in:
Nagaraj, Sriraksha
2025-04-17 23:10:52 -05:00
committed by GitHub
parent 46818b0167
commit 87badfbd15
22 changed files with 866 additions and 107 deletions
+8
View File
@@ -274,6 +274,14 @@ GetSurfaceStrideInternal(rocDecVideoSurfaceFormat surface_format,
*pitch = align(width, 128) * 2;
*vstride = align(height, 16);
break;
case rocDecVideoSurfaceFormat_YUV422:
*pitch = align(width, 256);
*vstride = align(height, 16);
break;
case rocDecVideoSurfaceFormat_YUV422_16Bit:
*pitch = align(width, 128) * 2;
*vstride = align(height, 16);
break;
}
return;
}
+10
View File
@@ -94,8 +94,11 @@ GetChromaPlaneCount(rocDecVideoSurfaceFormat surface_format)
{
case rocDecVideoSurfaceFormat_NV12:
case rocDecVideoSurfaceFormat_P016: num_planes = 1; break;
// All YUV formats have 2 planes (to my knowledge).
case rocDecVideoSurfaceFormat_YUV444:
case rocDecVideoSurfaceFormat_YUV444_16Bit: num_planes = 2; break;
case rocDecVideoSurfaceFormat_YUV422:
case rocDecVideoSurfaceFormat_YUV422_16Bit:
case rocDecVideoSurfaceFormat_YUV420:
case rocDecVideoSurfaceFormat_YUV420_16Bit: num_planes = 2; break;
}
@@ -109,10 +112,17 @@ GetChromaHeightFactor(rocDecVideoSurfaceFormat surface_format)
float factor = 0.5;
switch(surface_format)
{
// NV12 and P016 have 1/2 vertical resolution, 1/2 horizontal resolution
// (different 420 sampling techniques across a single plane)
case rocDecVideoSurfaceFormat_NV12:
case rocDecVideoSurfaceFormat_P016:
// 420 pulldown has 1/2 vertical resolution, 1/2 horizontal resolution
case rocDecVideoSurfaceFormat_YUV420:
case rocDecVideoSurfaceFormat_YUV420_16Bit: factor = 0.5; break;
// 422 pulldown has full vertical resolution, 1/2 horizontal resolution
case rocDecVideoSurfaceFormat_YUV422:
case rocDecVideoSurfaceFormat_YUV422_16Bit:
// 444 pulldown has full vertical and horizontal resolution
case rocDecVideoSurfaceFormat_YUV444:
case rocDecVideoSurfaceFormat_YUV444_16Bit: factor = 1.0; break;
}