summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Levy <alevy@redhat.com>2011-06-05 14:07:40 +0300
committerAlon Levy <alevy@redhat.com>2011-07-31 12:34:28 +0300
commitf3774dbad9f6a9926de8d7834f86fb29e9caa906 (patch)
tree953f1f53d60b28edf68359ec95be53e3d25f49e3
parentca4bd8b1038ec863a50e57761eed3ca920b981a8 (diff)
display/driver: add DebugCountAliveSurfaces
Disabled if no DBG, and uses loglevel == 1
-rw-r--r--display/driver.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/display/driver.c b/display/driver.c
index 9705a3c..d1de1ef 100644
--- a/display/driver.c
+++ b/display/driver.c
@@ -528,11 +528,42 @@ err1:
return NULL;
}
+#ifdef DBG
+static void DebugCountAliveSurfaces(PDev *pdev)
+{
+ UINT32 i;
+ SurfaceInfo *surface_info;
+ int total = 0;
+ int of_pdev = 0;
+ int no_surf_obj = 0;
+
+ for (i = 0 ; i < pdev->n_surfaces; ++i) {
+ surface_info = GetSurfaceInfo(pdev, i);
+ if (surface_info->draw_area.base_mem != NULL) {
+ total++;
+ if (surface_info->u.pdev == pdev) {
+ of_pdev++;
+ if (surface_info->draw_area.surf_obj == NULL) {
+ no_surf_obj++;
+ }
+ }
+ }
+ }
+ DEBUG_PRINT((pdev, 1, "%s: %p: %d / %d / %d (total,pdev,no_surf_obj)\n", __FUNCTION__, pdev,
+ total, of_pdev, no_surf_obj));
+}
+#else
+static void DebugCountAliveSurfaces(PDev *pdev)
+{
+}
+#endif
+
VOID DrvDisablePDEV(DHPDEV in_pdev)
{
PDev* pdev = (PDev*)in_pdev;
DEBUG_PRINT((pdev, 1, "%s: 0x%lx\n", __FUNCTION__, pdev));
+ DebugCountAliveSurfaces(pdev);
ResDestroy(pdev);
DestroyPalette(pdev);
EngFreeMem(pdev);