From 5c13f06d8c3ebf5295a0b658ecfbc19171171ce9 Mon Sep 17 00:00:00 2001 From: Alexander von Gluck IV Date: Wed, 28 Nov 2012 02:54:23 +0000 Subject: [PATCH] swpipe: Add a missing hook call for get_param * For now we always force fb validation * Thanks for finding this AnEvilYak! * swpipe driver no longer crashes (however it doesn't work yet) --- src/add-ons/opengl/swpipe/GalliumContext.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/add-ons/opengl/swpipe/GalliumContext.cpp b/src/add-ons/opengl/swpipe/GalliumContext.cpp index 41ac9f9697..23bde584bb 100644 --- a/src/add-ons/opengl/swpipe/GalliumContext.cpp +++ b/src/add-ons/opengl/swpipe/GalliumContext.cpp @@ -225,6 +225,23 @@ hook_winsys_displaytarget_destroy(struct sw_winsys* winsys, } +static int +hook_stm_get_param(struct st_manager *smapi, enum st_manager_param param) +{ + CALLED(); + + switch (param) { + case ST_MANAGER_BROKEN_INVALIDATE: + TRACE("%s: TODO: How should we handle BROKEN_INVALIDATE calls?\n", + __func__); + // For now we force validation of the framebuffer. + return 1; + } + + return 0; +} + + GalliumContext::GalliumContext(ulong options) : fOptions(options), @@ -331,6 +348,7 @@ GalliumContext::CreateContext(Bitmap *bitmap) ERROR("%s: Couldn't allocate Mesa state tracker manager!\n", __func__); return -1; } + context->manager->get_param = hook_stm_get_param; // Calculate visual configuration const GLboolean rgbFlag = ((fOptions & BGL_INDEX) == 0);