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

« back to all changes in this revision

Viewing changes to src/mesa/drivers/dri/i965/brw_wm_state.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:
104
104
   key->uses_kill = fp->UsesKill || ctx->Color.AlphaEnabled;
105
105
   key->is_glsl = bfp->isGLSL;
106
106
 
107
 
   /* temporary sanity check assertion */
108
 
   ASSERT(bfp->isGLSL == brw_wm_is_glsl(fp));
 
107
   /* If using the fragment shader backend, the program is always
 
108
    * 8-wide.
 
109
    */
 
110
   if (ctx->Shader.CurrentProgram) {
 
111
      int i;
 
112
 
 
113
      for (i = 0; i < ctx->Shader.CurrentProgram->_NumLinkedShaders; i++) {
 
114
         struct brw_shader *shader =
 
115
            (struct brw_shader *)ctx->Shader.CurrentProgram->_LinkedShaders[i];;
 
116
 
 
117
         if (shader->base.Type == GL_FRAGMENT_SHADER &&
 
118
             shader->ir != NULL) {
 
119
            key->is_glsl = GL_TRUE;
 
120
         }
 
121
      }
 
122
   }
109
123
 
110
124
   /* _NEW_DEPTH */
111
125
   key->stats_wm = intel->stats_wm;
122
136
/**
123
137
 * Setup wm hardware state.  See page 225 of Volume 2
124
138
 */
125
 
static dri_bo *
 
139
static drm_intel_bo *
126
140
wm_unit_create_from_key(struct brw_context *brw, struct brw_wm_unit_key *key,
127
 
                        dri_bo **reloc_bufs)
 
141
                        drm_intel_bo **reloc_bufs)
128
142
{
129
143
   struct intel_context *intel = &brw->intel;
130
144
   struct brw_wm_unit_state wm;
131
 
   dri_bo *bo;
 
145
   drm_intel_bo *bo;
132
146
 
133
147
   memset(&wm, 0, sizeof(wm));
134
148
 
213
227
                         &wm, sizeof(wm));
214
228
 
215
229
   /* Emit WM program relocation */
216
 
   dri_bo_emit_reloc(bo,
217
 
                     I915_GEM_DOMAIN_INSTRUCTION, 0,
218
 
                     wm.thread0.grf_reg_count << 1,
219
 
                     offsetof(struct brw_wm_unit_state, thread0),
220
 
                     brw->wm.prog_bo);
 
230
   drm_intel_bo_emit_reloc(bo, offsetof(struct brw_wm_unit_state, thread0),
 
231
                           brw->wm.prog_bo, wm.thread0.grf_reg_count << 1,
 
232
                           I915_GEM_DOMAIN_INSTRUCTION, 0);
221
233
 
222
234
   /* Emit scratch space relocation */
223
235
   if (key->total_scratch != 0) {
224
 
      dri_bo_emit_reloc(bo,
225
 
                        0, 0,
226
 
                        wm.thread2.per_thread_scratch_space,
227
 
                        offsetof(struct brw_wm_unit_state, thread2),
228
 
                        brw->wm.scratch_bo);
 
236
      drm_intel_bo_emit_reloc(bo, offsetof(struct brw_wm_unit_state, thread2),
 
237
                              brw->wm.scratch_bo,
 
238
                              wm.thread2.per_thread_scratch_space,
 
239
                              I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER);
229
240
   }
230
241
 
231
242
   /* Emit sampler state relocation */
232
243
   if (key->sampler_count != 0) {
233
 
      dri_bo_emit_reloc(bo,
234
 
                        I915_GEM_DOMAIN_INSTRUCTION, 0,
235
 
                        wm.wm4.stats_enable | (wm.wm4.sampler_count << 2),
236
 
                        offsetof(struct brw_wm_unit_state, wm4),
237
 
                        brw->wm.sampler_bo);
 
244
      drm_intel_bo_emit_reloc(bo, offsetof(struct brw_wm_unit_state, wm4),
 
245
                              brw->wm.sampler_bo, (wm.wm4.stats_enable |
 
246
                                                   (wm.wm4.sampler_count << 2)),
 
247
                              I915_GEM_DOMAIN_INSTRUCTION, 0);
238
248
   }
239
249
 
240
250
   return bo;
245
255
{
246
256
   struct intel_context *intel = &brw->intel;
247
257
   struct brw_wm_unit_key key;
248
 
   dri_bo *reloc_bufs[3];
 
258
   drm_intel_bo *reloc_bufs[3];
249
259
   wm_unit_populate_key(brw, &key);
250
260
 
251
261
   /* Allocate the necessary scratch space if we haven't already.  Don't
257
267
      GLuint total = key.total_scratch * brw->wm_max_threads;
258
268
 
259
269
      if (brw->wm.scratch_bo && total > brw->wm.scratch_bo->size) {
260
 
         dri_bo_unreference(brw->wm.scratch_bo);
 
270
         drm_intel_bo_unreference(brw->wm.scratch_bo);
261
271
         brw->wm.scratch_bo = NULL;
262
272
      }
263
273
      if (brw->wm.scratch_bo == NULL) {
264
 
         brw->wm.scratch_bo = dri_bo_alloc(intel->bufmgr,
265
 
                                           "wm scratch",
266
 
                                           total,
267
 
                                           4096);
 
274
         brw->wm.scratch_bo = drm_intel_bo_alloc(intel->bufmgr,
 
275
                                                 "wm scratch",
 
276
                                                 total,
 
277
                                                 4096);
268
278
      }
269
279
   }
270
280
 
272
282
   reloc_bufs[1] = brw->wm.scratch_bo;
273
283
   reloc_bufs[2] = brw->wm.sampler_bo;
274
284
 
275
 
   dri_bo_unreference(brw->wm.state_bo);
 
285
   drm_intel_bo_unreference(brw->wm.state_bo);
276
286
   brw->wm.state_bo = brw_search_cache(&brw->cache, BRW_WM_UNIT,
277
287
                                       &key, sizeof(key),
278
288
                                       reloc_bufs, 3,