drm/msm/hdmi: Enable HPD after HDMI IRQ is set up
[linux/fpc-iii.git] / drivers / gpu / drm / gma500 / mmu.h
blobe89abec6209d89e5a82f18031868aa0ac414be90
1 /**************************************************************************
2 * Copyright (c) 2007-2011, Intel Corporation.
3 * All Rights Reserved.
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 **************************************************************************/
15 #ifndef __MMU_H
16 #define __MMU_H
18 struct psb_mmu_driver {
19 /* protects driver- and pd structures. Always take in read mode
20 * before taking the page table spinlock.
22 struct rw_semaphore sem;
24 /* protects page tables, directory tables and pt tables.
25 * and pt structures.
27 spinlock_t lock;
29 atomic_t needs_tlbflush;
30 atomic_t *msvdx_mmu_invaldc;
31 struct psb_mmu_pd *default_pd;
32 uint32_t bif_ctrl;
33 int has_clflush;
34 int clflush_add;
35 unsigned long clflush_mask;
37 struct drm_device *dev;
40 struct psb_mmu_pd;
42 struct psb_mmu_pt {
43 struct psb_mmu_pd *pd;
44 uint32_t index;
45 uint32_t count;
46 struct page *p;
47 uint32_t *v;
50 struct psb_mmu_pd {
51 struct psb_mmu_driver *driver;
52 int hw_context;
53 struct psb_mmu_pt **tables;
54 struct page *p;
55 struct page *dummy_pt;
56 struct page *dummy_page;
57 uint32_t pd_mask;
58 uint32_t invalid_pde;
59 uint32_t invalid_pte;
62 extern struct psb_mmu_driver *psb_mmu_driver_init(struct drm_device *dev,
63 int trap_pagefaults,
64 int invalid_type,
65 atomic_t *msvdx_mmu_invaldc);
66 extern void psb_mmu_driver_takedown(struct psb_mmu_driver *driver);
67 extern struct psb_mmu_pd *psb_mmu_get_default_pd(struct psb_mmu_driver
68 *driver);
69 extern struct psb_mmu_pd *psb_mmu_alloc_pd(struct psb_mmu_driver *driver,
70 int trap_pagefaults,
71 int invalid_type);
72 extern void psb_mmu_free_pagedir(struct psb_mmu_pd *pd);
73 extern void psb_mmu_flush(struct psb_mmu_driver *driver);
74 extern void psb_mmu_remove_pfn_sequence(struct psb_mmu_pd *pd,
75 unsigned long address,
76 uint32_t num_pages);
77 extern int psb_mmu_insert_pfn_sequence(struct psb_mmu_pd *pd,
78 uint32_t start_pfn,
79 unsigned long address,
80 uint32_t num_pages, int type);
81 extern int psb_mmu_virtual_to_pfn(struct psb_mmu_pd *pd, uint32_t virtual,
82 unsigned long *pfn);
83 extern void psb_mmu_set_pd_context(struct psb_mmu_pd *pd, int hw_context);
84 extern int psb_mmu_insert_pages(struct psb_mmu_pd *pd, struct page **pages,
85 unsigned long address, uint32_t num_pages,
86 uint32_t desired_tile_stride,
87 uint32_t hw_tile_stride, int type);
88 extern void psb_mmu_remove_pages(struct psb_mmu_pd *pd,
89 unsigned long address, uint32_t num_pages,
90 uint32_t desired_tile_stride,
91 uint32_t hw_tile_stride);
93 #endif