| 225 | } |
| 226 | |
| 227 | XResult XQueueManager::AutoDestroy(HwQueueHandle hwq_h) |
| 228 | { |
| 229 | if (!GetEnvOption(XSCHED_AUTO_XQUEUE_ENV_NAME, false)) { |
| 230 | XDEBG("XQueue auto-destroy is disabled"); |
| 231 | return kXSchedSuccess; |
| 232 | } |
| 233 | auto xq_shptr = HwQueueManager::GetXQueue(hwq_h); |
| 234 | if (xq_shptr == nullptr) { |
| 235 | XWARN("XQueue for HwQueue 0x" FMT_64X " does not exist", hwq_h); |
| 236 | return kXSchedErrorNotFound; |
| 237 | } |
| 238 | XResult res = XQueueDestroy(xq_shptr->GetHandle()); |
| 239 | if (res != kXSchedSuccess) { |
| 240 | XWARN("fail to auto-destroy XQueue 0x" FMT_64X " for HwQueue 0x" FMT_64X ", err: %d", |
| 241 | xq_shptr->GetHandle(), hwq_h, res); |
| 242 | return res; |
| 243 | } |
| 244 | XDEBG("auto-destroyed XQueue 0x" FMT_64X " for HwQueue 0x" FMT_64X, |
| 245 | xq_shptr->GetHandle(), hwq_h); |
| 246 | res = HwQueueDestroy(hwq_h); |
| 247 | if (res != kXSchedSuccess) { |
| 248 | XWARN("fail to auto-destroy HwQueue 0x" FMT_64X ", err: %d", hwq_h, res); |
| 249 | return res; |
| 250 | } |
| 251 | XDEBG("auto-destroyed HwQueue 0x" FMT_64X, hwq_h); |
| 252 | return res; |
| 253 | } |
| 254 | |
| 255 | EXPORT_C_FUNC XResult XQueueCreate(XQueueHandle *xq, HwQueueHandle hwq, int64_t level, int64_t flags) |
| 256 | { |
nothing calls this directly
no test coverage detected