xref: /linux/drivers/gpu/drm/gma500/gtt.h (revision 4f2c0a4acffbec01079c28f839422e64ddeff004)
1a61127c2SThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */
28c8f1c95SAlan Cox /**************************************************************************
38c8f1c95SAlan Cox  * Copyright (c) 2007-2008, Intel Corporation.
48c8f1c95SAlan Cox  * All Rights Reserved.
58c8f1c95SAlan Cox  *
68c8f1c95SAlan Cox  **************************************************************************/
78c8f1c95SAlan Cox 
88c8f1c95SAlan Cox #ifndef _PSB_GTT_H_
98c8f1c95SAlan Cox #define _PSB_GTT_H_
108c8f1c95SAlan Cox 
11d9fc9413SDaniel Vetter #include <drm/drm_gem.h>
128c8f1c95SAlan Cox 
133c101135SThomas Zimmermann struct drm_psb_private;
143c101135SThomas Zimmermann 
158c8f1c95SAlan Cox /* This wants cleaning up with respect to the psb_dev and un-needed stuff */
168c8f1c95SAlan Cox struct psb_gtt {
178c8f1c95SAlan Cox 	uint32_t gatt_start;
188c8f1c95SAlan Cox 	uint32_t mmu_gatt_start;
198c8f1c95SAlan Cox 	uint32_t gtt_start;
208c8f1c95SAlan Cox 	uint32_t gtt_phys_start;
218c8f1c95SAlan Cox 	unsigned gtt_pages;
228c8f1c95SAlan Cox 	unsigned gatt_pages;
238c8f1c95SAlan Cox 	unsigned long stolen_size;
248c8f1c95SAlan Cox 	unsigned long vram_stolen_size;
258c8f1c95SAlan Cox };
268c8f1c95SAlan Cox 
278c8f1c95SAlan Cox /* Exported functions */
2897bd66c4SThomas Zimmermann int psb_gtt_init(struct drm_device *dev);
296069fd81SThomas Zimmermann void psb_gtt_fini(struct drm_device *dev);
3042ceddb6SThomas Zimmermann int psb_gtt_resume(struct drm_device *dev);
311f9f6790SThomas Zimmermann 
323c101135SThomas Zimmermann int psb_gtt_allocate_resource(struct drm_psb_private *pdev, struct resource *res,
333c101135SThomas Zimmermann 			      const char *name, resource_size_t size, resource_size_t align,
343c101135SThomas Zimmermann 			      bool stolen, u32 *offset);
353c101135SThomas Zimmermann 
36*d339386cSThomas Zimmermann uint32_t psb_gtt_mask_pte(uint32_t pfn, int type);
37e1f80341SThomas Zimmermann void psb_gtt_insert_pages(struct drm_psb_private *pdev, const struct resource *res,
38e1f80341SThomas Zimmermann 			  struct page **pages);
39e1f80341SThomas Zimmermann void psb_gtt_remove_pages(struct drm_psb_private *pdev, const struct resource *res);
401f9f6790SThomas Zimmermann 
418c8f1c95SAlan Cox #endif
42