Lines Matching refs:stuff

384     LEGAL_NEW_RESOURCE(stuff->shmseg, client);  in ProcShmAttach()
385 if ((stuff->readOnly != xTrue) && (stuff->readOnly != xFalse)) { in ProcShmAttach()
386 client->errorValue = stuff->readOnly; in ProcShmAttach()
390 if (!SHMDESC_IS_FD(shmdesc) && shmdesc->shmid == stuff->shmid) in ProcShmAttach()
394 if (!stuff->readOnly && !shmdesc->writable) in ProcShmAttach()
405 shmdesc->addr = shmat(stuff->shmid, 0, in ProcShmAttach()
406 stuff->readOnly ? SHM_RDONLY : 0); in ProcShmAttach()
407 if ((shmdesc->addr == ((char *) -1)) || SHMSTAT(stuff->shmid, &buf)) { in ProcShmAttach()
416 if (shm_access(client, &(SHM_PERM(buf)), stuff->readOnly) == -1) { in ProcShmAttach()
422 shmdesc->shmid = stuff->shmid; in ProcShmAttach()
424 shmdesc->writable = !stuff->readOnly; in ProcShmAttach()
429 if (!AddResource(stuff->shmseg, ShmSegType, (void *) shmdesc)) in ProcShmAttach()
465 VERIFY_SHMSEG(stuff->shmseg, shmdesc, client); in ProcShmDetach()
466 FreeResource(stuff->shmseg, RT_NONE); in ProcShmDetach()
531 VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess); in ProcShmPutImage()
532 VERIFY_SHMPTR(stuff->shmseg, stuff->offset, FALSE, shmdesc, client); in ProcShmPutImage()
533 if ((stuff->sendEvent != xTrue) && (stuff->sendEvent != xFalse)) in ProcShmPutImage()
535 if (stuff->format == XYBitmap) { in ProcShmPutImage()
536 if (stuff->depth != 1) in ProcShmPutImage()
538 length = PixmapBytePad(stuff->totalWidth, 1); in ProcShmPutImage()
540 else if (stuff->format == XYPixmap) { in ProcShmPutImage()
541 if (pDraw->depth != stuff->depth) in ProcShmPutImage()
543 length = PixmapBytePad(stuff->totalWidth, 1); in ProcShmPutImage()
544 length *= stuff->depth; in ProcShmPutImage()
546 else if (stuff->format == ZPixmap) { in ProcShmPutImage()
547 if (pDraw->depth != stuff->depth) in ProcShmPutImage()
549 length = PixmapBytePad(stuff->totalWidth, stuff->depth); in ProcShmPutImage()
552 client->errorValue = stuff->format; in ProcShmPutImage()
562 if (stuff->totalHeight != 0 && in ProcShmPutImage()
563 length > (shmdesc->size - stuff->offset) / stuff->totalHeight) { in ProcShmPutImage()
564 client->errorValue = stuff->totalWidth; in ProcShmPutImage()
567 if (stuff->srcX > stuff->totalWidth) { in ProcShmPutImage()
568 client->errorValue = stuff->srcX; in ProcShmPutImage()
571 if (stuff->srcY > stuff->totalHeight) { in ProcShmPutImage()
572 client->errorValue = stuff->srcY; in ProcShmPutImage()
575 if ((stuff->srcX + stuff->srcWidth) > stuff->totalWidth) { in ProcShmPutImage()
576 client->errorValue = stuff->srcWidth; in ProcShmPutImage()
579 if ((stuff->srcY + stuff->srcHeight) > stuff->totalHeight) { in ProcShmPutImage()
580 client->errorValue = stuff->srcHeight; in ProcShmPutImage()
584 if ((((stuff->format == ZPixmap) && (stuff->srcX == 0)) || in ProcShmPutImage()
585 ((stuff->format != ZPixmap) && in ProcShmPutImage()
586 (stuff->srcX < screenInfo.bitmapScanlinePad) && in ProcShmPutImage()
587 ((stuff->format == XYBitmap) || in ProcShmPutImage()
588 ((stuff->srcY == 0) && in ProcShmPutImage()
589 (stuff->srcHeight == stuff->totalHeight))))) && in ProcShmPutImage()
590 ((stuff->srcX + stuff->srcWidth) == stuff->totalWidth)) in ProcShmPutImage()
591 (*pGC->ops->PutImage) (pDraw, pGC, stuff->depth, in ProcShmPutImage()
592 stuff->dstX, stuff->dstY, in ProcShmPutImage()
593 stuff->totalWidth, stuff->srcHeight, in ProcShmPutImage()
594 stuff->srcX, stuff->format, in ProcShmPutImage()
595 shmdesc->addr + stuff->offset + in ProcShmPutImage()
596 (stuff->srcY * length)); in ProcShmPutImage()
598 doShmPutImage(pDraw, pGC, stuff->depth, stuff->format, in ProcShmPutImage()
599 stuff->totalWidth, stuff->totalHeight, in ProcShmPutImage()
600 stuff->srcX, stuff->srcY, in ProcShmPutImage()
601 stuff->srcWidth, stuff->srcHeight, in ProcShmPutImage()
602 stuff->dstX, stuff->dstY, shmdesc->addr + stuff->offset); in ProcShmPutImage()
604 if (stuff->sendEvent) { in ProcShmPutImage()
607 .drawable = stuff->drawable, in ProcShmPutImage()
610 .shmseg = stuff->shmseg, in ProcShmPutImage()
611 .offset = stuff->offset in ProcShmPutImage()
634 if ((stuff->format != XYPixmap) && (stuff->format != ZPixmap)) { in ProcShmGetImage()
635 client->errorValue = stuff->format; in ProcShmGetImage()
638 rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0, DixReadAccess); in ProcShmGetImage()
641 VERIFY_SHMPTR(stuff->shmseg, stuff->offset, TRUE, shmdesc, client); in ProcShmGetImage()
646 pDraw->x + stuff->x < 0 || in ProcShmGetImage()
647 pDraw->x + stuff->x + (int) stuff->width > pDraw->pScreen->width in ProcShmGetImage()
648 || pDraw->y + stuff->y < 0 || in ProcShmGetImage()
649 pDraw->y + stuff->y + (int) stuff->height > in ProcShmGetImage()
652 stuff->x < -wBorderWidth((WindowPtr) pDraw) || in ProcShmGetImage()
653 stuff->x + (int) stuff->width > in ProcShmGetImage()
655 stuff->y < -wBorderWidth((WindowPtr) pDraw) || in ProcShmGetImage()
656 stuff->y + (int) stuff->height > in ProcShmGetImage()
662 pDraw->pScreen->SourceValidate(pDraw, stuff->x, stuff->y, in ProcShmGetImage()
663 stuff->width, stuff->height, in ProcShmGetImage()
667 if (stuff->x < 0 || in ProcShmGetImage()
668 stuff->x + (int) stuff->width > pDraw->width || in ProcShmGetImage()
669 stuff->y < 0 || stuff->y + (int) stuff->height > pDraw->height) in ProcShmGetImage()
680 if (stuff->format == ZPixmap) { in ProcShmGetImage()
681 length = PixmapBytePad(stuff->width, pDraw->depth) * stuff->height; in ProcShmGetImage()
684 lenPer = PixmapBytePad(stuff->width, 1) * stuff->height; in ProcShmGetImage()
687 length = lenPer * Ones(stuff->planeMask & (plane | (plane - 1))); in ProcShmGetImage()
690 VERIFY_SHMSIZE(shmdesc, stuff->offset, length, client); in ProcShmGetImage()
696 else if (stuff->format == ZPixmap) { in ProcShmGetImage()
697 (*pDraw->pScreen->GetImage) (pDraw, stuff->x, stuff->y, in ProcShmGetImage()
698 stuff->width, stuff->height, in ProcShmGetImage()
699 stuff->format, stuff->planeMask, in ProcShmGetImage()
700 shmdesc->addr + stuff->offset); in ProcShmGetImage()
703 PixmapBytePad(stuff->width, pDraw->depth), pDraw, in ProcShmGetImage()
704 stuff->x, stuff->y, stuff->width, stuff->height, in ProcShmGetImage()
705 stuff->format, shmdesc->addr + stuff->offset); in ProcShmGetImage()
709 length = stuff->offset; in ProcShmGetImage()
711 if (stuff->planeMask & plane) { in ProcShmGetImage()
713 stuff->x, stuff->y, in ProcShmGetImage()
714 stuff->width, stuff->height, in ProcShmGetImage()
715 stuff->format, plane, in ProcShmGetImage()
719 BitmapBytePad(stuff->width), pDraw, in ProcShmGetImage()
720 stuff->x, stuff->y, stuff->width, stuff->height, in ProcShmGetImage()
721 stuff->format, shmdesc->addr + length); in ProcShmGetImage()
749 result = dixLookupResourceByClass((void **) &draw, stuff->drawable, in ProcPanoramiXShmPutImage()
754 result = dixLookupResourceByType((void **) &gc, stuff->gc, in ProcPanoramiXShmPutImage()
761 orig_x = stuff->dstX; in ProcPanoramiXShmPutImage()
762 orig_y = stuff->dstY; in ProcPanoramiXShmPutImage()
763 sendEvent = stuff->sendEvent; in ProcPanoramiXShmPutImage()
764 stuff->sendEvent = 0; in ProcPanoramiXShmPutImage()
767 stuff->sendEvent = sendEvent; in ProcPanoramiXShmPutImage()
768 stuff->drawable = draw->info[j].id; in ProcPanoramiXShmPutImage()
769 stuff->gc = gc->info[j].id; in ProcPanoramiXShmPutImage()
771 stuff->dstX = orig_x - screenInfo.screens[j]->x; in ProcPanoramiXShmPutImage()
772 stuff->dstY = orig_y - screenInfo.screens[j]->y; in ProcPanoramiXShmPutImage()
798 if ((stuff->format != XYPixmap) && (stuff->format != ZPixmap)) { in ProcPanoramiXShmGetImage()
799 client->errorValue = stuff->format; in ProcPanoramiXShmGetImage()
803 rc = dixLookupResourceByClass((void **) &draw, stuff->drawable, in ProcPanoramiXShmGetImage()
811 rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0, DixReadAccess); in ProcPanoramiXShmGetImage()
815 VERIFY_SHMPTR(stuff->shmseg, stuff->offset, TRUE, shmdesc, client); in ProcPanoramiXShmGetImage()
817 x = stuff->x; in ProcPanoramiXShmGetImage()
818 y = stuff->y; in ProcPanoramiXShmGetImage()
819 w = stuff->width; in ProcPanoramiXShmGetImage()
820 h = stuff->height; in ProcPanoramiXShmGetImage()
821 format = stuff->format; in ProcPanoramiXShmGetImage()
822 planemask = stuff->planeMask; in ProcPanoramiXShmGetImage()
858 VERIFY_SHMSIZE(shmdesc, stuff->offset, length, client); in ProcPanoramiXShmGetImage()
894 shmdesc->addr + stuff->offset, in ProcPanoramiXShmGetImage()
899 length = stuff->offset; in ProcPanoramiXShmGetImage()
938 client->errorValue = stuff->pid; in ProcPanoramiXShmCreatePixmap()
941 LEGAL_NEW_RESOURCE(stuff->pid, client); in ProcPanoramiXShmCreatePixmap()
942 rc = dixLookupDrawable(&pDraw, stuff->drawable, client, M_ANY, in ProcPanoramiXShmCreatePixmap()
947 VERIFY_SHMPTR(stuff->shmseg, stuff->offset, TRUE, shmdesc, client); in ProcPanoramiXShmCreatePixmap()
949 width = stuff->width; in ProcPanoramiXShmCreatePixmap()
950 height = stuff->height; in ProcPanoramiXShmCreatePixmap()
951 depth = stuff->depth; in ProcPanoramiXShmCreatePixmap()
959 if (stuff->depth != 1) { in ProcPanoramiXShmCreatePixmap()
962 if (pDepth->depth == stuff->depth) in ProcPanoramiXShmCreatePixmap()
964 client->errorValue = stuff->depth; in ProcPanoramiXShmCreatePixmap()
975 if (stuff->offset + size < size) in ProcPanoramiXShmCreatePixmap()
978 VERIFY_SHMSIZE(shmdesc, stuff->offset, size, client); in ProcPanoramiXShmCreatePixmap()
985 panoramix_setup_ids(newPix, client, stuff->pid); in ProcPanoramiXShmCreatePixmap()
996 stuff->width, in ProcPanoramiXShmCreatePixmap()
997 stuff->height, in ProcPanoramiXShmCreatePixmap()
998 stuff->depth, in ProcPanoramiXShmCreatePixmap()
1000 stuff->offset); in ProcPanoramiXShmCreatePixmap()
1003 result = XaceHook(XACE_RESOURCE_ACCESS, client, stuff->pid, in ProcPanoramiXShmCreatePixmap()
1030 AddResource(stuff->pid, XRT_PIXMAP, newPix); in ProcPanoramiXShmCreatePixmap()
1071 client->errorValue = stuff->pid; in ProcShmCreatePixmap()
1074 LEGAL_NEW_RESOURCE(stuff->pid, client); in ProcShmCreatePixmap()
1075 rc = dixLookupDrawable(&pDraw, stuff->drawable, client, M_ANY, in ProcShmCreatePixmap()
1080 VERIFY_SHMPTR(stuff->shmseg, stuff->offset, TRUE, shmdesc, client); in ProcShmCreatePixmap()
1082 width = stuff->width; in ProcShmCreatePixmap()
1083 height = stuff->height; in ProcShmCreatePixmap()
1084 depth = stuff->depth; in ProcShmCreatePixmap()
1092 if (stuff->depth != 1) { in ProcShmCreatePixmap()
1095 if (pDepth->depth == stuff->depth) in ProcShmCreatePixmap()
1097 client->errorValue = stuff->depth; in ProcShmCreatePixmap()
1108 if (stuff->offset + size < size) in ProcShmCreatePixmap()
1111 VERIFY_SHMSIZE(shmdesc, stuff->offset, size, client); in ProcShmCreatePixmap()
1113 pMap = (*screen_priv->shmFuncs->CreatePixmap) (pDraw->pScreen, stuff->width, in ProcShmCreatePixmap()
1114 stuff->height, stuff->depth, in ProcShmCreatePixmap()
1116 stuff->offset); in ProcShmCreatePixmap()
1118 rc = XaceHook(XACE_RESOURCE_ACCESS, client, stuff->pid, RT_PIXMAP, in ProcShmCreatePixmap()
1127 pMap->drawable.id = stuff->pid; in ProcShmCreatePixmap()
1128 if (AddResource(stuff->pid, RT_PIXMAP, (void *) pMap)) { in ProcShmCreatePixmap()
1159 LEGAL_NEW_RESOURCE(stuff->shmseg, client); in ProcShmAttachFd()
1160 if ((stuff->readOnly != xTrue) && (stuff->readOnly != xFalse)) { in ProcShmAttachFd()
1161 client->errorValue = stuff->readOnly; in ProcShmAttachFd()
1180 stuff->readOnly ? PROT_READ : PROT_READ|PROT_WRITE, in ProcShmAttachFd()
1191 shmdesc->writable = !stuff->readOnly; in ProcShmAttachFd()
1193 shmdesc->resource = stuff->shmseg; in ProcShmAttachFd()
1205 if (!AddResource(stuff->shmseg, ShmSegType, (void *) shmdesc)) in ProcShmAttachFd()
1278 LEGAL_NEW_RESOURCE(stuff->shmseg, client); in ProcShmCreateSegment()
1279 if ((stuff->readOnly != xTrue) && (stuff->readOnly != xFalse)) { in ProcShmCreateSegment()
1280 client->errorValue = stuff->readOnly; in ProcShmCreateSegment()
1286 if (ftruncate(fd, stuff->size) < 0) { in ProcShmCreateSegment()
1296 shmdesc->addr = mmap(NULL, stuff->size, in ProcShmCreateSegment()
1297 stuff->readOnly ? PROT_READ : PROT_READ|PROT_WRITE, in ProcShmCreateSegment()
1308 shmdesc->writable = !stuff->readOnly; in ProcShmCreateSegment()
1309 shmdesc->size = stuff->size; in ProcShmCreateSegment()
1322 if (!AddResource(stuff->shmseg, ShmSegType, (void *) shmdesc)) { in ProcShmCreateSegment()
1328 FreeResource(stuff->shmseg, RT_NONE); in ProcShmCreateSegment()
1342 if (stuff->data == X_ShmQueryVersion) in ProcShmDispatch()
1348 switch (stuff->data) { in ProcShmDispatch()
1399 swaps(&stuff->length); in SProcShmQueryVersion()
1407 swaps(&stuff->length); in SProcShmAttach()
1409 swapl(&stuff->shmseg); in SProcShmAttach()
1410 swapl(&stuff->shmid); in SProcShmAttach()
1418 swaps(&stuff->length); in SProcShmDetach()
1420 swapl(&stuff->shmseg); in SProcShmDetach()
1428 swaps(&stuff->length); in SProcShmPutImage()
1430 swapl(&stuff->drawable); in SProcShmPutImage()
1431 swapl(&stuff->gc); in SProcShmPutImage()
1432 swaps(&stuff->totalWidth); in SProcShmPutImage()
1433 swaps(&stuff->totalHeight); in SProcShmPutImage()
1434 swaps(&stuff->srcX); in SProcShmPutImage()
1435 swaps(&stuff->srcY); in SProcShmPutImage()
1436 swaps(&stuff->srcWidth); in SProcShmPutImage()
1437 swaps(&stuff->srcHeight); in SProcShmPutImage()
1438 swaps(&stuff->dstX); in SProcShmPutImage()
1439 swaps(&stuff->dstY); in SProcShmPutImage()
1440 swapl(&stuff->shmseg); in SProcShmPutImage()
1441 swapl(&stuff->offset); in SProcShmPutImage()
1449 swaps(&stuff->length); in SProcShmGetImage()
1451 swapl(&stuff->drawable); in SProcShmGetImage()
1452 swaps(&stuff->x); in SProcShmGetImage()
1453 swaps(&stuff->y); in SProcShmGetImage()
1454 swaps(&stuff->width); in SProcShmGetImage()
1455 swaps(&stuff->height); in SProcShmGetImage()
1456 swapl(&stuff->planeMask); in SProcShmGetImage()
1457 swapl(&stuff->shmseg); in SProcShmGetImage()
1458 swapl(&stuff->offset); in SProcShmGetImage()
1466 swaps(&stuff->length); in SProcShmCreatePixmap()
1468 swapl(&stuff->pid); in SProcShmCreatePixmap()
1469 swapl(&stuff->drawable); in SProcShmCreatePixmap()
1470 swaps(&stuff->width); in SProcShmCreatePixmap()
1471 swaps(&stuff->height); in SProcShmCreatePixmap()
1472 swapl(&stuff->shmseg); in SProcShmCreatePixmap()
1473 swapl(&stuff->offset); in SProcShmCreatePixmap()
1483 swaps(&stuff->length); in SProcShmAttachFd()
1485 swapl(&stuff->shmseg); in SProcShmAttachFd()
1493 swaps(&stuff->length); in SProcShmCreateSegment()
1495 swapl(&stuff->shmseg); in SProcShmCreateSegment()
1496 swapl(&stuff->size); in SProcShmCreateSegment()
1506 if (stuff->data == X_ShmQueryVersion) in SProcShmDispatch()
1512 switch (stuff->data) { in SProcShmDispatch()