mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-04 22:10:11 +01:00
intel/common: Retry GEM_CONTEXT_CREATE when PXP have not finished initialization
If PXP initialization is not completed and application requested a protected context the GEM_CONTEXT_CREATE will wait up to 250ms for PXP to finish initialization but if that do not happens it will return a error and set errno to EIO. This patch add the missing retry handling. Cc: mesa-stable Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Signed-off-by: José Roberto de Souza <jose.souza@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30723>
This commit is contained in:
parent
ce60f47e96
commit
008ac818ba
1 changed files with 11 additions and 1 deletions
|
|
@ -176,7 +176,17 @@ i915_gem_create_context_engines(int fd,
|
|||
&low_latency_param.base);
|
||||
}
|
||||
|
||||
if (intel_ioctl(fd, DRM_IOCTL_I915_GEM_CONTEXT_CREATE_EXT, &create) == -1)
|
||||
int ret;
|
||||
bool retry;
|
||||
do {
|
||||
ret = intel_ioctl(fd, DRM_IOCTL_I915_GEM_CONTEXT_CREATE_EXT, &create);
|
||||
retry = ret == -1 && errno == EIO &&
|
||||
(flags & INTEL_GEM_CREATE_CONTEXT_EXT_PROTECTED_FLAG);
|
||||
if (retry)
|
||||
usleep(1000);
|
||||
} while (retry);
|
||||
|
||||
if (ret)
|
||||
return false;
|
||||
|
||||
*context_id = create.ctx_id;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue