From a17cb29f5acdfcdeac929d8c6be3600d44d038ef Mon Sep 17 00:00:00 2001 From: Simon Thum Date: Wed, 23 Jul 2008 12:03:17 +0200 Subject: dix: preparation change: make runtime exchange of filter chain safe Signed-off-by: Peter Hutterer --- dix/ptrveloc.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/dix/ptrveloc.c b/dix/ptrveloc.c index 32ba3e168..d6cd8c5af 100644 --- a/dix/ptrveloc.c +++ b/dix/ptrveloc.c @@ -30,6 +30,7 @@ #include #include #include +#include /***************************************************************************** * Predictable pointer ballistics @@ -151,6 +152,8 @@ InitFilterChain(DeviceVelocityPtr s, float rdecay, float progression, int stages ErrorF("(dix ptracc) invalid filter chain progression specified\n"); return; } + /* Block here to support runtime filter adjustment */ + OsBlockSignals(); for(fn = 0; fn < MAX_VELOCITY_FILTERS; fn++){ if(fn < stages){ InitFilterStage(&s->filters[fn], rdecay, lutsize); @@ -159,6 +162,10 @@ InitFilterChain(DeviceVelocityPtr s, float rdecay, float progression, int stages } rdecay /= progression; } + /* release again. Should the input loop be threaded, we also need + * memory release here (in princliple). + */ + OsReleaseSignals(); } @@ -199,7 +206,6 @@ InitFilterStage(FilterStagePtr s, float rdecay, int lutsize) float *oldlut; s->fading_lut_size = 0; /* prevent access */ - /* mb(); concurrency issues may arise */ if(lutsize > 0){ newlut = xalloc (sizeof(float)* lutsize); -- cgit v1.2.3