aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nv98_ppp.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-01-10 14:04:36 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-01-10 14:04:36 -0500
commit1a464cbb3d483f2f195b614cffa4aa1b910a0440 (patch)
treeaf57dee6436532dbb546b8670e9e1f6910d489b5 /drivers/gpu/drm/nouveau/nv98_ppp.c
parentdbe950f201a8edd353b0bd9079e8d536ee4ce37c (diff)
parent095f979a539245a46b9e5d600ec9c720b4d928e5 (diff)
Merge branch 'drm-core-next' of git://people.freedesktop.org/~airlied/linux
* 'drm-core-next' of git://people.freedesktop.org/~airlied/linux: (307 commits) drm/nouveau/pm: fix build with HWMON off gma500: silence gcc warnings in mid_get_vbt_data() drm/ttm: fix condition (and vs or) drm/radeon: double lock typo in radeon_vm_bo_rmv() drm/radeon: use after free in radeon_vm_bo_add() drm/sis|via: don't return stack garbage from free_mem ioctl drm/radeon/kms: remove pointless CS flags priority struct drm/radeon/kms: check if vm is supported in VA ioctl drm: introduce drm_can_sleep and use in intel/radeon drivers. (v2) radeon: Fix disabling PCI bus mastering on big endian hosts. ttm: fix agp since ttm tt rework agp: Fix multi-line warning message whitespace drm/ttm/dma: Fix accounting error when calling ttm_mem_global_free_page and don't try to free freed pages. drm/ttm/dma: Only call set_pages_array_wb when the page is not in WB pool. drm/radeon/kms: sync across multiple rings when doing bo moves v3 drm/radeon/kms: Add support for multi-ring sync in CS ioctl (v2) drm/radeon: GPU virtual memory support v22 drm: make DRM_UNLOCKED ioctls with their own mutex drm: no need to hold global mutex for static data drm/radeon/benchmark: common modes sweep ignores 640x480@32 ... Fix up trivial conflicts in radeon/evergreen.c and vmwgfx/vmwgfx_kms.c
Diffstat (limited to 'drivers/gpu/drm/nouveau/nv98_ppp.c')
-rw-r--r--drivers/gpu/drm/nouveau/nv98_ppp.c78
1 files changed, 78 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/nv98_ppp.c b/drivers/gpu/drm/nouveau/nv98_ppp.c
new file mode 100644
index 00000000000..a987dd6e003
--- /dev/null
+++ b/drivers/gpu/drm/nouveau/nv98_ppp.c
@@ -0,0 +1,78 @@
1/*
2 * Copyright 2011 Red Hat Inc.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
21 *
22 * Authors: Ben Skeggs
23 */
24
25#include "drmP.h"
26#include "nouveau_drv.h"
27#include "nouveau_util.h"
28#include "nouveau_vm.h"
29#include "nouveau_ramht.h"
30
31struct nv98_ppp_engine {
32 struct nouveau_exec_engine base;
33};
34
35static int
36nv98_ppp_fini(struct drm_device *dev, int engine, bool suspend)
37{
38 if (!(nv_rd32(dev, 0x000200) & 0x00000002))
39 return 0;
40
41 nv_mask(dev, 0x000200, 0x00000002, 0x00000000);
42 return 0;
43}
44
45static int
46nv98_ppp_init(struct drm_device *dev, int engine)
47{
48 nv_mask(dev, 0x000200, 0x00000002, 0x00000000);
49 nv_mask(dev, 0x000200, 0x00000002, 0x00000002);
50 return 0;
51}
52
53static void
54nv98_ppp_destroy(struct drm_device *dev, int engine)
55{
56 struct nv98_ppp_engine *pppp = nv_engine(dev, engine);
57
58 NVOBJ_ENGINE_DEL(dev, PPP);
59
60 kfree(pppp);
61}
62
63int
64nv98_ppp_create(struct drm_device *dev)
65{
66 struct nv98_ppp_engine *pppp;
67
68 pppp = kzalloc(sizeof(*pppp), GFP_KERNEL);
69 if (!pppp)
70 return -ENOMEM;
71
72 pppp->base.destroy = nv98_ppp_destroy;
73 pppp->base.init = nv98_ppp_init;
74 pppp->base.fini = nv98_ppp_fini;
75
76 NVOBJ_ENGINE_ADD(dev, PPP, &pppp->base);
77 return 0;
78}