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

« back to all changes in this revision

Viewing changes to src/sna/kgem.h

  • Committer: Package Import Robot
  • Author(s): Timo Aaltonen
  • Date: 2012-09-29 16:45:35 UTC
  • mfrom: (1.4.24)
  • Revision ID: package-import@ubuntu.com-20120929164535-g15mwstkty0de7ki
Tags: 2:2.20.9-0ubuntu1
* Merge from unrelease debian git.
  - fixes racy UXA pageflip code (LP: #966744)
* Drop dont-run-intel-mode-fini-before-preinit.diff, upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
262
262
 
263
263
uint32_t kgem_bo_get_binding(struct kgem_bo *bo, uint32_t format);
264
264
void kgem_bo_set_binding(struct kgem_bo *bo, uint32_t format, uint16_t offset);
 
265
int kgem_bo_get_swizzling(struct kgem *kgem, struct kgem_bo *bo);
265
266
 
266
267
void kgem_bo_retire(struct kgem *kgem, struct kgem_bo *bo);
267
268
bool kgem_retire(struct kgem *kgem);
344
345
static inline void _kgem_set_mode(struct kgem *kgem, enum kgem_mode mode)
345
346
{
346
347
        assert(kgem->mode == KGEM_NONE);
 
348
        assert(kgem->nbatch == 0);
347
349
        kgem->context_switch(kgem, mode);
348
350
        kgem->mode = mode;
349
351
}
418
420
void *kgem_bo_map__debug(struct kgem *kgem, struct kgem_bo *bo);
419
421
void *kgem_bo_map__cpu(struct kgem *kgem, struct kgem_bo *bo);
420
422
void kgem_bo_sync__cpu(struct kgem *kgem, struct kgem_bo *bo);
 
423
void *__kgem_bo_map__cpu(struct kgem *kgem, struct kgem_bo *bo);
 
424
void __kgem_bo_unmap__cpu(struct kgem *kgem, struct kgem_bo *bo, void *ptr);
421
425
uint32_t kgem_bo_flink(struct kgem *kgem, struct kgem_bo *bo);
422
426
 
423
427
bool kgem_bo_write(struct kgem *kgem, struct kgem_bo *bo,
493
497
        return bo->presumed_offset + kgem_bo_size(bo) <= kgem->aperture_mappable;
494
498
}
495
499
 
496
 
static inline bool kgem_bo_mapped(struct kgem_bo *bo)
 
500
static inline bool kgem_bo_mapped(struct kgem *kgem, struct kgem_bo *bo)
497
501
{
498
502
        DBG(("%s: map=%p, tiling=%d, domain=%d\n",
499
503
             __FUNCTION__, bo->map, bo->tiling, bo->domain));
501
505
        if (bo->map == NULL)
502
506
                return bo->tiling == I915_TILING_NONE && bo->domain == DOMAIN_CPU;
503
507
 
 
508
        if (bo->tiling == I915_TILING_X && !bo->scanout && kgem->has_llc)
 
509
                return IS_CPU_MAP(bo->map);
 
510
 
504
511
        return IS_CPU_MAP(bo->map) == !bo->tiling;
505
512
}
506
513
 
507
514
static inline bool kgem_bo_can_map(struct kgem *kgem, struct kgem_bo *bo)
508
515
{
509
 
        if (kgem_bo_mapped(bo))
 
516
        if (kgem_bo_mapped(kgem, bo))
510
517
                return true;
511
518
 
512
519
        if (!bo->tiling && kgem->has_llc)