Path: blob/master/drivers/gpu/drm/nouveau/nouveau_ramht.h
15112 views
/*1* Copyright 2010 Red Hat Inc.2*3* Permission is hereby granted, free of charge, to any person obtaining a4* copy of this software and associated documentation files (the "Software"),5* to deal in the Software without restriction, including without limitation6* the rights to use, copy, modify, merge, publish, distribute, sublicense,7* and/or sell copies of the Software, and to permit persons to whom the8* Software is furnished to do so, subject to the following conditions:9*10* The above copyright notice and this permission notice shall be included in11* all copies or substantial portions of the Software.12*13* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR14* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,15* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL16* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR17* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,18* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR19* OTHER DEALINGS IN THE SOFTWARE.20*21* Authors: Ben Skeggs22*/2324#ifndef __NOUVEAU_RAMHT_H__25#define __NOUVEAU_RAMHT_H__2627struct nouveau_ramht_entry {28struct list_head head;29struct nouveau_channel *channel;30struct nouveau_gpuobj *gpuobj;31u32 handle;32};3334struct nouveau_ramht {35struct drm_device *dev;36struct kref refcount;37spinlock_t lock;38struct nouveau_gpuobj *gpuobj;39struct list_head entries;40int bits;41};4243extern int nouveau_ramht_new(struct drm_device *, struct nouveau_gpuobj *,44struct nouveau_ramht **);45extern void nouveau_ramht_ref(struct nouveau_ramht *, struct nouveau_ramht **,46struct nouveau_channel *unref_channel);4748extern int nouveau_ramht_insert(struct nouveau_channel *, u32 handle,49struct nouveau_gpuobj *);50extern int nouveau_ramht_remove(struct nouveau_channel *, u32 handle);51extern struct nouveau_gpuobj *52nouveau_ramht_find(struct nouveau_channel *chan, u32 handle);5354#endif555657