~ubuntu-branches/ubuntu/trusty/xserver-xorg-video-nouveau/trusty

« back to all changes in this revision

Viewing changes to src/nouveau_drmif.h

  • Committer: Bazaar Package Importer
  • Author(s): Chris Lamb
  • Date: 2009-02-05 00:21:35 UTC
  • mfrom: (1.1.3 upstream) (2.1.1 experimental)
  • Revision ID: james.westby@ubuntu.com-20090205002135-wjjfsjsda0rz6w0d
Tags: 1:0.0.10~git+20090205+4dfd0b1-1
* New upstream snapshot (Closes: #514080)
  - 4dfd0b1... oops
  - e02813a... link against libdrm_nouveau (installed with libdrm)
  - 2c06308... require drm 0.0.12
  - 29aa134... fix NoAccel from when map/unmap became stricter
  - 62adc55... Revert "Improve the NoAccel situation, but it's not working 
    yet."
  - 285027a... Improve the NoAccel situation, but it's not working yet.
  - 5e63c78... Revert "nv50: make entire offscreen area tiled, use extra 
    blits to scanout buffer"
  - 6c3f8da... nv50: make entire offscreen area tiled, use extra blits to 
    scanout buffer
  - 6179102... nv10: use the correct 3d object on NV1A
  - dfd87ec... xv: Unmap filter table BO after init so it can be validated 
    (nv30,40)
  - b8de749... Avoid any risk of parsing oscillation on if_is_24bit
  - 0a0bb72... Split up parsing the bit structure, complain when necessary 
    tables are missing
  - 2d86018... Swap the order of calling parse_fp_mode_table and 
    parse_lvds_manufacturer_table
  - 8c6b3a8... Make calling of init bios functions common
  - 9b32034... Don't read obviously useless bios images, and drop 5x 
    reading on PROM
  - 63aa210... Implement bios I2C opcode 4E (untested)
  - a81f159... Handle I2C device 0xff fallback for I2C bios opcodes
  - 34e967e... Fix pasta error in bios opcode 4D
  - 786dd36... Fix nv04+ IFC upload and frag prog upload
  - 3ab65cf... add vm_vram_base field to nouveau_device instead of 
    hardcoding 512MiB
  - d833c81... nv50/xv: previous xv commit was bonged - fix that
  - 0f741eb... exa: small cleanup
  - c10c3c9... exa: mass renaming and movement of nv04 solid/copy code to 
    nv04_exa.c
  - 81ace5d... exa: remove driver pixmaps path that never worked here anyway
  - 4b1829e... exa: remove NVCopyROP table..
  - 410788d... blow up horribly if GPU access to mapped buffer is attempted
  - 4c9346b... bo_del->bo_ref, closer to ng api
  - c533f86... exa: same for UTS state
  - 02677c0... exa: ensure DFS state is updated across flushes
  - 69d02bc... nv50: remove some redundant init, this stuff is done as 
    required now
  - 60aea90... nv50: forgotten buffer access flags during init
  - 5a382dd... nv10/exa: resubmit state in composite as needed
  - d4ff8db... nv30/exa: resubmit state in composite as needed
  - b71ebcb... nv40/exa: resubmit state in composite as necessary
  - 6ddaddb... exa: rework common pre-nv50 code in the same way nv50 code 
    just was
  - f36fa31... nv50/xv: ensure entire frame will fit in pushbuf without 
    causing a flush
  - 1b48331... nv50/exa: ensure buffer usage is tracked correctly
  - 7e64426... remove unconditional FIRE_RING() in DoneComposite() hooks
  - 34fc446... hack a flush_notify() hook in to match ng
  - d9da090... Drop GPU resources on LeaveVT, reaquire on EnterVT
  - 1eb8b87... Enable ShadowFB for DRM-less mode.
  - 4874638... Allow NoAccel operation without the DRM module present.
  - f78aeed... if CARD_INIT ioctl fails, report it instead of continuing
  - cf65b87... Fix stupidity introduced in 
    25de6b867f319099dac05ba84f170da0f0e6c803
  - 55e9cdd... Split out a function for finding the panel power sequencer 
    stuff
  - 1b3546b... Move the bios flat-panel pointers back into the bios struct
  - d29c481... Remove a BITism from BMP parsing path, and move old style 
    BMP init into common path
  - 3e971f6... randr12: lock independent crtc base registers separately 
    (#19620)
  - ffbca72... randr12: code motion and allow ramdac580 setting on nv40
  - 75a0376... randr12: better selection of nv4x single pll mode and some 
    notes
  - 767fcea... randr12: no mmiotrace indication that the blob ever clears 
    these bits
  - 985ac72... randr12: no mmiotrace evidence for nv47 using the special 
    pll bits
  - 3ef6b41... twoStagePLL is actually a description of cards using two PLL 
    regs
  - c7a423a... nv04 blitter: use correct number of dma params for real nv04
  - 25de6b8... Complain more about weird bios images
  - 4d72981... randr12: avoid classic macro error
  - 133c1a5... No need of separate allocation for bios image
  - 8a25049... Make turning on bios execution logging slightly easier
  - 54d43c4... nv50: small fix
  - 5c9f8d3... nv50: Add a fallback for non-repeating XRGB pixmaps.
  - 0321e67... nv50: don't segfault if preinit fails before display setup 
    done
* Don't include .git in .orig.tar.gz.
* Replace "(C)" in debian/copyright with "©" to appease lintian.
* Replace usage of `dh_clean -k` with dh_prep.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright 2007 Nouveau Project
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 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
18
 
 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
19
 
 * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
 
 * SOFTWARE.
21
 
 */
22
 
 
23
 
#ifndef __NOUVEAU_DRMIF_H__
24
 
#define __NOUVEAU_DRMIF_H__
25
 
 
26
 
#include <stdint.h>
27
 
#include <xf86drm.h>
28
 
#include <nouveau_drm.h>
29
 
 
30
 
#include "nouveau_device.h"
31
 
#include "nouveau_channel.h"
32
 
#include "nouveau_grobj.h"
33
 
#include "nouveau_notifier.h"
34
 
#include "nouveau_bo.h"
35
 
#include "nouveau_local.h"
36
 
 
37
 
struct nouveau_device_priv {
38
 
        struct nouveau_device base;
39
 
 
40
 
        int fd;
41
 
        drm_context_t ctx;
42
 
        drmLock *lock;
43
 
        int needs_close;
44
 
};
45
 
#define nouveau_device(n) ((struct nouveau_device_priv *)(n))
46
 
 
47
 
NOUVEAU_PRIVATE int
48
 
nouveau_device_open_existing(struct nouveau_device **, int close,
49
 
                             int fd, drm_context_t ctx);
50
 
 
51
 
NOUVEAU_PRIVATE int
52
 
nouveau_device_open(struct nouveau_device **, const char *busid);
53
 
 
54
 
NOUVEAU_PRIVATE void
55
 
nouveau_device_close(struct nouveau_device **);
56
 
 
57
 
NOUVEAU_PRIVATE int
58
 
nouveau_device_get_param(struct nouveau_device *, uint64_t param, uint64_t *v);
59
 
 
60
 
NOUVEAU_PRIVATE int
61
 
nouveau_device_set_param(struct nouveau_device *, uint64_t param, uint64_t val);
62
 
 
63
 
struct nouveau_channel_priv {
64
 
        struct nouveau_channel base;
65
 
 
66
 
        struct drm_nouveau_channel_alloc drm;
67
 
 
68
 
        struct {
69
 
                struct nouveau_grobj *grobj;
70
 
                uint32_t seq;
71
 
        } subchannel[8];
72
 
        uint32_t subc_sequence;
73
 
 
74
 
        uint32_t *pushbuf;
75
 
        void     *notifier_block;
76
 
 
77
 
        volatile uint32_t *user;
78
 
        volatile uint32_t *put;
79
 
        volatile uint32_t *get;
80
 
        volatile uint32_t *ref_cnt;
81
 
 
82
 
        struct {
83
 
                uint32_t base, max;
84
 
                uint32_t cur, put;
85
 
                uint32_t free;
86
 
 
87
 
                int push_free;
88
 
        } dma;
89
 
 
90
 
        struct nouveau_bo_reloc *relocs;
91
 
        int num_relocs;
92
 
        int max_relocs;
93
 
};
94
 
#define nouveau_channel(n) ((struct nouveau_channel_priv *)(n))
95
 
 
96
 
NOUVEAU_PRIVATE int
97
 
nouveau_channel_alloc(struct nouveau_device *, uint32_t fb, uint32_t tt,
98
 
                      struct nouveau_channel **);
99
 
 
100
 
NOUVEAU_PRIVATE void
101
 
nouveau_channel_free(struct nouveau_channel **);
102
 
 
103
 
struct nouveau_grobj_priv {
104
 
        struct nouveau_grobj base;
105
 
};
106
 
#define nouveau_grobj(n) ((struct nouveau_grobj_priv *)(n))
107
 
 
108
 
NOUVEAU_PRIVATE int nouveau_grobj_alloc(struct nouveau_channel *, uint32_t handle,
109
 
                               int class, struct nouveau_grobj **);
110
 
NOUVEAU_PRIVATE int nouveau_grobj_ref(struct nouveau_channel *, uint32_t handle,
111
 
                             struct nouveau_grobj **);
112
 
NOUVEAU_PRIVATE void nouveau_grobj_free(struct nouveau_grobj **);
113
 
 
114
 
 
115
 
struct nouveau_notifier_priv {
116
 
        struct nouveau_notifier base;
117
 
 
118
 
        struct drm_nouveau_notifierobj_alloc drm;
119
 
        volatile void *map;
120
 
};
121
 
#define nouveau_notifier(n) ((struct nouveau_notifier_priv *)(n))
122
 
 
123
 
NOUVEAU_PRIVATE int
124
 
nouveau_notifier_alloc(struct nouveau_channel *, uint32_t handle, int count,
125
 
                       struct nouveau_notifier **);
126
 
 
127
 
NOUVEAU_PRIVATE void
128
 
nouveau_notifier_free(struct nouveau_notifier **);
129
 
 
130
 
NOUVEAU_PRIVATE void
131
 
nouveau_notifier_reset(struct nouveau_notifier *, int id);
132
 
 
133
 
NOUVEAU_PRIVATE uint32_t
134
 
nouveau_notifier_status(struct nouveau_notifier *, int id);
135
 
 
136
 
NOUVEAU_PRIVATE uint32_t
137
 
nouveau_notifier_return_val(struct nouveau_notifier *, int id);
138
 
 
139
 
NOUVEAU_PRIVATE int
140
 
nouveau_notifier_wait_status(struct nouveau_notifier *, int id, int status,
141
 
                             int timeout);
142
 
 
143
 
struct nouveau_bo_priv {
144
 
        struct nouveau_bo base;
145
 
 
146
 
        struct drm_nouveau_mem_alloc drm;
147
 
        void *map;
148
 
 
149
 
        int refcount;
150
 
};
151
 
 
152
 
struct nouveau_bo_reloc {
153
 
        struct nouveau_bo_priv *bo;
154
 
        uint32_t *ptr;
155
 
        uint32_t flags;
156
 
        uint32_t data, vor, tor;
157
 
};
158
 
 
159
 
#define nouveau_bo(n) ((struct nouveau_bo_priv *)(n))
160
 
 
161
 
NOUVEAU_PRIVATE int
162
 
nouveau_bo_new(struct nouveau_device *, uint32_t flags, int align, int size,
163
 
               struct nouveau_bo **);
164
 
 
165
 
NOUVEAU_PRIVATE int
166
 
nouveau_bo_ref(struct nouveau_device *, uint64_t handle, struct nouveau_bo **);
167
 
 
168
 
NOUVEAU_PRIVATE void
169
 
nouveau_bo_del(struct nouveau_bo **);
170
 
 
171
 
NOUVEAU_PRIVATE int
172
 
nouveau_bo_map(struct nouveau_bo *, uint32_t flags);
173
 
 
174
 
NOUVEAU_PRIVATE void
175
 
nouveau_bo_unmap(struct nouveau_bo *);
176
 
 
177
 
NOUVEAU_PRIVATE void
178
 
nouveau_bo_emit_reloc(struct nouveau_channel *chan, void *ptr,
179
 
                      struct nouveau_bo *, uint32_t data, uint32_t flags,
180
 
                      uint32_t vor, uint32_t tor);
181
 
 
182
 
NOUVEAU_PRIVATE void
183
 
nouveau_bo_validate(struct nouveau_channel *);
184
 
 
185
 
#endif