Commit 53b3d4df authored by Ulrich Sibiller's avatar Ulrich Sibiller

Split.c: reformat comments

parent cb283d4a
...@@ -36,7 +36,6 @@ ...@@ -36,7 +36,6 @@
#include "compext/Compext.h" #include "compext/Compext.h"
/* /*
* Set here the required log level. * Set here the required log level.
*/ */
...@@ -47,9 +46,8 @@ ...@@ -47,9 +46,8 @@
#undef DEBUG #undef DEBUG
/* /*
* This should be a macro but for now * This should be a macro but for now we make it a real function to
* we make it a real function to log * log a warning in the logs.
* a warning in the logs.
*/ */
DrawablePtr nxagentSplitDrawable(DrawablePtr pDrawable) DrawablePtr nxagentSplitDrawable(DrawablePtr pDrawable)
...@@ -348,8 +346,7 @@ int nxagentCreateSplit(DrawablePtr pDrawable, GCPtr *pGC) ...@@ -348,8 +346,7 @@ int nxagentCreateSplit(DrawablePtr pDrawable, GCPtr *pGC)
pResource -> commit = 1; pResource -> commit = 1;
/* /*
* Make a copy of the GC so the client * Make a copy of the GC so the client can safely remove it.
* can safely remove it.
*/ */
pResource -> gc = CreateScratchGC(pDrawable -> pScreen, pDrawable -> depth); pResource -> gc = CreateScratchGC(pDrawable -> pScreen, pDrawable -> depth);
...@@ -400,8 +397,7 @@ FIXME: What do we do here? ...@@ -400,8 +397,7 @@ FIXME: What do we do here?
} }
/* /*
* Set the region to be the current * Set the region to be the current streaming region.
* streaming region.
*/ */
void nxagentRegionSplit(DrawablePtr pDrawable, RegionPtr pRegion) void nxagentRegionSplit(DrawablePtr pDrawable, RegionPtr pRegion)
...@@ -442,9 +438,9 @@ void nxagentRegionSplit(DrawablePtr pDrawable, RegionPtr pRegion) ...@@ -442,9 +438,9 @@ void nxagentRegionSplit(DrawablePtr pDrawable, RegionPtr pRegion)
} }
/* /*
* Remove the association between the drawable * Remove the association between the drawable and the split
* and the split resource. The resource is not * resource. The resource is not deallocated until the end of the
* deallocated until the end of the split. * split.
*/ */
void nxagentReleaseSplit(DrawablePtr pDrawable) void nxagentReleaseSplit(DrawablePtr pDrawable)
...@@ -477,10 +473,8 @@ void nxagentReleaseSplit(DrawablePtr pDrawable) ...@@ -477,10 +473,8 @@ void nxagentReleaseSplit(DrawablePtr pDrawable)
if (pResource -> region != NullRegion) if (pResource -> region != NullRegion)
{ {
/* /*
* If we have a region the commits * If we have a region the commits had to be still valid. In this
* had to be still valid. In this * case tell the proxy to abort the data transfer.
* case tell the proxy to abort the
* data transfer.
*/ */
#ifdef TEST #ifdef TEST
...@@ -528,8 +522,8 @@ void nxagentReleaseSplit(DrawablePtr pDrawable) ...@@ -528,8 +522,8 @@ void nxagentReleaseSplit(DrawablePtr pDrawable)
} }
/* /*
* Remove the association between the * Remove the association between the drawable and the resource
* drawable and the resource record. * record.
*/ */
#ifdef TEST #ifdef TEST
...@@ -547,9 +541,8 @@ void nxagentReleaseSplit(DrawablePtr pDrawable) ...@@ -547,9 +541,8 @@ void nxagentReleaseSplit(DrawablePtr pDrawable)
} }
/* /*
* Invalidate the commits and remove the * Invalidate the commits and remove the association between the
* association between the resource and * resource and the drawable.
* the drawable.
*/ */
pResource -> drawable = NULL; pResource -> drawable = NULL;
...@@ -607,9 +600,8 @@ void nxagentValidateSplit(DrawablePtr pDrawable, RegionPtr pRegion) ...@@ -607,9 +600,8 @@ void nxagentValidateSplit(DrawablePtr pDrawable, RegionPtr pRegion)
#endif #endif
/* /*
* If a null region is passed as parameter, * If a null region is passed as parameter, we assume that all the
* we assume that all the commits have to * commits have to be discarded.
* be discarded.
*/ */
if (pRegion == NullRegion) if (pRegion == NullRegion)
...@@ -626,9 +618,8 @@ void nxagentValidateSplit(DrawablePtr pDrawable, RegionPtr pRegion) ...@@ -626,9 +618,8 @@ void nxagentValidateSplit(DrawablePtr pDrawable, RegionPtr pRegion)
RegionRec tmpRegion; RegionRec tmpRegion;
/* /*
* Check if the provided region overlaps * Check if the provided region overlaps the area covered by the
* the area covered by the image being * image being streamed.
* streamed.
*/ */
RegionInit(&tmpRegion, NullBox, 1); RegionInit(&tmpRegion, NullBox, 1);
...@@ -698,10 +689,9 @@ void nxagentFreeSplit(int resource) ...@@ -698,10 +689,9 @@ void nxagentFreeSplit(int resource)
else else
{ {
/* /*
* The end of the split has come after we have * The end of the split has come after we have invalidated the
* invalidated the operation and removed the * operation and removed the association to the drawable. This
* association to the drawable. This happens, * happens, for example, if the drawable is destroyed.
* for example, if the drawable is destroyed.
*/ */
fprintf(stderr, "nxagentFreeSplit: WARNING! Releasing invalidated resource [%d].\n", fprintf(stderr, "nxagentFreeSplit: WARNING! Releasing invalidated resource [%d].\n",
...@@ -718,8 +708,8 @@ void nxagentFreeSplit(int resource) ...@@ -718,8 +708,8 @@ void nxagentFreeSplit(int resource)
} }
/* /*
FIXME: This must be enabled when the vanilla FIXME: This must be enabled when the vanilla synchronization procedure
synchronization procedure is working. is working.
*/ */
#define USE_FINISH_SPLIT #define USE_FINISH_SPLIT
...@@ -747,8 +737,7 @@ void nxagentWaitDrawable(DrawablePtr pDrawable) ...@@ -747,8 +737,7 @@ void nxagentWaitDrawable(DrawablePtr pDrawable)
#endif #endif
/* /*
* Be sure we intercept an I/O error * Be sure we intercept an I/O error as well as an interrupt.
* as well as an interrupt.
*/ */
#ifdef USE_FINISH_SPLIT #ifdef USE_FINISH_SPLIT
...@@ -762,21 +751,18 @@ void nxagentWaitDrawable(DrawablePtr pDrawable) ...@@ -762,21 +751,18 @@ void nxagentWaitDrawable(DrawablePtr pDrawable)
for (;;) for (;;)
{ {
/* /*
* Handling all the possible events here * Handling all the possible events here preempts the queue and
* preempts the queue and makes a better * makes a better use of the link.
* use of the link.
* *
* We should better use XIfEvent() instead * We should better use XIfEvent() instead of looping again and
* of looping again and again through the * again through the event queue.
* event queue.
*/ */
nxagentDispatchEvents(NULL); nxagentDispatchEvents(NULL);
/* /*
* Wait indefinitely until the resource * Wait indefinitely until the resource is released or the display
* is released or the display is shut * is shut down.
* down.
*/ */
if (nxagentSplitResource(pDrawable) == NULL || if (nxagentSplitResource(pDrawable) == NULL ||
...@@ -821,16 +807,14 @@ void nxagentWaitCommitEvent(int resource) ...@@ -821,16 +807,14 @@ void nxagentWaitCommitEvent(int resource)
XEvent event; XEvent event;
/* /*
* Check if there is any commit pending. As * Check if there is any commit pending. As we are at it, handle any
* we are at it, handle any commit, even those * commit, even those commits pertaining to other resources.
* commits pertaining to other resources.
* *
* We can receive some commits even if we'll * We can receive some commits even if we'll later receive a
* later receive a no-split event. The proxy, * no-split event. The proxy, in fact, may have missed to find the
* in fact, may have missed to find the image * image in the memory cache and could have loaded it from disk (so
* in the memory cache and could have loaded it * requiring a commit) before we marked the end of the split
* from disk (so requiring a commit) before we * sequence.
* marked the end of the split sequence.
*/ */
while (nxagentCheckEvents(nxagentDisplay, &event, while (nxagentCheckEvents(nxagentDisplay, &event,
...@@ -866,9 +850,8 @@ int nxagentWaitSplitEvent(int resource) ...@@ -866,9 +850,8 @@ int nxagentWaitSplitEvent(int resource)
int split = 0; int split = 0;
/* /*
* Don't flush the link. We only want to * Don't flush the link. We only want to query the NX transport to
* query the NX transport to check whether * check whether the operation caused a split.
* the operation caused a split.
*/ */
NXFlushDisplay(nxagentDisplay, NXFlushBuffer); NXFlushDisplay(nxagentDisplay, NXFlushBuffer);
...@@ -1223,10 +1206,9 @@ void nxagentSetCorruptedTimestamp(DrawablePtr pDrawable) ...@@ -1223,10 +1206,9 @@ void nxagentSetCorruptedTimestamp(DrawablePtr pDrawable)
} }
/* /*
* Reset the timestamp taken when the drawable * Reset the timestamp taken when the drawable became initially
* became initially corrupted. The timestamp is * corrupted. The timestamp is reset only after the drawable has been
* reset only after the drawable has been fully * fully synchronized.
* synchronized.
*/ */
void nxagentResetCorruptedTimestamp(DrawablePtr pDrawable) void nxagentResetCorruptedTimestamp(DrawablePtr pDrawable)
...@@ -1253,4 +1235,3 @@ void nxagentResetCorruptedTimestamp(DrawablePtr pDrawable) ...@@ -1253,4 +1235,3 @@ void nxagentResetCorruptedTimestamp(DrawablePtr pDrawable)
} }
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment