amdgpu_probe.h revision d6c0b56e
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 enum { 58 CHIP_FAMILY_UNKNOW, 59 CHIP_FAMILY_LEGACY, 60 CHIP_FAMILY_AMDGPU, 61 CHIP_FAMILY_BONAIRE, 62 CHIP_FAMILY_KAVERI, 63 CHIP_FAMILY_KABINI, 64 CHIP_FAMILY_HAWAII, 65 CHIP_FAMILY_TOPAZ, 66 CHIP_FAMILY_TONGA, 67 CHIP_FAMILY_CARRIZO, 68 CHIP_FAMILY_FIJI, 69 CHIP_FAMILY_STONEY, 70 CHIP_FAMILY_POLARIS10, 71 CHIP_FAMILY_POLARIS11, 72 CHIP_FAMILY_LAST 73} AMDGPUChipFamily; 74 75typedef struct { 76 uint32_t pci_device_id; 77 AMDGPUChipFamily chip_family; 78} AMDGPUCardInfo; 79 80typedef struct { 81 Bool HasCRTC2; /* All cards except original Radeon */ 82 83 amdgpu_device_handle pDev; 84 85 int fd; /* for sharing across zaphod heads */ 86 int fd_ref; 87 unsigned long fd_wakeup_registered; /* server generation for which fd has been registered for wakeup handling */ 88 int fd_wakeup_ref; 89 unsigned int assigned_crtcs; 90 struct xf86_platform_device *platform_dev; 91} AMDGPUEntRec, *AMDGPUEntPtr; 92 93extern const OptionInfoRec *AMDGPUOptionsWeak(void); 94 95extern Bool AMDGPUPreInit_KMS(ScrnInfoPtr, int); 96extern Bool AMDGPUScreenInit_KMS(SCREEN_INIT_ARGS_DECL); 97extern Bool AMDGPUSwitchMode_KMS(SWITCH_MODE_ARGS_DECL); 98extern void AMDGPUAdjustFrame_KMS(ADJUST_FRAME_ARGS_DECL); 99extern Bool AMDGPUEnterVT_KMS(VT_FUNC_ARGS_DECL); 100extern void AMDGPULeaveVT_KMS(VT_FUNC_ARGS_DECL); 101extern void AMDGPUFreeScreen_KMS(FREE_SCREEN_ARGS_DECL); 102 103extern ModeStatus AMDGPUValidMode(SCRN_ARG_TYPE arg, DisplayModePtr mode, 104 Bool verbose, int flag); 105#endif /* _AMDGPU_PROBE_H_ */ 106