Skip to content

Commit

Permalink
XQuartz: Added some pseudoramiX debug traces
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyhu committed Apr 26, 2008
1 parent db7d118 commit 5bee158
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 2 deletions.
2 changes: 2 additions & 0 deletions hw/xquartz/darwin.h
Expand Up @@ -129,4 +129,6 @@ extern FILE *debug_log_fp;
#define DEBUG_LOG(msg, args...)
#endif

#define TRACE() DEBUG_LOG("\n")

#endif /* _DARWIN_H */
37 changes: 37 additions & 0 deletions hw/xquartz/pseudoramiX.c
Expand Up @@ -37,6 +37,7 @@ Equipment Corporation.
#include <dix-config.h>
#endif

#include "darwin.h"
#include "pseudoramiX.h"
#include "extnsionst.h"
#include "dixstruct.h"
Expand Down Expand Up @@ -99,6 +100,8 @@ PseudoramiXAddScreen(int x, int y, int w, int h)
sizeof(PseudoramiXScreenRec));
}

DEBUG_LOG("x: %d, y: %d, w: %d, h: %d\n", x, y, w, h);

s = &pseudoramiXScreens[pseudoramiXNumScreens++];
s->x = x;
s->y = y;
Expand All @@ -116,6 +119,8 @@ void PseudoramiXExtensionInit(int argc, char *argv[])

if (noPseudoramiXExtension) return;

TRACE();

/* Even with only one screen we need to enable PseudoramiX to allow
dynamic screen configuration changes. */
#if 0
Expand Down Expand Up @@ -153,19 +158,25 @@ void PseudoramiXExtensionInit(int argc, char *argv[])

void PseudoramiXResetScreens(void)
{
TRACE();

pseudoramiXNumScreens = 0;
}


static void PseudoramiXResetProc(ExtensionEntry *extEntry)
{
TRACE();

PseudoramiXResetScreens();
}


// was PanoramiX
static int ProcPseudoramiXQueryVersion(ClientPtr client)
{
TRACE();

return ProcPanoramiXQueryVersion(client);
}

Expand All @@ -178,6 +189,8 @@ static int ProcPseudoramiXGetState(ClientPtr client)
xPanoramiXGetStateReply rep;
register int n;

TRACE();

REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
pWin = LookupWindow (stuff->window, client);
if (!pWin)
Expand All @@ -204,6 +217,8 @@ static int ProcPseudoramiXGetScreenCount(ClientPtr client)
xPanoramiXGetScreenCountReply rep;
register int n;

TRACE();

REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
pWin = LookupWindow (stuff->window, client);
if (!pWin)
Expand All @@ -230,6 +245,8 @@ static int ProcPseudoramiXGetScreenSize(ClientPtr client)
xPanoramiXGetScreenSizeReply rep;
register int n;

TRACE();

REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
pWin = LookupWindow (stuff->window, client);
if (!pWin)
Expand Down Expand Up @@ -259,6 +276,8 @@ static int ProcPseudoramiXIsActive(ClientPtr client)
/* REQUEST(xXineramaIsActiveReq); */
xXineramaIsActiveReply rep;

TRACE();

REQUEST_SIZE_MATCH(xXineramaIsActiveReq);

rep.type = X_Reply;
Expand All @@ -282,6 +301,8 @@ static int ProcPseudoramiXQueryScreens(ClientPtr client)
/* REQUEST(xXineramaQueryScreensReq); */
xXineramaQueryScreensReply rep;

DEBUG_LOG("noPseudoramiXExtension=%d, pseudoramiXNumScreens=%d\n", noPseudoramiXExtension, pseudoramiXNumScreens);

REQUEST_SIZE_MATCH(xXineramaQueryScreensReq);

rep.type = X_Reply;
Expand Down Expand Up @@ -324,6 +345,7 @@ static int ProcPseudoramiXQueryScreens(ClientPtr client)
// was PanoramiX
static int ProcPseudoramiXDispatch (ClientPtr client)
{ REQUEST(xReq);
TRACE();
switch (stuff->data)
{
case X_PanoramiXQueryVersion:
Expand All @@ -350,6 +372,8 @@ SProcPseudoramiXQueryVersion (ClientPtr client)
REQUEST(xPanoramiXQueryVersionReq);
register int n;

TRACE();

swaps(&stuff->length,n);
REQUEST_SIZE_MATCH (xPanoramiXQueryVersionReq);
return ProcPseudoramiXQueryVersion(client);
Expand All @@ -361,6 +385,8 @@ SProcPseudoramiXGetState(ClientPtr client)
REQUEST(xPanoramiXGetStateReq);
register int n;

TRACE();

swaps (&stuff->length, n);
REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
return ProcPseudoramiXGetState(client);
Expand All @@ -372,6 +398,8 @@ SProcPseudoramiXGetScreenCount(ClientPtr client)
REQUEST(xPanoramiXGetScreenCountReq);
register int n;

TRACE();

swaps (&stuff->length, n);
REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
return ProcPseudoramiXGetScreenCount(client);
Expand All @@ -383,6 +411,8 @@ SProcPseudoramiXGetScreenSize(ClientPtr client)
REQUEST(xPanoramiXGetScreenSizeReq);
register int n;

TRACE();

swaps (&stuff->length, n);
REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
return ProcPseudoramiXGetScreenSize(client);
Expand All @@ -395,6 +425,8 @@ SProcPseudoramiXIsActive(ClientPtr client)
REQUEST(xXineramaIsActiveReq);
register int n;

TRACE();

swaps (&stuff->length, n);
REQUEST_SIZE_MATCH(xXineramaIsActiveReq);
return ProcPseudoramiXIsActive(client);
Expand All @@ -407,6 +439,8 @@ SProcPseudoramiXQueryScreens(ClientPtr client)
REQUEST(xXineramaQueryScreensReq);
register int n;

TRACE();

swaps (&stuff->length, n);
REQUEST_SIZE_MATCH(xXineramaQueryScreensReq);
return ProcPseudoramiXQueryScreens(client);
Expand All @@ -416,6 +450,9 @@ SProcPseudoramiXQueryScreens(ClientPtr client)
static int
SProcPseudoramiXDispatch (ClientPtr client)
{ REQUEST(xReq);

TRACE();

switch (stuff->data)
{
case X_PanoramiXQueryVersion:
Expand Down
2 changes: 0 additions & 2 deletions hw/xquartz/quartzCocoa.m
Expand Up @@ -44,8 +44,6 @@

#include <Cocoa/Cocoa.h>

#include "pseudoramiX.h"

extern void FatalError(const char *, ...);
extern char *display;
extern int noPanoramiXExtension;
Expand Down

0 comments on commit 5bee158

Please sign in to comment.