Merge tag 'msm-next-5.19-fixes' of https://gitlab.freedesktop.org/abhinavk/msm into...
[linux-2.6-microblaze.git] / drivers / gpu / drm / gma500 / gtt.h
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 };
26
27 /* Exported functions */
28 int psb_gtt_init(struct drm_device *dev);
29 void psb_gtt_fini(struct drm_device *dev);
30 int psb_gtt_resume(struct drm_device *dev);
31
32 int psb_gtt_allocate_resource(struct drm_psb_private *pdev, struct resource *res,
33                               const char *name, resource_size_t size, resource_size_t align,
34                               bool stolen, u32 *offset);
35
36 uint32_t psb_gtt_mask_pte(uint32_t pfn, int type);
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