131921Sbrian/**************************************************************************
231921Sbrian *
331921Sbrian * Copyright 2008-2009 VMware, Inc., Palo Alto, CA., USA
431921Sbrian * All Rights Reserved.
531921Sbrian *
631921Sbrian * Permission is hereby granted, free of charge, to any person obtaining a
731921Sbrian * copy of this software and associated documentation files (the
831921Sbrian * "Software"), to deal in the Software without restriction, including
931921Sbrian * without limitation the rights to use, copy, modify, merge, publish,
1031921Sbrian * distribute, sub license, and/or sell copies of the Software, and to
1131921Sbrian * permit persons to whom the Software is furnished to do so, subject to
1231921Sbrian * the following conditions:
1331921Sbrian *
1431921Sbrian * The above copyright notice and this permission notice (including the
1531921Sbrian * next paragraph) shall be included in all copies or substantial portions
1631921Sbrian * of the Software.
1731921Sbrian *
1831921Sbrian * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1931921Sbrian * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2031921Sbrian * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
2131921Sbrian * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
2231921Sbrian * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
2331921Sbrian * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
2431921Sbrian * USE OR OTHER DEALINGS IN THE SOFTWARE.
2531921Sbrian *
2631921Sbrian **************************************************************************/
2799109Sobrien/*
2899109Sobrien * Authors: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
2935773Scharnier */
3069457Sbrian/* $FreeBSD$ */
3127874Sbrian
3227874Sbrian#ifndef _DRM_GLOBAL_H_
3327874Sbrian#define _DRM_GLOBAL_H_
3427874Sbrianenum drm_global_types {
3527874Sbrian	DRM_GLOBAL_TTM_MEM = 0,
3627874Sbrian	DRM_GLOBAL_TTM_BO,
3727874Sbrian	DRM_GLOBAL_TTM_OBJECT,
3891079Smarkm	DRM_GLOBAL_NUM
3927874Sbrian};
4027874Sbrian
4127874Sbrianstruct drm_global_reference {
4227874Sbrian	enum drm_global_types global_type;
4357326Salfred	size_t size;
4457326Salfred	void *object;
4527874Sbrian	int (*init) (struct drm_global_reference *);
4627874Sbrian	void (*release) (struct drm_global_reference *);
4727874Sbrian};
4827874Sbrian
4927874Sbrianextern void drm_global_init(void);
5027874Sbrianextern void drm_global_release(void);
5127874Sbrianextern int drm_global_item_ref(struct drm_global_reference *ref);
5227874Sbrianextern void drm_global_item_unref(struct drm_global_reference *ref);
5327874Sbrian
5427874SbrianMALLOC_DECLARE(M_DRM_GLOBAL);
5559175Sbrian
5627874Sbrian#endif
5727874Sbrian