1247834Skib/************************************************************************** 2247834Skib * 3247834Skib * Copyright 2008-2009 VMware, Inc., Palo Alto, CA., USA 4247834Skib * All Rights Reserved. 5247834Skib * 6247834Skib * Permission is hereby granted, free of charge, to any person obtaining a 7247834Skib * copy of this software and associated documentation files (the 8247834Skib * "Software"), to deal in the Software without restriction, including 9247834Skib * without limitation the rights to use, copy, modify, merge, publish, 10247834Skib * distribute, sub license, and/or sell copies of the Software, and to 11247834Skib * permit persons to whom the Software is furnished to do so, subject to 12247834Skib * the following conditions: 13247834Skib * 14247834Skib * The above copyright notice and this permission notice (including the 15247834Skib * next paragraph) shall be included in all copies or substantial portions 16247834Skib * of the Software. 17247834Skib * 18247834Skib * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19247834Skib * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20247834Skib * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL 21247834Skib * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, 22247834Skib * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 23247834Skib * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 24247834Skib * USE OR OTHER DEALINGS IN THE SOFTWARE. 25247834Skib * 26247834Skib **************************************************************************/ 27247834Skib/* 28247834Skib * Authors: Thomas Hellstrom <thellstrom-at-vmware-dot-com> 29247834Skib */ 30247834Skib/* $FreeBSD$ */ 31247834Skib 32247834Skib#ifndef _DRM_GLOBAL_H_ 33247834Skib#define _DRM_GLOBAL_H_ 34247834Skibenum drm_global_types { 35247834Skib DRM_GLOBAL_TTM_MEM = 0, 36247834Skib DRM_GLOBAL_TTM_BO, 37247834Skib DRM_GLOBAL_TTM_OBJECT, 38247834Skib DRM_GLOBAL_NUM 39247834Skib}; 40247834Skib 41247834Skibstruct drm_global_reference { 42247834Skib enum drm_global_types global_type; 43247834Skib size_t size; 44247834Skib void *object; 45247834Skib int (*init) (struct drm_global_reference *); 46247834Skib void (*release) (struct drm_global_reference *); 47247834Skib}; 48247834Skib 49247834Skibextern void drm_global_init(void); 50247834Skibextern void drm_global_release(void); 51247834Skibextern int drm_global_item_ref(struct drm_global_reference *ref); 52247834Skibextern void drm_global_item_unref(struct drm_global_reference *ref); 53247834Skib 54247834SkibMALLOC_DECLARE(M_DRM_GLOBAL); 55247834Skib 56247834Skib#endif 57