Lines Matching refs:mode
66 RRModePtr mode, *newModes;
71 mode = malloc(sizeof(RRModeRec) + modeInfo->nameLength + 1);
72 if (!mode)
74 mode->refcnt = 1;
75 mode->mode = *modeInfo;
76 mode->name = (char *) (mode + 1);
77 memcpy(mode->name, name, modeInfo->nameLength);
78 mode->name[modeInfo->nameLength] = '\0';
79 mode->userScreen = userScreen;
87 free(mode);
91 mode->mode.id = FakeClientID(0);
92 if (!AddResource(mode->mode.id, RRModeType, (void *) mode)) {
97 modes[num_modes++] = mode;
100 * give the caller a reference to this mode
102 ++mode->refcnt;
103 return mode;
110 RRModePtr mode;
113 mode = modes[i];
114 if (mode->mode.nameLength == nameLength &&
115 !memcmp(name, mode->name, nameLength)) {
116 return mode;
128 RRModePtr mode = modes[i];
130 if (RRModeEqual(&mode->mode, modeInfo) &&
131 !memcmp(name, mode->name, modeInfo->nameLength)) {
132 ++mode->refcnt;
133 return mode;
144 RRModePtr mode;
146 mode = RRModeFindByName(name, modeInfo->nameLength);
147 if (mode) {
152 mode = RRModeCreate(modeInfo, name, pScreen);
153 if (!mode) {
158 return mode;
181 RRModePtr mode = (m < output->numModes ?
185 if (screen_modes[n] == mode)
188 screen_modes[num_screen_modes++] = mode;
198 RRModePtr mode = crtc->mode;
201 if (!mode)
204 if (screen_modes[n] == mode)
207 screen_modes[num_screen_modes++] = mode;
213 RRModePtr mode = modes[m];
216 if (mode->userScreen != pScreen)
219 if (screen_modes[n] == mode)
222 screen_modes[num_screen_modes++] = mode;
230 RRModeDestroy(RRModePtr mode)
234 if (--mode->refcnt > 0)
237 if (modes[m] == mode) {
249 free(mode);
260 * Initialize mode type
275 * Initialize mode type error value
294 RRModePtr mode;
311 mode = RRModeCreateUser(pScreen, modeInfo, name, &error);
312 if (!mode)
319 .mode = mode->mode.id
324 swapl(&rep.mode);
327 /* Drop out reference to this mode */
328 RRModeDestroy(mode);
336 RRModePtr mode;
339 VERIFY_RR_MODE(stuff->mode, mode, DixDestroyAccess);
341 if (!mode->userScreen)
343 if (mode->refcnt > 1)
345 FreeResource(stuff->mode, 0);
353 RRModePtr mode;
358 VERIFY_RR_MODE(stuff->mode, mode, DixUseAccess);
363 return RROutputAddUserMode(output, mode);
370 RRModePtr mode;
375 VERIFY_RR_MODE(stuff->mode, mode, DixUseAccess);
380 return RROutputDeleteUserMode(output, mode);