i965: Enable GL_KHR_robustness
[mesa.git] / src / mesa / drivers / dri / i965 / brw_reset.c
index e3182b1474f369cd0744d1a1887016d8816a7159..df734e5f0fbd8bfb02bfe0edc1f7b55f1fd80c19 100644 (file)
@@ -20,6 +20,9 @@
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
  */
+
+#include "main/context.h"
+
 #include "brw_context.h"
 
 /**
@@ -73,3 +76,20 @@ brw_get_graphics_reset_status(struct gl_context *ctx)
 
    return GL_NO_ERROR;
 }
+
+void
+brw_check_for_reset(struct brw_context *brw)
+{
+   uint32_t reset_count;
+   uint32_t active;
+   uint32_t pending;
+   int err;
+
+   err = drm_intel_get_reset_stats(brw->hw_ctx, &reset_count, &active,
+                                   &pending);
+   if (err)
+      return;
+
+   if (active > 0 || pending > 0)
+      _mesa_set_context_lost_dispatch(&brw->ctx);
+}