[virglrenderer-devel] [PATCH] renderer: return to original context before deleting a VA element

Dave Airlie airlied at gmail.com
Mon Jun 18 02:51:22 UTC 2018


On 16 June 2018 at 04:21,  <ramin.azarmehr at gmail.com> wrote:
> From: Ramin Azarmehr <ramin.azarmehr at gmail.com>
>
> Bug (GL or GLES): deleting a VA element from a wrong current-context causes rendering/freezing problems.
>
> Reason: at the time of deleting the VA element, the original context that generated it is not current, causing
> a "va->id" of another context to be deleted. This problem can also occur for sampler view/state and other objects.
>
> Fix: check if the correct EGL context is "current" (if not, switch to it) before deleting VAs. Calling
> vrend_hw_switch_context() is cheap if the correct context is already current.
>
> Reproducible example: run Android Nougat with virgl, then launch Google Maps (creates lots of VAs in its context).
> Then, press Square button of Android to tile the active applications (context switches to SurfaceFlinger),
> and close Google Maps window from there. The rendering will freeze (VA from SurfaceFlinger will be deleted instead).
> On Mesa-based drivers (e.g., Intel i915) an error like below will be generated by glBindVertexArray()
> in vrend_draw_bind_vertex_binding():
>
> "Mesa: User error: GL_INVALID_OPERATION in glBindVertexArray(non-gen name)"
>

This seems indicative of a bigger problem, there may be a bunch of
object destruction paths which rely on the context
being correct, we probably need to audit them all, I don't think we
should need to store the ctx like here, we should
have switched ctx before getting this far.

Dave.


More information about the virglrenderer-devel mailing list