1/*
2 * Copyright 2000 ATI Technologies Inc., Markham, Ontario, and
3 *                VA Linux Systems Inc., Fremont, California.
4 *
5 * All Rights Reserved.
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining
8 * a copy of this software and associated documentation files (the
9 * "Software"), to deal in the Software without restriction, including
10 * without limitation on the rights to use, copy, modify, merge,
11 * publish, distribute, sublicense, and/or sell copies of the Software,
12 * and to permit persons to whom the Software is furnished to do so,
13 * subject to the following conditions:
14 *
15 * The above copyright notice and this permission notice (including the
16 * next paragraph) shall be included in all copies or substantial
17 * portions of the Software.
18 *
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
22 * NON-INFRINGEMENT.  IN NO EVENT SHALL ATI, VA LINUX SYSTEMS AND/OR
23 * THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
24 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
26 * DEALINGS IN THE SOFTWARE.
27 */
28
29/*
30 * Authors:
31 *   Kevin E. Martin <martin@xfree86.org>
32 *
33 * Modified by Marc Aurele La France <tsi@xfree86.org> for ATI driver merge.
34 */
35
36#ifndef _AMDGPU_PROBE_H_
37#define _AMDGPU_PROBE_H_ 1
38
39#include <stdint.h>
40#include "xorg-server.h"
41#include "xf86str.h"
42#include "xf86DDC.h"
43#include "randrstr.h"
44
45#include "xf86Crtc.h"
46
47#ifdef XSERVER_PLATFORM_BUS
48#include "xf86platformBus.h"
49#endif
50
51#include <amdgpu.h>
52
53#include "compat-api.h"
54
55extern DriverRec AMDGPU;
56
57typedef struct {
58	Bool HasCRTC2;		/* All cards except original Radeon  */
59	Bool has_page_flip_target;
60
61	amdgpu_device_handle pDev;
62
63	int fd;			/* for sharing across zaphod heads   */
64	int fd_ref;
65	unsigned long fd_wakeup_registered;	/* server generation for which fd has been registered for wakeup handling */
66	int fd_wakeup_ref;
67	unsigned int assigned_crtcs;
68	unsigned int num_scrns;
69	ScrnInfoPtr scrn[6];
70	struct xf86_platform_device *platform_dev;
71	char *render_node;
72	char *busid;
73} AMDGPUEntRec, *AMDGPUEntPtr;
74
75extern void amdgpu_kernel_close_fd(AMDGPUEntPtr pAMDGPUEnt);
76
77extern const OptionInfoRec *AMDGPUOptionsWeak(void);
78
79extern Bool AMDGPUPreInit_KMS(ScrnInfoPtr, int);
80extern Bool AMDGPUScreenInit_KMS(ScreenPtr pScreen, int argc, char **argv);
81extern Bool AMDGPUSwitchMode_KMS(ScrnInfoPtr pScrn, DisplayModePtr mode);
82extern void AMDGPUAdjustFrame_KMS(ScrnInfoPtr pScrn, int x, int y);
83extern Bool AMDGPUEnterVT_KMS(ScrnInfoPtr pScrn);
84extern void AMDGPULeaveVT_KMS(ScrnInfoPtr pScrn);
85extern void AMDGPUFreeScreen_KMS(ScrnInfoPtr pScrn);
86
87extern ModeStatus AMDGPUValidMode(ScrnInfoPtr pScrn, DisplayModePtr mode,
88				  Bool verbose, int flag);
89#endif /* _AMDGPU_PROBE_H_ */
90