Skip to content

Commit

Permalink
Merge pull request #59551 from jinjunzh/iaadeflate_upgrade_qpl_v1.4.0
Browse files Browse the repository at this point in the history
Upgrade QPL to v1.4.0+Fix qpl_deflate codec bug for polling timeout
  • Loading branch information
rschu1ze committed Feb 23, 2024
2 parents 1a4b4d4 + 38d4d1f commit e325afa
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
2 changes: 1 addition & 1 deletion contrib/qpl
Submodule qpl updated 110 files
9 changes: 2 additions & 7 deletions src/Compression/CompressionCodecDeflateQpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,15 +223,12 @@ Int32 HardwareCodecDeflateQpl::doDecompressDataSynchronous(const char * source,
LOG_WARNING(log, "DeflateQpl HW codec failed, falling back to SW codec. (Details: doDecompressDataSynchronous->qpl_submit_job with error code: {} - please refer to qpl_status in ./contrib/qpl/include/qpl/c_api/status.h)", static_cast<UInt32>(status));
return RET_ERROR;
}

/// Busy waiting till job complete.
UInt32 num_checks = 0;
do
{
_tpause(1, __rdtsc() + 1000);
status = qpl_check_job(job_ptr);
++num_checks;
} while (status == QPL_STS_BEING_PROCESSED && num_checks < MAX_CHECKS);
} while (status == QPL_STS_BEING_PROCESSED);

if (status != QPL_STS_OK)
{
Expand Down Expand Up @@ -280,7 +277,6 @@ void HardwareCodecDeflateQpl::flushAsynchronousDecompressRequests()
{
auto n_jobs_processing = decomp_async_job_map.size();
std::map<UInt32, qpl_job *>::iterator it = decomp_async_job_map.begin();
UInt32 num_checks = 0;

while (n_jobs_processing)
{
Expand All @@ -290,7 +286,7 @@ void HardwareCodecDeflateQpl::flushAsynchronousDecompressRequests()
job_ptr = it->second;

auto status = qpl_check_job(job_ptr);
if ((status == QPL_STS_BEING_PROCESSED) && (num_checks < MAX_CHECKS))
if (status == QPL_STS_BEING_PROCESSED)
{
it++;
}
Expand All @@ -316,7 +312,6 @@ void HardwareCodecDeflateQpl::flushAsynchronousDecompressRequests()
{
it = decomp_async_job_map.begin();
_tpause(1, __rdtsc() + 1000);
++num_checks;
}
}
}
Expand Down
2 changes: 0 additions & 2 deletions src/Compression/CompressionCodecDeflateQpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ class HardwareCodecDeflateQpl
public:
/// RET_ERROR stands for hardware codec fail, needs fallback to software codec.
static constexpr Int32 RET_ERROR = -1;
/// Maximum times to check if hardware job complete, otherwise fallback to software codec.
static constexpr UInt32 MAX_CHECKS = UINT16_MAX;

HardwareCodecDeflateQpl(SoftwareCodecDeflateQpl & sw_codec_);
~HardwareCodecDeflateQpl();
Expand Down

0 comments on commit e325afa

Please sign in to comment.