Lines Matching refs:output
29 * Notify the output of some change
32 RROutputChanged (RROutputPtr output, Bool configChanged)
34 ScreenPtr pScreen = output->pScreen;
36 output->changed = TRUE;
47 * Create an output
56 RROutputPtr output;
75 output = malloc(sizeof (RROutputRec) + nameLength + 1);
76 if (!output)
78 output->id = FakeClientID (0);
79 output->pScreen = pScreen;
80 output->name = (char *) (output + 1);
81 output->nameLength = nameLength;
82 memcpy (output->name, name, nameLength);
83 output->name[nameLength] = '\0';
84 output->connection = RR_UnknownConnection;
85 output->subpixelOrder = SubPixelUnknown;
86 output->mmWidth = 0;
87 output->mmHeight = 0;
88 output->crtc = NULL;
89 output->numCrtcs = 0;
90 output->crtcs = NULL;
91 output->numClones = 0;
92 output->clones = NULL;
93 output->numModes = 0;
94 output->numPreferred = 0;
95 output->modes = NULL;
96 output->numUserModes = 0;
97 output->userModes = NULL;
98 output->properties = NULL;
99 output->pendingProperties = FALSE;
100 output->changed = FALSE;
101 output->devPrivate = devPrivate;
103 if (!AddResource (output->id, RROutputType, (pointer) output))
106 pScrPriv->outputs[pScrPriv->numOutputs++] = output;
107 return output;
111 * Notify extension that output parameters have been changed
114 RROutputSetClones (RROutputPtr output,
121 if (numClones == output->numClones)
124 if (output->clones[i] != clones[i])
137 free(output->clones);
139 output->clones = newClones;
140 output->numClones = numClones;
141 RROutputChanged (output, TRUE);
146 RROutputSetModes (RROutputPtr output,
154 if (numModes == output->numModes && numPreferred == output->numPreferred)
157 if (output->modes[i] != modes[i])
175 if (output->modes)
177 for (i = 0; i < output->numModes; i++)
178 RRModeDestroy (output->modes[i]);
179 free(output->modes);
182 output->modes = newModes;
183 output->numModes = numModes;
184 output->numPreferred = numPreferred;
185 RROutputChanged (output, TRUE);
190 RROutputAddUserMode (RROutputPtr output,
194 ScreenPtr pScreen = output->pScreen;
198 /* Check to see if this mode is already listed for this output */
199 for (m = 0; m < output->numModes + output->numUserModes; m++)
201 RRModePtr e = (m < output->numModes ?
202 output->modes[m] :
203 output->userModes[m - output->numModes]);
210 if (!pScrPriv->rrOutputValidateMode (pScreen, output, mode))
213 if (output->userModes)
214 newModes = realloc(output->userModes,
215 (output->numUserModes + 1) * sizeof (RRModePtr));
221 output->userModes = newModes;
222 output->userModes[output->numUserModes++] = mode;
224 RROutputChanged (output, TRUE);
230 RROutputDeleteUserMode (RROutputPtr output,
236 for (m = 0; m < output->numUserModes; m++)
238 RRModePtr e = output->userModes[m];
244 if (m == output->numUserModes)
247 /* make sure the mode isn't active for this output */
248 if (output->crtc && output->crtc->mode == mode)
251 memmove (output->userModes + m, output->userModes + m + 1,
252 (output->numUserModes - m - 1) * sizeof (RRModePtr));
253 output->numUserModes--;
259 RROutputSetCrtcs (RROutputPtr output,
266 if (numCrtcs == output->numCrtcs)
269 if (output->crtcs[i] != crtcs[i])
282 free(output->crtcs);
284 output->crtcs = newCrtcs;
285 output->numCrtcs = numCrtcs;
286 RROutputChanged (output, TRUE);
291 RROutputSetConnection (RROutputPtr output,
294 if (output->connection == connection)
296 output->connection = connection;
297 RROutputChanged (output, TRUE);
302 RROutputSetSubpixelOrder (RROutputPtr output,
305 if (output->subpixelOrder == subpixelOrder)
308 output->subpixelOrder = subpixelOrder;
309 RROutputChanged (output, FALSE);
314 RROutputSetPhysicalSize (RROutputPtr output,
318 if (output->mmWidth == mmWidth && output->mmHeight == mmHeight)
320 output->mmWidth = mmWidth;
321 output->mmHeight = mmHeight;
322 RROutputChanged (output, FALSE);
328 RRDeliverOutputEvent(ClientPtr client, WindowPtr pWin, RROutputPtr output)
333 RRCrtcPtr crtc = output->crtc;
341 oe.output = output->id;
354 oe.connection = output->connection;
355 oe.subpixelOrder = output->subpixelOrder;
363 RROutputDestroy (RROutputPtr output)
365 FreeResource (output->id, 0);
371 RROutputPtr output = (RROutputPtr) value;
372 ScreenPtr pScreen = output->pScreen;
380 if (pScrPriv->primaryOutput == output)
385 if (pScrPriv->outputs[i] == output)
394 if (output->modes)
396 for (m = 0; m < output->numModes; m++)
397 RRModeDestroy (output->modes[m]);
398 free(output->modes);
401 for (m = 0; m < output->numUserModes; m++)
402 RRModeDestroy (output->userModes[m]);
403 free(output->userModes);
405 free(output->crtcs);
406 free(output->clones);
407 RRDeleteAllOutputProperties (output);
408 free(output);
413 * Initialize output type
426 * Initialize output type error value
441 RROutputPtr output;
453 VERIFY_RR_OUTPUT(stuff->output, output, DixReadAccess);
455 pScreen = output->pScreen;
462 rep.crtc = output->crtc ? output->crtc->id : None;
463 rep.mmWidth = output->mmWidth;
464 rep.mmHeight = output->mmHeight;
465 rep.connection = output->connection;
466 rep.subpixelOrder = output->subpixelOrder;
467 rep.nCrtcs = output->numCrtcs;
468 rep.nModes = output->numModes + output->numUserModes;
469 rep.nPreferred = output->numPreferred;
470 rep.nClones = output->numClones;
471 rep.nameLength = output->nameLength;
473 extraLen = ((output->numCrtcs +
474 output->numModes + output->numUserModes +
475 output->numClones +
489 modes = (RRMode *) (crtcs + output->numCrtcs);
490 clones = (RROutput *) (modes + output->numModes + output->numUserModes);
491 name = (char *) (clones + output->numClones);
493 for (i = 0; i < output->numCrtcs; i++)
495 crtcs[i] = output->crtcs[i]->id;
499 for (i = 0; i < output->numModes + output->numUserModes; i++)
501 if (i < output->numModes)
502 modes[i] = output->modes[i]->mode.id;
504 modes[i] = output->userModes[i - output->numModes]->mode.id;
508 for (i = 0; i < output->numClones; i++)
510 clones[i] = output->clones[i]->id;
514 memcpy (name, output->name, output->nameLength);
539 RROutputPtr output)
541 if (pScrPriv->primaryOutput == output)
551 if (output) {
552 pScrPriv->primaryOutput = output;
553 RROutputChanged(output, 0);
565 RROutputPtr output = NULL;
576 if (stuff->output) {
577 VERIFY_RR_OUTPUT(stuff->output, output, DixReadAccess);
579 if (output->pScreen != pWin->drawable.pScreen) {
586 RRSetPrimaryOutput(pWin->drawable.pScreen, pScrPriv, output);
614 rep.output = primary ? primary->id : None;
619 swapl(&rep.output, n);