summaryrefslogtreecommitdiff
path: root/src/intel.h
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-07-11 16:28:15 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2011-07-11 21:46:36 +0100
commit2608a367acba7247e50754c3daeed09ba2e97d05 (patch)
tree3298b7aceb5479b59e15e6b97189cf857b99e48d /src/intel.h
parentab1000821ae881a301fb0e1f2210493ec383e681 (diff)
dri: Prevent abuse of the Resource database
The Resource database is only designed to store a single value for a particular type associated with an XID. Due to the asynchronous nature of the vblank/flip requests, we would often associate multiple frame events with a particular drawable/client. Upon freeing the resource, we would not necessarily decouple the right value, leaving a stale pointer behind. Later when the client disappeared, we would write through that stale pointer upsetting valgrind and causing memory corruption. MDK. Instead, we need to implement an extra layer for tracking multiple frames within a single Resource. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=37700 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/intel.h')
-rw-r--r--src/intel.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/intel.h b/src/intel.h
index 2b114c37..9d64d30f 100644
--- a/src/intel.h
+++ b/src/intel.h
@@ -476,11 +476,12 @@ typedef void (*DRI2SwapEventPtr)(ClientPtr client, void *data, int type,
typedef struct _DRI2FrameEvent {
XID drawable_id;
- XID client_id; /* fake client ID to track client destruction */
ClientPtr client;
enum DRI2FrameEventType type;
int frame;
+ struct list drawable_resource, client_resource;
+
/* for swaps & flips only */
DRI2SwapEventPtr event_complete;
void *event_data;