From 4e98318fc1722171a07d867a99ab7608ecf758cd Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 12 May 2011 21:05:30 -0700 Subject: [PATCH] i965: Instead of fallback on missing region, just bind a null renderbuffer. The change for GPU hanging in 13bab58f04c1ec6d0d52760eab490a0997d9abe2 fell back even when rb == NULL, which is wrong for GLES2 and caused segfaulting in GLES2 conformance. For the GPU hang case (where the broken 2D driver failed to allocate a BO for the window system renderbuffer), it also would assertion fail/segfault immediately after the fallback setup when the renderbuffer map failed. Fixes GLES2 conformance packed_depth_stencil. Signed-off-by: Eric Anholt Signed-off-by: Kenneth Graunke --- src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 8 ++------ src/mesa/drivers/dri/i965/gen7_wm_surface_state.c | 8 ++------ 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c index d34059f0e61..cef0c65e478 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c @@ -562,12 +562,8 @@ prepare_wm_surfaces(struct brw_context *brw) struct intel_renderbuffer *irb = intel_renderbuffer(rb); struct intel_region *region = irb ? irb->region : NULL; - if (region == NULL || region->buffer == NULL) { - brw->intel.Fallback = GL_TRUE; /* boolean, not bitfield */ - return; - } - - brw_add_validated_bo(brw, region->buffer); + if (region) + brw_add_validated_bo(brw, region->buffer); nr_surfaces = SURF_INDEX_DRAW(i) + 1; } } diff --git a/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c b/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c index ff220255311..361db2fead8 100644 --- a/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c +++ b/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c @@ -329,12 +329,8 @@ prepare_wm_surfaces(struct brw_context *brw) struct intel_renderbuffer *irb = intel_renderbuffer(rb); struct intel_region *region = irb ? irb->region : NULL; - if (region == NULL || region->buffer == NULL) { - brw->intel.Fallback = GL_TRUE; /* boolean, not bitfield */ - return; - } - - brw_add_validated_bo(brw, region->buffer); + if (region) + brw_add_validated_bo(brw, region->buffer); nr_surfaces = SURF_INDEX_DRAW(i) + 1; } } -- 2.30.2