summaryrefslogtreecommitdiff
path: root/src/radeon_mergedfb.h
blob: e51ce5c42e0d0192e8a35f9c7602340b83aa2247 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
/* $XFree86$ */
/*
 * Copyright 2003 Alex Deucher.
 *
 * All Rights Reserved.
 *
 * Permission is hereby granted, free of charge, to any person obtaining
 * a copy of this software and associated documentation files (the
 * "Software"), to deal in the Software without restriction, including
 * without limitation on the rights to use, copy, modify, merge,
 * publish, distribute, sublicense, and/or sell copies of the Software,
 * and to permit persons to whom the Software is furnished to do so,
 * subject to the following conditions:
 *
 * The above copyright notice and this permission notice (including the
 * next paragraph) shall be included in all copies or substantial
 * portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NON-INFRINGEMENT.  IN NO EVENT SHALL ALEX DEUCHER, OR ANY OTHER
 * CONTRIBUTORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 * DEALINGS IN THE SOFTWARE.
 */

/*
 * Authors:
 *   Alex Deucher <agd5f@yahoo.com>
 *
 */

#ifndef _RADEON_MERGEDFB_H_
#define _RADEON_MERGEDFB_H_

#include "xf86.h"

#include "radeon.h"

#if 0
		/* Psuedo Xinerama support */
#define NEED_REPLIES  		/* ? */
#define EXTENSION_PROC_ARGS void *
#include "extnsionst.h"  	/* required */
#include "panoramiXproto.h"  	/* required */
#define RADEON_XINERAMA_MAJOR_VERSION  1
#define RADEON_XINERAMA_MINOR_VERSION  1

/* needed for pseudo-xinerama by radeon_driver.c */
Bool 		RADEONnoPanoramiXExtension = TRUE;

/* Relative merge position */
typedef enum {
   radeonLeftOf,
   radeonRightOf,
   radeonAbove,
   radeonBelow,
   radeonClone
} RADEONScrn2Rel;
#endif

#define SDMPTR(x) ((RADEONMergedDisplayModePtr)(x->currentMode->Private))
#define CDMPTR    ((RADEONMergedDisplayModePtr)(info->CurrentLayout.mode->Private))

#define BOUND(test,low,hi) { \
    if(test < low) test = low; \
    if(test > hi) test = hi; }

#define REBOUND(low,hi,test) { \
    if(test < low) { \
        hi += test-low; \
        low = test; } \
    if(test > hi) { \
        low += test-hi; \
        hi = test; } }

typedef struct _MergedDisplayModeRec {
    DisplayModePtr CRT1;
    DisplayModePtr CRT2;
    RADEONScrn2Rel    CRT2Position;
} RADEONMergedDisplayModeRec, *RADEONMergedDisplayModePtr;

typedef struct _region {
    int x0,x1,y0,y1;
} region;

typedef struct _RADEONXineramaData {
    int x;
    int y;
    int width;
    int height;
} RADEONXineramaData;

/* needed by radeon_driver.c */
extern void
RADEONAdjustFrameMerged(int scrnIndex, int x, int y, int flags);
extern void
RADEONMergePointerMoved(int scrnIndex, int x, int y);
extern DisplayModePtr
RADEONGenerateModeList(ScrnInfoPtr pScrn, char* str,
		    DisplayModePtr i, DisplayModePtr j,
		    RADEONScrn2Rel srel);
extern int
RADEONStrToRanges(range *r, char *s, int max);
extern void
RADEONXineramaExtensionInit(ScrnInfoPtr pScrn);
extern void
RADEONUpdateXineramaScreenInfo(ScrnInfoPtr pScrn1);
extern void
RADEONMergedFBSetDpi(ScrnInfoPtr pScrn1, ScrnInfoPtr pScrn2, RADEONScrn2Rel srel);
extern void
RADEONRecalcDefaultVirtualSize(ScrnInfoPtr pScrn);

/* needed by radeon_cursor.c */
extern void
RADEONSetCursorPositionMerged(ScrnInfoPtr pScrn, int x, int y);

/* needed by radeon_video.c */
extern void
RADEONChooseOverlayCRTC(ScrnInfoPtr, BoxPtr);

#endif /* _RADEON_MERGEDFB_H_ */