summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/i915/intel_ioctl.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2007-12-12 10:25:19 -0800
committerEric Anholt <eric@anholt.net>2007-12-12 11:52:10 -0800
commit7c71ef3a3d0cf2620525f468960cdc76a0fb0d33 (patch)
tree7b7e071b5c854bc5b737401990b54e488febf650 /src/mesa/drivers/dri/i915/intel_ioctl.c
parent00e10a1385bfd376f5f45ad94e3543ac87f15de8 (diff)
[intel] Move bufmgr back to context instead of screen, fixing glthreads.
Putting the bufmgr in the screen is not thread-safe since the emit_reloc changes. It also led to a significant performance hit from pthread usage for the attempted thread-safety (up to 12% of a cpu spent on refcounting protection in single-threaded 965). The motivation had been to allow multi-context bufmgr sharing in classic mode, but it wasn't worth the cost.
Diffstat (limited to 'src/mesa/drivers/dri/i915/intel_ioctl.c')
-rw-r--r--src/mesa/drivers/dri/i915/intel_ioctl.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/mesa/drivers/dri/i915/intel_ioctl.c b/src/mesa/drivers/dri/i915/intel_ioctl.c
index 94f7e73ecf..37704d66ec 100644
--- a/src/mesa/drivers/dri/i915/intel_ioctl.c
+++ b/src/mesa/drivers/dri/i915/intel_ioctl.c
@@ -47,15 +47,14 @@
#define FILE_DEBUG_FLAG DEBUG_IOCTL
int
-intelEmitIrqLocked(intelScreenPrivate *intelScreen)
+intelEmitIrqLocked(struct intel_context *intel)
{
drmI830IrqEmit ie;
int ret, seq;
ie.irq_seq = &seq;
- ret = drmCommandWriteRead(intelScreen->driScrnPriv->fd,
- DRM_I830_IRQ_EMIT, &ie, sizeof(ie));
+ ret = drmCommandWriteRead(intel->driFd, DRM_I830_IRQ_EMIT, &ie, sizeof(ie));
if (ret) {
fprintf(stderr, "%s: drmI830IrqEmit: %d\n", __FUNCTION__, ret);
exit(1);
@@ -67,7 +66,7 @@ intelEmitIrqLocked(intelScreenPrivate *intelScreen)
}
void
-intelWaitIrq(intelScreenPrivate *intelScreen, int seq)
+intelWaitIrq(struct intel_context *intel, int seq)
{
drm_i915_irq_wait_t iw;
int ret;
@@ -77,8 +76,7 @@ intelWaitIrq(intelScreenPrivate *intelScreen, int seq)
iw.irq_seq = seq;
do {
- ret = drmCommandWrite(intelScreen->driScrnPriv->fd,
- DRM_I830_IRQ_WAIT, &iw, sizeof(iw));
+ ret = drmCommandWrite(intel->driFd, DRM_I830_IRQ_WAIT, &iw, sizeof(iw));
} while (ret == -EAGAIN || ret == -EINTR);
if (ret) {
@@ -170,7 +168,7 @@ intel_exec_ioctl(struct intel_context *intel,
}
- fo = intel_ttm_fence_create_from_arg(intel->intelScreen->bufmgr, "fence buffers",
+ fo = intel_ttm_fence_create_from_arg(intel->bufmgr, "fence buffers",
&execbuf.fence_arg);
if (!fo) {
fprintf(stderr, "failed to fence handle: %08x\n", execbuf.fence_arg.handle);