1b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell/**
2b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell * \file server/radeon_dri.h
3b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell * \brief Radeon server-side structures.
4b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell *
5b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell * \author Kevin E. Martin <martin@xfree86.org>
6b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell * \author Rickard E. Faith <faith@valinux.com>
7b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell */
8b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell
9b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell/*
10b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell * Copyright 2000 ATI Technologies Inc., Markham, Ontario,
11b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell *                VA Linux Systems Inc., Fremont, California.
12b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell *
13b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell * All Rights Reserved.
14b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell *
15b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell * Permission is hereby granted, free of charge, to any person obtaining
16b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell * a copy of this software and associated documentation files (the
17b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell * "Software"), to deal in the Software without restriction, including
18b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell * without limitation on the rights to use, copy, modify, merge,
19b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell * publish, distribute, sublicense, and/or sell copies of the Software,
20b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell * and to permit persons to whom the Software is furnished to do so,
21b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell * subject to the following conditions:
22b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell *
23b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell * The above copyright notice and this permission notice (including the
24b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell * next paragraph) shall be included in all copies or substantial
25b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell * portions of the Software.
26b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell *
27b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
28b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
29b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
30b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell * NON-INFRINGEMENT.  IN NO EVENT SHALL ATI, VA LINUX SYSTEMS AND/OR
31b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell * THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
32b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
33b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
34b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell * DEALINGS IN THE SOFTWARE.
35b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell */
36b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell
37b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell
38b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell#ifndef _RADEON_DRI_
39b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell#define _RADEON_DRI_
40b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell
41b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell#include "xf86drm.h"
42ae4a1cc0666860bf5cc37a5cb549afc9aa5448b0Jon Smirl#include "drm.h"
43ae4a1cc0666860bf5cc37a5cb549afc9aa5448b0Jon Smirl#include "radeon_drm.h"
44b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell
45b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell/* DRI Driver defaults */
46b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell#define RADEON_DEFAULT_CP_PIO_MODE    RADEON_CSQ_PRIPIO_INDPIO
47b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell#define RADEON_DEFAULT_CP_BM_MODE     RADEON_CSQ_PRIBM_INDBM
48b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell#define RADEON_DEFAULT_AGP_MODE       1
49b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell#define RADEON_DEFAULT_AGP_FAST_WRITE 0
50b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell#define RADEON_DEFAULT_AGP_SIZE       8 /* MB (must be 2^n and > 4MB) */
51b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell#define RADEON_DEFAULT_RING_SIZE      1 /* MB (must be page aligned) */
52b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell#define RADEON_DEFAULT_BUFFER_SIZE    2 /* MB (must be page aligned) */
53b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell#define RADEON_DEFAULT_AGP_TEX_SIZE   1 /* MB (must be page aligned) */
54b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell#define RADEON_DEFAULT_CP_TIMEOUT     10000  /* usecs */
55a7abda582082ca345bf1b883cc3c125b3918d5b8Dave Airlie#define RADEON_DEFAULT_PAGE_FLIP      0 /* page flipping diabled */
56b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell#define RADEON_BUFFER_ALIGN           0x00000fff
57b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell
58b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell/**
59b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell * \brief Radeon DRI driver private data.
60b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell */
61b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwelltypedef struct {
62b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell    /**
63b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell     * \name DRI screen private data
64b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell     */
65b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell    /*@{*/
66b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell    int           deviceID;	 /**< \brief PCI device ID */
67b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell    int           width;	 /**< \brief width in pixels of display */
68b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell    int           height;	 /**< \brief height in scanlines of display */
69b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell    int           depth;	 /**< \brief depth of display (8, 15, 16, 24) */
70b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell    int           bpp;		 /**< \brief bit depth of display (8, 16, 24, 32) */
71b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell
72b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell    int           IsPCI;	 /**< \brief is current card a PCI card? */
73b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell    int           AGPMode;	 /**< \brief AGP mode */
74b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell
75b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell    int           frontOffset;   /**< \brief front buffer offset */
76b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell    int           frontPitch;	 /**< \brief front buffer pitch */
77b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell    int           backOffset;    /**< \brief shared back buffer offset */
78b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell    int           backPitch;     /**< \brief shared back buffer pitch */
79b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell    int           depthOffset;   /**< \brief shared depth buffer offset */
80b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell    int           depthPitch;    /**< \brief shared depth buffer pitch */
81b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell    int           textureOffset; /**< \brief start of texture data in frame buffer */
82b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell    int           textureSize;   /**< \brief size of texture date */
83b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell    int           log2TexGran;   /**< \brief log2 texture granularity */
84b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell    /*@}*/
85b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell
86b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell    /**
87b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell     * \name MMIO register data
88b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell     */
89b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell    /*@{*/
90c06b25594e5effe34a90c067e1a3da0f61cf2b13Ian Romanick    drm_handle_t     registerHandle; /**< \brief MMIO register map size */
91b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell    drmSize       registerSize;   /**< \brief MMIO register map handle */
92b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell    /*@}*/
93b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell
94b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell    /**
95b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell     * \name CP in-memory status information
96b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell     */
97b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell    /*@{*/
98c06b25594e5effe34a90c067e1a3da0f61cf2b13Ian Romanick    drm_handle_t     statusHandle;   /**< \brief status map handle */
99b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell    drmSize       statusSize;     /**< \brief status map size */
100b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell    /*@}*/
101b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell
102b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell    /**
103b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell     * \name CP AGP Texture data
104b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell     */
105b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell    /*@{*/
106c06b25594e5effe34a90c067e1a3da0f61cf2b13Ian Romanick    drm_handle_t     gartTexHandle;   /**< \brief AGP texture area map handle */
107bcc6eddd335e97d49ed2ef3a1440f94d58dce12dJon Smirl    drmSize       gartTexMapSize;  /**< \brief AGP texture area map size */
108bcc6eddd335e97d49ed2ef3a1440f94d58dce12dJon Smirl    int           log2GARTTexGran; /**< \brief AGP texture granularity in log base 2 */
109bcc6eddd335e97d49ed2ef3a1440f94d58dce12dJon Smirl    int           gartTexOffset;   /**< \brief AGP texture area offset in AGP space */
110b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell    /*@}*/
111b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell
112b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell    unsigned int  sarea_priv_offset; /**< \brief offset of the private SAREA data*/
113b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell} RADEONDRIRec, *RADEONDRIPtr;
114b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell
115b93652d67ed976562edc121b319b0594f79cc00aKeith Whitwell#endif
116