~ubuntu-branches/ubuntu/utopic/xserver-xorg-video-intel/utopic

« back to all changes in this revision

Viewing changes to src/sna/sna.h

  • Committer: Package Import Robot
  • Author(s): Timo Aaltonen
  • Date: 2012-09-12 07:43:59 UTC
  • mfrom: (1.4.22)
  • Revision ID: package-import@ubuntu.com-20120912074359-i3h8ol6hoghbemoq
Tags: 2:2.20.7-0ubuntu1
Merge from unreleased debian git.

Show diffs side-by-side

added added

removed removed

Lines of Context:
47
47
#include <xorg-server.h>
48
48
 
49
49
#include <xf86Crtc.h>
 
50
#if XF86_CRTC_VERSION >= 5
 
51
#define HAS_PIXMAP_SHARING 1
 
52
#endif
 
53
 
50
54
#include <xf86str.h>
51
55
#include <windowstr.h>
52
56
#include <glyphstr.h>
119
123
 
120
124
#define SOURCE_BIAS 4
121
125
        uint16_t source_count;
122
 
        uint8_t pinned :1;
 
126
        uint8_t pinned :3;
 
127
#define PIN_SCANOUT 0x1
 
128
#define PIN_DRI 0x2
 
129
#define PIN_PRIME 0x4
123
130
        uint8_t mapped :1;
124
131
        uint8_t shm :1;
125
132
        uint8_t clear :1;
149
156
                return get_window_pixmap((WindowPtr)drawable);
150
157
}
151
158
 
 
159
extern DevPrivateKeyRec sna_pixmap_key;
 
160
 
152
161
constant static inline struct sna_pixmap *sna_pixmap(PixmapPtr pixmap)
153
162
{
154
 
        return ((void **)pixmap->devPrivates)[1];
 
163
        return ((void **)dixGetPrivateAddr(&pixmap->devPrivates, &sna_pixmap_key))[1];
155
164
}
156
165
 
157
166
static inline struct sna_pixmap *sna_pixmap_from_drawable(DrawablePtr drawable)
167
176
 
168
177
static inline struct sna_gc *sna_gc(GCPtr gc)
169
178
{
170
 
        return (struct sna_gc *)gc->devPrivates;
 
179
        return dixGetPrivateAddr(&gc->devPrivates, &sna_gc_key);
171
180
}
172
181
 
173
182
enum {
309
318
constant static inline struct sna *
310
319
to_sna_from_pixmap(PixmapPtr pixmap)
311
320
{
312
 
        return *(void **)pixmap->devPrivates;
 
321
        return ((void **)dixGetPrivateAddr(&pixmap->devPrivates, &sna_pixmap_key))[0];
313
322
}
314
323
 
315
324
constant static inline struct sna *
536
545
        return sna_pixmap(pixmap)->gpu_bo;
537
546
}
538
547
 
539
 
static inline struct kgem_bo *sna_pixmap_pin(PixmapPtr pixmap)
 
548
static inline struct kgem_bo *sna_pixmap_pin(PixmapPtr pixmap, unsigned flags)
540
549
{
541
550
        struct sna_pixmap *priv;
542
551
 
544
553
        if (!priv)
545
554
                return NULL;
546
555
 
547
 
        priv->pinned = 1;
 
556
        priv->pinned |= flags;
548
557
        return priv->gpu_bo;
549
558
}
550
559