~ubuntu-branches/ubuntu/natty/mesa/natty-proposed

« back to all changes in this revision

Viewing changes to src/gallium/winsys/i915/drm/i915_drm_fence.c

  • Committer: Bazaar Package Importer
  • Author(s): Robert Hooker, Robert Hooker, Christopher James Halse Rogers
  • Date: 2010-09-14 08:55:40 UTC
  • mfrom: (1.2.28 upstream)
  • Revision ID: james.westby@ubuntu.com-20100914085540-m4fpl0hdjlfd4jgz
Tags: 7.9~git20100909-0ubuntu1
[ Robert Hooker ]
* New upstream git snapshot up to commit 94118fe2d4b1e5 (LP: #631413)
* New features include ATI HD5xxx series support in r600, and a vastly
  improved glsl compiler.
* Remove pre-generated .pc's, use the ones generated at build time
  instead.
* Remove all references to mesa-utils now that its no longer shipped
  with the mesa source.
* Disable the experimental ARB_fragment_shader option by default on
  i915, it exposes incomplete functionality that breaks KDE compositing
  among other things. It can be enabled via driconf still. (LP: #628930).

[ Christopher James Halse Rogers ]
* debian/patches/04_osmesa_version.diff:
  - Refresh for new upstream
* Bugs fixed in this release:
  - Fixes severe rendering corruption in Unity on radeon (LP: #628727,
    LP: #596292, LP: #599741, LP: #630315, LP: #613694, LP: #599741).
  - Also fixes rendering in gnome-shell (LP: #578619).
  - Flickering in OpenGL apps on radeon (LP: #626943, LP: #610541).
  - Provides preliminary support for new intel chips (LP: #601052).
* debian/rules:
  - Update configure flags to match upstream reshuffling.
  - Explicitly remove gallium DRI drivers that we don't want to ship.
* Update debian/gbp.conf for this Maverick-specific packaging
* libegl1-mesa-dri-x11,kms: There are no longer separate kms or x11 drivers
  for EGL, libegl1-mesa-drivers now contains a single driver that provides
  both backends.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
#include "i915_drm_winsys.h"
 
3
#include "util/u_memory.h"
 
4
#include "util/u_atomic.h"
 
5
#include "util/u_inlines.h"
 
6
 
 
7
/**
 
8
 * Because gem does not have fence's we have to create our own fences.
 
9
 *
 
10
 * They work by keeping the batchbuffer around and checking if that has
 
11
 * been idled. If bo is NULL fence has expired.
 
12
 */
 
13
struct i915_drm_fence
 
14
{
 
15
   struct pipe_reference reference;
 
16
   drm_intel_bo *bo;
 
17
};
 
18
 
 
19
 
 
20
struct pipe_fence_handle *
 
21
i915_drm_fence_create(drm_intel_bo *bo)
 
22
{
 
23
   struct i915_drm_fence *fence = CALLOC_STRUCT(i915_drm_fence);
 
24
 
 
25
   pipe_reference_init(&fence->reference, 1);
 
26
   /* bo is null if fence already expired */
 
27
   if (bo) {
 
28
      drm_intel_bo_reference(bo);
 
29
      fence->bo = bo;
 
30
   }
 
31
 
 
32
   return (struct pipe_fence_handle *)fence;
 
33
}
 
34
 
 
35
static void
 
36
i915_drm_fence_reference(struct i915_winsys *iws,
 
37
                          struct pipe_fence_handle **ptr,
 
38
                          struct pipe_fence_handle *fence)
 
39
{
 
40
   struct i915_drm_fence *old = (struct i915_drm_fence *)*ptr;
 
41
   struct i915_drm_fence *f = (struct i915_drm_fence *)fence;
 
42
 
 
43
   if (pipe_reference(&((struct i915_drm_fence *)(*ptr))->reference, &f->reference)) {
 
44
      if (old->bo)
 
45
         drm_intel_bo_unreference(old->bo);
 
46
      FREE(old);
 
47
   }
 
48
   *ptr = fence;
 
49
}
 
50
 
 
51
static int
 
52
i915_drm_fence_signalled(struct i915_winsys *iws,
 
53
                          struct pipe_fence_handle *fence)
 
54
{
 
55
   assert(0);
 
56
 
 
57
   return 0;
 
58
}
 
59
 
 
60
static int
 
61
i915_drm_fence_finish(struct i915_winsys *iws,
 
62
                       struct pipe_fence_handle *fence)
 
63
{
 
64
   struct i915_drm_fence *f = (struct i915_drm_fence *)fence;
 
65
 
 
66
   /* fence already expired */
 
67
   if (!f->bo)
 
68
      return 0;
 
69
 
 
70
   drm_intel_bo_wait_rendering(f->bo);
 
71
   drm_intel_bo_unreference(f->bo);
 
72
   f->bo = NULL;
 
73
 
 
74
   return 0;
 
75
}
 
76
 
 
77
void
 
78
i915_drm_winsys_init_fence_functions(struct i915_drm_winsys *idws)
 
79
{
 
80
   idws->base.fence_reference = i915_drm_fence_reference;
 
81
   idws->base.fence_signalled = i915_drm_fence_signalled;
 
82
   idws->base.fence_finish = i915_drm_fence_finish;
 
83
}