• Jeffrey Lee's avatar
    Check that overlay calls are being made from the foreground · ed09f44e
    Jeffrey Lee authored
    The GraphicsV spec says that the overlay-related calls should only be
    called from the foreground (or a similar non-interrupt context). For
    BCMVideo's case, if they're called from IRQ handlers then things will
    likely break, because the module won't be able to yield properly to wait
    for the Dispmanx service connection to be free, or to wait for replies
    from the GPU within VCHIQSend.
    
    Although it might be possible to relax the spec to allow some calls to
    be made from IRQ handlers (with BCMVideo queueing the changes to apply
    them at a later date, as with some pointer updates), for now let's just
    go with the approach of having the module check the calling context and
    ignore the call if it's being made from the background.
    
    This fixes the problem reported on the forums with unwanted overlays
    being left on screen by the (experimental) threaded ADFFS modules. Now
    the overlays simply won't be displayed at all, since the calls to
    display them were being made from within the VSync IRQ handler.
    
    https://www.riscosopen.org/forum/forums/4/topics/19002#posts-146116
    ed09f44e