diff options
author | Keith Whitwell <[email protected]> | 2009-11-05 13:57:05 +0000 |
---|---|---|
committer | Keith Whitwell <[email protected]> | 2009-11-05 14:01:37 +0000 |
commit | c796aed5ddad011d66e631c4cafdbf779e73f213 (patch) | |
tree | d8a510233b281c9d6a0690632948f10a03819a84 /src/gallium/drivers/i965/brw_eu.h | |
parent | 31b8b1dd36d9f07a7893a89ee985d83c4d0bb95b (diff) |
i965g: add lots of error checks and early returns
Any allocation that may fail should be checked, and propogate the
error upwards. At the highest level we will flush batch and retry.
This is an alternate strategy to what the original DRI driver did of
attempting to flush batch from the lowest levels (eg inside
BEGIN_BATCH). The trouble with that strategy was that flushes could
occur at unexpected times, and additionally there was a need for a
wierd notification mechanism to propogate the 'lost context' state
back up to higher levels.
Propogating the errors directly gives us a lot of flexibility how to
deal with these states, at the expense of a lot more checking in the
code.
Will add some sanity checks later to make sure that out-of-memory
conditions are properly escalated and not lost halfway up the stack.
Diffstat (limited to 'src/gallium/drivers/i965/brw_eu.h')
-rw-r--r-- | src/gallium/drivers/i965/brw_eu.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/gallium/drivers/i965/brw_eu.h b/src/gallium/drivers/i965/brw_eu.h index 7bddc3859ca..565f4ef1c59 100644 --- a/src/gallium/drivers/i965/brw_eu.h +++ b/src/gallium/drivers/i965/brw_eu.h @@ -34,6 +34,7 @@ #define BRW_EU_H #include "util/u_debug.h" +#include "pipe/p_error.h" #include "brw_structs.h" #include "brw_defines.h" @@ -132,6 +133,8 @@ struct brw_compile { struct brw_eu_label *first_label; /**< linked list of labels */ struct brw_eu_call *first_call; /**< linked list of CALs */ + + boolean error; }; @@ -772,7 +775,10 @@ void brw_set_predicate_control( struct brw_compile *p, GLuint pc ); void brw_set_conditionalmod( struct brw_compile *p, GLuint conditional ); void brw_init_compile( struct brw_context *, struct brw_compile *p ); -const GLuint *brw_get_program( struct brw_compile *p, GLuint *sz ); + +enum pipe_error brw_get_program( struct brw_compile *p, + const GLuint **program, + GLuint *sz ); /* Helpers for regular instructions: |