~ubuntu-branches/debian/wheezy/xserver-xorg-video-intel/wheezy

« back to all changes in this revision

Viewing changes to src/intel_batchbuffer.c

  • Committer: Package Import Robot
  • Author(s): Cyril Brulebois, Timo Aaltonen
  • Date: 2011-11-19 12:46:57 UTC
  • mfrom: (26.1.11 sid)
  • Revision ID: package-import@ubuntu.com-20111119124657-zpht20ygj578uqwn
Tags: 2:2.17.0-1
[ Timo Aaltonen ]
New upstream release. (Closes: #635953)

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
#include "i915_drm.h"
41
41
#include "i965_reg.h"
42
42
 
 
43
#include "uxa.h"
 
44
 
43
45
#define DUMP_BATCHBUFFERS NULL // "/tmp/i915-batchbuffers.dump"
44
46
 
45
47
static void intel_end_vertex(intel_screen_private *intel)
137
139
                list_del(intel->flush_pixmaps.next);
138
140
}
139
141
 
 
142
static void intel_emit_post_sync_nonzero_flush(ScrnInfoPtr scrn)
 
143
{
 
144
        intel_screen_private *intel = intel_get_screen_private(scrn);
 
145
 
 
146
        /* keep this entire sequence of 3 PIPE_CONTROL cmds in one batch to
 
147
         * avoid upsetting the gpu. */
 
148
        BEGIN_BATCH(3*4);
 
149
        OUT_BATCH(BRW_PIPE_CONTROL | (4 - 2));
 
150
        OUT_BATCH(BRW_PIPE_CONTROL_CS_STALL |
 
151
                  BRW_PIPE_CONTROL_STALL_AT_SCOREBOARD);
 
152
        OUT_BATCH(0); /* address */
 
153
        OUT_BATCH(0); /* write data */
 
154
 
 
155
        OUT_BATCH(BRW_PIPE_CONTROL | (4 - 2));
 
156
        OUT_BATCH(BRW_PIPE_CONTROL_WRITE_QWORD);
 
157
        OUT_RELOC(intel->wa_scratch_bo,
 
158
                  I915_GEM_DOMAIN_INSTRUCTION, I915_GEM_DOMAIN_INSTRUCTION, 0);
 
159
        OUT_BATCH(0); /* write data */
 
160
 
 
161
        /* now finally the _real flush */
 
162
        OUT_BATCH(BRW_PIPE_CONTROL | (4 - 2));
 
163
        OUT_BATCH(BRW_PIPE_CONTROL_WC_FLUSH |
 
164
                  BRW_PIPE_CONTROL_TC_FLUSH |
 
165
                  BRW_PIPE_CONTROL_NOWRITE);
 
166
        OUT_BATCH(0); /* write address */
 
167
        OUT_BATCH(0); /* write data */
 
168
        ADVANCE_BATCH();
 
169
}
 
170
 
140
171
void intel_batch_emit_flush(ScrnInfoPtr scrn)
141
172
{
142
173
        intel_screen_private *intel = intel_get_screen_private(scrn);
154
185
                        OUT_BATCH(0);
155
186
                        ADVANCE_BATCH();
156
187
                } else  {
157
 
                        BEGIN_BATCH(4);
158
 
                        OUT_BATCH(BRW_PIPE_CONTROL | (4 - 2));
159
 
                        OUT_BATCH(BRW_PIPE_CONTROL_WC_FLUSH |
160
 
                                  BRW_PIPE_CONTROL_TC_FLUSH |
161
 
                                  BRW_PIPE_CONTROL_NOWRITE);
162
 
                        OUT_BATCH(0); /* write address */
163
 
                        OUT_BATCH(0); /* write data */
164
 
                        ADVANCE_BATCH();
 
188
                        if ((INTEL_INFO(intel)->gen == 60)) {
 
189
                                /* HW-Workaround for Sandybdrige */
 
190
                                intel_emit_post_sync_nonzero_flush(scrn);
 
191
                        } else {
 
192
                                BEGIN_BATCH(4);
 
193
                                OUT_BATCH(BRW_PIPE_CONTROL | (4 - 2));
 
194
                                OUT_BATCH(BRW_PIPE_CONTROL_WC_FLUSH |
 
195
                                          BRW_PIPE_CONTROL_TC_FLUSH |
 
196
                                          BRW_PIPE_CONTROL_NOWRITE);
 
197
                                OUT_BATCH(0); /* write address */
 
198
                                OUT_BATCH(0); /* write data */
 
199
                                ADVANCE_BATCH();
 
200
                        }
165
201
                }
166
202
        } else {
167
203
                flags = MI_WRITE_DIRTY_STATE | MI_INVALIDATE_MAP_CACHE;