randrstr.h revision 051b6151
1/* 2 * Copyright © 2000 Compaq Computer Corporation 3 * Copyright © 2002 Hewlett-Packard Company 4 * Copyright © 2006 Intel Corporation 5 * Copyright © 2008 Red Hat, Inc. 6 * 7 * Permission to use, copy, modify, distribute, and sell this software and its 8 * documentation for any purpose is hereby granted without fee, provided that 9 * the above copyright notice appear in all copies and that both that copyright 10 * notice and this permission notice appear in supporting documentation, and 11 * that the name of the copyright holders not be used in advertising or 12 * publicity pertaining to distribution of the software without specific, 13 * written prior permission. The copyright holders make no representations 14 * about the suitability of this software for any purpose. It is provided "as 15 * is" without express or implied warranty. 16 * 17 * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 18 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO 19 * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR 20 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, 21 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 22 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 23 * OF THIS SOFTWARE. 24 * 25 * Author: Jim Gettys, Hewlett-Packard Company, Inc. 26 * Keith Packard, Intel Corporation 27 */ 28 29#ifdef HAVE_DIX_CONFIG_H 30#include <dix-config.h> 31#endif 32 33#ifndef _RANDRSTR_H_ 34#define _RANDRSTR_H_ 35 36#include <X11/X.h> 37#include <X11/Xproto.h> 38#include "misc.h" 39#include "os.h" 40#include "dixstruct.h" 41#include "resource.h" 42#include "scrnintstr.h" 43#include "windowstr.h" 44#include "pixmapstr.h" 45#include "extnsionst.h" 46#include "servermd.h" 47#include "rrtransform.h" 48#include <X11/extensions/randr.h> 49#include <X11/extensions/randrproto.h> 50#include <X11/extensions/render.h> /* we share subpixel order information */ 51#include "picturestr.h" 52#include <X11/Xfuncproto.h> 53 54/* required for ABI compatibility for now */ 55#define RANDR_10_INTERFACE 1 56#define RANDR_12_INTERFACE 1 57#define RANDR_13_INTERFACE 1 /* requires RANDR_12_INTERFACE */ 58#define RANDR_GET_CRTC_INTERFACE 1 59 60#define RANDR_INTERFACE_VERSION 0x0103 61 62typedef XID RRMode; 63typedef XID RROutput; 64typedef XID RRCrtc; 65 66extern _X_EXPORT int RREventBase, RRErrorBase; 67 68extern _X_EXPORT int (*ProcRandrVector[RRNumberRequests])(ClientPtr); 69extern _X_EXPORT int (*SProcRandrVector[RRNumberRequests])(ClientPtr); 70 71/* 72 * Modeline for a monitor. Name follows directly after this struct 73 */ 74 75#define RRModeName(pMode) ((char *) (pMode + 1)) 76typedef struct _rrMode RRModeRec, *RRModePtr; 77typedef struct _rrPropertyValue RRPropertyValueRec, *RRPropertyValuePtr; 78typedef struct _rrProperty RRPropertyRec, *RRPropertyPtr; 79typedef struct _rrCrtc RRCrtcRec, *RRCrtcPtr; 80typedef struct _rrOutput RROutputRec, *RROutputPtr; 81 82struct _rrMode { 83 int refcnt; 84 xRRModeInfo mode; 85 char *name; 86 ScreenPtr userScreen; 87}; 88 89struct _rrPropertyValue { 90 Atom type; /* ignored by server */ 91 short format; /* format of data for swapping - 8,16,32 */ 92 long size; /* size of data in (format/8) bytes */ 93 pointer data; /* private to client */ 94}; 95 96struct _rrProperty { 97 RRPropertyPtr next; 98 ATOM propertyName; 99 Bool is_pending; 100 Bool range; 101 Bool immutable; 102 int num_valid; 103 INT32 *valid_values; 104 RRPropertyValueRec current, pending; 105}; 106 107struct _rrCrtc { 108 RRCrtc id; 109 ScreenPtr pScreen; 110 RRModePtr mode; 111 int x, y; 112 Rotation rotation; 113 Rotation rotations; 114 Bool changed; 115 int numOutputs; 116 RROutputPtr *outputs; 117 int gammaSize; 118 CARD16 *gammaRed; 119 CARD16 *gammaBlue; 120 CARD16 *gammaGreen; 121 void *devPrivate; 122 Bool transforms; 123 RRTransformRec client_pending_transform; 124 RRTransformRec client_current_transform; 125 PictTransform transform; 126 struct pict_f_transform f_transform; 127 struct pict_f_transform f_inverse; 128}; 129 130struct _rrOutput { 131 RROutput id; 132 ScreenPtr pScreen; 133 char *name; 134 int nameLength; 135 CARD8 connection; 136 CARD8 subpixelOrder; 137 int mmWidth; 138 int mmHeight; 139 RRCrtcPtr crtc; 140 int numCrtcs; 141 RRCrtcPtr *crtcs; 142 int numClones; 143 RROutputPtr *clones; 144 int numModes; 145 int numPreferred; 146 RRModePtr *modes; 147 int numUserModes; 148 RRModePtr *userModes; 149 Bool changed; 150 RRPropertyPtr properties; 151 Bool pendingProperties; 152 void *devPrivate; 153}; 154 155#if RANDR_12_INTERFACE 156typedef Bool (*RRScreenSetSizeProcPtr) (ScreenPtr pScreen, 157 CARD16 width, 158 CARD16 height, 159 CARD32 mmWidth, 160 CARD32 mmHeight); 161 162typedef Bool (*RRCrtcSetProcPtr) (ScreenPtr pScreen, 163 RRCrtcPtr crtc, 164 RRModePtr mode, 165 int x, 166 int y, 167 Rotation rotation, 168 int numOutputs, 169 RROutputPtr *outputs); 170 171typedef Bool (*RRCrtcSetGammaProcPtr) (ScreenPtr pScreen, 172 RRCrtcPtr crtc); 173 174typedef Bool (*RRCrtcGetGammaProcPtr) (ScreenPtr pScreen, 175 RRCrtcPtr crtc); 176 177typedef Bool (*RROutputSetPropertyProcPtr) (ScreenPtr pScreen, 178 RROutputPtr output, 179 Atom property, 180 RRPropertyValuePtr value); 181 182typedef Bool (*RROutputValidateModeProcPtr) (ScreenPtr pScreen, 183 RROutputPtr output, 184 RRModePtr mode); 185 186typedef void (*RRModeDestroyProcPtr) (ScreenPtr pScreen, 187 RRModePtr mode); 188 189#endif 190 191#if RANDR_13_INTERFACE 192typedef Bool (*RROutputGetPropertyProcPtr) (ScreenPtr pScreen, 193 RROutputPtr output, 194 Atom property); 195typedef Bool (*RRGetPanningProcPtr) (ScreenPtr pScrn, 196 RRCrtcPtr crtc, 197 BoxPtr totalArea, 198 BoxPtr trackingArea, 199 INT16 *border); 200typedef Bool (*RRSetPanningProcPtr) (ScreenPtr pScrn, 201 RRCrtcPtr crtc, 202 BoxPtr totalArea, 203 BoxPtr trackingArea, 204 INT16 *border); 205 206#endif /* RANDR_13_INTERFACE */ 207 208typedef Bool (*RRGetInfoProcPtr) (ScreenPtr pScreen, Rotation *rotations); 209typedef Bool (*RRCloseScreenProcPtr) ( int i, ScreenPtr pscreen); 210 211/* These are for 1.0 compatibility */ 212 213typedef struct _rrRefresh { 214 CARD16 rate; 215 RRModePtr mode; 216} RRScreenRate, *RRScreenRatePtr; 217 218typedef struct _rrScreenSize { 219 int id; 220 short width, height; 221 short mmWidth, mmHeight; 222 int nRates; 223 RRScreenRatePtr pRates; 224} RRScreenSize, *RRScreenSizePtr; 225 226#ifdef RANDR_10_INTERFACE 227 228typedef Bool (*RRSetConfigProcPtr) (ScreenPtr pScreen, 229 Rotation rotation, 230 int rate, 231 RRScreenSizePtr pSize); 232 233#endif 234 235 236typedef struct _rrScrPriv { 237 /* 238 * 'public' part of the structure; DDXen fill this in 239 * as they initialize 240 */ 241#if RANDR_10_INTERFACE 242 RRSetConfigProcPtr rrSetConfig; 243#endif 244 RRGetInfoProcPtr rrGetInfo; 245#if RANDR_12_INTERFACE 246 RRScreenSetSizeProcPtr rrScreenSetSize; 247 RRCrtcSetProcPtr rrCrtcSet; 248 RRCrtcSetGammaProcPtr rrCrtcSetGamma; 249 RRCrtcGetGammaProcPtr rrCrtcGetGamma; 250 RROutputSetPropertyProcPtr rrOutputSetProperty; 251 RROutputValidateModeProcPtr rrOutputValidateMode; 252 RRModeDestroyProcPtr rrModeDestroy; 253#endif 254#if RANDR_13_INTERFACE 255 RROutputGetPropertyProcPtr rrOutputGetProperty; 256 RRGetPanningProcPtr rrGetPanning; 257 RRSetPanningProcPtr rrSetPanning; 258#endif 259 260 /* 261 * Private part of the structure; not considered part of the ABI 262 */ 263 TimeStamp lastSetTime; /* last changed by client */ 264 TimeStamp lastConfigTime; /* possible configs changed */ 265 RRCloseScreenProcPtr CloseScreen; 266 267 Bool changed; /* some config changed */ 268 Bool configChanged; /* configuration changed */ 269 Bool layoutChanged; /* screen layout changed */ 270 271 CARD16 minWidth, minHeight; 272 CARD16 maxWidth, maxHeight; 273 CARD16 width, height; /* last known screen size */ 274 CARD16 mmWidth, mmHeight; /* last known screen size */ 275 276 int numOutputs; 277 RROutputPtr *outputs; 278 RROutputPtr primaryOutput; 279 280 int numCrtcs; 281 RRCrtcPtr *crtcs; 282 283 /* Last known pointer position */ 284 RRCrtcPtr pointerCrtc; 285 286#ifdef RANDR_10_INTERFACE 287 /* 288 * Configuration information 289 */ 290 Rotation rotations; 291 CARD16 reqWidth, reqHeight; 292 293 int nSizes; 294 RRScreenSizePtr pSizes; 295 296 Rotation rotation; 297 int rate; 298 int size; 299#endif 300} rrScrPrivRec, *rrScrPrivPtr; 301 302extern _X_EXPORT DevPrivateKeyRec rrPrivKeyRec; 303#define rrPrivKey (&rrPrivKeyRec) 304 305#define rrGetScrPriv(pScr) ((rrScrPrivPtr)dixLookupPrivate(&(pScr)->devPrivates, rrPrivKey)) 306#define rrScrPriv(pScr) rrScrPrivPtr pScrPriv = rrGetScrPriv(pScr) 307#define SetRRScreen(s,p) dixSetPrivate(&(s)->devPrivates, rrPrivKey, p) 308 309/* 310 * each window has a list of clients requesting 311 * RRNotify events. Each client has a resource 312 * for each window it selects RRNotify input for, 313 * this resource is used to delete the RRNotifyRec 314 * entry from the per-window queue. 315 */ 316 317typedef struct _RREvent *RREventPtr; 318 319typedef struct _RREvent { 320 RREventPtr next; 321 ClientPtr client; 322 WindowPtr window; 323 XID clientResource; 324 int mask; 325} RREventRec; 326 327typedef struct _RRTimes { 328 TimeStamp setTime; 329 TimeStamp configTime; 330} RRTimesRec, *RRTimesPtr; 331 332typedef struct _RRClient { 333 int major_version; 334 int minor_version; 335/* RRTimesRec times[0]; */ 336} RRClientRec, *RRClientPtr; 337 338extern _X_EXPORT RESTYPE RRClientType, RREventType; /* resource types for event masks */ 339extern _X_EXPORT DevPrivateKeyRec RRClientPrivateKeyRec; 340#define RRClientPrivateKey (&RRClientPrivateKeyRec) 341extern _X_EXPORT RESTYPE RRCrtcType, RRModeType, RROutputType; 342 343#define VERIFY_RR_OUTPUT(id, ptr, a)\ 344 {\ 345 int rc = dixLookupResourceByType((pointer *)&(ptr), id,\ 346 RROutputType, client, a);\ 347 if (rc != Success) {\ 348 client->errorValue = id;\ 349 return rc;\ 350 }\ 351 } 352 353#define VERIFY_RR_CRTC(id, ptr, a)\ 354 {\ 355 int rc = dixLookupResourceByType((pointer *)&(ptr), id,\ 356 RRCrtcType, client, a);\ 357 if (rc != Success) {\ 358 client->errorValue = id;\ 359 return rc;\ 360 }\ 361 } 362 363#define VERIFY_RR_MODE(id, ptr, a)\ 364 {\ 365 int rc = dixLookupResourceByType((pointer *)&(ptr), id,\ 366 RRModeType, client, a);\ 367 if (rc != Success) {\ 368 client->errorValue = id;\ 369 return rc;\ 370 }\ 371 } 372 373#define GetRRClient(pClient) ((RRClientPtr)dixLookupPrivate(&(pClient)->devPrivates, RRClientPrivateKey)) 374#define rrClientPriv(pClient) RRClientPtr pRRClient = GetRRClient(pClient) 375 376/* Initialize the extension */ 377extern _X_EXPORT void 378RRExtensionInit (void); 379 380#ifdef RANDR_12_INTERFACE 381/* 382 * Set the range of sizes for the screen 383 */ 384extern _X_EXPORT void 385RRScreenSetSizeRange (ScreenPtr pScreen, 386 CARD16 minWidth, 387 CARD16 minHeight, 388 CARD16 maxWidth, 389 CARD16 maxHeight); 390#endif 391 392/* rrscreen.c */ 393/* 394 * Notify the extension that the screen size has been changed. 395 * The driver is responsible for calling this whenever it has changed 396 * the size of the screen 397 */ 398extern _X_EXPORT void 399RRScreenSizeNotify (ScreenPtr pScreen); 400 401/* 402 * Request that the screen be resized 403 */ 404extern _X_EXPORT Bool 405RRScreenSizeSet (ScreenPtr pScreen, 406 CARD16 width, 407 CARD16 height, 408 CARD32 mmWidth, 409 CARD32 mmHeight); 410 411/* 412 * Send ConfigureNotify event to root window when 'something' happens 413 */ 414extern _X_EXPORT void 415RRSendConfigNotify (ScreenPtr pScreen); 416 417/* 418 * screen dispatch 419 */ 420extern _X_EXPORT int 421ProcRRGetScreenSizeRange (ClientPtr client); 422 423extern _X_EXPORT int 424ProcRRSetScreenSize (ClientPtr client); 425 426extern _X_EXPORT int 427ProcRRGetScreenResources (ClientPtr client); 428 429extern _X_EXPORT int 430ProcRRGetScreenResourcesCurrent (ClientPtr client); 431 432extern _X_EXPORT int 433ProcRRSetScreenConfig (ClientPtr client); 434 435extern _X_EXPORT int 436ProcRRGetScreenInfo (ClientPtr client); 437 438/* 439 * Deliver a ScreenNotify event 440 */ 441extern _X_EXPORT void 442RRDeliverScreenEvent (ClientPtr client, WindowPtr pWin, ScreenPtr pScreen); 443 444/* randr.c */ 445/* 446 * Send all pending events 447 */ 448extern _X_EXPORT void 449RRTellChanged (ScreenPtr pScreen); 450 451extern _X_EXPORT void 452RRSetChanged (ScreenPtr pScreen); 453 454/* 455 * Poll the driver for changed information 456 */ 457extern _X_EXPORT Bool 458RRGetInfo (ScreenPtr pScreen, Bool force_query); 459 460extern _X_EXPORT Bool RRInit (void); 461 462extern _X_EXPORT Bool RRScreenInit(ScreenPtr pScreen); 463 464extern _X_EXPORT RROutputPtr 465RRFirstOutput (ScreenPtr pScreen); 466 467extern _X_EXPORT Rotation 468RRGetRotation (ScreenPtr pScreen); 469 470extern _X_EXPORT CARD16 471RRVerticalRefresh (xRRModeInfo *mode); 472 473#ifdef RANDR_10_INTERFACE 474/* 475 * This is the old interface, deprecated but left 476 * around for compatibility 477 */ 478 479/* 480 * Then, register the specific size with the screen 481 */ 482 483extern _X_EXPORT RRScreenSizePtr 484RRRegisterSize (ScreenPtr pScreen, 485 short width, 486 short height, 487 short mmWidth, 488 short mmHeight); 489 490extern _X_EXPORT Bool 491RRRegisterRate (ScreenPtr pScreen, 492 RRScreenSizePtr pSize, 493 int rate); 494 495/* 496 * Finally, set the current configuration of the screen 497 */ 498 499extern _X_EXPORT void 500RRSetCurrentConfig (ScreenPtr pScreen, 501 Rotation rotation, 502 int rate, 503 RRScreenSizePtr pSize); 504 505extern _X_EXPORT Bool RRScreenInit (ScreenPtr pScreen); 506 507extern _X_EXPORT Rotation 508RRGetRotation (ScreenPtr pScreen); 509 510#endif 511 512/* rrcrtc.c */ 513 514/* 515 * Notify the CRTC of some change; layoutChanged indicates that 516 * some position or size element changed 517 */ 518extern _X_EXPORT void 519RRCrtcChanged (RRCrtcPtr crtc, Bool layoutChanged); 520 521/* 522 * Create a CRTC 523 */ 524extern _X_EXPORT RRCrtcPtr 525RRCrtcCreate (ScreenPtr pScreen, void *devPrivate); 526 527/* 528 * Set the allowed rotations on a CRTC 529 */ 530extern _X_EXPORT void 531RRCrtcSetRotations (RRCrtcPtr crtc, Rotation rotations); 532 533/* 534 * Set whether transforms are allowed on a CRTC 535 */ 536extern _X_EXPORT void 537RRCrtcSetTransformSupport (RRCrtcPtr crtc, Bool transforms); 538 539/* 540 * Notify the extension that the Crtc has been reconfigured, 541 * the driver calls this whenever it has updated the mode 542 */ 543extern _X_EXPORT Bool 544RRCrtcNotify (RRCrtcPtr crtc, 545 RRModePtr mode, 546 int x, 547 int y, 548 Rotation rotation, 549 RRTransformPtr transform, 550 int numOutputs, 551 RROutputPtr *outputs); 552 553extern _X_EXPORT void 554RRDeliverCrtcEvent (ClientPtr client, WindowPtr pWin, RRCrtcPtr crtc); 555 556/* 557 * Request that the Crtc be reconfigured 558 */ 559extern _X_EXPORT Bool 560RRCrtcSet (RRCrtcPtr crtc, 561 RRModePtr mode, 562 int x, 563 int y, 564 Rotation rotation, 565 int numOutput, 566 RROutputPtr *outputs); 567 568/* 569 * Request that the Crtc gamma be changed 570 */ 571 572extern _X_EXPORT Bool 573RRCrtcGammaSet (RRCrtcPtr crtc, 574 CARD16 *red, 575 CARD16 *green, 576 CARD16 *blue); 577 578/* 579 * Request current gamma back from the DDX (if possible). 580 * This includes gamma size. 581 */ 582 583extern _X_EXPORT Bool 584RRCrtcGammaGet(RRCrtcPtr crtc); 585 586/* 587 * Notify the extension that the Crtc gamma has been changed 588 * The driver calls this whenever it has changed the gamma values 589 * in the RRCrtcRec 590 */ 591 592extern _X_EXPORT Bool 593RRCrtcGammaNotify (RRCrtcPtr crtc); 594 595/* 596 * Set the size of the gamma table at server startup time 597 */ 598 599extern _X_EXPORT Bool 600RRCrtcGammaSetSize (RRCrtcPtr crtc, 601 int size); 602 603/* 604 * Return the area of the frame buffer scanned out by the crtc, 605 * taking into account the current mode and rotation 606 */ 607 608extern _X_EXPORT void 609RRCrtcGetScanoutSize(RRCrtcPtr crtc, int *width, int *height); 610 611/* 612 * Compute the complete transformation matrix including 613 * client-specified transform, rotation/reflection values and the crtc 614 * offset. 615 * 616 * Return TRUE if the resulting transform is not a simple translation. 617 */ 618extern _X_EXPORT Bool 619RRTransformCompute (int x, 620 int y, 621 int width, 622 int height, 623 Rotation rotation, 624 RRTransformPtr rr_transform, 625 626 PictTransformPtr transform, 627 struct pict_f_transform *f_transform, 628 struct pict_f_transform *f_inverse); 629 630/* 631 * Return crtc transform 632 */ 633extern _X_EXPORT RRTransformPtr 634RRCrtcGetTransform (RRCrtcPtr crtc); 635 636/* 637 * Check whether the pending and current transforms are the same 638 */ 639extern _X_EXPORT Bool 640RRCrtcPendingTransform (RRCrtcPtr crtc); 641 642/* 643 * Destroy a Crtc at shutdown 644 */ 645extern _X_EXPORT void 646RRCrtcDestroy (RRCrtcPtr crtc); 647 648 649/* 650 * Set the pending CRTC transformation 651 */ 652 653extern _X_EXPORT int 654RRCrtcTransformSet (RRCrtcPtr crtc, 655 PictTransformPtr transform, 656 struct pict_f_transform *f_transform, 657 struct pict_f_transform *f_inverse, 658 char *filter, 659 int filter_len, 660 xFixed *params, 661 int nparams); 662 663/* 664 * Initialize crtc type 665 */ 666extern _X_EXPORT Bool 667RRCrtcInit (void); 668 669/* 670 * Initialize crtc type error value 671 */ 672extern _X_EXPORT void 673RRCrtcInitErrorValue (void); 674 675/* 676 * Crtc dispatch 677 */ 678 679extern _X_EXPORT int 680ProcRRGetCrtcInfo (ClientPtr client); 681 682extern _X_EXPORT int 683ProcRRSetCrtcConfig (ClientPtr client); 684 685extern _X_EXPORT int 686ProcRRGetCrtcGammaSize (ClientPtr client); 687 688extern _X_EXPORT int 689ProcRRGetCrtcGamma (ClientPtr client); 690 691extern _X_EXPORT int 692ProcRRSetCrtcGamma (ClientPtr client); 693 694extern _X_EXPORT int 695ProcRRSetCrtcTransform (ClientPtr client); 696 697extern _X_EXPORT int 698ProcRRGetCrtcTransform (ClientPtr client); 699 700int 701ProcRRGetPanning (ClientPtr client); 702 703int 704ProcRRSetPanning (ClientPtr client); 705 706/* rrdispatch.c */ 707extern _X_EXPORT Bool 708RRClientKnowsRates (ClientPtr pClient); 709 710/* rrmode.c */ 711/* 712 * Find, and if necessary, create a mode 713 */ 714 715extern _X_EXPORT RRModePtr 716RRModeGet (xRRModeInfo *modeInfo, 717 const char *name); 718 719/* 720 * Destroy a mode. 721 */ 722 723extern _X_EXPORT void 724RRModeDestroy (RRModePtr mode); 725 726/* 727 * Return a list of modes that are valid for some output in pScreen 728 */ 729extern _X_EXPORT RRModePtr * 730RRModesForScreen (ScreenPtr pScreen, int *num_ret); 731 732/* 733 * Initialize mode type 734 */ 735extern _X_EXPORT Bool 736RRModeInit (void); 737 738/* 739 * Initialize mode type error value 740 */ 741extern _X_EXPORT void 742RRModeInitErrorValue (void); 743 744extern _X_EXPORT int 745ProcRRCreateMode (ClientPtr client); 746 747extern _X_EXPORT int 748ProcRRDestroyMode (ClientPtr client); 749 750extern _X_EXPORT int 751ProcRRAddOutputMode (ClientPtr client); 752 753extern _X_EXPORT int 754ProcRRDeleteOutputMode (ClientPtr client); 755 756/* rroutput.c */ 757 758/* 759 * Notify the output of some change. configChanged indicates whether 760 * any external configuration (mode list, clones, connected status) 761 * has changed, or whether the change was strictly internal 762 * (which crtc is in use) 763 */ 764extern _X_EXPORT void 765RROutputChanged (RROutputPtr output, Bool configChanged); 766 767/* 768 * Create an output 769 */ 770 771extern _X_EXPORT RROutputPtr 772RROutputCreate (ScreenPtr pScreen, 773 const char *name, 774 int nameLength, 775 void *devPrivate); 776 777/* 778 * Notify extension that output parameters have been changed 779 */ 780extern _X_EXPORT Bool 781RROutputSetClones (RROutputPtr output, 782 RROutputPtr *clones, 783 int numClones); 784 785extern _X_EXPORT Bool 786RROutputSetModes (RROutputPtr output, 787 RRModePtr *modes, 788 int numModes, 789 int numPreferred); 790 791extern _X_EXPORT int 792RROutputAddUserMode (RROutputPtr output, 793 RRModePtr mode); 794 795extern _X_EXPORT int 796RROutputDeleteUserMode (RROutputPtr output, 797 RRModePtr mode); 798 799extern _X_EXPORT Bool 800RROutputSetCrtcs (RROutputPtr output, 801 RRCrtcPtr *crtcs, 802 int numCrtcs); 803 804extern _X_EXPORT Bool 805RROutputSetConnection (RROutputPtr output, 806 CARD8 connection); 807 808extern _X_EXPORT Bool 809RROutputSetSubpixelOrder (RROutputPtr output, 810 int subpixelOrder); 811 812extern _X_EXPORT Bool 813RROutputSetPhysicalSize (RROutputPtr output, 814 int mmWidth, 815 int mmHeight); 816 817extern _X_EXPORT void 818RRDeliverOutputEvent(ClientPtr client, WindowPtr pWin, RROutputPtr output); 819 820extern _X_EXPORT void 821RROutputDestroy (RROutputPtr output); 822 823extern _X_EXPORT int 824ProcRRGetOutputInfo (ClientPtr client); 825 826extern _X_EXPORT int 827ProcRRSetOutputPrimary (ClientPtr client); 828 829extern _X_EXPORT int 830ProcRRGetOutputPrimary (ClientPtr client); 831 832/* 833 * Initialize output type 834 */ 835extern _X_EXPORT Bool 836RROutputInit (void); 837 838/* 839 * Initialize output type error value 840 */ 841extern _X_EXPORT void 842RROutputInitErrorValue (void); 843 844/* rrpointer.c */ 845extern _X_EXPORT void 846RRPointerMoved (ScreenPtr pScreen, int x, int y); 847 848extern _X_EXPORT void 849RRPointerScreenConfigured (ScreenPtr pScreen); 850 851/* rrproperty.c */ 852 853extern _X_EXPORT void 854RRDeleteAllOutputProperties (RROutputPtr output); 855 856extern _X_EXPORT RRPropertyValuePtr 857RRGetOutputProperty (RROutputPtr output, Atom property, Bool pending); 858 859extern _X_EXPORT RRPropertyPtr 860RRQueryOutputProperty (RROutputPtr output, Atom property); 861 862extern _X_EXPORT void 863RRDeleteOutputProperty (RROutputPtr output, Atom property); 864 865extern _X_EXPORT Bool 866RRPostPendingProperties (RROutputPtr output); 867 868extern _X_EXPORT int 869RRChangeOutputProperty (RROutputPtr output, Atom property, Atom type, 870 int format, int mode, unsigned long len, 871 pointer value, Bool sendevent, Bool pending); 872 873extern _X_EXPORT int 874RRConfigureOutputProperty (RROutputPtr output, Atom property, 875 Bool pending, Bool range, Bool immutable, 876 int num_values, INT32 *values); 877extern _X_EXPORT int 878ProcRRChangeOutputProperty (ClientPtr client); 879 880extern _X_EXPORT int 881ProcRRGetOutputProperty (ClientPtr client); 882 883extern _X_EXPORT int 884ProcRRListOutputProperties (ClientPtr client); 885 886extern _X_EXPORT int 887ProcRRQueryOutputProperty (ClientPtr client); 888 889extern _X_EXPORT int 890ProcRRConfigureOutputProperty (ClientPtr client); 891 892extern _X_EXPORT int 893ProcRRDeleteOutputProperty (ClientPtr client); 894 895/* rrxinerama.c */ 896#ifdef XINERAMA 897extern _X_EXPORT void 898RRXineramaExtensionInit(void); 899#endif 900 901#endif /* _RANDRSTR_H_ */ 902 903/* 904 905randr extension implementation structure 906 907Query state: 908 ProcRRGetScreenInfo/ProcRRGetScreenResources 909 RRGetInfo 910 911 • Request configuration from driver, either 1.0 or 1.2 style 912 • These functions only record state changes, all 913 other actions are pended until RRTellChanged is called 914 915 ->rrGetInfo 916 1.0: 917 RRRegisterSize 918 RRRegisterRate 919 RRSetCurrentConfig 920 1.2: 921 RRScreenSetSizeRange 922 RROutputSetCrtcs 923 RRModeGet 924 RROutputSetModes 925 RROutputSetConnection 926 RROutputSetSubpixelOrder 927 RROutputSetClones 928 RRCrtcNotify 929 930 • Must delay scanning configuration until after ->rrGetInfo returns 931 because some drivers will call SetCurrentConfig in the middle 932 of the ->rrGetInfo operation. 933 934 1.0: 935 936 • Scan old configuration, mirror to new structures 937 938 RRScanOldConfig 939 RRCrtcCreate 940 RROutputCreate 941 RROutputSetCrtcs 942 RROutputSetConnection 943 RROutputSetSubpixelOrder 944 RROldModeAdd • This adds modes one-at-a-time 945 RRModeGet 946 RRCrtcNotify 947 948 • send events, reset pointer if necessary 949 950 RRTellChanged 951 WalkTree (sending events) 952 953 • when layout has changed: 954 RRPointerScreenConfigured 955 RRSendConfigNotify 956 957Asynchronous state setting (1.2 only) 958 When setting state asynchronously, the driver invokes the 959 ->rrGetInfo function and then calls RRTellChanged to flush 960 the changes to the clients and reset pointer if necessary 961 962Set state 963 964 ProcRRSetScreenConfig 965 RRCrtcSet 966 1.2: 967 ->rrCrtcSet 968 RRCrtcNotify 969 1.0: 970 ->rrSetConfig 971 RRCrtcNotify 972 RRTellChanged 973 */ 974