Lines Matching refs:clientp
275 static void release_lockpages(int devfd, _Dga_window clientp);
279 void safe_free_clientp(_Dga_window clientp);
283 safe_free_clientp(clientp)
284 _Dga_window clientp;
287 if(clientp){
288 if(clientp->back) free(clientp->back);
289 if(clientp->depth) free(clientp->depth);
290 if(clientp->stencil) free(clientp->stencil);
291 if(clientp->accum) free(clientp->accum);
292 if(clientp->alpha) free(clientp->alpha);
293 free(clientp);
331 _Dga_window clientp = NULL;
358 * allocated clientp structure. Also remember to add
378 /* Add it to the list of clientp structure associated
461 /* Add it to the list of clientp structure associated
477 if( (clientp =
480 memset(clientp, 0, sizeof(struct dga_window));
511 safe_free_clientp(clientp) ;
536 safe_free_clientp(clientp) ;
543 clientp->drawable_type = DGA_DRAW_WINDOW;
545 clientp->w_dpy = dpy;
546 clientp->w_info = (void*)infop ;
547 clientp->w_infofd = 0; /* no longer needed */
548 clientp->w_next = NULL;
550 clientp->curs_info = NULL; /* must set up here, may be changed below */
551 clientp->curs_fd = -1;
554 clientp->w_devfd = infop->w_sdevfd; ;
555 clientp->w_lockp = (Dga_lockp)infop->w_slockp;
556 clientp->w_unlockp = (Dga_lockp)infop->w_slockp;
558 clientp->w_lib_private = (void *) infop; /* PRIVATE DATA */
560 clientp->w_devfd = lockfd ;
573 clientp->curs_fd = winp->curs_fd;
574 clientp->curs_info = winp->curs_info;
601 safe_free_clientp(clientp) ;
621 safe_free_clientp(clientp) ;
632 safe_free_clientp(clientp) ;
639 clientp->w_lockp = lockp ;
640 clientp->w_unlockp = unlockp ;
644 ((clientp->curs_fd == -1) || (clientp->curs_info == NULL))) {
656 release_lockpages(devfd, clientp);
659 clientp->curs_fd = curs_fd;
662 clientp->curs_info = (caddr_t) mmap(0,
669 if (clientp->curs_info == (caddr_t) -1) {
675 release_lockpages(devfd, clientp);
679 if (((Dga_cursinfo *) (clientp->curs_info))->c_magic !=
685 munmap(clientp->curs_info, MINSHMEMSIZE) ;
687 release_lockpages(devfd, clientp);
694 clientp->w_token = token;
695 clientp->w_client = 0 ;
696 clientp->c_clipseq = 0 ;
697 clientp->s_clipseq_p = &(infop->u.vn.w_clipseq) ;
699 clientp->w_update_func = (int(*)())dgai_mbsmemb_update;
702 clientp->w_update_func = dga_win_update;
706 clientp->w_unlock_func = dgai_unlock;
708 clientp->w_unlock_func = NULL;
711 clientp->w_lock_func = NULL;
712 clientp->w_unlock_func = NULL;
714 clientp->w_lockcnt = 0;
716 clientp->w_clipptr = (short *)((char *)infop+infop->u.vn.w_clipoff);
717 clientp->w_cliplen = 0;
720 clientp->c_chngcnt = 0;
721 clientp->s_chngcnt_p = clientp->s_clipseq_p;
723 clientp->c_chngcnt = 0;
724 clientp->s_chngcnt_p = &(infop->w_chng_cnt);
726 clientp->c_wm_chngcnt[i] = 0;
728 clientp->shadow_chngcnt[i] = 0;
736 clientp->w_wm_2nd = clientp->c_wm_chngcnt + 1;
738 if ((infop->w_version < 2) || (clientp->curs_info == NULL)) {
739 clientp->s_curseq_p = &clientp->c_curseq;
740 clientp->c_curseq = 0;
742 clientp->s_curseq_p =
743 &(((Dga_cursinfo *) (clientp->curs_info))->c_chng_cnt);
744 clientp->c_curseq =
745 ((Dga_cursinfo *) (clientp->curs_info))->c_chng_cnt - 1;
749 clientp->back = (void *)malloc(sizeof(dga_internal_buffer_rec));
750 if ( !clientp->back )
753 clientp->depth = (void *)malloc(sizeof(dga_internal_buffer_rec));
754 if ( !clientp->depth )
757 clientp->stencil = (void *)malloc(sizeof(dga_internal_buffer_rec));
758 if ( !clientp->stencil )
761 clientp->accum = (void *)malloc(sizeof(dga_internal_buffer_rec));
762 if ( !clientp->accum )
765 clientp->alpha = (void *)malloc(sizeof(dga_internal_buffer_rec));
766 if ( !clientp->alpha )
769 ((dga_internal_buffer)clientp->back)->bufferp = NULL;
770 ((dga_internal_buffer)clientp->depth)->bufferp = NULL;
771 ((dga_internal_buffer)clientp->stencil)->bufferp = NULL;
772 ((dga_internal_buffer)clientp->accum)->bufferp = NULL;
773 ((dga_internal_buffer)clientp->alpha)->bufferp = NULL;
775 ((dga_internal_buffer)clientp->back)->pDraw = (Dga_drawable)clientp;
776 ((dga_internal_buffer)clientp->depth)->pDraw = (Dga_drawable)clientp;
777 ((dga_internal_buffer)clientp->stencil)->pDraw = (Dga_drawable)clientp;
778 ((dga_internal_buffer)clientp->accum)->pDraw = (Dga_drawable)clientp;
779 ((dga_internal_buffer)clientp->alpha)->pDraw = (Dga_drawable)clientp;
781 ((dga_internal_buffer)clientp->back)->buf_size = 0;
782 ((dga_internal_buffer)clientp->depth)->buf_size = 0;
783 ((dga_internal_buffer)clientp->stencil)->buf_size = 0;
784 ((dga_internal_buffer)clientp->accum)->buf_size = 0;
785 ((dga_internal_buffer)clientp->alpha)->buf_size = 0;
787 clientp->buf_resize_flag = 0;
788 clientp->c_buffer_swap = 0;
790 clientp->db_enabled = 0;
791 clientp->c_rtnseq = 0;
792 clientp->s_rtnseq_p = &clientp->c_rtnseq;
793 clientp->rtn_info = NULL;
794 clientp->rtn_flags = 0;
797 clientp->pMbs = NULL;
799 clientp->c_mbufseq = 0;
800 clientp->s_mbufseq_p = &infop->w_mbsInfo.mbufseq;
801 clientp->c_mbcomposseq = 0;
802 clientp->s_mbcomposseq_p = &infop->w_mbsInfo.compositionseq;
803 clientp->s_devinfoseq_p = &infop->w_devinfoseq;
804 clientp->c_devinfoseq = 0;
805 clientp->siteNotifyFunc = NULL;
806 clientp->siteNotifyClientData = NULL;
807 clientp->mbNotifyFunc = NULL;
808 clientp->mbNotifyClientData = NULL;
809 clientp->rendBufNotifyFunc = NULL;
810 clientp->rendBufNotifyClientData = NULL;
811 clientp->rLockSubj = DGA_LOCKSUBJ_INVALID;
812 clientp->eLockSubj = DGA_LOCKSUBJ_INVALID;
813 clientp->eLockSubjPrev = DGA_LOCKSUBJ_INVALID;
814 clientp->changeMask = 0;
815 clientp->prevWasMbuffered = 0;
816 clientp->mbChgReason = DGA_MBCHG_UNKNOWN;
817 clientp->siteChgReason = DGA_SITECHG_UNKNOWN;
818 clientp->prevLocked = 0;
832 dga_wlist->dga_clientplist_draw = clientp;
836 dga_wlist->dga_clientplist = clientp;
847 new_wlist->dga_clientplist_draw = clientp;
851 new_wlist->dga_clientplist = clientp;
862 clientp->mutexp = &dga_wlist->mutex;
870 if (!dgai_win_initMbufset(clientp)) {
871 dga_win_ungrab(clientp, 0);
875 return((Dga_window)clientp);
897 _Dga_window clientp;
901 if (clientp = winp->dga_clientplist_draw) {
902 linfop = (WXINFO *) clientp->w_info;
904 return(clientp);
907 if (clientp = winp->dga_clientplist) {
908 linfop = (WXINFO *) clientp->w_info;
910 return(clientp);
919 release_lockpages(devfd, clientp)
921 _Dga_window clientp;
923 int lockfd = clientp->w_devfd ;
924 WXINFO *infop = (WXINFO *) clientp->w_info ;
925 Dga_lockp lockp = clientp->w_lockp ;
926 Dga_lockp unlockp = clientp->w_unlockp ;
929 if ((clientp->curs_info ||
934 * Note: check both clientp->curs_info and infop->c_sinfo because
954 safe_free_clientp(clientp) ;
963 _Dga_window clientp = (struct dga_window *)clientpi;
969 dgai_win_ungrab_common(clientp, cflag,drawableGrabber)
970 _Dga_window clientp;
975 WXINFO *infop = (WXINFO *) clientp->w_info ;
987 if (winp->w_token == clientp->w_token) {
996 if (clntp == clientp) {
1016 if (clntp == clientp) {
1042 if ((clientp->rtn_flags & RTN_GRABBED) && (!winp->dga_clientplist))
1043 dga_rtn_ungrab(clientp);
1044 if (clientp->db_enabled && (!winp->dga_clientplist))
1045 dga_db_release(clientp);
1046 devfd = clientp->w_devfd ;
1051 if ((clientp->curs_info) && (check_other_curg_windows(infop) == NULL) &&
1053 curs_fd = clientp->curs_fd;
1054 munmap(clientp->curs_info, MINSHMEMSIZE) ;
1060 if (clientp->pMbs) {
1061 dgai_mbufset_decref(clientp->pMbs);
1062 clientp->pMbs = NULL;
1065 /* TODO: shouldn't we free the clientp??? */
1070 release_lockpages( cflag ? -1 : 0, clientp ) ;
1085 dgai_win_check_multiple_grab(clientp, drawableGrabber)
1086 _Dga_window clientp;
1099 if (winp->w_token == clientp->w_token) {
1111 if (clntp == clientp) {
1330 dgai_win_clip_update (_Dga_window clientp)
1336 WXINFO *infop = (WXINFO *) clientp->w_info ;
1349 if (clientp->w_clipptr == cmclip) {
1350 clientp->w_cliplen = infop->w_scliplen;
1351 clientp->w_clipptr = (short *)infop->u.vn.w_sclipptr;
1354 if (clientp->w_clipptr != cmclip) {
1355 clientp->w_clipptr = cmclip;
1362 if (clientp->w_clipptr == cmclip) {
1365 DGA_UNLOCK(clientp);
1366 sprintf(filename, "%s%08x", GRABFILE, clientp->w_token);
1380 DGA_LOCK(clientp);
1382 clientp->w_cliplen = cliplen;
1383 clientp->w_clipptr = clipptr;
1387 if (clientp->w_cliplen != infop->w_scliplen) {
1390 DGA_UNLOCK(clientp);
1391 sprintf(filename, "%s%08x", GRABFILE, clientp->w_token);
1403 DGA_LOCK(clientp);
1405 clientp->w_clipptr = cmclip;
1407 clientp->w_cliplen = cliplen;
1408 clientp->w_clipptr = clipptr;
1414 if (clientp->w_clipptr != cmclip) {
1416 DGA_UNLOCK(clientp);
1417 sprintf(filename, "%s%08x", GRABFILE, clientp->w_token);
1420 clientp->w_clipptr = cmclip;
1424 clientp->w_clipptr = cmclip;
1430 DGA_LOCK(clientp);
1431 clientp->w_clipptr = cmclip;
1487 dgai_win_rtn_update (_Dga_window clientp)
1492 mapped = clientp->rtn_flags & RTN_MAPPED;
1493 if (mapped && RTN_INFOP(clientp)->obsolete) {
1495 (void) _dga_rtn_unmap(clientp);
1496 (void) _dga_rtn_map(clientp);
1499 if (!mapped && (((WXINFO *) clientp->w_info)->w_srtndlink != NULL)) {
1501 (void) _dga_rtn_map(clientp);
1505 mapped = clientp->rtn_flags & RTN_MAPPED;
1506 if (mapped && RTN_INFOP(clientp)->obsolete) {
1508 DGA_UNLOCK(clientp);
1509 (void) _dga_rtn_unmap(clientp);
1510 (void) _dga_rtn_map(clientp);
1511 DGA_LOCK(clientp);
1514 if (!mapped && (((WXINFO *) clientp->w_info)->w_srtndlink != NULL)) {
1516 DGA_UNLOCK(clientp);
1517 (void) _dga_rtn_map(clientp);
1518 DGA_LOCK(clientp);
1757 _Dga_window clientp = (struct dga_window *)clientpi;
1758 WXINFO *infop = (WXINFO *) clientp->w_info ;
1760 printf("client page is %p\n", clientp) ;
1761 printf(" w_info = %p\n", (WXINFO *) clientp->w_info) ;
1762 printf(" w_next = %p\n", clientp->w_next) ;
1763 printf(" w_client = %p\n", clientp->w_client) ;
1764 printf(" c_clipseq = %u\n", clientp->c_clipseq) ;
1765 printf(" s_clipseq_p = %p\n", clientp->s_clipseq_p) ;
1766 printf(" w_update_func = %p\n", clientp->w_update_func) ;
1767 printf(" w_infofd = %d\n", clientp->w_infofd) ;
1768 printf(" w_devfd = %d\n", clientp->w_devfd) ;
1769 printf(" w_lockcnt = %d\n", clientp->w_lockcnt) ;
1770 printf(" w_lockp = %p\n", clientp->w_lockp) ;
1771 printf(" w_unlockp = %p\n", clientp->w_unlockp) ;
1772 printf(" w_clipptr = %p\n", clientp->w_clipptr) ;
1773 printf(" w_cliplen = %u\n", clientp->w_cliplen) ;