162306a36Sopenharmony_ci/* radeon_drv.h -- Private header for radeon driver -*- linux-c -*-
262306a36Sopenharmony_ci *
362306a36Sopenharmony_ci * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
462306a36Sopenharmony_ci * Copyright 2000 VA Linux Systems, Inc., Fremont, California.
562306a36Sopenharmony_ci * All rights reserved.
662306a36Sopenharmony_ci *
762306a36Sopenharmony_ci * Permission is hereby granted, free of charge, to any person obtaining a
862306a36Sopenharmony_ci * copy of this software and associated documentation files (the "Software"),
962306a36Sopenharmony_ci * to deal in the Software without restriction, including without limitation
1062306a36Sopenharmony_ci * the rights to use, copy, modify, merge, publish, distribute, sublicense,
1162306a36Sopenharmony_ci * and/or sell copies of the Software, and to permit persons to whom the
1262306a36Sopenharmony_ci * Software is furnished to do so, subject to the following conditions:
1362306a36Sopenharmony_ci *
1462306a36Sopenharmony_ci * The above copyright notice and this permission notice (including the next
1562306a36Sopenharmony_ci * paragraph) shall be included in all copies or substantial portions of the
1662306a36Sopenharmony_ci * Software.
1762306a36Sopenharmony_ci *
1862306a36Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1962306a36Sopenharmony_ci * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2062306a36Sopenharmony_ci * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
2162306a36Sopenharmony_ci * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
2262306a36Sopenharmony_ci * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
2362306a36Sopenharmony_ci * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
2462306a36Sopenharmony_ci * DEALINGS IN THE SOFTWARE.
2562306a36Sopenharmony_ci *
2662306a36Sopenharmony_ci * Authors:
2762306a36Sopenharmony_ci *    Kevin E. Martin <martin@valinux.com>
2862306a36Sopenharmony_ci *    Gareth Hughes <gareth@valinux.com>
2962306a36Sopenharmony_ci */
3062306a36Sopenharmony_ci
3162306a36Sopenharmony_ci#ifndef __RADEON_DRV_H__
3262306a36Sopenharmony_ci#define __RADEON_DRV_H__
3362306a36Sopenharmony_ci
3462306a36Sopenharmony_ci#include <linux/firmware.h>
3562306a36Sopenharmony_ci#include <linux/platform_device.h>
3662306a36Sopenharmony_ci#include <drm/drm_legacy.h>
3762306a36Sopenharmony_ci
3862306a36Sopenharmony_ci#include "radeon_family.h"
3962306a36Sopenharmony_ci
4062306a36Sopenharmony_ci/* General customization:
4162306a36Sopenharmony_ci */
4262306a36Sopenharmony_ci
4362306a36Sopenharmony_ci#define DRIVER_AUTHOR		"Gareth Hughes, Keith Whitwell, others."
4462306a36Sopenharmony_ci
4562306a36Sopenharmony_ci#define DRIVER_NAME		"radeon"
4662306a36Sopenharmony_ci#define DRIVER_DESC		"ATI Radeon"
4762306a36Sopenharmony_ci#define DRIVER_DATE		"20080528"
4862306a36Sopenharmony_ci
4962306a36Sopenharmony_ci/* Interface history:
5062306a36Sopenharmony_ci *
5162306a36Sopenharmony_ci * 1.1 - ??
5262306a36Sopenharmony_ci * 1.2 - Add vertex2 ioctl (keith)
5362306a36Sopenharmony_ci *     - Add stencil capability to clear ioctl (gareth, keith)
5462306a36Sopenharmony_ci *     - Increase MAX_TEXTURE_LEVELS (brian)
5562306a36Sopenharmony_ci * 1.3 - Add cmdbuf ioctl (keith)
5662306a36Sopenharmony_ci *     - Add support for new radeon packets (keith)
5762306a36Sopenharmony_ci *     - Add getparam ioctl (keith)
5862306a36Sopenharmony_ci *     - Add flip-buffers ioctl, deprecate fullscreen foo (keith).
5962306a36Sopenharmony_ci * 1.4 - Add scratch registers to get_param ioctl.
6062306a36Sopenharmony_ci * 1.5 - Add r200 packets to cmdbuf ioctl
6162306a36Sopenharmony_ci *     - Add r200 function to init ioctl
6262306a36Sopenharmony_ci *     - Add 'scalar2' instruction to cmdbuf
6362306a36Sopenharmony_ci * 1.6 - Add static GART memory manager
6462306a36Sopenharmony_ci *       Add irq handler (won't be turned on unless X server knows to)
6562306a36Sopenharmony_ci *       Add irq ioctls and irq_active getparam.
6662306a36Sopenharmony_ci *       Add wait command for cmdbuf ioctl
6762306a36Sopenharmony_ci *       Add GART offset query for getparam
6862306a36Sopenharmony_ci * 1.7 - Add support for cube map registers: R200_PP_CUBIC_FACES_[0..5]
6962306a36Sopenharmony_ci *       and R200_PP_CUBIC_OFFSET_F1_[0..5].
7062306a36Sopenharmony_ci *       Added packets R200_EMIT_PP_CUBIC_FACES_[0..5] and
7162306a36Sopenharmony_ci *       R200_EMIT_PP_CUBIC_OFFSETS_[0..5].  (brian)
7262306a36Sopenharmony_ci * 1.8 - Remove need to call cleanup ioctls on last client exit (keith)
7362306a36Sopenharmony_ci *       Add 'GET' queries for starting additional clients on different VT's.
7462306a36Sopenharmony_ci * 1.9 - Add DRM_IOCTL_RADEON_CP_RESUME ioctl.
7562306a36Sopenharmony_ci *       Add texture rectangle support for r100.
7662306a36Sopenharmony_ci * 1.10- Add SETPARAM ioctl; first parameter to set is FB_LOCATION, which
7762306a36Sopenharmony_ci *       clients use to tell the DRM where they think the framebuffer is
7862306a36Sopenharmony_ci *       located in the card's address space
7962306a36Sopenharmony_ci * 1.11- Add packet R200_EMIT_RB3D_BLENDCOLOR to support GL_EXT_blend_color
8062306a36Sopenharmony_ci *       and GL_EXT_blend_[func|equation]_separate on r200
8162306a36Sopenharmony_ci * 1.12- Add R300 CP microcode support - this just loads the CP on r300
8262306a36Sopenharmony_ci *       (No 3D support yet - just microcode loading).
8362306a36Sopenharmony_ci * 1.13- Add packet R200_EMIT_TCL_POINT_SPRITE_CNTL for ARB_point_parameters
8462306a36Sopenharmony_ci *     - Add hyperz support, add hyperz flags to clear ioctl.
8562306a36Sopenharmony_ci * 1.14- Add support for color tiling
8662306a36Sopenharmony_ci *     - Add R100/R200 surface allocation/free support
8762306a36Sopenharmony_ci * 1.15- Add support for texture micro tiling
8862306a36Sopenharmony_ci *     - Add support for r100 cube maps
8962306a36Sopenharmony_ci * 1.16- Add R200_EMIT_PP_TRI_PERF_CNTL packet to support brilinear
9062306a36Sopenharmony_ci *       texture filtering on r200
9162306a36Sopenharmony_ci * 1.17- Add initial support for R300 (3D).
9262306a36Sopenharmony_ci * 1.18- Add support for GL_ATI_fragment_shader, new packets
9362306a36Sopenharmony_ci *       R200_EMIT_PP_AFS_0/1, R200_EMIT_PP_TXCTLALL_0-5 (replaces
9462306a36Sopenharmony_ci *       R200_EMIT_PP_TXFILTER_0-5, 2 more regs) and R200_EMIT_ATF_TFACTOR
9562306a36Sopenharmony_ci *       (replaces R200_EMIT_TFACTOR_0 (8 consts instead of 6)
9662306a36Sopenharmony_ci * 1.19- Add support for gart table in FB memory and PCIE r300
9762306a36Sopenharmony_ci * 1.20- Add support for r300 texrect
9862306a36Sopenharmony_ci * 1.21- Add support for card type getparam
9962306a36Sopenharmony_ci * 1.22- Add support for texture cache flushes (R300_TX_CNTL)
10062306a36Sopenharmony_ci * 1.23- Add new radeon memory map work from benh
10162306a36Sopenharmony_ci * 1.24- Add general-purpose packet for manipulating scratch registers (r300)
10262306a36Sopenharmony_ci * 1.25- Add support for r200 vertex programs (R200_EMIT_VAP_PVS_CNTL,
10362306a36Sopenharmony_ci *       new packet type)
10462306a36Sopenharmony_ci * 1.26- Add support for variable size PCI(E) gart aperture
10562306a36Sopenharmony_ci * 1.27- Add support for IGP GART
10662306a36Sopenharmony_ci * 1.28- Add support for VBL on CRTC2
10762306a36Sopenharmony_ci * 1.29- R500 3D cmd buffer support
10862306a36Sopenharmony_ci * 1.30- Add support for occlusion queries
10962306a36Sopenharmony_ci * 1.31- Add support for num Z pipes from GET_PARAM
11062306a36Sopenharmony_ci * 1.32- fixes for rv740 setup
11162306a36Sopenharmony_ci * 1.33- Add r6xx/r7xx const buffer support
11262306a36Sopenharmony_ci * 1.34- fix evergreen/cayman GS register
11362306a36Sopenharmony_ci */
11462306a36Sopenharmony_ci#define DRIVER_MAJOR		1
11562306a36Sopenharmony_ci#define DRIVER_MINOR		34
11662306a36Sopenharmony_ci#define DRIVER_PATCHLEVEL	0
11762306a36Sopenharmony_ci
11862306a36Sopenharmony_cilong radeon_drm_ioctl(struct file *filp,
11962306a36Sopenharmony_ci		      unsigned int cmd, unsigned long arg);
12062306a36Sopenharmony_ci
12162306a36Sopenharmony_ciint radeon_driver_load_kms(struct drm_device *dev, unsigned long flags);
12262306a36Sopenharmony_civoid radeon_driver_unload_kms(struct drm_device *dev);
12362306a36Sopenharmony_ciint radeon_driver_open_kms(struct drm_device *dev, struct drm_file *file_priv);
12462306a36Sopenharmony_civoid radeon_driver_postclose_kms(struct drm_device *dev,
12562306a36Sopenharmony_ci				 struct drm_file *file_priv);
12662306a36Sopenharmony_ci
12762306a36Sopenharmony_ci/* atpx handler */
12862306a36Sopenharmony_ci#if defined(CONFIG_VGA_SWITCHEROO)
12962306a36Sopenharmony_civoid radeon_register_atpx_handler(void);
13062306a36Sopenharmony_civoid radeon_unregister_atpx_handler(void);
13162306a36Sopenharmony_cibool radeon_has_atpx_dgpu_power_cntl(void);
13262306a36Sopenharmony_cibool radeon_is_atpx_hybrid(void);
13362306a36Sopenharmony_ci#else
13462306a36Sopenharmony_cistatic inline void radeon_register_atpx_handler(void) {}
13562306a36Sopenharmony_cistatic inline void radeon_unregister_atpx_handler(void) {}
13662306a36Sopenharmony_cistatic inline bool radeon_has_atpx_dgpu_power_cntl(void) { return false; }
13762306a36Sopenharmony_cistatic inline bool radeon_is_atpx_hybrid(void) { return false; }
13862306a36Sopenharmony_ci#endif
13962306a36Sopenharmony_ci
14062306a36Sopenharmony_ci#endif				/* __RADEON_DRV_H__ */
141