OpenGL performance degrading
We are currently developing software to render three video stream on a dual headed display. One head displays full size 1920x1080 HD video, while other head displays two HD videos, downsized in software to 960x540. OpenGL is used to render the video streams by transferring the pixels to a texture and rendering a textured quad. We are able to render all three video streams at 30 Hz without issue. However, over time we see a performace degradation to the point where we are unable to maintain rendering at 30 Hz. We also see the same performance hit when we pause the full size video stream (stop rendering to that window) for a few seconds and then unpause (continue rendering to that window). We typically see the frame rate in all three windows drop from 30 Hz down to 20-25 Hz. After timing the execution of all steps in the video pipeline, we have found that the time spent executing the drawing of the textured quad increases noticeably.
We have been able to reproduce the issue in a simple protype program which I've attached. This program simply creates three threads, each of which creates a window (one window is 1920x1080, two are 960x540), and calls a render function for each window at a rate of 30 Hz. The render function simply copies random frame data equal to the size of each window, in this case a simple solid gray frame, to a texture and draws a textured quad. A separate thread listens for keyboard input so we can pause rendering to one of the windows. We find that after pausing and unpausing rendering to the full size window, the time to render each frame increases by about 25%. This is consistent with what have observed. With additional OpenGL processing being done on the frames in our software (drawing of overlays on the video, etc.) which also slow down, the drop in performance is large enough that we can no longer maintain 30 Hz. We have tried with this with several different driver versions including 195.36.31, 256.35, and 285.05.09. The problem exists with all three drivers tested, though does not seem quite as bad on the 195 driver.
We are using a Pny Quadro FX3800 graphics card running RHEL 5.4 with the 64 bit 184.108.40.206 kernel. It is a dual headed display running in TwinView.