[mythtv-commits] mythtv commit: r26085 by markk

mythtv at cvs.mythtv.org mythtv at cvs.mythtv.org
Thu Sep 2 16:40:31 UTC 2010


      Author: markk
        Date: 2010-09-02 16:40:31 +0000 (Thu, 02 Sep 2010)
New Revision: 26085
   Changeset: http://svn.mythtv.org/trac/changeset/26085

Log:

Smarter caching in MythPainter.

Previously we attempted to keep a check on memory consumption by
tracking the total number of hardware buffers created for OpenGL,
Direct3D9 and VDPAU painting and releasing resources when the count
exceeded 256. A little debugging showed that it was fairly easy to reach
over 300Mb of allocate memory, which was confirmed via OpenGL profiling.
Given that OpenGL will mirror hardware buffers in main memory, that
amounts to a sizeable chunk of memory consumption even by modern
standards.

This is now replaced with an estimate of the memory consumed by the
bitmaps and begins to release resources above a consistent limit. I've
set this at 64Mb, which appears to work without issue on even the most
resource hungry themes and should represent around 8 full screens of
bitmaps when displayed at 1920x1080. It can of course be tweaked if it
proves to be inadequate.

There is a also a knock on benefit for VDPAU playback on graphics cards
with 256Mb of memory. As OpenGL will not immediately release memory to
other 'services' even when released by the application, this approach to
caching should limit the land grab made by the OpenGL element of the
driver.

I've not touched the Qt painter as it doesn't seem to have any cache
management of its own. Which is odd.


Modified:

   trunk/mythtv/libs/libmythui/mythpainter_d3d9.cpp
   trunk/mythtv/libs/libmythui/mythpainter_ogl.cpp
   trunk/mythtv/libs/libmythui/mythpainter_ogl.h
   trunk/mythtv/libs/libmythui/mythpainter_vdpau.cpp




More information about the mythtv-commits mailing list