VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/x11include/xorg-server-1.9.99.901+git20110131.be3be758/xf86Crtc.h@ 36300

最後變更 在這個檔案從36300是 35847,由 vboxsync 提交於 14 年 前

Additions/x11/x11include: export header files for X.Org Server 1.10 pre-release to OSE

  • 屬性 svn:eol-style 設為 native
檔案大小: 26.3 KB
 
1/*
2 * Copyright © 2006 Keith Packard
3 *
4 * Permission to use, copy, modify, distribute, and sell this software and its
5 * documentation for any purpose is hereby granted without fee, provided that
6 * the above copyright notice appear in all copies and that both that copyright
7 * notice and this permission notice appear in supporting documentation, and
8 * that the name of the copyright holders not be used in advertising or
9 * publicity pertaining to distribution of the software without specific,
10 * written prior permission. The copyright holders make no representations
11 * about the suitability of this software for any purpose. It is provided "as
12 * is" without express or implied warranty.
13 *
14 * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
15 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
16 * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
17 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
18 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
19 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
20 * OF THIS SOFTWARE.
21 */
22#ifndef _XF86CRTC_H_
23#define _XF86CRTC_H_
24
25#include <edid.h>
26#include "randrstr.h"
27#if XF86_MODES_RENAME
28#include "xf86Rename.h"
29#endif
30#include "xf86Modes.h"
31#include "xf86Cursor.h"
32#include "xf86i2c.h"
33#include "damage.h"
34#include "picturestr.h"
35
36/* Compat definitions for older X Servers. */
37#ifndef M_T_PREFERRED
38#define M_T_PREFERRED 0x08
39#endif
40#ifndef M_T_DRIVER
41#define M_T_DRIVER 0x40
42#endif
43#ifndef M_T_USERPREF
44#define M_T_USERPREF 0x80
45#endif
46#ifndef HARDWARE_CURSOR_ARGB
47#define HARDWARE_CURSOR_ARGB 0x00004000
48#endif
49
50typedef struct _xf86Crtc xf86CrtcRec, *xf86CrtcPtr;
51typedef struct _xf86Output xf86OutputRec, *xf86OutputPtr;
52
53/* define a standard for connector types */
54typedef enum _xf86ConnectorType {
55 XF86ConnectorNone,
56 XF86ConnectorVGA,
57 XF86ConnectorDVI_I,
58 XF86ConnectorDVI_D,
59 XF86ConnectorDVI_A,
60 XF86ConnectorComposite,
61 XF86ConnectorSvideo,
62 XF86ConnectorComponent,
63 XF86ConnectorLFP,
64 XF86ConnectorProprietary,
65 XF86ConnectorHDMI,
66 XF86ConnectorDisplayPort,
67} xf86ConnectorType;
68
69typedef enum _xf86OutputStatus {
70 XF86OutputStatusConnected,
71 XF86OutputStatusDisconnected,
72 XF86OutputStatusUnknown
73} xf86OutputStatus;
74
75typedef enum _xf86CrtcSetFlags {
76 XF86CrtcSetMode = 1, /* mode */
77 XF86CrtcSetOutput = 2, /* outputs */
78 XF86CrtcSetOrigin = 4, /* x/y */
79 XF86CrtcSetTransform = 8, /* transform */
80 XF86CrtcSetRotation = 16, /* rotation */
81 XF86CrtcSetProperty = 32, /* output property */
82 XF86CrtcSetScanoutPixmap = 64, /* scanout pixmap */
83} xf86CrtcSetFlags;
84
85typedef struct _xf86CrtcSet {
86 xf86CrtcSetFlags flags;
87 DisplayModePtr mode;
88 Rotation rotation;
89 RRTransformPtr transform;
90 int x, y;
91 PixmapPtr scanout_pixmap;
92} xf86CrtcSetRec;
93
94typedef struct _xf86CrtcFuncs {
95 /**
96 * Turns the crtc on/off, or sets intermediate power levels if available.
97 *
98 * Unsupported intermediate modes drop to the lower power setting. If the
99 * mode is DPMSModeOff, the crtc must be disabled sufficiently for it to
100 * be safe to call mode_set.
101 */
102 void
103 (*dpms)(xf86CrtcPtr crtc,
104 int mode);
105
106 /**
107 * Saves the crtc's state for restoration on VT switch.
108 */
109 void
110 (*save)(xf86CrtcPtr crtc);
111
112 /**
113 * Restore's the crtc's state at VT switch.
114 */
115 void
116 (*restore)(xf86CrtcPtr crtc);
117
118 /**
119 * Lock CRTC prior to mode setting, mostly for DRI.
120 * Returns whether unlock is needed
121 */
122 Bool
123 (*lock) (xf86CrtcPtr crtc);
124
125 /**
126 * Unlock CRTC after mode setting, mostly for DRI
127 */
128 void
129 (*unlock) (xf86CrtcPtr crtc);
130
131 /**
132 * Callback to adjust the mode to be set in the CRTC.
133 *
134 * This allows a CRTC to adjust the clock or even the entire set of
135 * timings, which is used for panels with fixed timings or for
136 * buses with clock limitations.
137 */
138 Bool
139 (*mode_fixup)(xf86CrtcPtr crtc,
140 DisplayModePtr mode,
141 DisplayModePtr adjusted_mode);
142
143 /**
144 * Prepare CRTC for an upcoming mode set.
145 */
146 void
147 (*prepare)(xf86CrtcPtr crtc);
148
149 /**
150 * Callback for setting up a video mode after fixups have been made.
151 */
152 void
153 (*mode_set)(xf86CrtcPtr crtc,
154 DisplayModePtr mode,
155 DisplayModePtr adjusted_mode,
156 int x, int y);
157
158 /**
159 * Commit mode changes to a CRTC
160 */
161 void
162 (*commit)(xf86CrtcPtr crtc);
163
164 /* Set the color ramps for the CRTC to the given values. */
165 void
166 (*gamma_set)(xf86CrtcPtr crtc, CARD16 *red, CARD16 *green, CARD16 *blue,
167 int size);
168
169 /**
170 * Allocate the shadow area, delay the pixmap creation until needed
171 */
172 void *
173 (*shadow_allocate) (xf86CrtcPtr crtc, int width, int height);
174
175 /**
176 * Create shadow pixmap for rotation support
177 */
178 PixmapPtr
179 (*shadow_create) (xf86CrtcPtr crtc, void *data, int width, int height);
180
181 /**
182 * Destroy shadow pixmap
183 */
184 void
185 (*shadow_destroy) (xf86CrtcPtr crtc, PixmapPtr pPixmap, void *data);
186
187 /**
188 * Set cursor colors
189 */
190 void
191 (*set_cursor_colors) (xf86CrtcPtr crtc, int bg, int fg);
192
193 /**
194 * Set cursor position
195 */
196 void
197 (*set_cursor_position) (xf86CrtcPtr crtc, int x, int y);
198
199 /**
200 * Show cursor
201 */
202 void
203 (*show_cursor) (xf86CrtcPtr crtc);
204
205 /**
206 * Hide cursor
207 */
208 void
209 (*hide_cursor) (xf86CrtcPtr crtc);
210
211 /**
212 * Load monochrome image
213 */
214 void
215 (*load_cursor_image) (xf86CrtcPtr crtc, CARD8 *image);
216
217 /**
218 * Load ARGB image
219 */
220 void
221 (*load_cursor_argb) (xf86CrtcPtr crtc, CARD32 *image);
222
223 /**
224 * Clean up driver-specific bits of the crtc
225 */
226 void
227 (*destroy) (xf86CrtcPtr crtc);
228
229 /**
230 * Less fine-grained mode setting entry point for kernel modesetting
231 */
232 Bool
233 (*set_mode_major)(xf86CrtcPtr crtc, DisplayModePtr mode,
234 Rotation rotation, int x, int y);
235
236 /**
237 * Callback for panning. Doesn't change the mode.
238 * Added in ABI version 2
239 */
240 void
241 (*set_origin)(xf86CrtcPtr crtc, int x, int y);
242
243 /**
244 * General mode setting entry point that does everything
245 */
246 Bool
247 (*set)(xf86CrtcPtr crtc, xf86CrtcSetFlags flags);
248
249} xf86CrtcFuncsRec, *xf86CrtcFuncsPtr;
250
251#define XF86_CRTC_VERSION 3
252
253struct _xf86Crtc {
254 /**
255 * ABI versioning
256 */
257 int version;
258
259 /**
260 * Associated ScrnInfo
261 */
262 ScrnInfoPtr scrn;
263
264 /**
265 * Desired state of this CRTC
266 *
267 * Set when this CRTC should be driving one or more outputs
268 */
269 Bool enabled;
270
271 /**
272 * Active mode
273 *
274 * This reflects the mode as set in the CRTC currently
275 * It will be cleared when the VT is not active or
276 * during server startup
277 */
278 DisplayModeRec mode;
279 Rotation rotation;
280 PixmapPtr rotatedPixmap;
281 void *rotatedData;
282 PixmapPtr scanoutPixmap;
283
284 /**
285 * Position on screen
286 *
287 * Locates this CRTC within the frame buffer
288 */
289 int x, y;
290
291 /**
292 * Desired mode
293 *
294 * This is set to the requested mode, independent of
295 * whether the VT is active. In particular, it receives
296 * the startup configured mode and saves the active mode
297 * on VT switch.
298 */
299 DisplayModeRec desiredMode;
300 Rotation desiredRotation;
301 int desiredX, desiredY;
302
303 /** crtc-specific functions */
304 const xf86CrtcFuncsRec *funcs;
305
306 /**
307 * Driver private
308 *
309 * Holds driver-private information
310 */
311 void *driver_private;
312
313#ifdef RANDR_12_INTERFACE
314 /**
315 * RandR crtc
316 *
317 * When RandR 1.2 is available, this
318 * points at the associated crtc object
319 */
320 RRCrtcPtr randr_crtc;
321#else
322 void *randr_crtc;
323#endif
324
325 /**
326 * Current cursor is ARGB
327 */
328 Bool cursor_argb;
329 /**
330 * Track whether cursor is within CRTC range
331 */
332 Bool cursor_in_range;
333 /**
334 * Track state of cursor associated with this CRTC
335 */
336 Bool cursor_shown;
337
338 /**
339 * Current transformation matrix
340 */
341 PictTransform crtc_to_framebuffer;
342 /* framebuffer_to_crtc was removed in ABI 2 */
343 struct pict_f_transform f_crtc_to_framebuffer; /* ABI 2 */
344 struct pict_f_transform f_framebuffer_to_crtc; /* ABI 2 */
345 PictFilterPtr filter; /* ABI 2 */
346 xFixed *params; /* ABI 2 */
347 int nparams; /* ABI 2 */
348 int filter_width; /* ABI 2 */
349 int filter_height; /* ABI 2 */
350 Bool transform_in_use;
351 Bool sprite_transform_in_use;
352 RRTransformRec transform; /* ABI 2 */
353 Bool transformPresent; /* ABI 2 */
354 RRTransformRec desiredTransform; /* ABI 2 */
355 Bool desiredTransformPresent; /* ABI 2 */
356 /**
357 * Bounding box in screen space
358 */
359 BoxRec bounds;
360 /**
361 * Panning:
362 * TotalArea: total panning area, larger than CRTC's size
363 * TrackingArea: Area of the pointer for which the CRTC is panned
364 * border: Borders of the displayed CRTC area which induces panning if the pointer reaches them
365 * Added in ABI version 2
366 */
367 BoxRec panningTotalArea;
368 BoxRec panningTrackingArea;
369 INT16 panningBorder[4];
370
371 /**
372 * Current gamma, especially useful after initial config.
373 * Added in ABI version 3
374 */
375 CARD16 *gamma_red;
376 CARD16 *gamma_green;
377 CARD16 *gamma_blue;
378 int gamma_size;
379
380 /**
381 * Actual state of this CRTC
382 *
383 * Set to TRUE after modesetting, set to FALSE if no outputs are connected
384 * Added in ABI version 3
385 */
386 Bool active;
387 /**
388 * Clear the shadow
389 */
390 Bool shadowClear;
391
392 /**
393 * Sprite position transforms
394 */
395
396 /* Transform a screen coordinate to a crtc coordinate */
397 struct pixman_f_transform f_screen_to_crtc;
398
399 /* The user-specified portion of the screen to crtc conversion */
400 struct pixman_f_transform user_sprite_position_transform;
401
402 /* Transform a hardware cursor coordinate to a cursor coordinate */
403 struct pixman_f_transform f_crtc_to_cursor;
404
405 /* The user-specified portion of the cursor to hardware transform */
406 struct pixman_f_transform user_sprite_image_transform;
407};
408
409typedef struct _xf86OutputFuncs {
410 /**
411 * Called to allow the output a chance to create properties after the
412 * RandR objects have been created.
413 */
414 void
415 (*create_resources)(xf86OutputPtr output);
416
417 /**
418 * Turns the output on/off, or sets intermediate power levels if available.
419 *
420 * Unsupported intermediate modes drop to the lower power setting. If the
421 * mode is DPMSModeOff, the output must be disabled, as the DPLL may be
422 * disabled afterwards.
423 */
424 void
425 (*dpms)(xf86OutputPtr output,
426 int mode);
427
428 /**
429 * Saves the output's state for restoration on VT switch.
430 */
431 void
432 (*save)(xf86OutputPtr output);
433
434 /**
435 * Restore's the output's state at VT switch.
436 */
437 void
438 (*restore)(xf86OutputPtr output);
439
440 /**
441 * Callback for testing a video mode for a given output.
442 *
443 * This function should only check for cases where a mode can't be supported
444 * on the output specifically, and not represent generic CRTC limitations.
445 *
446 * \return MODE_OK if the mode is valid, or another MODE_* otherwise.
447 */
448 int
449 (*mode_valid)(xf86OutputPtr output,
450 DisplayModePtr pMode);
451
452 /**
453 * Callback to adjust the mode to be set in the CRTC.
454 *
455 * This allows an output to adjust the clock or even the entire set of
456 * timings, which is used for panels with fixed timings or for
457 * buses with clock limitations.
458 */
459 Bool
460 (*mode_fixup)(xf86OutputPtr output,
461 DisplayModePtr mode,
462 DisplayModePtr adjusted_mode);
463
464 /**
465 * Callback for preparing mode changes on an output
466 */
467 void
468 (*prepare)(xf86OutputPtr output);
469
470 /**
471 * Callback for committing mode changes on an output
472 */
473 void
474 (*commit)(xf86OutputPtr output);
475
476 /**
477 * Callback for setting up a video mode after fixups have been made.
478 *
479 * This is only called while the output is disabled. The dpms callback
480 * must be all that's necessary for the output, to turn the output on
481 * after this function is called.
482 */
483 void
484 (*mode_set)(xf86OutputPtr output,
485 DisplayModePtr mode,
486 DisplayModePtr adjusted_mode);
487
488 /**
489 * Probe for a connected output, and return detect_status.
490 */
491 xf86OutputStatus
492 (*detect)(xf86OutputPtr output);
493
494 /**
495 * Query the device for the modes it provides.
496 *
497 * This function may also update MonInfo, mm_width, and mm_height.
498 *
499 * \return singly-linked list of modes or NULL if no modes found.
500 */
501 DisplayModePtr
502 (*get_modes)(xf86OutputPtr output);
503
504#ifdef RANDR_12_INTERFACE
505 /**
506 * Callback when an output's property has changed.
507 */
508 Bool
509 (*set_property)(xf86OutputPtr output,
510 Atom property,
511 RRPropertyValuePtr value);
512#endif
513#ifdef RANDR_13_INTERFACE
514 /**
515 * Callback to get an updated property value
516 */
517 Bool
518 (*get_property)(xf86OutputPtr output,
519 Atom property);
520#endif
521#ifdef RANDR_GET_CRTC_INTERFACE
522 /**
523 * Callback to get current CRTC for a given output
524 */
525 xf86CrtcPtr
526 (*get_crtc)(xf86OutputPtr output);
527#endif
528 /**
529 * Clean up driver-specific bits of the output
530 */
531 void
532 (*destroy) (xf86OutputPtr output);
533} xf86OutputFuncsRec, *xf86OutputFuncsPtr;
534
535
536#define XF86_OUTPUT_VERSION 2
537
538struct _xf86Output {
539 /**
540 * ABI versioning
541 */
542 int version;
543
544 /**
545 * Associated ScrnInfo
546 */
547 ScrnInfoPtr scrn;
548
549 /**
550 * Currently connected crtc (if any)
551 *
552 * If this output is not in use, this field will be NULL.
553 */
554 xf86CrtcPtr crtc;
555
556 /**
557 * Possible CRTCs for this output as a mask of crtc indices
558 */
559 CARD32 possible_crtcs;
560
561 /**
562 * Possible outputs to share the same CRTC as a mask of output indices
563 */
564 CARD32 possible_clones;
565
566 /**
567 * Whether this output can support interlaced modes
568 */
569 Bool interlaceAllowed;
570
571 /**
572 * Whether this output can support double scan modes
573 */
574 Bool doubleScanAllowed;
575
576 /**
577 * List of available modes on this output.
578 *
579 * This should be the list from get_modes(), plus perhaps additional
580 * compatible modes added later.
581 */
582 DisplayModePtr probed_modes;
583
584 /**
585 * Options parsed from the related monitor section
586 */
587 OptionInfoPtr options;
588
589 /**
590 * Configured monitor section
591 */
592 XF86ConfMonitorPtr conf_monitor;
593
594 /**
595 * Desired initial position
596 */
597 int initial_x, initial_y;
598
599 /**
600 * Desired initial rotation
601 */
602 Rotation initial_rotation;
603
604 /**
605 * Current connection status
606 *
607 * This indicates whether a monitor is known to be connected
608 * to this output or not, or whether there is no way to tell
609 */
610 xf86OutputStatus status;
611
612 /** EDID monitor information */
613 xf86MonPtr MonInfo;
614
615 /** subpixel order */
616 int subpixel_order;
617
618 /** Physical size of the currently attached output device. */
619 int mm_width, mm_height;
620
621 /** Output name */
622 char *name;
623
624 /** output-specific functions */
625 const xf86OutputFuncsRec *funcs;
626
627 /** driver private information */
628 void *driver_private;
629
630 /** Whether to use the old per-screen Monitor config section */
631 Bool use_screen_monitor;
632
633#ifdef RANDR_12_INTERFACE
634 /**
635 * RandR 1.2 output structure.
636 *
637 * When RandR 1.2 is available, this points at the associated
638 * RandR output structure and is created when this output is created
639 */
640 RROutputPtr randr_output;
641#else
642 void *randr_output;
643#endif
644 /**
645 * Desired initial panning
646 * Added in ABI version 2
647 */
648 BoxRec initialTotalArea;
649 BoxRec initialTrackingArea;
650 INT16 initialBorder[4];
651};
652
653typedef enum _xf86SetConfigResponse {
654 xf86SetConfigFailed, /* set_config failed */
655 xf86SetConfigChecked, /* set_config validated the configuration */
656 xf86SetConfigDone, /* set_config finished the work */
657} xf86SetConfigResponse;
658
659typedef struct _xf86CrtcSetConfig {
660 xf86CrtcPtr crtc;
661 int x, y;
662 DisplayModeRec mode;
663 Rotation rotation;
664 int numOutputs;
665 xf86OutputPtr *outputs;
666 struct pict_f_transform sprite_position_transform;
667 struct pict_f_transform sprite_image_transform;
668
669 /* Probably want some internal structure for the pixmap so that
670 * this can be set before the server is running
671 */
672 PixmapPtr pixmap;
673 int pixmap_x, pixmap_y;
674} xf86CrtcSetConfigRec, *xf86CrtcSetConfigPtr;
675
676typedef struct _xf86CrtcScanoutFormat {
677 int depth;
678 int bitsPerPixel;
679 int maxWidth, maxHeight;
680 Rotation rotations;
681 PictFormatShort format;
682} xf86CrtcScanoutFormat;
683
684typedef struct _xf86CrtcConfigFuncs {
685 /**
686 * Requests that the driver resize the screen.
687 *
688 * The driver is responsible for updating scrn->virtualX and scrn->virtualY.
689 * If the requested size cannot be set, the driver should leave those values
690 * alone and return FALSE.
691 *
692 * A naive driver that cannot reallocate the screen may simply change
693 * virtual[XY]. A more advanced driver will want to also change the
694 * devPrivate.ptr and devKind of the screen pixmap, update any offscreen
695 * pixmaps it may have moved, and change pScrn->displayWidth.
696 */
697 Bool
698 (*resize)(ScrnInfoPtr scrn,
699 int width,
700 int height);
701
702 xf86SetConfigResponse
703 (*set_config) (ScrnInfoPtr scrn,
704 RRScreenConfigPtr screen_config,
705 xf86CrtcSetConfigPtr crtc_configs,
706 int num_configs);
707
708 /**
709 * Create a scanout pixmap
710 */
711 PixmapPtr
712 (*create_scanout_pixmap)(ScrnInfoPtr scrn,
713 int width,
714 int height,
715 Rotation rotations,
716 xf86CrtcScanoutFormat *format);
717
718} xf86CrtcConfigFuncsRec, *xf86CrtcConfigFuncsPtr;
719
720typedef void (*xf86_crtc_notify_proc_ptr) (ScreenPtr pScreen);
721
722typedef struct _xf86CrtcConfig {
723 int num_output;
724 xf86OutputPtr *output;
725 /**
726 * compat_output is used whenever we deal
727 * with legacy code that only understands a single
728 * output. pScrn->modes will be loaded from this output,
729 * adjust frame will whack this output, etc.
730 */
731 int compat_output;
732
733 int num_crtc;
734 xf86CrtcPtr *crtc;
735
736 int minWidth, minHeight;
737 int maxWidth, maxHeight;
738
739 /* For crtc-based rotation */
740 DamagePtr rotation_damage;
741 Bool rotation_damage_registered;
742
743 /* DGA */
744 unsigned int dga_flags;
745 unsigned long dga_address;
746 DGAModePtr dga_modes;
747 int dga_nmode;
748 int dga_width, dga_height, dga_stride;
749 DisplayModePtr dga_save_mode;
750
751 const xf86CrtcConfigFuncsRec *funcs;
752
753 CreateScreenResourcesProcPtr CreateScreenResources;
754
755 CloseScreenProcPtr CloseScreen;
756
757 /* Cursor information */
758 xf86CursorInfoPtr cursor_info;
759 CursorPtr cursor;
760 CARD8 *cursor_image;
761 Bool cursor_on;
762 CARD32 cursor_fg, cursor_bg;
763
764 /**
765 * Options parsed from the related device section
766 */
767 OptionInfoPtr options;
768
769 Bool debug_modes;
770
771 /* wrap screen BlockHandler for rotation */
772 ScreenBlockHandlerProcPtr BlockHandler;
773
774 /* callback when crtc configuration changes */
775 xf86_crtc_notify_proc_ptr xf86_crtc_notify;
776
777 /*
778 * Supported scanout pixmap formats
779 */
780 int num_scanout_formats;
781 xf86CrtcScanoutFormat *scanout_formats;
782} xf86CrtcConfigRec, *xf86CrtcConfigPtr;
783
784extern _X_EXPORT int xf86CrtcConfigPrivateIndex;
785
786#define XF86_CRTC_CONFIG_PTR(p) ((xf86CrtcConfigPtr) ((p)->privates[xf86CrtcConfigPrivateIndex].ptr))
787
788static _X_INLINE xf86OutputPtr
789xf86CompatOutput(ScrnInfoPtr pScrn)
790{
791 xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
792 return config->output[config->compat_output];
793}
794
795static _X_INLINE xf86CrtcPtr
796xf86CompatCrtc(ScrnInfoPtr pScrn)
797{
798 xf86OutputPtr compat_output = xf86CompatOutput(pScrn);
799 if (!compat_output)
800 return NULL;
801 return compat_output->crtc;
802}
803
804static _X_INLINE RRCrtcPtr
805xf86CompatRRCrtc(ScrnInfoPtr pScrn)
806{
807 xf86CrtcPtr compat_crtc = xf86CompatCrtc(pScrn);
808 if (!compat_crtc)
809 return NULL;
810 return compat_crtc->randr_crtc;
811}
812
813
814/*
815 * Initialize xf86CrtcConfig structure
816 */
817
818extern _X_EXPORT void
819xf86CrtcConfigInit (ScrnInfoPtr scrn,
820 const xf86CrtcConfigFuncsRec *funcs);
821
822extern _X_EXPORT void
823xf86CrtcSetSizeRange (ScrnInfoPtr scrn,
824 int minWidth, int minHeight,
825 int maxWidth, int maxHeight);
826
827extern _X_EXPORT void
828xf86CrtcSetScanoutFormats (ScrnInfoPtr scrn,
829 int num_formats,
830 xf86CrtcScanoutFormat *formats);
831
832/*
833 * Crtc functions
834 */
835extern _X_EXPORT xf86CrtcPtr
836xf86CrtcCreate (ScrnInfoPtr scrn,
837 const xf86CrtcFuncsRec *funcs);
838
839extern _X_EXPORT void
840xf86CrtcDestroy (xf86CrtcPtr crtc);
841
842/**
843 * Change a crtc configuration (modes, outputs, etc)
844 */
845
846extern _X_EXPORT Bool
847xf86CrtcSet (xf86CrtcPtr crtc, xf86CrtcSetRec *set);
848
849extern _X_EXPORT void
850xf86CrtcSetOrigin (xf86CrtcPtr crtc, int x, int y);
851
852/*
853 * Assign crtc rotation during mode set
854 */
855extern _X_EXPORT Bool
856xf86CrtcRotate (xf86CrtcPtr crtc);
857
858
859/*
860 * Update cursor transform matrices after user changes
861 * This is just the cursor subset of xf86CrtcRotate
862 */
863extern _X_EXPORT void
864xf86CrtcRotateCursor (xf86CrtcPtr crtc);
865
866/*
867 * Clean up any rotation data, used when a crtc is turned off
868 * as well as when rotation is disabled.
869 */
870extern _X_EXPORT void
871xf86RotateDestroy (xf86CrtcPtr crtc);
872
873/*
874 * free shadow memory allocated for all crtcs
875 */
876extern _X_EXPORT void
877xf86RotateFreeShadow(ScrnInfoPtr pScrn);
878
879/*
880 * Clean up rotation during CloseScreen
881 */
882extern _X_EXPORT void
883xf86RotateCloseScreen (ScreenPtr pScreen);
884
885/**
886 * Return whether any output is assigned to the crtc
887 */
888extern _X_EXPORT Bool
889xf86CrtcInUse (xf86CrtcPtr crtc);
890
891/*
892 * Output functions
893 */
894extern _X_EXPORT xf86OutputPtr
895xf86OutputCreate (ScrnInfoPtr scrn,
896 const xf86OutputFuncsRec *funcs,
897 const char *name);
898
899extern _X_EXPORT void
900xf86OutputUseScreenMonitor (xf86OutputPtr output, Bool use_screen_monitor);
901
902extern _X_EXPORT Bool
903xf86OutputRename (xf86OutputPtr output, const char *name);
904
905extern _X_EXPORT void
906xf86OutputDestroy (xf86OutputPtr output);
907
908extern _X_EXPORT void
909xf86ProbeOutputModes (ScrnInfoPtr pScrn, int maxX, int maxY);
910
911extern _X_EXPORT void
912xf86SetScrnInfoModes (ScrnInfoPtr pScrn);
913
914#ifdef RANDR_13_INTERFACE
915# define ScreenInitRetType int
916#else
917# define ScreenInitRetType Bool
918#endif
919
920extern _X_EXPORT ScreenInitRetType
921xf86CrtcScreenInit (ScreenPtr pScreen);
922
923extern _X_EXPORT Bool
924xf86InitialConfiguration (ScrnInfoPtr pScrn, Bool canGrow);
925
926extern _X_EXPORT void
927xf86DPMSSet(ScrnInfoPtr pScrn, int PowerManagementMode, int flags);
928
929extern _X_EXPORT Bool
930xf86SaveScreen(ScreenPtr pScreen, int mode);
931
932extern _X_EXPORT void
933xf86DisableUnusedFunctions(ScrnInfoPtr pScrn);
934
935extern _X_EXPORT DisplayModePtr
936xf86OutputFindClosestMode (xf86OutputPtr output, DisplayModePtr desired);
937
938extern _X_EXPORT Bool
939xf86SetSingleMode (ScrnInfoPtr pScrn, DisplayModePtr desired, Rotation rotation);
940
941/**
942 * Set the EDID information for the specified output
943 */
944extern _X_EXPORT void
945xf86OutputSetEDID (xf86OutputPtr output, xf86MonPtr edid_mon);
946
947/**
948 * Return the list of modes supported by the EDID information
949 * stored in 'output'
950 */
951extern _X_EXPORT DisplayModePtr
952xf86OutputGetEDIDModes (xf86OutputPtr output);
953
954extern _X_EXPORT xf86MonPtr
955xf86OutputGetEDID (xf86OutputPtr output, I2CBusPtr pDDCBus);
956
957/**
958 * Initialize dga for this screen
959 */
960
961#ifdef XFreeXDGA
962extern _X_EXPORT Bool
963xf86DiDGAInit (ScreenPtr pScreen, unsigned long dga_address);
964
965/* this is the real function, used only internally */
966_X_INTERNAL Bool
967_xf86_di_dga_init_internal (ScreenPtr pScreen);
968
969/**
970 * Re-initialize dga for this screen (as when the set of modes changes)
971 */
972
973extern _X_EXPORT Bool
974xf86DiDGAReInit (ScreenPtr pScreen);
975#endif
976
977/* This is the real function, used only internally */
978_X_INTERNAL Bool
979_xf86_di_dga_reinit_internal (ScreenPtr pScreen);
980
981/*
982 * Set the subpixel order reported for the screen using
983 * the information from the outputs
984 */
985
986extern _X_EXPORT void
987xf86CrtcSetScreenSubpixelOrder (ScreenPtr pScreen);
988
989/*
990 * Get a standard string name for a connector type
991 */
992extern _X_EXPORT char *
993xf86ConnectorGetName(xf86ConnectorType connector);
994
995/*
996 * Using the desired mode information in each crtc, set
997 * modes (used in EnterVT functions, or at server startup)
998 */
999
1000extern _X_EXPORT Bool
1001xf86SetDesiredModes (ScrnInfoPtr pScrn);
1002
1003/**
1004 * Initialize the CRTC-based cursor code. CRTC function vectors must
1005 * contain relevant cursor setting functions.
1006 *
1007 * Driver should call this from ScreenInit function
1008 */
1009extern _X_EXPORT Bool
1010xf86_cursors_init (ScreenPtr screen, int max_width, int max_height, int flags);
1011
1012/**
1013 * Called when anything on the screen is reconfigured.
1014 *
1015 * Reloads cursor images as needed, then adjusts cursor positions.
1016 *
1017 * Driver should call this from crtc commit function.
1018 */
1019extern _X_EXPORT void
1020xf86_reload_cursors (ScreenPtr screen);
1021
1022/**
1023 * Called from EnterVT to turn the cursors back on
1024 */
1025extern _X_EXPORT void
1026xf86_show_cursors (ScrnInfoPtr scrn);
1027
1028/**
1029 * Called by the driver to turn cursors off
1030 */
1031extern _X_EXPORT void
1032xf86_hide_cursors (ScrnInfoPtr scrn);
1033
1034/**
1035 * Clean up CRTC-based cursor code. Driver must call this at CloseScreen time.
1036 */
1037extern _X_EXPORT void
1038xf86_cursors_fini (ScreenPtr screen);
1039
1040/*
1041 * For overlay video, compute the relevant CRTC and
1042 * clip video to that.
1043 * wraps xf86XVClipVideoHelper()
1044 */
1045
1046extern _X_EXPORT Bool
1047xf86_crtc_clip_video_helper(ScrnInfoPtr pScrn,
1048 xf86CrtcPtr *crtc_ret,
1049 xf86CrtcPtr desired_crtc,
1050 BoxPtr dst,
1051 INT32 *xa,
1052 INT32 *xb,
1053 INT32 *ya,
1054 INT32 *yb,
1055 RegionPtr reg,
1056 INT32 width,
1057 INT32 height);
1058
1059extern _X_EXPORT xf86_crtc_notify_proc_ptr
1060xf86_wrap_crtc_notify (ScreenPtr pScreen, xf86_crtc_notify_proc_ptr new);
1061
1062extern _X_EXPORT void
1063xf86_unwrap_crtc_notify(ScreenPtr pScreen, xf86_crtc_notify_proc_ptr old);
1064
1065extern _X_EXPORT void
1066xf86_crtc_notify(ScreenPtr pScreen);
1067
1068/**
1069 * Gamma
1070 */
1071
1072extern _X_EXPORT Bool
1073xf86_crtc_supports_gamma(ScrnInfoPtr pScrn);
1074
1075#endif /* _XF86CRTC_H_ */
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette