nanogui: Nano-X:GsError out of server memory...
Subject:
Nano-X:GsError out of server memory...
From:
"Prashanth Dwarakanath" ####@####.####
Date:
18 Sep 2007 09:50:01 +0100
Message-Id: <20070918084800.10309.qmail@webmail54.rediffmail.com>
Hi All,
We tried running the t1demo.c program(/user/microwin/src/demos/nanox) on our PC and it worked perfectly fine. But we want to make t1demo program run on uClinux in Blackfin environment(target board), and cross compiled the same using bfin-linux-gcc.
We tried running the t1demo program on the board but initially we got a printed message "Cannot allocate root window". With some changes we further got the message "Nano-X:GsError out of server memory". This seems to be happening on a call to GrOpen API which in turn calls GsInitialize function in srvmain.c . The chunk of the t1demo is given below:
int *testing1;
char *testing2;
GR_WINDOW_ID window;
GR_GC_ID gc;
GR_FONT_ID fontid;
int x, y, fnum;
GR_REGION_ID regionid;
testing1 = (int *)malloc(SIZEOFINT);******Even this malloc does not work******
if(testing1 == NULL)
{
printf("\nMalloc failed\n");
}
else
{
free(testing1);
printf("\nAllocated and free patchu\n");
//printf("\nMalloc retrun value %d in success\n",patchu);
}
sleep(1);
testing2 = (char *)malloc(SIZEOFCHAR);******Even this does not work*******
if(testing2 == NULL)
{
printf("\nChar malloc failed\n");
}
else
{
free(testing2);
printf("\nChar Malloc returned \n");
exit(1);
}
sleep(5);
if (GrOpen() < 0)************Facing problems here**********
{
exit(1);
printf("\nProblem with GrOpen\n");
}
else
{
printf("\nGropen working\n");
}
window = GrNewWindowEx(GR_WM_PROPS_APPWINDOW,
"t1demo loadable fonts (truetype, t1lib, pcf, mgl, hzk)",
GR_ROOT_WINDOW_ID, 50, 50, WIDTH, HEIGHT, BLACK);
GrSelectEvents(window,
GR_EVENT_MASK_EXPOSURE | GR_EVENT_MASK_CLOSE_REQ);
GrMapWindow(window);
gc = GrNewGC();
GrSetGCUseBackground(gc, GR_FALSE);
GrSetGCBackground(gc, BLACK);
GrSetGCBackground(gc, WHITE);
We commented the GrOpen and further chunks, leaving only the other 2 mallocs in the beginning, then the mallocs worked. But when we uncomment the GrOpen and futher chunk , the initial mallocs would also not work.
We have 64MB of RAM on target board.
Kindly suggest what has to be done.
Thank you,
Prashanth