r300: Converted exit calls to _mesa_exit calls.
authorOliver McFadden <z3ro.geek@gmail.com>
Wed, 9 May 2007 03:32:15 +0000 (03:32 +0000)
committerOliver McFadden <z3ro.geek@gmail.com>
Wed, 9 May 2007 03:32:15 +0000 (03:32 +0000)
Note that the exit codes are inconsistent and should be fixed.

src/mesa/drivers/dri/r300/r300_cmdbuf.c
src/mesa/drivers/dri/r300/r300_emit.h
src/mesa/drivers/dri/r300/r300_ioctl.c
src/mesa/drivers/dri/r300/r300_maos.c
src/mesa/drivers/dri/r300/r300_state.c
src/mesa/drivers/dri/r300/r300_texmem.c
src/mesa/drivers/dri/r300/r300_vertprog.c

index dbb38bf3acd6d4838ee0661ace7cfcfb2bd422af..9bfdc85c4abdb7d236d0d89116db2a9702d042ae 100644 (file)
@@ -122,7 +122,7 @@ int r300FlushCmdBuf(r300ContextPtr r300, const char *caller)
 
        if (ret) {
                fprintf(stderr, "drmRadeonCmdBuffer: %d (exiting)\n", ret);
-               exit(ret);
+               _mesa_exit(ret);
        }
 
        return ret;
index 90c2b8c1419c42f8f32a2f54c186b3d97c74ec8b..e616986c08fd39da4933336e8ee9a30f366938fb 100644 (file)
@@ -160,7 +160,7 @@ static __inline__ uint32_t cmdpacify(void)
                                "cmd_written=%d cmd_reserved=%d\n",     \
                                __FILE__, __FUNCTION__, __LINE__,       \
                                cmd_written, cmd_reserved);             \
-                       exit(-1);                                       \
+                       _mesa_exit(-1);                                 \
                }                                                       \
        } while(0)
 
@@ -195,7 +195,7 @@ static __inline__ uint32_t cmdpacify(void)
                        fprintf(stderr,"Too big packet3 %08x: cannot "  \
                                "store %d dwords\n",                    \
                                _p, _n);                                \
-                       exit(-1);                                       \
+                       _mesa_exit(-1);                                 \
                }                                                       \
                cmd[0].i = cmdpacket3(R300_CMD_PACKET3_RAW);            \
                cmd[1].i = _p | ((_n & 0x3fff)<<16);                    \
index de0a482eb5d178699f500a91cc1a5d4ab0a75e34..05fe5e2c90434ceaf7f7c7e268ef9638e6b4bb60 100644 (file)
@@ -465,7 +465,7 @@ static void r300RefillCurrentDmaRegion(r300ContextPtr rmesa, int size)
                if (dmabuf->id == 0) {
                        fprintf(stderr,
                                "Error: Could not get dma buffer... exiting\n");
-                       exit(-1);
+                       _mesa_exit(-1);
                }
        }
 
@@ -591,7 +591,7 @@ static void r300RefillCurrentDmaRegion(r300ContextPtr rmesa)
                        UNLOCK_HARDWARE(&rmesa->radeon);
                        fprintf(stderr,
                                "Error: Could not get dma buffer... exiting\n");
-                       exit(-1);
+                       _mesa_exit(-1);
                }
        }
 
index c424e7a31a95f4ee94ae983a54a27d8fe0a5d9dd..94b1f65f263d6bbe3f773c29dee0b4d7a1054c9a 100644 (file)
@@ -217,7 +217,7 @@ static void emit_vector(GLcontext * ctx,
                break;
        default:
                assert(0);
-               exit(1);
+               _mesa_exit(1);
                break;
        }
 
@@ -243,7 +243,7 @@ void r300EmitElts(GLcontext * ctx, void *elts, unsigned long n_elts,
                return;
        } else if (r300IsGartMemory(rmesa, elts, 1)) {
                WARN_ONCE("Pointer not within GART memory!\n");
-               exit(1);
+               _mesa_exit(1);
        }
 
        r300AllocDmaRegion(rmesa, rvb, n_elts * elt_size, elt_size);
index 75d606fdcc4aaf48e14c1be7cfb5f92427d9640a..fbdb4ca98f4ed3ddd6747fa04032de2d35113238 100644 (file)
@@ -1330,7 +1330,7 @@ void r300_setup_textures(GLcontext * ctx)
                fprintf(stderr,
                        "Aiiee ! mtu=%d is greater than R300_MAX_TEXTURE_UNITS=%d\n",
                        mtu, R300_MAX_TEXTURE_UNITS);
-               exit(-1);
+               _mesa_exit(-1);
        }
 
        /* We cannot let disabled tmu offsets pass DRM */
@@ -1514,7 +1514,7 @@ void r300_setup_rs_unit(GLcontext * ctx)
 
                if (i == ctx->Const.MaxTextureUnits) {
                        fprintf(stderr, "\tno free texcoord found...\n");
-                       exit(0);
+                       _mesa_exit(0);
                }
 
                InputsRead |= (FRAG_BIT_TEX0 << i);
@@ -1542,7 +1542,7 @@ void r300_setup_rs_unit(GLcontext * ctx)
                                    ("fragprog wants coords for tex%d, vp doesn't provide them!\n",
                                     i);
                                //_mesa_print_program(&CURRENT_VERTEX_SHADER(ctx)->Base);
-                               //exit(-1);
+                               //_mesa_exit(-1);
                        }
                        InputsRead &= ~(FRAG_BIT_TEX0 << i);
                        fp_reg++;
@@ -1562,7 +1562,7 @@ void r300_setup_rs_unit(GLcontext * ctx)
                            ("fragprog wants col0, vp doesn't provide it\n");
                        goto out;       /* FIXME */
                        //_mesa_print_program(&CURRENT_VERTEX_SHADER(ctx)->Base);
-                       //exit(-1);
+                       //_mesa_exit(-1);
                }
 
                r300->hw.rr.cmd[R300_RR_ROUTE_0] |= 0
@@ -1579,7 +1579,7 @@ void r300_setup_rs_unit(GLcontext * ctx)
                     _TNL_ATTRIB_COLOR1)) {
                        WARN_ONCE
                            ("fragprog wants col1, vp doesn't provide it\n");
-                       //exit(-1);
+                       //_mesa_exit(-1);
                }
 
                r300->hw.rr.cmd[R300_RR_ROUTE_1] |=
@@ -1637,7 +1637,7 @@ void static inline setup_vertex_shader_fragment(r300ContextPtr r300,
        if (vsf->length & 0x3) {
                fprintf(stderr,
                        "VERTEX_SHADER_FRAGMENT must have length divisible by 4\n");
-               exit(-1);
+               _mesa_exit(-1);
        }
 
        switch ((dest >> 8) & 0xf) {
@@ -1672,7 +1672,7 @@ void static inline setup_vertex_shader_fragment(r300ContextPtr r300,
                fprintf(stderr,
                        "%s:%s don't know how to handle dest %04x\n",
                        __FILE__, __FUNCTION__, dest);
-               exit(-1);
+               _mesa_exit(-1);
        }
 }
 
@@ -2277,7 +2277,7 @@ void r300ResetHwState(r300ContextPtr r300)
        default:
                fprintf(stderr, "Error: Unsupported depth %d... exiting\n",
                        ctx->Visual.depthBits);
-               exit(-1);
+               _mesa_exit(-1);
 
        }
        /* z compress? */
@@ -2347,7 +2347,7 @@ void r300InitState(r300ContextPtr r300)
        default:
                fprintf(stderr, "Error: Unsupported depth %d... exiting\n",
                        ctx->Visual.depthBits);
-               exit(-1);
+               _mesa_exit(-1);
        }
 
        /* Only have hw stencil when depth buffer is 24 bits deep */
index c527677cd0ce68eea3ea9ce85e10b6902a9b8449..4750c468db47e82d4b70da4eafbeaac432aa505b 100644 (file)
@@ -485,7 +485,7 @@ static void uploadSubImage( r300ContextPtr rmesa, r300TexObjPtr t,
                fprintf( stderr, "    blit width=%d height=%d data=%p\n",
                                t->image[face][hwlevel].width, t->image[face][hwlevel].height,
                                t->image[face][hwlevel].data );
-               exit( 1 );
+               _mesa_exit( 1 );
        }
 }
 
index 6e023ef2ffa957011f8013c9f380a2e463dbfb92..c7bfd8e8a813c3c3addb257e88eb3422dbad7c56 100644 (file)
@@ -121,7 +121,7 @@ int r300VertexProgUpdateParams(GLcontext *ctx, struct r300_vertex_program_cont *
 
        if(mesa_vp->Base.Parameters->NumParameters * 4 > VSF_MAX_FRAGMENT_LENGTH){
                fprintf(stderr, "%s:Params exhausted\n", __FUNCTION__);
-               exit(-1);
+               _mesa_exit(-1);
        }
 
         paramList = mesa_vp->Base.Parameters;
@@ -173,7 +173,7 @@ static unsigned long t_dst_class(enum register_file file)
                */
                default:
                        fprintf(stderr, "problem in %s", __FUNCTION__);
-                       exit(0);
+                       _mesa_exit(0);
        }
 }
 
@@ -207,7 +207,7 @@ static unsigned long t_src_class(enum register_file file)
                */
                default:
                        fprintf(stderr, "problem in %s", __FUNCTION__);
-                       exit(0);
+                       _mesa_exit(0);
        }
 }
 
@@ -311,7 +311,7 @@ static unsigned long t_opcode(enum prog_opcode opcode)
                default:
                        fprintf(stderr, "%s: Should not be called with opcode %d!", __FUNCTION__, opcode);
        }
-       exit(-1);
+       _mesa_exit(-1);
        return 0;
 }
 
@@ -325,7 +325,7 @@ static unsigned long op_operands(enum prog_opcode opcode)
                        return op_names[i].ip;
 
        fprintf(stderr, "op %d not found in op_names\n", opcode);
-       exit(-1);
+       _mesa_exit(-1);
        return 0;
 }
 
@@ -796,7 +796,7 @@ static void r300_translate_vertex_shader(struct r300_vertex_program *vp, struct
 
                case OPCODE_RCC:
                        fprintf(stderr, "Dont know how to handle op %d yet\n", vpi->Opcode);
-                       exit(-1);
+                       _mesa_exit(-1);
                break;
                case OPCODE_END:
                        break;
@@ -829,7 +829,7 @@ static void r300_translate_vertex_shader(struct r300_vertex_program *vp, struct
 
                                default:
                                        fprintf(stderr, "scalars and op RCC not handled yet");
-                                       exit(-1);
+                                       _mesa_exit(-1);
                                break;
                        }
                }else{
@@ -854,7 +854,7 @@ static void r300_translate_vertex_shader(struct r300_vertex_program *vp, struct
 
                                default:
                                        fprintf(stderr, "scalars and op RCC not handled yet");
-                                       exit(-1);
+                                       _mesa_exit(-1);
                                break;
                        }
                }
@@ -1080,7 +1080,7 @@ void r300_select_vertex_shader(r300ContextPtr r300)
 
                if(i == ctx->Const.MaxTextureUnits){
                        fprintf(stderr, "\tno free texcoord found\n");
-                       exit(0);
+                       _mesa_exit(0);
                }
 
                InputsRead |= (FRAG_BIT_TEX0 << i);