2000-12-02 13:10:03 +00:00
|
|
|
/* mach64_drm.h -- Public header for the mach64 driver -*- linux-c -*-
|
|
|
|
|
* Created: Thu Nov 30 20:04:32 2000 by gareth@valinux.com
|
|
|
|
|
*
|
|
|
|
|
* Copyright 2000 Gareth Hughes
|
|
|
|
|
* 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
|
|
|
|
|
* 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 NONINFRINGEMENT. IN NO EVENT SHALL
|
|
|
|
|
* GARETH HUGHES 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:
|
|
|
|
|
* Gareth Hughes <gareth@valinux.com>
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef __MACH64_DRM_H__
|
|
|
|
|
#define __MACH64_DRM_H__
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* WARNING: If you change any of these defines, make sure to change the
|
|
|
|
|
* defines in the Xserver file (xf86drmMach64.h)
|
|
|
|
|
*/
|
|
|
|
|
#ifndef __MACH64_DEFINES__
|
|
|
|
|
#define __MACH64_DEFINES__
|
|
|
|
|
|
2000-12-04 06:26:37 +00:00
|
|
|
/* What needs to be changed for the current vertex buffer?
|
2000-12-02 13:10:03 +00:00
|
|
|
*/
|
2000-12-04 06:26:37 +00:00
|
|
|
#define MACH64_UPLOAD_CONTEXT 0x001
|
|
|
|
|
#define MACH64_UPLOAD_SETUP 0x002
|
|
|
|
|
#define MACH64_UPLOAD_TEX0 0x004
|
|
|
|
|
#define MACH64_UPLOAD_TEX1 0x008
|
|
|
|
|
#define MACH64_UPLOAD_TEX0IMAGES 0x010
|
|
|
|
|
#define MACH64_UPLOAD_TEX1IMAGES 0x020
|
|
|
|
|
#define MACH64_UPLOAD_CORE 0x040
|
|
|
|
|
#define MACH64_UPLOAD_MASKS 0x080
|
|
|
|
|
#define MACH64_UPLOAD_WINDOW 0x100
|
|
|
|
|
#define MACH64_UPLOAD_CLIPRECTS 0x200 /* handled client-side */
|
|
|
|
|
#define MACH64_REQUIRE_QUIESCENCE 0x400
|
|
|
|
|
#define MACH64_UPLOAD_ALL 0x7ff
|
|
|
|
|
|
|
|
|
|
#define MACH64_FRONT 0x1
|
|
|
|
|
#define MACH64_BACK 0x2
|
|
|
|
|
#define MACH64_DEPTH 0x4
|
2000-12-02 13:10:03 +00:00
|
|
|
|
|
|
|
|
/* Keep these small for testing.
|
|
|
|
|
*/
|
|
|
|
|
#define MACH64_NR_SAREA_CLIPRECTS 8
|
|
|
|
|
|
|
|
|
|
/* WARNING: If you change any of these defines, make sure to change the
|
|
|
|
|
* defines in the Xserver file (mach64_sarea.h)
|
|
|
|
|
*/
|
|
|
|
|
#define MACH64_CARD_HEAP 0
|
|
|
|
|
#define MACH64_AGP_HEAP 1
|
|
|
|
|
#define MACH64_NR_TEX_HEAPS 2
|
2000-12-04 06:26:37 +00:00
|
|
|
#define MACH64_NR_TEX_REGIONS 64
|
2000-12-02 13:10:03 +00:00
|
|
|
#define MACH64_LOG_TEX_GRANULARITY 16
|
|
|
|
|
|
2000-12-04 06:26:37 +00:00
|
|
|
#endif /* __MACH64_SAREA_DEFINES__ */
|
2000-12-02 13:10:03 +00:00
|
|
|
|
|
|
|
|
typedef struct drm_mach64_init {
|
|
|
|
|
enum {
|
|
|
|
|
MACH64_INIT_DMA = 0x01,
|
|
|
|
|
MACH64_CLEANUP_DMA = 0x02
|
|
|
|
|
} func;
|
|
|
|
|
|
2000-12-04 06:26:37 +00:00
|
|
|
unsigned int sarea_priv_offset;
|
2000-12-02 13:10:03 +00:00
|
|
|
|
2000-12-04 06:26:37 +00:00
|
|
|
unsigned int fb_bpp;
|
|
|
|
|
unsigned int front_offset, front_pitch;
|
|
|
|
|
unsigned int back_offset, back_pitch;
|
2000-12-02 13:10:03 +00:00
|
|
|
|
2000-12-04 06:26:37 +00:00
|
|
|
unsigned int depth_bpp;
|
|
|
|
|
unsigned int depth_offset, depth_pitch;
|
|
|
|
|
unsigned int span_offset;
|
2000-12-02 13:10:03 +00:00
|
|
|
|
2000-12-04 06:26:37 +00:00
|
|
|
unsigned int fb_offset;
|
2000-12-02 13:10:03 +00:00
|
|
|
unsigned int mmio_offset;
|
2000-12-04 06:26:37 +00:00
|
|
|
} drm_mach64_init_t;
|
2000-12-02 13:10:03 +00:00
|
|
|
|
|
|
|
|
|
2000-12-04 06:26:37 +00:00
|
|
|
typedef struct drm_mach64_tex_region {
|
2000-12-02 13:10:03 +00:00
|
|
|
unsigned char next, prev;
|
|
|
|
|
unsigned char in_use;
|
|
|
|
|
int age;
|
2000-12-04 06:26:37 +00:00
|
|
|
} drm_mach64_tex_region_t;
|
2000-12-02 13:10:03 +00:00
|
|
|
|
|
|
|
|
typedef struct drm_mach64_sarea {
|
|
|
|
|
/* The channel for communication of state information to the kernel
|
|
|
|
|
* on firing a vertex dma buffer.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/* FIXME: fill this in... */
|
|
|
|
|
|
|
|
|
|
/* The current cliprects, or a subset thereof.
|
|
|
|
|
*/
|
2000-12-04 06:26:37 +00:00
|
|
|
drm_clip_rect_t boxes[MACH64_NR_SAREA_CLIPRECTS];
|
2000-12-02 13:10:03 +00:00
|
|
|
unsigned int nbox;
|
|
|
|
|
|
|
|
|
|
/* Counters for client-side throttling of rendering clients.
|
|
|
|
|
*/
|
|
|
|
|
unsigned int last_frame;
|
|
|
|
|
unsigned int last_dispatch;
|
|
|
|
|
|
|
|
|
|
/* Texture memory LRU.
|
|
|
|
|
*/
|
2000-12-04 06:26:37 +00:00
|
|
|
drm_mach64_tex_region_t tex_list[MACH64_NR_TEX_HEAPS]
|
|
|
|
|
[MACH64_NR_TEX_REGIONS+1];
|
2000-12-02 13:10:03 +00:00
|
|
|
int tex_age[MACH64_NR_TEX_HEAPS];
|
|
|
|
|
int ctx_owner;
|
|
|
|
|
} drm_mach64_sarea_t;
|
|
|
|
|
|
2000-12-04 06:26:37 +00:00
|
|
|
typedef struct drm_mach64_clear {
|
|
|
|
|
unsigned int flags;
|
|
|
|
|
int x, y, w, h;
|
|
|
|
|
unsigned int clear_color;
|
|
|
|
|
unsigned int clear_depth;
|
|
|
|
|
} drm_mach64_clear_t;
|
|
|
|
|
|
2000-12-02 13:10:03 +00:00
|
|
|
#endif
|