Path: blob/master/drivers/gpu/drm/nouveau/nouveau_mm.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_REGION_H__25#define __NOUVEAU_REGION_H__2627struct nouveau_mm_node {28struct list_head nl_entry;29struct list_head fl_entry;30struct list_head rl_entry;3132u8 type;33u32 offset;34u32 length;35};3637struct nouveau_mm {38struct list_head nodes;39struct list_head free;4041struct mutex mutex;4243u32 block_size;44};4546int nouveau_mm_init(struct nouveau_mm **, u32 offset, u32 length, u32 block);47int nouveau_mm_fini(struct nouveau_mm **);48int nouveau_mm_pre(struct nouveau_mm *);49int nouveau_mm_get(struct nouveau_mm *, int type, u32 size, u32 size_nc,50u32 align, struct nouveau_mm_node **);51void nouveau_mm_put(struct nouveau_mm *, struct nouveau_mm_node *);5253int nv50_vram_init(struct drm_device *);54int nv50_vram_new(struct drm_device *, u64 size, u32 align, u32 size_nc,55u32 memtype, struct nouveau_mem **);56void nv50_vram_del(struct drm_device *, struct nouveau_mem **);57bool nv50_vram_flags_valid(struct drm_device *, u32 tile_flags);5859int nvc0_vram_init(struct drm_device *);60int nvc0_vram_new(struct drm_device *, u64 size, u32 align, u32 ncmin,61u32 memtype, struct nouveau_mem **);62bool nvc0_vram_flags_valid(struct drm_device *, u32 tile_flags);6364#endif656667