summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2013-08-01 15:11:39 -0700
committerKenneth Graunke <[email protected]>2013-08-06 14:41:37 -0700
commitc047ad000b24bdd5edb3e59f59738104e0fb42bd (patch)
tree705ec6d39f141e6be1a07b058b97af2590623e4f
parent263ebe1a71b3b8ad581484540b1d4c3110e9202a (diff)
i965: Initialize the intel_context::bufmgr pointer earlier.
This prevents a crash in a future patch. _mesa_initialize_context() creates a default transform feedback object by calling the NewTransformFeedbackObject() driver hook. Eventually, we'll want to subclass that and allocate a buffer object. This means passing brw->bufmgr to drm_intel_alloc_bo(), and crashing if it isn't initialized yet. The buffer manager is actually already initialized; we just hadn't copied the pointer from intel_screen to intel_context quite early enough. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Paul Berry <[email protected]>
-rw-r--r--src/mesa/drivers/dri/i965/intel_context.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_context.c b/src/mesa/drivers/dri/i965/intel_context.c
index 7860e1fc036..461d4931c41 100644
--- a/src/mesa/drivers/dri/i965/intel_context.c
+++ b/src/mesa/drivers/dri/i965/intel_context.c
@@ -481,6 +481,7 @@ intelInitContext(struct brw_context *brw,
}
brw->intelScreen = intelScreen;
+ brw->bufmgr = intelScreen->bufmgr;
if (!_mesa_initialize_context(&brw->ctx, api, mesaVis, shareCtx,
functions)) {
@@ -540,8 +541,6 @@ intelInitContext(struct brw_context *brw,
*/
brw->max_gtt_map_object_size = gtt_size / 4;
- brw->bufmgr = intelScreen->bufmgr;
-
bo_reuse_mode = driQueryOptioni(&brw->optionCache, "bo_reuse");
switch (bo_reuse_mode) {
case DRI_CONF_BO_REUSE_DISABLED: