xref: /openbmc/linux/drivers/gpu/drm/gma500/gtt.h (revision 31eeb6b0)
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /**************************************************************************
3  * Copyright (c) 2007-2008, Intel Corporation.
4  * All Rights Reserved.
5  *
6  **************************************************************************/
7 
8 #ifndef _PSB_GTT_H_
9 #define _PSB_GTT_H_
10 
11 #include <drm/drm_gem.h>
12 
13 struct drm_psb_private;
14 
15 /* This wants cleaning up with respect to the psb_dev and un-needed stuff */
16 struct psb_gtt {
17 	uint32_t gatt_start;
18 	uint32_t mmu_gatt_start;
19 	uint32_t gtt_start;
20 	uint32_t gtt_phys_start;
21 	unsigned gtt_pages;
22 	unsigned gatt_pages;
23 	unsigned long stolen_size;
24 	unsigned long vram_stolen_size;
25 	struct rw_semaphore sem;
26 };
27 
28 /* Exported functions */
29 extern int psb_gtt_init(struct drm_device *dev, int resume);
30 extern void psb_gtt_takedown(struct drm_device *dev);
31 extern int psb_gtt_restore(struct drm_device *dev);
32 
33 int psb_gtt_allocate_resource(struct drm_psb_private *pdev, struct resource *res,
34 			      const char *name, resource_size_t size, resource_size_t align,
35 			      bool stolen, u32 *offset);
36 
37 void psb_gtt_insert_pages(struct drm_psb_private *pdev, const struct resource *res,
38 			  struct page **pages);
39 void psb_gtt_remove_pages(struct drm_psb_private *pdev, const struct resource *res);
40 
41 #endif
42