Hi,

the two attached patches fix some annoying messages in debug mode. OK to
commit?


Cheers,
Andre'

>From 7cb15fb0c18db9f1a1a7527e0464945f33e789f0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <andre.dras...@st.com>
Date: Thu, 13 May 2010 18:40:20 +0100
Subject: [PATCH 1/1] fbdev: prevent assertion in debug mode

There are places in DirectFB which D_ASSUME() the lock's offset and the
allocation's offset to be identical, being verbose if that's not the
case.
---
 systems/fbdev/fbdev_surface_pool.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/systems/fbdev/fbdev_surface_pool.c b/systems/fbdev/fbdev_surface_pool.c
index 7383681..79caab7 100644
--- a/systems/fbdev/fbdev_surface_pool.c
+++ b/systems/fbdev/fbdev_surface_pool.c
@@ -342,6 +342,9 @@ fbdevLock( CoreSurfacePool       *pool,
 
           lock->pitch  = shared->fix.line_length;
           lock->offset = index * surface->config.size.h * lock->pitch;
+#if D_DEBUG_ENABLED
+          allocation->offset = lock->offset;
+#endif
      }
      else {
           D_MAGIC_ASSERT( alloc->chunk, Chunk );
-- 
1.7.0.4

>From ae2fc245eac4e7360b8fa94a8b8492597bcaa454 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <andre.dras...@st.com>
Date: Mon, 10 May 2010 13:53:52 +0100
Subject: [PATCH 1/1] fusion/ref: prevent invalid assertion when destroying a ref

ref->multi.shared might have been zero'ed out already by the cleanup thread by
the time we get to run again.
---
 lib/fusion/ref.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/lib/fusion/ref.c b/lib/fusion/ref.c
index b90cdf6..1eb2d31 100644
--- a/lib/fusion/ref.c
+++ b/lib/fusion/ref.c
@@ -192,8 +192,11 @@ fusion_ref_down (FusionRef *ref, bool global)
           return DR_FAILURE;
      }
 
-     D_DEBUG_AT( Fusion_Ref, "  -> %d references now\n",
-                 ioctl( _fusion_fd( ref->multi.shared ), FUSION_REF_STAT, &ref->multi.id ) );
+     if (ref->multi.shared)
+          D_DEBUG_AT( Fusion_Ref, "  -> %d references now\n",
+                      ioctl( _fusion_fd( ref->multi.shared ), FUSION_REF_STAT, &ref->multi.id ) );
+     else
+          D_DEBUG_AT( Fusion_Ref, "  -> destroyed\n" );
 
      return DR_OK;
 }
-- 
1.7.0.4

_______________________________________________
directfb-dev mailing list
directfb-dev@directfb.org
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev

Reply via email to