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

« back to all changes in this revision

Viewing changes to src/mesa/drivers/dri/i965/brw_state_batch.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:
97
97
{
98
98
   brw_clear_batch_cache(brw);
99
99
}
 
100
 
 
101
/**
 
102
 * Allocates a block of space in the batchbuffer for indirect state.
 
103
 *
 
104
 * We don't want to allocate separate BOs for every bit of indirect
 
105
 * state in the driver.  It means overallocating by a significant
 
106
 * margin (4096 bytes, even if the object is just a 20-byte surface
 
107
 * state), and more buffers to walk and count for aperture size checking.
 
108
 *
 
109
 * However, due to the restrictions inposed by the aperture size
 
110
 * checking performance hacks, we can't have the batch point at a
 
111
 * separate indirect state buffer, because once the batch points at
 
112
 * it, no more relocations can be added to it.  So, we sneak these
 
113
 * buffers in at the top of the batchbuffer.
 
114
 */
 
115
void *
 
116
brw_state_batch(struct brw_context *brw,
 
117
                int size,
 
118
                int alignment,
 
119
                drm_intel_bo **out_bo,
 
120
                uint32_t *out_offset)
 
121
{
 
122
   struct intel_batchbuffer *batch = brw->intel.batch;
 
123
   uint32_t offset;
 
124
 
 
125
   assert(size < batch->buf->size);
 
126
   offset = ROUND_DOWN_TO(batch->state_batch_offset - size, alignment);
 
127
 
 
128
   /* If allocating from the top would wrap below the batchbuffer, or
 
129
    * if the batch's used space (plus the reserved pad) collides with our
 
130
    * space, then flush and try again.
 
131
    */
 
132
   if (batch->state_batch_offset < size ||
 
133
       offset < batch->ptr - batch->map + batch->reserved_space) {
 
134
      intel_batchbuffer_flush(batch);
 
135
      offset = ROUND_DOWN_TO(batch->state_batch_offset - size, alignment);
 
136
   }
 
137
 
 
138
   batch->state_batch_offset = offset;
 
139
 
 
140
   if (*out_bo != batch->buf) {
 
141
      drm_intel_bo_unreference(*out_bo);
 
142
      drm_intel_bo_reference(batch->buf);
 
143
      *out_bo = batch->buf;
 
144
   }
 
145
 
 
146
   *out_offset = offset;
 
147
   return batch->map + offset;
 
148
}