intel: track bufmgr move to libdrm_intel and bufmgr_fake irq emit/wait change.
authorEric Anholt <eric@anholt.net>
Sat, 6 Sep 2008 02:09:43 +0000 (03:09 +0100)
committerEric Anholt <eric@anholt.net>
Wed, 10 Sep 2008 20:59:45 +0000 (13:59 -0700)
26 files changed:
src/mesa/drivers/dri/i915/Makefile
src/mesa/drivers/dri/i915/i830_texstate.c
src/mesa/drivers/dri/i915/i915_texstate.c
src/mesa/drivers/dri/i965/Makefile
src/mesa/drivers/dri/i965/brw_cc.c
src/mesa/drivers/dri/i965/brw_clip_state.c
src/mesa/drivers/dri/i965/brw_draw.h
src/mesa/drivers/dri/i965/brw_gs_state.c
src/mesa/drivers/dri/i965/brw_sf_state.c
src/mesa/drivers/dri/i965/brw_state_upload.c
src/mesa/drivers/dri/i965/brw_vs_state.c
src/mesa/drivers/dri/i965/brw_wm_sampler_state.c
src/mesa/drivers/dri/i965/brw_wm_state.c
src/mesa/drivers/dri/i965/brw_wm_surface_state.c
src/mesa/drivers/dri/intel/intel_batchbuffer.c
src/mesa/drivers/dri/intel/intel_batchbuffer.h
src/mesa/drivers/dri/intel/intel_blit.h
src/mesa/drivers/dri/intel/intel_buffer_objects.c
src/mesa/drivers/dri/intel/intel_context.c
src/mesa/drivers/dri/intel/intel_context.h
src/mesa/drivers/dri/intel/intel_ioctl.c
src/mesa/drivers/dri/intel/intel_ioctl.h
src/mesa/drivers/dri/intel/intel_regions.c
src/mesa/drivers/dri/intel/intel_regions.h
src/mesa/drivers/dri/intel/intel_screen.c
src/mesa/drivers/dri/intel/intel_screen.h

index fd77980ebf8c4bcf1bbaa593498ba850478ab579..8f09c9f71e5c2d3bac3d86da8b79258f522062cc 100644 (file)
@@ -64,6 +64,8 @@ DRIVER_DEFINES = -I../intel -I../intel/server -DI915 \
        $(shell pkg-config libdrm --atleast-version=2.3.1 \
                                && echo "-DDRM_VBLANK_FLIP=DRM_VBLANK_FLIP")
 
+DRI_LIB_DEPS += -ldrm_intel
+
 include ../Makefile.template
 
 intel_decode.o: ../intel/intel_decode.c
index 4e9b022eaeb5448644f5dfc2b277d573c291f200..314bbe32b65d0bda069c4d01d8830a2f33dde085 100644 (file)
@@ -28,7 +28,6 @@
 #include "mtypes.h"
 #include "enums.h"
 #include "texformat.h"
-#include "dri_bufmgr.h"
 
 #include "intel_mipmap_tree.h"
 #include "intel_tex.h"
index 1b1122cd8aa8716e5ec563e7b5559c6f8946527f..48137f025f02ecc0a2acbf0c30e7839bdcbe4e4b 100644 (file)
@@ -28,7 +28,6 @@
 #include "mtypes.h"
 #include "enums.h"
 #include "texformat.h"
-#include "dri_bufmgr.h"
 
 #include "intel_mipmap_tree.h"
 #include "intel_tex.h"
index 8fa205e79ff0524141d5eda7b7b3aa8477c81ae0..e72790c687180c13856e40a6ba0ce854307b6691 100644 (file)
@@ -91,6 +91,8 @@ ASM_SOURCES =
 
 DRIVER_DEFINES = -I../intel -I../intel/server
 
+DRI_LIB_DEPS += -ldrm_intel
+
 include ../Makefile.template
 
 symlinks:
index d662cf75211bf5f4b75e152e892004c926985b2e..0458bf598329dd6a9dc08d97a93e8d7c973efb61 100644 (file)
@@ -255,12 +255,12 @@ cc_unit_create_from_key(struct brw_context *brw, struct brw_cc_unit_key *key)
                         NULL, NULL);
 
    /* Emit CC viewport relocation */
-   intel_bo_emit_reloc(bo,
-                      I915_GEM_DOMAIN_INSTRUCTION,
-                      0,
-                      0,
-                      offsetof(struct brw_cc_unit_state, cc4),
-                      brw->cc.vp_bo);
+   dri_bo_emit_reloc(bo,
+                    I915_GEM_DOMAIN_INSTRUCTION,
+                    0,
+                    0,
+                    offsetof(struct brw_cc_unit_state, cc4),
+                    brw->cc.vp_bo);
 
    return bo;
 }
index ae904c6253d3005785d4ff9f45669fca45d4931b..51045f91880328d54bbc1a66b44e7da566e74d96 100644 (file)
@@ -119,12 +119,12 @@ clip_unit_create_from_key(struct brw_context *brw,
 
    /* Emit clip program relocation */
    assert(brw->clip.prog_bo);
-   intel_bo_emit_reloc(bo,
-                      I915_GEM_DOMAIN_INSTRUCTION,
-                      0,
-                      clip.thread0.grf_reg_count << 1,
-                      offsetof(struct brw_clip_unit_state, thread0),
-                      brw->clip.prog_bo);
+   dri_bo_emit_reloc(bo,
+                    I915_GEM_DOMAIN_INSTRUCTION,
+                    0,
+                    clip.thread0.grf_reg_count << 1,
+                    offsetof(struct brw_clip_unit_state, thread0),
+                    brw->clip.prog_bo);
 
    return bo;
 }
index 2a3e0c1c5bf77b132b977e704903828cf989a1ec..e0bba589d5aa95314654a413255a220731ea3bce 100644 (file)
@@ -31,7 +31,6 @@
 #include "mtypes.h"            /* for GLcontext... */
 #include "vbo/vbo.h"
 
-#include "dri_bufmgr.h"
 struct brw_context;
 
 
index ff2e3ab059817a6982adc7fc8e86c31c0e5605fa..633e17cc9d27f93171179478234e1ea958f65457 100644 (file)
@@ -106,11 +106,11 @@ gs_unit_create_from_key(struct brw_context *brw, struct brw_gs_unit_key *key)
 
    if (key->prog_active) {
       /* Emit GS program relocation */
-      intel_bo_emit_reloc(bo,
-                         I915_GEM_DOMAIN_INSTRUCTION, 0,
-                         gs.thread0.grf_reg_count << 1,
-                         offsetof(struct brw_gs_unit_state, thread0),
-                         brw->gs.prog_bo);
+      dri_bo_emit_reloc(bo,
+                       I915_GEM_DOMAIN_INSTRUCTION, 0,
+                       gs.thread0.grf_reg_count << 1,
+                       offsetof(struct brw_gs_unit_state, thread0),
+                       brw->gs.prog_bo);
    }
 
    return bo;
index 2478872b827c2e4041d5aa39e6a4ccc0a646998b..07d0b4c798a0a50136b42cc364015b482336a2c0 100644 (file)
@@ -251,18 +251,18 @@ sf_unit_create_from_key(struct brw_context *brw, struct brw_sf_unit_key *key,
                         NULL, NULL);
 
    /* Emit SF program relocation */
-   intel_bo_emit_reloc(bo,
-                      I915_GEM_DOMAIN_INSTRUCTION, 0,
-                      sf.thread0.grf_reg_count << 1,
-                      offsetof(struct brw_sf_unit_state, thread0),
-                      brw->sf.prog_bo);
+   dri_bo_emit_reloc(bo,
+                    I915_GEM_DOMAIN_INSTRUCTION, 0,
+                    sf.thread0.grf_reg_count << 1,
+                    offsetof(struct brw_sf_unit_state, thread0),
+                    brw->sf.prog_bo);
 
    /* Emit SF viewport relocation */
-   intel_bo_emit_reloc(bo,
-                      I915_GEM_DOMAIN_INSTRUCTION, 0,
-                      sf.sf5.front_winding | (sf.sf5.viewport_transform << 1),
-                      offsetof(struct brw_sf_unit_state, sf5),
-                      brw->sf.vp_bo);
+   dri_bo_emit_reloc(bo,
+                    I915_GEM_DOMAIN_INSTRUCTION, 0,
+                    sf.sf5.front_winding | (sf.sf5.viewport_transform << 1),
+                    offsetof(struct brw_sf_unit_state, sf5),
+                    brw->sf.vp_bo);
 
    return bo;
 }
index d1d319d92e63fe7d107f192732b735d5961035bb..7d4fd467b1cb320bf1dc8aeb6cf019c9492219ba 100644 (file)
@@ -33,7 +33,6 @@
 
 #include "brw_context.h"
 #include "brw_state.h"
-#include "dri_bufmgr.h"
 #include "intel_batchbuffer.h"
 
 /* This is used to initialize brw->state.atoms[].  We could use this
index 909b942610d84c40bc52ed4857cec1e02127b91c..24bf5567bd08163529489396e1239e58573d624b 100644 (file)
@@ -115,11 +115,11 @@ vs_unit_create_from_key(struct brw_context *brw, struct brw_vs_unit_key *key)
                         NULL, NULL);
 
    /* Emit VS program relocation */
-   intel_bo_emit_reloc(bo,
-                      I915_GEM_DOMAIN_INSTRUCTION, 0,
-                      vs.thread0.grf_reg_count << 1,
-                      offsetof(struct brw_vs_unit_state, thread0),
-                      brw->vs.prog_bo);
+   dri_bo_emit_reloc(bo,
+                    I915_GEM_DOMAIN_INSTRUCTION, 0,
+                    vs.thread0.grf_reg_count << 1,
+                    offsetof(struct brw_vs_unit_state, thread0),
+                    brw->vs.prog_bo);
 
    return bo;
 }
index 08d01823dee80e3f0b5ca94e94ac22b2e960a91c..e47dbe8b10126e47c6828725c7146b031ac05695 100644 (file)
@@ -303,12 +303,12 @@ static void upload_wm_samplers( struct brw_context *brw )
         if (!brw->attribs.Texture->Unit[i]._ReallyEnabled)
            continue;
 
-        intel_bo_emit_reloc(brw->wm.sampler_bo,
-                            I915_GEM_DOMAIN_INSTRUCTION, 0,
-                            0,
-                            i * sizeof(struct brw_sampler_state) +
-                            offsetof(struct brw_sampler_state, ss2),
-                            brw->wm.sdc_bo[i]);
+        dri_bo_emit_reloc(brw->wm.sampler_bo,
+                          I915_GEM_DOMAIN_INSTRUCTION, 0,
+                          0,
+                          i * sizeof(struct brw_sampler_state) +
+                          offsetof(struct brw_sampler_state, ss2),
+                          brw->wm.sdc_bo[i]);
       }
    }
 }
index f97d0dc2854dd6b80c265960e31197df8d980eea..61fe97a4634bb615c339c0dc1c5f0b02c227fd15 100644 (file)
@@ -34,7 +34,6 @@
 #include "brw_context.h"
 #include "brw_state.h"
 #include "brw_defines.h"
-#include "dri_bufmgr.h"
 #include "brw_wm.h"
 
 /***********************************************************************
@@ -199,28 +198,28 @@ wm_unit_create_from_key(struct brw_context *brw, struct brw_wm_unit_key *key,
                         NULL, NULL);
 
    /* Emit WM program relocation */
-   intel_bo_emit_reloc(bo,
-                      I915_GEM_DOMAIN_INSTRUCTION, 0,
-                      wm.thread0.grf_reg_count << 1,
-                      offsetof(struct brw_wm_unit_state, thread0),
-                      brw->wm.prog_bo);
+   dri_bo_emit_reloc(bo,
+                    I915_GEM_DOMAIN_INSTRUCTION, 0,
+                    wm.thread0.grf_reg_count << 1,
+                    offsetof(struct brw_wm_unit_state, thread0),
+                    brw->wm.prog_bo);
 
    /* Emit scratch space relocation */
    if (key->total_scratch != 0) {
-      intel_bo_emit_reloc(bo,
-                         0, 0,
-                         wm.thread2.per_thread_scratch_space,
-                         offsetof(struct brw_wm_unit_state, thread2),
-                         brw->wm.scratch_buffer);
+      dri_bo_emit_reloc(bo,
+                       0, 0,
+                       wm.thread2.per_thread_scratch_space,
+                       offsetof(struct brw_wm_unit_state, thread2),
+                       brw->wm.scratch_buffer);
    }
 
    /* Emit sampler state relocation */
    if (key->sampler_count != 0) {
-      intel_bo_emit_reloc(bo,
-                         I915_GEM_DOMAIN_INSTRUCTION, 0,
-                         wm.wm4.stats_enable | (wm.wm4.sampler_count << 2),
-                         offsetof(struct brw_wm_unit_state, wm4),
-                         brw->wm.sampler_bo);
+      dri_bo_emit_reloc(bo,
+                       I915_GEM_DOMAIN_INSTRUCTION, 0,
+                       wm.wm4.stats_enable | (wm.wm4.sampler_count << 2),
+                       offsetof(struct brw_wm_unit_state, wm4),
+                       brw->wm.sampler_bo);
    }
 
    return bo;
index 493d2b182ca45535303a681436ae5669745c6c71..8fcd50924f3de38a21526395719d7a9bbb33b41f 100644 (file)
@@ -234,11 +234,11 @@ brw_create_texture_surface( struct brw_context *brw,
 
    if (key->bo) {
       /* Emit relocation to surface contents */
-      intel_bo_emit_reloc(bo,
-                         I915_GEM_DOMAIN_SAMPLER, 0,
-                         0,
-                         offsetof(struct brw_surface_state, ss1),
-                         key->bo);
+      dri_bo_emit_reloc(bo,
+                       I915_GEM_DOMAIN_SAMPLER, 0,
+                       0,
+                       offsetof(struct brw_surface_state, ss1),
+                       key->bo);
    }
    return bo;
 }
@@ -374,13 +374,13 @@ brw_update_region_surface(struct brw_context *brw, struct intel_region *region,
          * them both.  We might be able to figure out from other state
          * a more restrictive relocation to emit.
          */
-        intel_bo_emit_reloc(brw->wm.surf_bo[unit],
-                            I915_GEM_DOMAIN_RENDER |
-                            I915_GEM_DOMAIN_SAMPLER,
-                            I915_GEM_DOMAIN_RENDER,
-                            0,
-                            offsetof(struct brw_surface_state, ss1),
-                            region_bo);
+        dri_bo_emit_reloc(brw->wm.surf_bo[unit],
+                          I915_GEM_DOMAIN_RENDER |
+                          I915_GEM_DOMAIN_SAMPLER,
+                          I915_GEM_DOMAIN_RENDER,
+                          0,
+                          offsetof(struct brw_surface_state, ss1),
+                          region_bo);
       }
    }
 }
@@ -420,11 +420,11 @@ brw_wm_get_binding_table(struct brw_context *brw)
       /* Emit binding table relocations to surface state */
       for (i = 0; i < BRW_WM_MAX_SURF; i++) {
         if (brw->wm.surf_bo[i] != NULL) {
-           intel_bo_emit_reloc(bind_bo,
-                               I915_GEM_DOMAIN_INSTRUCTION, 0,
-                               0,
-                               i * sizeof(GLuint),
-                               brw->wm.surf_bo[i]);
+           dri_bo_emit_reloc(bind_bo,
+                             I915_GEM_DOMAIN_INSTRUCTION, 0,
+                             0,
+                             i * sizeof(GLuint),
+                             brw->wm.surf_bo[i]);
         }
       }
 
index 550f467f830afa5de610f0e8f3d1ef00dd645099..9671232343b93cfe6b5f85cc4272eb752510ff1d 100644 (file)
@@ -261,13 +261,9 @@ _intel_batchbuffer_flush(struct intel_batchbuffer *batch, const char *file,
       UNLOCK_HARDWARE(intel);
 
    if (INTEL_DEBUG & DEBUG_SYNC) {
-      int irq;
-
       fprintf(stderr, "waiting for idle\n");
-      LOCK_HARDWARE(intel);
-      irq = intelEmitIrqLocked(intel->intelScreen);
-      UNLOCK_HARDWARE(intel);
-      intelWaitIrq(intel->intelScreen, irq);
+      dri_bo_map(batch->buf, GL_TRUE);
+      dri_bo_unmap(batch->buf);
    }
 
    /* Reset the buffer:
@@ -289,8 +285,8 @@ intel_batchbuffer_emit_reloc(struct intel_batchbuffer *batch,
    if (batch->ptr - batch->map > batch->buf->size)
     _mesa_printf ("bad relocation ptr %p map %p offset %d size %d\n",
                  batch->ptr, batch->map, batch->ptr - batch->map, batch->buf->size);
-   ret = intel_bo_emit_reloc(batch->buf, read_domains, write_domain,
-                            delta, batch->ptr - batch->map, buffer);
+   ret = dri_bo_emit_reloc(batch->buf, read_domains, write_domain,
+                          delta, batch->ptr - batch->map, buffer);
 
    /*
     * Using the old buffer offset, write in what the right data would be, in case
index 52d6ecc22389973dc218f207f10b0212521db77e..7ede1b890350fc453664ea9273a2f3ce973aca49 100644 (file)
@@ -3,7 +3,7 @@
 
 #include "mtypes.h"
 
-#include "dri_bufmgr.h"
+#include "intel_bufmgr.h"
 #include "intel_reg.h"
 
 struct intel_context;
index 0881cc4fdc7bbe16c63317860b806e1f79d1e4e5..60e30f21e8ef0f07bbb417d80e57fffdf6518ed0 100644 (file)
@@ -30,7 +30,6 @@
 
 #include "intel_context.h"
 #include "intel_ioctl.h"
-#include "dri_bufmgr.h"
 
 extern void intelCopyBuffer(const __DRIdrawablePrivate * dpriv,
                             const drm_clip_rect_t * rect);
index 1923a21516cc184af6ba090677c504cfd58f30b1..88484a07af664f61b7d1617bc9d045ee946e1bbb 100644 (file)
@@ -34,7 +34,6 @@
 #include "intel_buffer_objects.h"
 #include "intel_batchbuffer.h"
 #include "intel_regions.h"
-#include "dri_bufmgr.h"
 
 static GLboolean intel_bufferobj_unmap(GLcontext * ctx,
                                       GLenum target,
index 15ab9cbf358c2b2f4801d907d1b68889f5deb77c..591b5216648b4844ab6d0f81c42b9ac9b4659fee 100644 (file)
@@ -278,7 +278,7 @@ intel_update_renderbuffers(__DRIcontext *context, __DRIdrawable *drawable)
        }
 
        if (rb->region) {
-         intel_bo_flink(rb->region->buffer, &name);
+         dri_bo_flink(rb->region->buffer, &name);
          if (name == buffers[i].name)
             continue;
        }
@@ -614,8 +614,6 @@ intelInitContext(struct intel_context *intel,
    GLcontext *shareCtx = (GLcontext *) sharedContextPrivate;
    __DRIscreenPrivate *sPriv = driContextPriv->driScreenPriv;
    intelScreenPrivate *intelScreen = (intelScreenPrivate *) sPriv->private;
-   volatile struct drm_i915_sarea *saPriv = (struct drm_i915_sarea *)
-      (((GLubyte *) sPriv->pSAREA) + intelScreen->sarea_priv_offset);
    int fthrottle_mode;
 
    if (!_mesa_initialize_context(&intel->ctx, mesaVis, shareCtx,
@@ -627,7 +625,7 @@ intelInitContext(struct intel_context *intel,
    driContextPriv->driverPrivate = intel;
    intel->intelScreen = intelScreen;
    intel->driScreen = sPriv;
-   intel->sarea = saPriv;
+   intel->sarea = intelScreen->sarea;
    intel->driContext = driContextPriv;
 
    /* Dri stuff */
index 04a20278d1efcb0c28e94cabe55334abe1440611..8bd75753ea6569fafc65a89305c79aa48562ef1e 100644 (file)
@@ -34,7 +34,6 @@
 #include "drm.h"
 #include "mm.h"
 #include "texmem.h"
-#include "dri_bufmgr.h"
 #include "intel_bufmgr.h"
 
 #include "intel_screen.h"
index ac9e9337d6fdb9ef9abaed774787e5a9c45e423d..c58a80350565d6c12dca1baf95ee3ebc0f5fab2e 100644 (file)
 
 #define FILE_DEBUG_FLAG DEBUG_IOCTL
 
-int
-intelEmitIrqLocked(intelScreenPrivate *intelScreen)
-{
-   __DRIscreenPrivate *spriv = intelScreen->driScrnPriv;
-   struct drm_i915_irq_emit ie;
-   int ret, seq = 1;
-
-   if (intelScreen->no_hw)
-      return 1;
-
-   /*
-     assert(((*(int *)intelScreen->driHwLock) & ~DRM_LOCK_CONT) ==
-     (DRM_LOCK_HELD|intelScreen->hHWContext));
-   */
-
-   ie.irq_seq = &seq;
-
-   ret = drmCommandWriteRead(spriv->fd, DRM_I915_IRQ_EMIT, &ie, sizeof(ie));
-   if (ret) {
-      fprintf(stderr, "%s: drm_i915_irq_emit: %d\n", __FUNCTION__, ret);
-      exit(1);
-   }
-
-   DBG("%s -->  %d\n", __FUNCTION__, seq);
-
-   return seq;
-}
-
-void
-intelWaitIrq(intelScreenPrivate *intelScreen, int seq)
-{
-   __DRIscreenPrivate *spriv = intelScreen->driScrnPriv;
-   struct drm_i915_irq_wait iw;
-   int ret, lastdispatch;
-   volatile struct drm_i915_sarea *sarea = (struct drm_i915_sarea *)
-      (((GLubyte *) spriv->pSAREA) + intelScreen->sarea_priv_offset);
-
-   if (intelScreen->no_hw)
-      return;
-
-   DBG("%s %d\n", __FUNCTION__, seq);
-
-   iw.irq_seq = seq;
-
-   do {
-      lastdispatch = sarea->last_dispatch;
-      ret = drmCommandWrite(spriv->fd, DRM_I915_IRQ_WAIT, &iw, sizeof(iw));
-   } while (ret == -EAGAIN ||
-           ret == -EINTR ||
-           (ret == -EBUSY && lastdispatch != sarea->last_dispatch) ||
-           (ret == 0 && seq > sarea->last_dispatch) ||
-           (ret == 0 && sarea->last_dispatch - seq >= (1 << 24)));
-
-   if (ret) {
-      fprintf(stderr, "%s: drm_i915_irq_wait: %d\n", __FUNCTION__, ret);
-      exit(1);
-   }
-}
-
-
 int
 intel_batch_ioctl(struct intel_context *intel,
                   GLuint start_offset,
index 2ea40001db97954556089d1c884725856367a2ac..6736856dbd4b8afcf7f30f63c30ed5888d4c8635 100644 (file)
@@ -30,9 +30,6 @@
 
 #include "intel_context.h"
 
-void intelWaitIrq(intelScreenPrivate *intelScreen, int seq);
-int intelEmitIrqLocked(intelScreenPrivate *intelScreen);
-
 int intel_batch_ioctl(struct intel_context *intel,
                      GLuint start_offset,
                      GLuint used,
index c86c1034a9f26fee792f7bd54a619e8b99b9d0ea..1cfc8ddd64c3f77ae57d21224a74a1866838426d 100644 (file)
@@ -46,7 +46,6 @@
 #include "intel_regions.h"
 #include "intel_blit.h"
 #include "intel_buffer_objects.h"
-#include "dri_bufmgr.h"
 #include "intel_bufmgr.h"
 #include "intel_batchbuffer.h"
 #include "intel_chipset.h"
index 1285f250a779234a7d62e37bb57039bb3d38fbfd..a561de485e24286b89d6f2d61c7fba5666eca829 100644 (file)
  * the basic structure for rectangular collections of pixels stored in a dri_bo.
  */
 
+#include <xf86drm.h>
+
 #include "mtypes.h"
-#include "dri_bufmgr.h"
+#include "intel_bufmgr.h"
 
 struct intel_context;
 struct intel_buffer_object;
index 5cfb89330569cc84096a47a8cfbee5083deb5263..2355eafeca25976b0616dc7eecde573111426474 100644 (file)
@@ -274,9 +274,9 @@ static GLboolean intelInitDriver(__DRIscreenPrivate *sPriv)
 
    intelScreen->driScrnPriv = sPriv;
    sPriv->private = (void *) intelScreen;
-   intelScreen->sarea_priv_offset = gDRIPriv->sarea_priv_offset;
    sarea = (struct drm_i915_sarea *)
-      (((GLubyte *) sPriv->pSAREA) + intelScreen->sarea_priv_offset);
+      (((GLubyte *) sPriv->pSAREA) + gDRIPriv->sarea_priv_offset);
+   intelScreen->sarea = sarea;
 
    intelScreen->deviceID = gDRIPriv->deviceID;
 
@@ -289,8 +289,6 @@ static GLboolean intelInitDriver(__DRIscreenPrivate *sPriv)
       return GL_FALSE;
    }
 
-   intelScreen->sarea_priv_offset = gDRIPriv->sarea_priv_offset;
-
    if (0)
       intelPrintDRIInfo(intelScreen, sPriv, gDRIPriv);
 
@@ -551,34 +549,6 @@ intelFillInModes(__DRIscreenPrivate *psp,
    return configs;
 }
 
-
-/** Driver-specific fence emit implementation for the fake memory manager. */
-static unsigned int
-intel_fence_emit(void *private)
-{
-   intelScreenPrivate *intelScreen = (intelScreenPrivate *)private;
-   unsigned int fence;
-
-   /* XXX: Need to emit a flush, if we haven't already (at least with the
-    * current batchbuffer implementation, we have).
-    */
-
-   fence = intelEmitIrqLocked(intelScreen);
-
-   return fence;
-}
-
-/** Driver-specific fence wait implementation for the fake memory manager. */
-static int
-intel_fence_wait(void *private, unsigned int cookie)
-{
-   intelScreenPrivate *intelScreen = (intelScreenPrivate *)private;
-
-   intelWaitIrq(intelScreen, cookie);
-
-   return 0;
-}
-
 static GLboolean
 intel_init_bufmgr(intelScreenPrivate *intelScreen)
 {
@@ -628,12 +598,13 @@ intel_init_bufmgr(intelScreenPrivate *intelScreen)
         return GL_FALSE;
       }
 
-      intelScreen->bufmgr = intel_bufmgr_fake_init(intelScreen->tex.offset,
-                                                  intelScreen->tex.map,
-                                                  intelScreen->tex.size,
-                                                  intel_fence_emit,
-                                                  intel_fence_wait,
-                                                  intelScreen);
+      intelScreen->bufmgr =
+        intel_bufmgr_fake_init(spriv->fd,
+                               intelScreen->tex.offset,
+                               intelScreen->tex.map,
+                               intelScreen->tex.size,
+                               (unsigned int * volatile)
+                               &intelScreen->sarea->last_dispatch);
    }
 
    /* XXX bufmgr should be per-screen, not per-context */
index 299da872100b759b41fafe0f02da698a0bb50f7c..daf2ab4c5826b910cc6ce6d5ad4f9224ee1abd53 100644 (file)
@@ -30,7 +30,7 @@
 
 #include <sys/time.h>
 #include "dri_util.h"
-#include "dri_bufmgr.h"
+#include "intel_bufmgr.h"
 #include "i915_drm.h"
 #include "xmlconfig.h"
 
@@ -68,7 +68,8 @@ typedef struct
    int logTextureGranularity;
 
    __DRIscreenPrivate *driScrnPriv;
-   unsigned int sarea_priv_offset;
+
+   volatile struct drm_i915_sarea *sarea;
 
    int drmMinor;