Mesa (master): progs/redbook: Fix memory leaks on error paths.
Module: Mesa Branch: master Commit: 7eaf33ad0349e39dd6611b0b27aa44687e8c3014 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=7eaf33ad0349e39dd6611b0b27aa44687e8c3014 Author: Vinson Lee Date: Wed Feb 17 01:57:14 2010 -0800 progs/redbook: Fix memory leaks on error paths. --- progs/redbook/convolution.c |1 + progs/redbook/histogram.c |1 + progs/redbook/minmax.c |1 + 3 files changed, 3 insertions(+), 0 deletions(-) diff --git a/progs/redbook/convolution.c b/progs/redbook/convolution.c index 0543379..0898ef2 100644 --- a/progs/redbook/convolution.c +++ b/progs/redbook/convolution.c @@ -97,6 +97,7 @@ readImage( const char* filename, GLsizei* width, GLsizei *height ) pixels = (GLubyte *) malloc( n * sizeof( GLubyte )); if ( !pixels ) { fprintf( stderr, "Unable to malloc() bytes for pixels\n" ); + fclose( infile ); return NULL; } diff --git a/progs/redbook/histogram.c b/progs/redbook/histogram.c index de1e59e..70a5282 100644 --- a/progs/redbook/histogram.c +++ b/progs/redbook/histogram.c @@ -102,6 +102,7 @@ readImage( const char* filename, GLsizei* width, GLsizei *height ) pixels = (GLubyte *) malloc( n * sizeof( GLubyte )); if ( !pixels ) { fprintf( stderr, "Unable to malloc() bytes for pixels\n" ); + fclose( infile ); return NULL; } diff --git a/progs/redbook/minmax.c b/progs/redbook/minmax.c index da5b875..8281800 100644 --- a/progs/redbook/minmax.c +++ b/progs/redbook/minmax.c @@ -97,6 +97,7 @@ readImage( const char* filename, GLsizei* width, GLsizei *height ) pixels = (GLubyte *) malloc( n * sizeof( GLubyte )); if ( !pixels ) { fprintf( stderr, "Unable to malloc() bytes for pixels\n" ); + fclose( infile ); return NULL; } ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): glsl: Silence unused value warning.
Module: Mesa Branch: master Commit: ba0ac64f06e7b6d9c7c1440b7e3fbc9007af88ff URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=ba0ac64f06e7b6d9c7c1440b7e3fbc9007af88ff Author: Vinson Lee Date: Wed Feb 17 02:10:49 2010 -0800 glsl: Silence unused value warning. --- src/mesa/shader/slang/slang_emit.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/src/mesa/shader/slang/slang_emit.c b/src/mesa/shader/slang/slang_emit.c index c9ecbd2..0f67036 100644 --- a/src/mesa/shader/slang/slang_emit.c +++ b/src/mesa/shader/slang/slang_emit.c @@ -1122,6 +1122,8 @@ emit_clamp(slang_emit_info *emitInfo, slang_ir_node *n) return inst; } } +#else + (void) inst; #endif if (!alloc_node_storage(emitInfo, n, n->Children[0]->Store->Size)) ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): glsl/cl: Properly emit layout qualifier list.
Module: Mesa Branch: master Commit: a21215a74e56a8661e6191ec09d1be9c0a186111 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=a21215a74e56a8661e6191ec09d1be9c0a186111 Author: Michal Krol Date: Wed Feb 17 09:54:59 2010 +0100 glsl/cl: Properly emit layout qualifier list. --- src/glsl/cl/sl_cl_parse.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/glsl/cl/sl_cl_parse.c b/src/glsl/cl/sl_cl_parse.c index 883bc1f..f635375 100644 --- a/src/glsl/cl/sl_cl_parse.c +++ b/src/glsl/cl/sl_cl_parse.c @@ -760,10 +760,9 @@ _parse_layout_qualifier(struct parse_context *ctx, return -1; } } - } - return -1; + return 0; } @@ -1068,8 +1067,9 @@ _parse_fully_specified_type(struct parse_context *ctx, struct parse_state p = *ps; if (_parse_layout_qualifier(ctx, &p)) { - _emit(ctx, &p.out, LAYOUT_QUALIFIER_NONE); + return -1; } + _emit(ctx, &p.out, LAYOUT_QUALIFIER_NONE); if (_parse_invariant_qualifier(ctx, &p)) { _emit(ctx, &p.out, TYPE_VARIANT); ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): glsl/pp: Remove sl_pp_get_extension_state().
Module: Mesa Branch: master Commit: cb66e9f2b427afeffc0b92801e6943f0b17bf1f1 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=cb66e9f2b427afeffc0b92801e6943f0b17bf1f1 Author: Michal Krol Date: Wed Feb 17 11:18:03 2010 +0100 glsl/pp: Remove sl_pp_get_extension_state(). Parse extension tokens to track current state of extension enables. --- src/glsl/pp/sl_pp_context.h |8 src/glsl/pp/sl_pp_extension.c | 41 - src/glsl/pp/sl_pp_public.h|4 3 files changed, 0 insertions(+), 53 deletions(-) diff --git a/src/glsl/pp/sl_pp_context.h b/src/glsl/pp/sl_pp_context.h index 1232f1e..8abb970 100644 --- a/src/glsl/pp/sl_pp_context.h +++ b/src/glsl/pp/sl_pp_context.h @@ -43,16 +43,8 @@ #define SL_PP_MAX_PREDEFINED 16 -enum sl_pp_extension_state { - SL_PP_EXTENSION_STATE_ENABLED, - SL_PP_EXTENSION_STATE_DISABLED, - SL_PP_EXTENSION_STATE_WARN, - SL_PP_EXTENSION_STATE_REQUIRE -}; - struct sl_pp_extension { int name; /*< GL_VENDOR_extension_name */ - enum sl_pp_extension_state state; }; struct sl_pp_predefined { diff --git a/src/glsl/pp/sl_pp_extension.c b/src/glsl/pp/sl_pp_extension.c index 0816e81..d119677 100644 --- a/src/glsl/pp/sl_pp_extension.c +++ b/src/glsl/pp/sl_pp_extension.c @@ -53,8 +53,6 @@ sl_pp_context_add_extension(struct sl_pp_context *context, return -1; } - ext.state = SL_PP_EXTENSION_STATE_DISABLED; - context->extensions[context->num_extensions++] = ext; assert(context->num_extensions <= sizeof(context->extensions)); @@ -63,23 +61,6 @@ sl_pp_context_add_extension(struct sl_pp_context *context, } -enum sl_pp_extension_state -sl_pp_get_extension_state(const struct sl_pp_context *context, - int extension_name) -{ - unsigned i; - - for (i = 0; i < context->num_extensions; i++) { - if (extension_name == context->extensions[i].name) { - return context->extensions[i].state; - } - } - - assert(0 && "unknown extension"); - return SL_PP_EXTENSION_STATE_DISABLED; -} - - /** * Process a "#extension name: behavior" directive. */ @@ -93,7 +74,6 @@ sl_pp_process_extension(struct sl_pp_context *context, int extension_name = -1; int behavior = -1; struct sl_pp_token_info out; - struct sl_pp_extension *extension = NULL; /* Grab the extension name. */ if (first < last && input[first].token == SL_PP_IDENTIFIER) { @@ -115,7 +95,6 @@ sl_pp_process_extension(struct sl_pp_context *context, for (i = 0; i < context->num_extensions; i++) { if (extension_name == context->extensions[i].name) { out.data.extension = extension_name; -extension = &context->extensions[i]; break; } } @@ -155,11 +134,6 @@ sl_pp_process_extension(struct sl_pp_context *context, return -1; } out.token = SL_PP_EXTENSION_REQUIRE; - - if (extension_name != context->dict.all) { - assert(extension); - extension->state = SL_PP_EXTENSION_STATE_REQUIRE; - } } else if (behavior == context->dict.enable) { if (out.data.extension == -1) { /* Warning: the extension cannot be enabled. */ @@ -170,33 +144,18 @@ sl_pp_process_extension(struct sl_pp_context *context, return -1; } out.token = SL_PP_EXTENSION_ENABLE; - - if (extension_name != context->dict.all) { - assert(extension); - extension->state = SL_PP_EXTENSION_STATE_ENABLED; - } } else if (behavior == context->dict.warn) { if (out.data.extension == -1) { /* Warning: the extension is not supported. */ return 0; } out.token = SL_PP_EXTENSION_WARN; - - if (extension_name != context->dict.all) { - assert(extension); - extension->state = SL_PP_EXTENSION_STATE_WARN; - } } else if (behavior == context->dict.disable) { if (out.data.extension == -1) { /* Warning: the extension is not supported. */ return 0; } out.token = SL_PP_EXTENSION_DISABLE; - - if (extension_name != context->dict.all) { - assert(extension); - extension->state = SL_PP_EXTENSION_STATE_DISABLED; - } } else { strcpy(context->error_msg, "unrecognised behavior name"); return -1; diff --git a/src/glsl/pp/sl_pp_public.h b/src/glsl/pp/sl_pp_public.h index e4ad80d..ca6f722 100644 --- a/src/glsl/pp/sl_pp_public.h +++ b/src/glsl/pp/sl_pp_public.h @@ -55,10 +55,6 @@ int sl_pp_context_add_extension(struct sl_pp_context *context, const char *name); -enum sl_pp_extension_state -sl_pp_get_extension_state(const struct sl_pp_context *context, - int extension_name); - int sl_pp_context_add_predefined(struct sl_pp_context *context, const char *name, ___ mesa-commit mailing list
Mesa (master): glsl/cl: Parse layout qualifiers only when an appropriate extension enabled.
Module: Mesa Branch: master Commit: 27a68bd14aea55ee4653520403c29e3e16f55e63 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=27a68bd14aea55ee4653520403c29e3e16f55e63 Author: Michal Krol Date: Wed Feb 17 11:07:17 2010 +0100 glsl/cl: Parse layout qualifiers only when an appropriate extension enabled. --- src/glsl/cl/sl_cl_parse.c | 77 +++- 1 files changed, 75 insertions(+), 2 deletions(-) diff --git a/src/glsl/cl/sl_cl_parse.c b/src/glsl/cl/sl_cl_parse.c index f635375..8106ff6 100644 --- a/src/glsl/cl/sl_cl_parse.c +++ b/src/glsl/cl/sl_cl_parse.c @@ -325,6 +325,9 @@ struct parse_dict { int _false; int _true; + + int all; + int _GL_ARB_fragment_coord_conventions; }; @@ -343,6 +346,8 @@ struct parse_context { unsigned int shader_type; unsigned int parsing_builtin; + unsigned int fragment_coord_conventions:1; + char error[256]; int process_error; }; @@ -460,6 +465,10 @@ _fetch_token(struct parse_context *ctx, case SL_PP_IDENTIFIER: case SL_PP_UINT: case SL_PP_FLOAT: + case SL_PP_EXTENSION_REQUIRE: + case SL_PP_EXTENSION_ENABLE: + case SL_PP_EXTENSION_WARN: + case SL_PP_EXTENSION_DISABLE: case SL_PP_EOF: ctx->tokens_read++; break; @@ -728,6 +737,20 @@ _parse_layout_qualifier(struct parse_context *ctx, struct parse_state *ps) { if (_parse_id(ctx, ctx->dict.layout, ps) == 0) { + if (!ctx->fragment_coord_conventions) { + _error(ctx, "GL_ARB_fragment_coord_conventions extension must be enabled " + "in order to use a layout qualifier"); + return -1; + } + + /* Layout qualifiers are only defined for fragment shaders, + * so do an early check. + */ + if (ctx->shader_type != 1) { + _error(ctx, "layout qualifiers are only valid for fragment shaders"); + return -1; + } + /* start of a parenthesised list of layout qualifiers */ if (_parse_token(ctx, SL_PP_LPAREN, ps)) { @@ -744,7 +767,7 @@ _parse_layout_qualifier(struct parse_context *ctx, _emit(ctx, &ps->out, LAYOUT_QUALIFIER_PIXEL_CENTER_INTEGER); } else { -_error(ctx, "expected a layout qualifier"); +_error(ctx, "expected a layout qualifier name"); return -1; } @@ -2745,14 +2768,59 @@ _parse_external_declaration(struct parse_context *ctx, static int +_parse_extensions(struct parse_context *ctx, + struct parse_state *ps) +{ + for (;;) { + const struct sl_pp_token_info *input = _fetch_token(ctx, ps->in); + unsigned int enable; + + if (!input) { + return -1; + } + + switch (input->token) { + case SL_PP_EXTENSION_REQUIRE: + case SL_PP_EXTENSION_ENABLE: + case SL_PP_EXTENSION_WARN: + enable = 1; + break; + case SL_PP_EXTENSION_DISABLE: + enable = 0; + break; + default: + return 0; + } + + ps->in++; + if (input->data.extension == ctx->dict.all) { + ctx->fragment_coord_conventions = enable; + } + else if (input->data.extension == ctx->dict._GL_ARB_fragment_coord_conventions) { + ctx->fragment_coord_conventions = enable; + } + } +} + + +static int _parse_translation_unit(struct parse_context *ctx, struct parse_state *ps) { _emit(ctx, &ps->out, REVISION); + if (_parse_extensions(ctx, ps)) { + return -1; + } if (_parse_external_declaration(ctx, ps)) { return -1; } - while (_parse_external_declaration(ctx, ps) == 0) { + for (;;) { + if (_parse_extensions(ctx, ps)) { + return -1; + } + if (_parse_external_declaration(ctx, ps)) { + break; + } } _emit(ctx, &ps->out, EXTERNAL_NULL); if (_parse_token(ctx, SL_PP_EOF, ps)) { @@ -2862,12 +2930,17 @@ sl_cl_compile(struct sl_pp_context *context, ADD_NAME_STR(ctx, _false, "false"); ADD_NAME_STR(ctx, _true, "true"); + ADD_NAME(ctx, all); + ADD_NAME_STR(ctx, _GL_ARB_fragment_coord_conventions, "GL_ARB_fragment_coord_conventions"); + ctx.out_buf = NULL; ctx.out_cap = 0; ctx.shader_type = shader_type; ctx.parsing_builtin = 1; + ctx.fragment_coord_conventions = 0; + ctx.error[0] = '\0'; ctx.process_error = 0; ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): llvmpipe: rework do_block_16 to use bitmasks and ffs
Module: Mesa Branch: master Commit: 31c816731ead9abce69829e6b5f55a201da3bb47 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=31c816731ead9abce69829e6b5f55a201da3bb47 Author: Keith Whitwell Date: Wed Feb 17 11:07:45 2010 + llvmpipe: rework do_block_16 to use bitmasks and ffs Some nice speedups: gears: 547 -> 597 isosurf: 83 -> 98 Others like gloss unchanged. Could do further work in this direction. --- src/gallium/drivers/llvmpipe/lp_rast_tri.c | 68 +--- 1 files changed, 41 insertions(+), 27 deletions(-) diff --git a/src/gallium/drivers/llvmpipe/lp_rast_tri.c b/src/gallium/drivers/llvmpipe/lp_rast_tri.c index 3f76f15..82ff2d9 100644 --- a/src/gallium/drivers/llvmpipe/lp_rast_tri.c +++ b/src/gallium/drivers/llvmpipe/lp_rast_tri.c @@ -146,42 +146,56 @@ static void do_block_16( struct lp_rasterizer_task *rast_task, const struct lp_rast_triangle *tri, int x, int y, + int c0, int c1, - int c2, - int c3 ) + int c2 ) { - const int eo1 = tri->eo1 * 4; - const int eo2 = tri->eo2 * 4; - const int eo3 = tri->eo3 * 4; - const int *step0 = tri->inputs.step[0]; - const int *step1 = tri->inputs.step[1]; - const int *step2 = tri->inputs.step[2]; - int i; + unsigned mask = 0; + int eo[3]; + int c[3]; + int i, j; assert(x % 16 == 0); assert(y % 16 == 0); - for (i = 0; i < 16; i++) { - int cx1 = c1 + step0[i] * 4; - int cx2 = c2 + step1[i] * 4; - int cx3 = c3 + step2[i] * 4; + eo[0] = tri->eo1 * 4; + eo[1] = tri->eo2 * 4; + eo[2] = tri->eo3 * 4; - if (cx1 + eo1 < 0 || - cx2 + eo2 < 0 || - cx3 + eo3 < 0) { - /* the block is completely outside the triangle - nop */ - LP_COUNT(nr_empty_4); - } - else { - int px = x + pos_table4[i][0]; - int py = y + pos_table4[i][1]; - /* Don't bother testing if the 4x4 block is entirely in/out of - * the triangle. It's a little faster to do it in the jit code. - */ - LP_COUNT(nr_non_empty_4); - do_block_4(rast_task, tri, px, py, cx1, cx2, cx3); + c[0] = c0; + c[1] = c1; + c[2] = c2; + + for (j = 0; j < 3; j++) { + const int *step = tri->inputs.step[j]; + int cx = c[j]; + int eox = eo[j]; + + /* Mask has bits set whenever we are outside any of the edges. + */ + for (i = 0; i < 16; i++) { + int out = cx + step[i] * 4 + eox; + mask |= (out >> 31) & (1 << i); } } + + mask = ~mask & 0x; + while (mask) { + int i = ffs(mask) - 1; + int px = x + pos_table4[i][0]; + int py = y + pos_table4[i][1]; + int cx1 = c0 + tri->inputs.step[0][i] * 4; + int cx2 = c1 + tri->inputs.step[1][i] * 4; + int cx3 = c2 + tri->inputs.step[2][i] * 4; + + mask &= ~(1 << i); + + /* Don't bother testing if the 4x4 block is entirely in/out of + * the triangle. It's a little faster to do it in the jit code. + */ + LP_COUNT(nr_non_empty_4); + do_block_4(rast_task, tri, px, py, cx1, cx2, cx3); + } } ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): egl: Add new error checking macros.
Module: Mesa Branch: master Commit: f3e03e1277839cddc35e0cc3427a7972bc17a10a URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=f3e03e1277839cddc35e0cc3427a7972bc17a10a Author: Chia-I Wu Date: Wed Feb 17 15:22:03 2010 +0800 egl: Add new error checking macros. Add _EGL_CHECK_* which will replace _EGL_DECLARE_* for error checking. Move _eglCheck* earlier in the file so that the macros and the functions are grouped together. --- src/egl/main/eglapi.c | 228 + 1 files changed, 134 insertions(+), 94 deletions(-) diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c index 364ad9c..b74b960 100644 --- a/src/egl/main/eglapi.c +++ b/src/egl/main/eglapi.c @@ -70,6 +70,140 @@ /** + * Macros to help return an API entrypoint. + */ +#define _EGL_ERROR(disp, err, ret) \ + ({ \ + /* EGL error codes are non-zero */\ + if (err) \ + _eglError(err, __FUNCTION__); \ + ret; \ + }) + + +/** + * A bunch of macros and checks to simplify error checking. + */ +#define _EGL_CHECK_DISPLAY(disp, ret) \ + ({ \ + _EGLDriver *__drv = _eglCheckDisplay(disp, __FUNCTION__); \ + if (!__drv) \ + return _EGL_ERROR(disp, 0, ret); \ + __drv;\ + }) + + +#define _EGL_CHECK_OBJECT(disp, type, obj, ret) \ + ({ \ + _EGLDriver *__drv = _eglCheck ## type(disp, obj, __FUNCTION__); \ + if (!__drv) \ + return _EGL_ERROR(disp, 0, ret); \ + __drv;\ + }) +#define _EGL_CHECK_SURFACE(disp, surf, ret) \ + _EGL_CHECK_OBJECT(disp, Surface, surf, ret) +#define _EGL_CHECK_CONTEXT(disp, context, ret) \ + _EGL_CHECK_OBJECT(disp, Context, context, ret) +#define _EGL_CHECK_CONFIG(disp, conf, ret) \ + _EGL_CHECK_OBJECT(disp, Config, conf, ret) +#define _EGL_CHECK_SCREEN(disp, scrn, ret) \ + _EGL_CHECK_OBJECT(disp, Screen, scrn, ret) +#define _EGL_CHECK_MODE(disp, m, ret)\ + _EGL_CHECK_OBJECT(disp, Mode, m, ret) + + +static INLINE _EGLDriver * +_eglCheckDisplay(_EGLDisplay *disp, const char *msg) +{ + if (!disp) { + _eglError(EGL_BAD_DISPLAY, msg); + return NULL; + } + if (!disp->Initialized) { + _eglError(EGL_NOT_INITIALIZED, msg); + return NULL; + } + return disp->Driver; +} + + +static INLINE _EGLDriver * +_eglCheckSurface(_EGLDisplay *disp, _EGLSurface *surf, const char *msg) +{ + _EGLDriver *drv = _eglCheckDisplay(disp, msg); + if (!drv) + return NULL; + if (!surf) { + _eglError(EGL_BAD_SURFACE, msg); + return NULL; + } + return drv; +} + + +static INLINE _EGLDriver * +_eglCheckContext(_EGLDisplay *disp, _EGLContext *context, const char *msg) +{ + _EGLDriver *drv = _eglCheckDisplay(disp, msg); + if (!drv) + return NULL; + if (!context) { + _eglError(EGL_BAD_CONTEXT, msg); + return NULL; + } + return drv; +} + + +static INLINE _EGLDriver * +_eglCheckConfig(_EGLDisplay *disp, _EGLConfig *conf, const char *msg) +{ + _EGLDriver *drv = _eglCheckDisplay(disp, msg); + if (!drv) + return NULL; + if (!conf) { + _eglError(EGL_BAD_CONFIG, msg); + return NULL; + } + return drv; +} + + +#ifdef EGL_MESA_screen_surface + + +static INLINE _EGLDriver * +_eglCheckScreen(_EGLDisplay *disp, _EGLScreen *scrn, const char *msg) +{ + _EGLDriver *drv = _eglCheckDisplay(disp, msg); + if (!drv) + return NULL; + if (!scrn) { + _eglError(EGL_BAD_SCREEN_MESA, msg); + return NULL; + } + return drv; +} + + +static INLINE _EGLDriver * +_eglCheckMode(_EGLDisplay *disp, _EGLMode *m, const char *msg) +{ + _EGLDriver *drv = _eglCheckDisplay(disp, msg); + if (!drv) + return NULL; + if (!m) { + _eglError(EGL_BAD_MODE_MESA, msg); + return NULL; + } + return drv; +} + + +#endif /* EGL_MESA_screen_surface */ + + +/** * This is typically the first EGL function that an application calls. * We initialize our global vars and create a private _EGLDisplay object. */ @@ -159,66 +293,6 @@ eglTerminate(EGLDisplay dpy) } -/** - * A bunch of check functions and declare macros to simply error checking. - */ -static INLINE _EGLDriver * -_eglCheckDisplay(_EGLDisplay *disp, const char *msg) -{ - if (!disp) { - _eglError(EGL_BAD_DISPLAY, msg); - return NULL; - } - if (!disp->Initialized) { - _eglError(EGL_NOT_INITIALIZED, msg); -
Mesa (master): egl: Use new error checking macros.
Module: Mesa Branch: master Commit: aed7358e54fd143033d240c6e543d403da2d7336 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=aed7358e54fd143033d240c6e543d403da2d7336 Author: Chia-I Wu Date: Wed Feb 17 15:43:47 2010 +0800 egl: Use new error checking macros. Replace all uses of _EGL_DECLARE_* and _eglCheck* by _EGL_CHECK_*. --- src/egl/main/eglapi.c | 225 - 1 files changed, 110 insertions(+), 115 deletions(-) diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c index b74b960..7889147 100644 --- a/src/egl/main/eglapi.c +++ b/src/egl/main/eglapi.c @@ -293,64 +293,13 @@ eglTerminate(EGLDisplay dpy) } -#define _EGL_DECLARE_DD(dpy) \ - _EGLDisplay *disp = _eglLookupDisplay(dpy); \ - _EGLDriver *drv;\ - do {\ - drv = _eglCheckDisplay(disp, __FUNCTION__); \ - if (!drv)\ - return EGL_FALSE; \ - } while (0) - - -#define _EGL_DECLARE_DD_AND_SURFACE(dpy, surface) \ - _EGLDisplay *disp = _eglLookupDisplay(dpy); \ - _EGLSurface *surf = _eglLookupSurface((surface), disp); \ - _EGLDriver *drv;\ - do {\ - drv = _eglCheckSurface(disp, surf, __FUNCTION__);\ - if (!drv)\ - return EGL_FALSE; \ - } while (0) - - -#define _EGL_DECLARE_DD_AND_CONTEXT(dpy, ctx) \ - _EGLDisplay *disp = _eglLookupDisplay(dpy); \ - _EGLContext *context = _eglLookupContext((ctx), disp); \ - _EGLDriver *drv;\ - do {\ - drv = _eglCheckContext(disp, context, __FUNCTION__); \ - if (!drv)\ - return EGL_FALSE; \ - } while (0) - - -#define _EGL_DECLARE_DD_AND_SCREEN(dpy, screen)\ - _EGLDisplay *disp = _eglLookupDisplay(dpy); \ - _EGLScreen *scrn = _eglLookupScreen((screen), disp);\ - _EGLDriver *drv;\ - do {\ - drv = _eglCheckScreen(disp, scrn, __FUNCTION__); \ - if (!drv)\ - return EGL_FALSE; \ - } while (0) - - -#define _EGL_DECLARE_DD_AND_MODE(dpy, mode)\ - _EGLDisplay *disp = _eglLookupDisplay(dpy); \ - _EGLMode *m = _eglLookupMode((mode), disp); \ - _EGLDriver *drv;\ - do {\ - drv = _eglCheckMode(disp, m, __FUNCTION__); \ - if (!drv)\ - return EGL_FALSE; \ - } while (0) - - const char * EGLAPIENTRY eglQueryString(EGLDisplay dpy, EGLint name) { - _EGL_DECLARE_DD(dpy); + _EGLDisplay *disp = _eglLookupDisplay(dpy); + _EGLDriver *drv; + + drv = _EGL_CHECK_DISPLAY(disp, NULL); return drv->API.QueryString(drv, disp, name); } @@ -359,7 +308,10 @@ EGLBoolean EGLAPIENTRY eglGetConfigs(EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config) { - _EGL_DECLARE_DD(dpy); + _EGLDisplay *disp = _eglLookupDisplay(dpy); + _EGLDriver *drv; + + drv = _EGL_CHECK_DISPLAY(disp, EGL_FALSE); return drv->API.GetConfigs(drv, disp, configs, config_size, num_config); } @@ -368,7 +320,10 @@ EGLBoolean EGLAPIENTRY eglChooseConfig(EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config) { - _EGL_DECLARE_DD(dpy); + _EGLDisplay *disp = _eglLookupDisplay(dpy); + _EGLDriver *drv; + + drv = _EGL_CHECK_DISPLAY(disp, EGL_FALSE); return drv->API.ChooseConfig(drv, disp, attrib_list, configs, config_size, num_config); } @@ -382,10 +337,7 @@ eglGetConfigAttrib(EGLDisplay dpy, EGLConfig config, _EGLConfig *conf = _eglLookupConfig(config, disp); _EGLDriver *drv; - drv = _eglCheckConfig(disp, conf, __FUNCTION__); - if (!drv) - return EGL_FALSE; - + drv = _EGL_CHECK_CONFIG(disp, conf, EGL_FALSE); return drv->API.GetConfigAttrib(drv, disp, conf, attribute, value); } @@ -400,9 +352,7 @@ eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLContext share_list, _EGLDriver *drv; _EGLContext *context; - drv = _eglCheck
Mesa (master): egl: Add a mutex to _EGLDisplay.
Module: Mesa Branch: master Commit: 99bcb1f06d35a038b9fcf9786938a31b3dba21b7 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=99bcb1f06d35a038b9fcf9786938a31b3dba21b7 Author: Chia-I Wu Date: Wed Feb 17 17:29:52 2010 +0800 egl: Add a mutex to _EGLDisplay. A display may be shared by multiple threads. Add a mutex for access control. --- src/egl/main/egldisplay.c |1 + src/egl/main/egldisplay.h |3 +++ 2 files changed, 4 insertions(+), 0 deletions(-) diff --git a/src/egl/main/egldisplay.c b/src/egl/main/egldisplay.c index d7a8d14..acf461d 100644 --- a/src/egl/main/egldisplay.c +++ b/src/egl/main/egldisplay.c @@ -55,6 +55,7 @@ _eglNewDisplay(EGLNativeDisplayType nativeDisplay) { _EGLDisplay *dpy = (_EGLDisplay *) calloc(1, sizeof(_EGLDisplay)); if (dpy) { + _eglInitMutex(&dpy->Mutex); dpy->NativeDisplay = nativeDisplay; } return dpy; diff --git a/src/egl/main/egldisplay.h b/src/egl/main/egldisplay.h index 0390329..3698646 100644 --- a/src/egl/main/egldisplay.h +++ b/src/egl/main/egldisplay.h @@ -4,6 +4,7 @@ #include "egltypedefs.h" #include "egldefines.h" +#include "eglmutex.h" enum _egl_resource_type { @@ -53,6 +54,8 @@ struct _egl_display /* used to link displays */ _EGLDisplay *Next; + _EGLMutex Mutex; + EGLNativeDisplayType NativeDisplay; EGLBoolean Initialized; /**< True if the display is initialized */ ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): egl: Always record error code.
Module: Mesa Branch: master Commit: 3dee01a692796496b6e3d6ff6e4ebac10b594640 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=3dee01a692796496b6e3d6ff6e4ebac10b594640 Author: Chia-I Wu Date: Wed Feb 17 16:42:30 2010 +0800 egl: Always record error code. The error code denotes the success or failure of the most recent function call. A call to _eglError should always update the error code. --- src/egl/main/eglcurrent.c |9 + 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/egl/main/eglcurrent.c b/src/egl/main/eglcurrent.c index 989c19a..c697bf7 100644 --- a/src/egl/main/eglcurrent.c +++ b/src/egl/main/eglcurrent.c @@ -248,19 +248,20 @@ _eglGetCurrentContext(void) /** - * Record EGL error code. + * Record EGL error code and return EGL_FALSE. */ EGLBoolean _eglError(EGLint errCode, const char *msg) { _EGLThreadInfo *t = _eglGetCurrentThread(); - const char *s; if (t == &dummy_thread) return EGL_FALSE; - if (t->LastError == EGL_SUCCESS) { - t->LastError = errCode; + t->LastError = errCode; + + if (errCode != EGL_SUCCESS) { + const char *s; switch (errCode) { case EGL_BAD_ACCESS: ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): egl: eglGetError should return the status of the last call.
Module: Mesa Branch: master Commit: b3bb18062005d3c9ec0f942a5e096e7e38c6f3e1 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=b3bb18062005d3c9ec0f942a5e096e7e38c6f3e1 Author: Chia-I Wu Date: Wed Feb 17 16:05:27 2010 +0800 egl: eglGetError should return the status of the last call. Use macros to record the status of the function call before returning. This is the only way that eglGetError can return the status of the most recent function call. --- src/egl/main/eglapi.c | 349 - 1 files changed, 226 insertions(+), 123 deletions(-) diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c index 7889147..66fbbe2 100644 --- a/src/egl/main/eglapi.c +++ b/src/egl/main/eglapi.c @@ -79,6 +79,9 @@ _eglError(err, __FUNCTION__); \ ret; \ }) +#define _EGL_SUCCESS(disp, ret) _EGL_ERROR(disp, EGL_SUCCESS, ret) +/* record EGL_SUCCESS only when ret evaluates to true */ +#define _EGL_EVAL(disp, ret) _EGL_ERROR(disp, (ret) ? EGL_SUCCESS : 0, ret) /** @@ -232,7 +235,7 @@ eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor) EGLint major_int, minor_int; if (!disp) - return _eglError(EGL_BAD_DISPLAY, __FUNCTION__); + return _EGL_ERROR(NULL, EGL_BAD_DISPLAY, EGL_FALSE); if (!disp->Initialized) { _EGLDriver *drv = disp->Driver; @@ -241,12 +244,12 @@ eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor) _eglPreloadDrivers(); drv = _eglMatchDriver(disp); if (!drv) -return _eglError(EGL_NOT_INITIALIZED, __FUNCTION__); +return _EGL_ERROR(disp, EGL_NOT_INITIALIZED, EGL_FALSE); } /* Initialize the particular display now */ if (!drv->API.Initialize(drv, disp, &major_int, &minor_int)) - return _eglError(EGL_NOT_INITIALIZED, __FUNCTION__); + return _EGL_ERROR(disp, EGL_NOT_INITIALIZED, EGL_FALSE); disp->APImajor = major_int; disp->APIminor = minor_int; @@ -269,7 +272,7 @@ eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor) *minor = minor_int; } - return EGL_TRUE; + return _EGL_SUCCESS(disp, EGL_TRUE); } @@ -279,7 +282,7 @@ eglTerminate(EGLDisplay dpy) _EGLDisplay *disp = _eglLookupDisplay(dpy); if (!disp) - return _eglError(EGL_BAD_DISPLAY, __FUNCTION__); + return _EGL_ERROR(NULL, EGL_BAD_DISPLAY, EGL_FALSE); if (disp->Initialized) { _EGLDriver *drv = disp->Driver; @@ -289,7 +292,7 @@ eglTerminate(EGLDisplay dpy) disp->Initialized = EGL_FALSE; } - return EGL_TRUE; + return _EGL_SUCCESS(disp, EGL_TRUE); } @@ -298,9 +301,12 @@ eglQueryString(EGLDisplay dpy, EGLint name) { _EGLDisplay *disp = _eglLookupDisplay(dpy); _EGLDriver *drv; + const char *ret; drv = _EGL_CHECK_DISPLAY(disp, NULL); - return drv->API.QueryString(drv, disp, name); + ret = drv->API.QueryString(drv, disp, name); + + return _EGL_EVAL(disp, ret); } @@ -310,9 +316,12 @@ eglGetConfigs(EGLDisplay dpy, EGLConfig *configs, { _EGLDisplay *disp = _eglLookupDisplay(dpy); _EGLDriver *drv; + EGLBoolean ret; drv = _EGL_CHECK_DISPLAY(disp, EGL_FALSE); - return drv->API.GetConfigs(drv, disp, configs, config_size, num_config); + ret = drv->API.GetConfigs(drv, disp, configs, config_size, num_config); + + return _EGL_EVAL(disp, ret); } @@ -322,10 +331,13 @@ eglChooseConfig(EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, { _EGLDisplay *disp = _eglLookupDisplay(dpy); _EGLDriver *drv; + EGLBoolean ret; drv = _EGL_CHECK_DISPLAY(disp, EGL_FALSE); - return drv->API.ChooseConfig(drv, disp, attrib_list, configs, + ret = drv->API.ChooseConfig(drv, disp, attrib_list, configs, config_size, num_config); + + return _EGL_EVAL(disp, ret); } @@ -336,9 +348,12 @@ eglGetConfigAttrib(EGLDisplay dpy, EGLConfig config, _EGLDisplay *disp = _eglLookupDisplay(dpy); _EGLConfig *conf = _eglLookupConfig(config, disp); _EGLDriver *drv; + EGLBoolean ret; drv = _EGL_CHECK_CONFIG(disp, conf, EGL_FALSE); - return drv->API.GetConfigAttrib(drv, disp, conf, attribute, value); + ret = drv->API.GetConfigAttrib(drv, disp, conf, attribute, value); + + return _EGL_EVAL(disp, ret); } @@ -351,18 +366,16 @@ eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLContext share_list, _EGLContext *share = _eglLookupContext(share_list, disp); _EGLDriver *drv; _EGLContext *context; + EGLContext ret; drv = _EGL_CHECK_CONFIG(disp, conf, EGL_NO_CONTEXT); - if (!share && share_list != EGL_NO_CONTEXT) { - _eglError(EGL_BAD_CONTEXT, __FUNCTION__); - return EGL_NO_CONTEXT; - } + if (!share && share_list != EGL_NO_CONTEXT) + return _EGL_ERROR(disp, EGL_BAD_CONTEXT, EGL_NO_CONTEXT); context = drv->API.CreateContext(drv, disp, conf, share, attrib_list); - if (con
Mesa (master): egl: Make eglGetDisplay atomic.
Module: Mesa Branch: master Commit: db5ce8b3843a03c6f83a02a79f033d7e74784dd5 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=db5ce8b3843a03c6f83a02a79f033d7e74784dd5 Author: Chia-I Wu Date: Wed Feb 17 18:39:27 2010 +0800 egl: Make eglGetDisplay atomic. Merge _eglNewDisplay and _eglLinkDisplay into _eglFindDisplay. Remove unused _eglUnlinkDisplay. --- src/egl/main/eglapi.c | 10 + src/egl/main/egldisplay.c | 91 +--- src/egl/main/egldisplay.h | 24 +--- 3 files changed, 22 insertions(+), 103 deletions(-) diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c index 66fbbe2..d5e69a6 100644 --- a/src/egl/main/eglapi.c +++ b/src/egl/main/eglapi.c @@ -208,18 +208,12 @@ _eglCheckMode(_EGLDisplay *disp, _EGLMode *m, const char *msg) /** * This is typically the first EGL function that an application calls. - * We initialize our global vars and create a private _EGLDisplay object. + * It associates a private _EGLDisplay object to the native display. */ EGLDisplay EGLAPIENTRY eglGetDisplay(EGLNativeDisplayType nativeDisplay) { - _EGLDisplay *dpy; - dpy = _eglFindDisplay(nativeDisplay); - if (!dpy) { - dpy = _eglNewDisplay(nativeDisplay); - if (dpy) - _eglLinkDisplay(dpy); - } + _EGLDisplay *dpy = _eglFindDisplay(nativeDisplay); return _eglGetDisplayHandle(dpy); } diff --git a/src/egl/main/egldisplay.c b/src/egl/main/egldisplay.c index acf461d..f7dbe8e 100644 --- a/src/egl/main/egldisplay.c +++ b/src/egl/main/egldisplay.c @@ -45,73 +45,8 @@ _eglFiniDisplay(void) /** - * Allocate a new _EGLDisplay object for the given nativeDisplay handle. - * We'll also try to determine the device driver name at this time. - * - * Note that nativeDisplay may be an X Display ptr, or a string. - */ -_EGLDisplay * -_eglNewDisplay(EGLNativeDisplayType nativeDisplay) -{ - _EGLDisplay *dpy = (_EGLDisplay *) calloc(1, sizeof(_EGLDisplay)); - if (dpy) { - _eglInitMutex(&dpy->Mutex); - dpy->NativeDisplay = nativeDisplay; - } - return dpy; -} - - -/** - * Link a display to itself and return the handle of the link. - * The handle can be passed to client directly. - */ -EGLDisplay -_eglLinkDisplay(_EGLDisplay *dpy) -{ - _eglLockMutex(_eglGlobal.Mutex); - - dpy->Next = _eglGlobal.DisplayList; - _eglGlobal.DisplayList = dpy; - - _eglUnlockMutex(_eglGlobal.Mutex); - - return (EGLDisplay) dpy; -} - - -/** - * Unlink a linked display from itself. - * Accessing an unlinked display should generate EGL_BAD_DISPLAY error. - */ -void -_eglUnlinkDisplay(_EGLDisplay *dpy) -{ - _EGLDisplay *prev; - - _eglLockMutex(_eglGlobal.Mutex); - - prev = _eglGlobal.DisplayList; - if (prev != dpy) { - while (prev) { - if (prev->Next == dpy) -break; - prev = prev->Next; - } - assert(prev); - prev->Next = dpy->Next; - } - else { - _eglGlobal.DisplayList = dpy->Next; - } - - _eglUnlockMutex(_eglGlobal.Mutex); -} - - -/** - * Find the display corresponding to the specified native display id in all - * linked displays. + * Find the display corresponding to the specified native display, or create a + * new one. */ _EGLDisplay * _eglFindDisplay(EGLNativeDisplayType nativeDisplay) @@ -120,18 +55,30 @@ _eglFindDisplay(EGLNativeDisplayType nativeDisplay) _eglLockMutex(_eglGlobal.Mutex); + /* search the display list first */ dpy = _eglGlobal.DisplayList; while (dpy) { - if (dpy->NativeDisplay == nativeDisplay) { - _eglUnlockMutex(_eglGlobal.Mutex); - return dpy; - } + if (dpy->NativeDisplay == nativeDisplay) + break; dpy = dpy->Next; } + /* create a new display */ + if (!dpy) { + dpy = (_EGLDisplay *) calloc(1, sizeof(_EGLDisplay)); + if (dpy) { + _eglInitMutex(&dpy->Mutex); + dpy->NativeDisplay = nativeDisplay; + + /* add to the display list */ + dpy->Next = _eglGlobal.DisplayList; + _eglGlobal.DisplayList = dpy; + } + } + _eglUnlockMutex(_eglGlobal.Mutex); - return NULL; + return dpy; } diff --git a/src/egl/main/egldisplay.h b/src/egl/main/egldisplay.h index 3698646..43b39bd 100644 --- a/src/egl/main/egldisplay.h +++ b/src/egl/main/egldisplay.h @@ -88,19 +88,7 @@ _eglFiniDisplay(void); extern _EGLDisplay * -_eglNewDisplay(EGLNativeDisplayType displayName); - - -extern EGLDisplay -_eglLinkDisplay(_EGLDisplay *dpy); - - -extern void -_eglUnlinkDisplay(_EGLDisplay *dpy); - - -extern _EGLDisplay * -_eglFindDisplay(EGLNativeDisplayType nativeDisplay); +_eglFindDisplay(EGLNativeDisplayType displayName); PUBLIC void @@ -167,16 +155,6 @@ _eglGetDisplayHandle(_EGLDisplay *dpy) } -/** - * Return true if the display is linked. - */ -static INLINE EGLBoolean -_eglIsDisplayLinked(_EGLDisplay *dpy) -{ - return (EGLBoolean) (_eglGetDisplayHandle(dpy) != EGL_NO_DISPLAY); -} - - extern void _eglLink
Mesa (master): egl: Always lock a display before using it.
Module: Mesa Branch: master Commit: 655f4654675e601a9482e40d8e50156c965b8934 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=655f4654675e601a9482e40d8e50156c965b8934 Author: Chia-I Wu Date: Wed Feb 17 17:30:44 2010 +0800 egl: Always lock a display before using it. This gives a simple access control to the display. It is potentially slow, but a finer grained mutex can always be used in the future. The benefit of this simple approach is that drivers need not to worry about thread-safety. --- src/egl/main/eglapi.c | 125 +++-- src/egl/main/eglapi.h |1 + 2 files changed, 81 insertions(+), 45 deletions(-) diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c index d5e69a6..2de1ac3 100644 --- a/src/egl/main/eglapi.c +++ b/src/egl/main/eglapi.c @@ -71,9 +71,13 @@ /** * Macros to help return an API entrypoint. + * + * These macros will unlock the display and record the error code. */ #define _EGL_ERROR(disp, err, ret) \ ({ \ + if (disp) \ + _eglUnlockDisplay(disp); \ /* EGL error codes are non-zero */\ if (err) \ _eglError(err, __FUNCTION__); \ @@ -207,6 +211,29 @@ _eglCheckMode(_EGLDisplay *disp, _EGLMode *m, const char *msg) /** + * Lookup and lock a display. + */ +static INLINE _EGLDisplay * +_eglLockDisplay(EGLDisplay display) +{ + _EGLDisplay *dpy = _eglLookupDisplay(display); + if (dpy) + _eglLockMutex(&dpy->Mutex); + return dpy; +} + + +/** + * Unlock a display. + */ +static INLINE void +_eglUnlockDisplay(_EGLDisplay *dpy) +{ + _eglUnlockMutex(&dpy->Mutex); +} + + +/** * This is typically the first EGL function that an application calls. * It associates a private _EGLDisplay object to the native display. */ @@ -225,7 +252,7 @@ eglGetDisplay(EGLNativeDisplayType nativeDisplay) EGLBoolean EGLAPIENTRY eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor) { - _EGLDisplay *disp = _eglLookupDisplay(dpy); + _EGLDisplay *disp = _eglLockDisplay(dpy); EGLint major_int, minor_int; if (!disp) @@ -273,7 +300,7 @@ eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor) EGLBoolean EGLAPIENTRY eglTerminate(EGLDisplay dpy) { - _EGLDisplay *disp = _eglLookupDisplay(dpy); + _EGLDisplay *disp = _eglLockDisplay(dpy); if (!disp) return _EGL_ERROR(NULL, EGL_BAD_DISPLAY, EGL_FALSE); @@ -293,7 +320,7 @@ eglTerminate(EGLDisplay dpy) const char * EGLAPIENTRY eglQueryString(EGLDisplay dpy, EGLint name) { - _EGLDisplay *disp = _eglLookupDisplay(dpy); + _EGLDisplay *disp = _eglLockDisplay(dpy); _EGLDriver *drv; const char *ret; @@ -308,7 +335,7 @@ EGLBoolean EGLAPIENTRY eglGetConfigs(EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config) { - _EGLDisplay *disp = _eglLookupDisplay(dpy); + _EGLDisplay *disp = _eglLockDisplay(dpy); _EGLDriver *drv; EGLBoolean ret; @@ -323,7 +350,7 @@ EGLBoolean EGLAPIENTRY eglChooseConfig(EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config) { - _EGLDisplay *disp = _eglLookupDisplay(dpy); + _EGLDisplay *disp = _eglLockDisplay(dpy); _EGLDriver *drv; EGLBoolean ret; @@ -339,7 +366,7 @@ EGLBoolean EGLAPIENTRY eglGetConfigAttrib(EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value) { - _EGLDisplay *disp = _eglLookupDisplay(dpy); + _EGLDisplay *disp = _eglLockDisplay(dpy); _EGLConfig *conf = _eglLookupConfig(config, disp); _EGLDriver *drv; EGLBoolean ret; @@ -355,7 +382,7 @@ EGLContext EGLAPIENTRY eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLContext share_list, const EGLint *attrib_list) { - _EGLDisplay *disp = _eglLookupDisplay(dpy); + _EGLDisplay *disp = _eglLockDisplay(dpy); _EGLConfig *conf = _eglLookupConfig(config, disp); _EGLContext *share = _eglLookupContext(share_list, disp); _EGLDriver *drv; @@ -376,7 +403,7 @@ eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLContext share_list, EGLBoolean EGLAPIENTRY eglDestroyContext(EGLDisplay dpy, EGLContext ctx) { - _EGLDisplay *disp = _eglLookupDisplay(dpy); + _EGLDisplay *disp = _eglLockDisplay(dpy); _EGLContext *context = _eglLookupContext(ctx, disp); _EGLDriver *drv; EGLBoolean ret; @@ -393,7 +420,7 @@ EGLBoolean EGLAPIENTRY eglMakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx) { - _EGLDisplay *disp = _eglLookupDisplay(dpy); + _EGLDisplay *disp = _eglLockDisplay(dpy); _EGLContext *context = _eglLookupContext(ctx, disp); _EGLSurface *draw_surf = _eglLookupSurface(draw, disp); _EGLSurface *read_surf = _eglLookupSurface(read, disp); @@ -429,7 +456,7 @@ EGLBoolean EGLAPIENTRY eglQueryContext(EG
Mesa (master): egl: Revisit global data locking.
Module: Mesa Branch: master Commit: 4afe24808ee253c44c65b855f65bd0749c1e1524 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=4afe24808ee253c44c65b855f65bd0749c1e1524 Author: Chia-I Wu Date: Wed Feb 17 19:03:30 2010 +0800 egl: Revisit global data locking. Lock the global mutex in _eglPreloadDrivers and _eglAllocScreenHandle. Add comments to why certain pathes do not need locking. --- src/egl/main/egldriver.c | 15 ++- src/egl/main/eglglobals.h |1 + src/egl/main/eglscreen.c | 11 --- src/egl/main/eglscreen.h |4 4 files changed, 23 insertions(+), 8 deletions(-) diff --git a/src/egl/main/egldriver.c b/src/egl/main/egldriver.c index a87c697..8748fe5 100644 --- a/src/egl/main/egldriver.c +++ b/src/egl/main/egldriver.c @@ -237,6 +237,10 @@ _eglMatchDriver(_EGLDisplay *dpy) _EGLDriver *best_drv = NULL; EGLint best_score = -1, i; + /* +* this function is called after preloading and the drivers never change +* after preloading. +*/ for (i = 0; i < _eglGlobal.NumDrivers; i++) { _EGLDriver *drv = _eglGlobal.Drivers[i]; EGLint score; @@ -529,14 +533,21 @@ _eglPreloadDrivers(void) { EGLBoolean loaded; + /* protect the preloading process */ + _eglLockMutex(_eglGlobal.Mutex); + /* already preloaded */ - if (_eglGlobal.NumDrivers) + if (_eglGlobal.NumDrivers) { + _eglUnlockMutex(_eglGlobal.Mutex); return EGL_TRUE; + } loaded = (_eglPreloadUserDriver() || _eglPreloadDisplayDrivers() || _eglPreloadDefaultDriver()); + _eglUnlockMutex(_eglGlobal.Mutex); + return loaded; } @@ -548,6 +559,8 @@ void _eglUnloadDrivers(void) { EGLint i; + + /* this is called at atexit time */ for (i = 0; i < _eglGlobal.NumDrivers; i++) { _EGLDriver *drv = _eglGlobal.Drivers[i]; lib_handle handle = drv->LibHandle; diff --git a/src/egl/main/eglglobals.h b/src/egl/main/eglglobals.h index cd1dd58..4368898 100644 --- a/src/egl/main/eglglobals.h +++ b/src/egl/main/eglglobals.h @@ -18,6 +18,7 @@ struct _egl_global EGLScreenMESA FreeScreenHandle; + /* these never change after preloading */ EGLint NumDrivers; _EGLDriver *Drivers[10]; diff --git a/src/egl/main/eglscreen.c b/src/egl/main/eglscreen.c index 97a405a..c47afd6 100644 --- a/src/egl/main/eglscreen.c +++ b/src/egl/main/eglscreen.c @@ -22,17 +22,22 @@ #include "eglconfig.h" #include "eglsurface.h" #include "eglscreen.h" +#include "eglmutex.h" /** * Return a new screen handle/ID. * NOTE: we never reuse these! */ -EGLScreenMESA +static EGLScreenMESA _eglAllocScreenHandle(void) { - EGLScreenMESA s = _eglGlobal.FreeScreenHandle; - _eglGlobal.FreeScreenHandle++; + EGLScreenMESA s; + + _eglLockMutex(_eglGlobal.Mutex); + s = _eglGlobal.FreeScreenHandle++; + _eglUnlockMutex(_eglGlobal.Mutex); + return s; } diff --git a/src/egl/main/eglscreen.h b/src/egl/main/eglscreen.h index c400ac3..0fd71f7 100644 --- a/src/egl/main/eglscreen.h +++ b/src/egl/main/eglscreen.h @@ -29,10 +29,6 @@ struct _egl_screen }; -extern EGLScreenMESA -_eglAllocScreenHandle(void); - - PUBLIC void _eglInitScreen(_EGLScreen *screen); ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): docs: Update TODOs of egl.html.
Module: Mesa Branch: master Commit: e16f577142ff041f058abf80712df23c6837f6cf URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=e16f577142ff041f058abf80712df23c6837f6cf Author: Chia-I Wu Date: Wed Feb 17 19:52:29 2010 +0800 docs: Update TODOs of egl.html. Thread-safety is no longer a TODO item. There are surely bugs to be fixed though. --- docs/egl.html | 10 +- 1 files changed, 9 insertions(+), 1 deletions(-) diff --git a/docs/egl.html b/docs/egl.html index 844cc32..82cc066 100644 --- a/docs/egl.html +++ b/docs/egl.html @@ -302,10 +302,18 @@ pbuffer surfaces. Therefore, the driver is responsible to guarantee that the client API renders to the specified render buffer for pixmap and pbuffer surfaces. +EGLDisplay Mutex + +The EGLDisplay will be locked before calling any of the dispatch +functions (well, except for GetProcAddress which does not take an +EGLDisplay). This guarantees that the same dispatch function will +not be called with the sample display at the same time. If a driver has access +to an EGLDisplay without going through the EGL APIs, the driver +should as well lock the display before using it. + TODOs -Thread safety Pass the conformance tests Better automatic driver selection: EGL_DISPLAY loads all drivers and might eat too much memory. ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): llvmpipe: use ffs technique for full tiles also
Module: Mesa Branch: master Commit: 0c938143db71b2753c97a8fb4c96aeb266f97a0e URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=0c938143db71b2753c97a8fb4c96aeb266f97a0e Author: Keith Whitwell Date: Wed Feb 17 11:53:31 2010 + llvmpipe: use ffs technique for full tiles also Need to compute two masks here for full and partial 16x16 blocks. Gives a further good improvement for isosurf particularly: isosurf 97 -> 108 gears 597 -> 611 --- src/gallium/drivers/llvmpipe/lp_rast_tri.c | 115 +--- 1 files changed, 70 insertions(+), 45 deletions(-) diff --git a/src/gallium/drivers/llvmpipe/lp_rast_tri.c b/src/gallium/drivers/llvmpipe/lp_rast_tri.c index 82ff2d9..0334705 100644 --- a/src/gallium/drivers/llvmpipe/lp_rast_tri.c +++ b/src/gallium/drivers/llvmpipe/lp_rast_tri.c @@ -168,13 +168,12 @@ do_block_16( struct lp_rasterizer_task *rast_task, for (j = 0; j < 3; j++) { const int *step = tri->inputs.step[j]; - int cx = c[j]; - int eox = eo[j]; + const int cx = c[j] + eo[j]; /* Mask has bits set whenever we are outside any of the edges. */ for (i = 0; i < 16; i++) { - int out = cx + step[i] * 4 + eox; + int out = cx + step[i] * 4; mask |= (out >> 31) & (1 << i); } } @@ -213,53 +212,79 @@ lp_rast_triangle( struct lp_rasterizer *rast, int x = rast_task->x; int y = rast_task->y; - unsigned i; + int ei[3], eo[3], c[3]; + unsigned outmask, inmask, partial_mask; + unsigned i, j; - int c1 = tri->c1 + tri->dx12 * y - tri->dy12 * x; - int c2 = tri->c2 + tri->dx23 * y - tri->dy23 * x; - int c3 = tri->c3 + tri->dx31 * y - tri->dy31 * x; + c[0] = tri->c1 + tri->dx12 * y - tri->dy12 * x; + c[1] = tri->c2 + tri->dx23 * y - tri->dy23 * x; + c[2] = tri->c3 + tri->dx31 * y - tri->dy31 * x; - int ei1 = tri->ei1 * 16; - int ei2 = tri->ei2 * 16; - int ei3 = tri->ei3 * 16; + eo[0] = tri->eo1 * 16; + eo[1] = tri->eo2 * 16; + eo[2] = tri->eo3 * 16; - int eo1 = tri->eo1 * 16; - int eo2 = tri->eo2 * 16; - int eo3 = tri->eo3 * 16; + ei[0] = tri->ei1 * 16; + ei[1] = tri->ei2 * 16; + ei[2] = tri->ei3 * 16; - LP_DBG(DEBUG_RAST, "lp_rast_triangle\n"); + outmask = 0; + inmask = 0x; - /* Walk over the tile to build a list of 4x4 pixel blocks which will -* be filled/shaded. We do this at two granularities: 16x16 blocks -* and then 4x4 blocks. -*/ - for (i = 0; i < 16; i++) { - int cx1 = c1 + (tri->inputs.step[0][i] * 16); - int cx2 = c2 + (tri->inputs.step[1][i] * 16); - int cx3 = c3 + (tri->inputs.step[2][i] * 16); - - if (cx1 + eo1 < 0 || - cx2 + eo2 < 0 || - cx3 + eo3 < 0) { - /* the block is completely outside the triangle - nop */ - LP_COUNT(nr_empty_16); - } - else { - int px = x + pos_table16[i][0]; - int py = y + pos_table16[i][1]; - - if (cx1 + ei1 > 0 && - cx2 + ei2 > 0 && - cx3 + ei3 > 0) { -/* the block is completely inside the triangle */ -LP_COUNT(nr_fully_covered_16); -block_full_16(rast_task, tri, px, py); - } - else { -/* the block is partially in/out of the triangle */ -LP_COUNT(nr_partially_covered_16); -do_block_16(rast_task, tri, px, py, cx1, cx2, cx3); - } + for (j = 0; j < 3; j++) { + const int *step = tri->inputs.step[j]; + const int cox = c[j] + eo[j]; + const int cio = ei[j]- eo[j]; + + /* Outmask has bits set whenever we are outside any of the + * edges. + */ + /* Inmask has bits set whenever we are inside all of the edges. + */ + for (i = 0; i < 16; i++) { + int out = cox + step[i] * 16; + int in = out + cio; + outmask |= (out >> 31) & (1 << i); + inmask &= ~((in >> 31) & (1 << i)); } } + + assert((outmask & inmask) == 0); + + if (outmask == 0x) + return; + + /* Invert mask, so that bits are set whenever we are at least +* partially inside all of the edges: +*/ + partial_mask = ~inmask & ~outmask & 0x; + + /* Iterate over partials: +*/ + while (partial_mask) { + int i = ffs(partial_mask) - 1; + int px = x + pos_table16[i][0]; + int py = y + pos_table16[i][1]; + int cx1 = c[0] + tri->inputs.step[0][i] * 16; + int cx2 = c[1] + tri->inputs.step[1][i] * 16; + int cx3 = c[2] + tri->inputs.step[2][i] * 16; + + partial_mask &= ~(1 << i); + + LP_COUNT(nr_partially_covered_16); + do_block_16(rast_task, tri, px, py, cx1, cx2, cx3); + } + + /* Iterate over fulls: +*/ + while (inmask) { + int i = ffs(inmask) - 1; + int px = x + pos_table16[i][0]; + int py = y + pos_table16[i][1]; + + inmask &= ~(1 << i); + + LP_COUNT(nr_fully_covered_16); + block_full_16(rast_task, tri, px, py); + } }
Mesa (master): progs/es1: Update .gitignore.
Module: Mesa Branch: master Commit: 915d60dcf5bd2db2476668110e43d230c1310c3f URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=915d60dcf5bd2db2476668110e43d230c1310c3f Author: Chia-I Wu Date: Wed Feb 17 22:29:43 2010 +0800 progs/es1: Update .gitignore. Add xegl/bindtex to .gitignore. --- progs/es1/.gitignore |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/progs/es1/.gitignore b/progs/es1/.gitignore index 4f14275..5e29a6b 100644 --- a/progs/es1/.gitignore +++ b/progs/es1/.gitignore @@ -1,5 +1,6 @@ screen/gears screen/tri +xegl/bindtex xegl/drawtex xegl/es1_info xegl/msaa ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): progs/openvg: Add .gitignore.
Module: Mesa Branch: master Commit: f4542477cfca8f78de7ac14ad7f431ac6454f45b URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=f4542477cfca8f78de7ac14ad7f431ac6454f45b Author: Chia-I Wu Date: Wed Feb 17 22:30:29 2010 +0800 progs/openvg: Add .gitignore. Add all OpenVG demos to .gitignore. --- progs/openvg/.gitignore | 24 1 files changed, 24 insertions(+), 0 deletions(-) diff --git a/progs/openvg/.gitignore b/progs/openvg/.gitignore new file mode 100644 index 000..9b05e1e --- /dev/null +++ b/progs/openvg/.gitignore @@ -0,0 +1,24 @@ +demos/lion +demos/sp +trivial/arc +trivial/cap +trivial/clear +trivial/coord +trivial/dash +trivial/ellipse +trivial/filter +trivial/gradorigin +trivial/lineto +trivial/lingrad +trivial/lookup +trivial/mask4 +trivial/mask +trivial/path3 +trivial/radialgrad +trivial/readpixels +trivial/roundedrect +trivial/star-nonzero +trivial/star-oddeven +trivial/stroke2 +trivial/stroke +trivial/vguarc ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): st/mesa: replace conditional with assertion
Module: Mesa Branch: master Commit: 6b4a553dd34764f8c696ae8198d98efbb28bbc93 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=6b4a553dd34764f8c696ae8198d98efbb28bbc93 Author: Brian Paul Date: Wed Feb 17 08:27:53 2010 -0700 st/mesa: replace conditional with assertion Core Mesa will not call ctx->Driver.CheckQuery() if the Ready flag is already set. --- src/mesa/state_tracker/st_cb_queryobj.c |9 ++--- 1 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/mesa/state_tracker/st_cb_queryobj.c b/src/mesa/state_tracker/st_cb_queryobj.c index 2281d10..dc40c5d 100644 --- a/src/mesa/state_tracker/st_cb_queryobj.c +++ b/src/mesa/state_tracker/st_cb_queryobj.c @@ -130,13 +130,8 @@ st_CheckQuery(GLcontext *ctx, struct gl_query_object *q) { struct pipe_context *pipe = ctx->st->pipe; struct st_query_object *stq = st_query_object(q); - - if (!q->Ready) { - q->Ready = pipe->get_query_result(pipe, - stq->pq, - FALSE, - &q->Result); - } + assert(!q->Ready); /* we should not get called if Ready is TRUE */ + q->Ready = pipe->get_query_result(pipe, stq->pq, FALSE, &q->Result); } ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): progs/demos: update GL version test to accept GL 3.x
Module: Mesa Branch: master Commit: 0583c29313a4bcd01cc8d30846c815cdc775cb16 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=0583c29313a4bcd01cc8d30846c815cdc775cb16 Author: Brian Paul Date: Wed Feb 17 09:02:33 2010 -0700 progs/demos: update GL version test to accept GL 3.x --- progs/demos/fslight.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/progs/demos/fslight.c b/progs/demos/fslight.c index 395b7ca..91a5a80 100644 --- a/progs/demos/fslight.c +++ b/progs/demos/fslight.c @@ -467,8 +467,8 @@ Init(void) const char *version; version = (const char *) glGetString(GL_VERSION); - if (version[0] != '2' || version[1] != '.') { - printf("This program requires OpenGL 2.x, found %s\n", version); + if (version[0] == '1') { + printf("This program requires OpenGL 2.x or higher, found %s\n", version); exit(1); } ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): glsl/apps: print usage info if insufficient args
Module: Mesa Branch: master Commit: 5b392ff49ab6be3947b457feafdbb72463fd0686 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=5b392ff49ab6be3947b457feafdbb72463fd0686 Author: Brian Paul Date: Wed Feb 17 08:59:02 2010 -0700 glsl/apps: print usage info if insufficient args --- src/glsl/apps/process.c |1 + src/glsl/apps/purify.c |1 + src/glsl/apps/tokenise.c |1 + src/glsl/apps/version.c |1 + 4 files changed, 4 insertions(+), 0 deletions(-) diff --git a/src/glsl/apps/process.c b/src/glsl/apps/process.c index 2d2ab91..e65f35c 100644 --- a/src/glsl/apps/process.c +++ b/src/glsl/apps/process.c @@ -47,6 +47,7 @@ main(int argc, unsigned int i; if (argc != 3) { + printf("Usage: process infile outfile\n"); return 1; } diff --git a/src/glsl/apps/purify.c b/src/glsl/apps/purify.c index 8c01f4f..3019e8b 100644 --- a/src/glsl/apps/purify.c +++ b/src/glsl/apps/purify.c @@ -45,6 +45,7 @@ main(int argc, FILE *out; if (argc != 3) { + printf("Usage: purify infile outfile\n"); return 1; } diff --git a/src/glsl/apps/tokenise.c b/src/glsl/apps/tokenise.c index 9ff7315..c70c3cc 100644 --- a/src/glsl/apps/tokenise.c +++ b/src/glsl/apps/tokenise.c @@ -46,6 +46,7 @@ main(int argc, unsigned int i; if (argc != 3) { + printf("Usage: tokenize infile outfile\n"); return 1; } diff --git a/src/glsl/apps/version.c b/src/glsl/apps/version.c index 40a4a06..0420f97 100644 --- a/src/glsl/apps/version.c +++ b/src/glsl/apps/version.c @@ -45,6 +45,7 @@ main(int argc, FILE *out; if (argc != 3) { + printf("Usage: version infile outfile\n"); return 1; } ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): glx: Use wrapper macro to detect direct rendering
Module: Mesa Branch: master Commit: 2b4e009ed56b69b243f5cc88f490dcf8166cf729 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=2b4e009ed56b69b243f5cc88f490dcf8166cf729 Author: Ian Romanick Date: Thu Feb 4 15:39:36 2010 -0800 glx: Use wrapper macro to detect direct rendering The wrapper macro GC_IS_DIRECT is used in CreateContext and a couple other places to eliminate the need for some of the '#ifdef GLX_DIRECT_RENDERING' madness. There appear to be a *LOT* of places in glxcmds.c where '#ifdef GLX_DIRECT_RENDERING' is missing. --- src/glx/glxcmds.c | 32 1 files changed, 8 insertions(+), 24 deletions(-) diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c index c3be974..4922406 100644 --- a/src/glx/glxcmds.c +++ b/src/glx/glxcmds.c @@ -42,6 +42,9 @@ #include #include #include "xf86dri.h" +#define GC_IS_DIRECT(gc) ((gc)->driContext != NULL) +#else +#define GC_IS_DIRECT(gc) (0) #endif #if defined(USE_XCB) @@ -431,11 +434,7 @@ CreateContext(Display * dpy, XVisualInfo * vis, req->visual = vis->visualid; req->screen = vis->screen; req->shareList = shareList ? shareList->xid : None; -#ifdef GLX_DIRECT_RENDERING - req->isDirect = gc->driContext != NULL; -#else - req->isDirect = 0; -#endif + req->isDirect = GC_IS_DIRECT(gc); } else if (use_glx_1_3) { xGLXCreateNewContextReq *req; @@ -449,11 +448,7 @@ CreateContext(Display * dpy, XVisualInfo * vis, req->screen = fbconfig->screen; req->renderType = renderType; req->shareList = shareList ? shareList->xid : None; -#ifdef GLX_DIRECT_RENDERING - req->isDirect = gc->driContext != NULL; -#else - req->isDirect = 0; -#endif + req->isDirect = GC_IS_DIRECT(gc); } else { xGLXVendorPrivateWithReplyReq *vpreq; @@ -472,11 +467,7 @@ CreateContext(Display * dpy, XVisualInfo * vis, req->screen = fbconfig->screen; req->renderType = renderType; req->shareList = shareList ? shareList->xid : None; -#ifdef GLX_DIRECT_RENDERING - req->isDirect = gc->driContext != NULL; -#else - req->isDirect = 0; -#endif + req->isDirect = GC_IS_DIRECT(gc); } UnlockDisplay(dpy); @@ -864,11 +855,9 @@ glXIsDirect(Display * dpy, GLXContext gc) { if (!gc) { return GL_FALSE; -#ifdef GLX_DIRECT_RENDERING } - else if (gc->driContext) { + else if (GC_IS_DIRECT(gc)) { return GL_TRUE; -#endif } return __glXIsDirect(dpy, gc->xid); } @@ -2874,13 +2863,8 @@ __glXReleaseTexImageEXT(Display * dpy, GLXDrawable drawable, int buffer) INT32 *buffer_ptr; CARD8 opcode; - if (gc == NULL) - return; - -#ifdef GLX_DIRECT_RENDERING - if (gc->driContext) + if ((gc == NULL) || GC_IS_DIRECT(gc)) return; -#endif opcode = __glXSetupForCommand(dpy); if (!opcode) ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): glx: Eliminate several 'unused variable' warnings in glxcmds .c.
Module: Mesa Branch: master Commit: 26b2bee79d77b7a7b854d7300a10dce69e93d5cd URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=26b2bee79d77b7a7b854d7300a10dce69e93d5cd Author: Ian Romanick Date: Thu Feb 4 15:47:54 2010 -0800 glx: Eliminate several 'unused variable' warnings in glxcmds.c. --- src/glx/glxcmds.c | 11 +++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c index 4922406..a4e626b 100644 --- a/src/glx/glxcmds.c +++ b/src/glx/glxcmds.c @@ -65,6 +65,8 @@ static Bool windowExistsFlag; static int windowExistsErrorHandler(Display * dpy, XErrorEvent * xerr) { + (void) dpy; + if (xerr->error_code == BadWindow) { windowExistsFlag = GL_FALSE; } @@ -1471,6 +1473,8 @@ glXQueryExtensionsString(Display * dpy, int screen) PUBLIC const char * glXGetClientString(Display * dpy, int name) { + (void) dpy; + switch (name) { case GLX_VENDOR: return (__glXGLXClientVendorName); @@ -2379,6 +2383,8 @@ __driGetMscRateOML(__DRIdrawable * draw, int i; __GLXDRIdrawable *glxDraw = private; + (void) draw; + psc = glxDraw->psc; if (XF86VidModeQueryVersion(psc->dpy, &i, &i) && XF86VidModeGetModeLine(psc->dpy, psc->scr, &dot_clock, &mode_line)) { @@ -2425,6 +2431,11 @@ __driGetMscRateOML(__DRIdrawable * draw, else return False; #else + (void) draw; + (void) numerator; + (void) denominator; + (void) private; + return False; #endif } ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): glx: Change type to eliminate ' comparison between signed and unsigned' warning
Module: Mesa Branch: master Commit: 1add5354d0fbfb2d9b6a4a3fd6a39225bcadc098 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=1add5354d0fbfb2d9b6a4a3fd6a39225bcadc098 Author: Ian Romanick Date: Thu Feb 4 16:00:58 2010 -0800 glx: Change type to eliminate 'comparison between signed and unsigned' warning --- src/glx/glxcmds.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c index 504d17f..19538f2 100644 --- a/src/glx/glxcmds.c +++ b/src/glx/glxcmds.c @@ -1636,7 +1636,6 @@ static int __glXQueryContextInfo(Display * dpy, GLXContext ctx) else { int *propList, *pProp; int nPropListBytes; - int i; nPropListBytes = numValues << 3; propList = (int *) Xmalloc(nPropListBytes); @@ -1644,6 +1643,8 @@ static int __glXQueryContextInfo(Display * dpy, GLXContext ctx) retval = 0; } else { +unsigned i; + _XRead(dpy, (char *) propList, nPropListBytes); pProp = propList; for (i = 0; i < numValues; i++) { ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): glx: Fix interval test in glXSwapIntervalMESA
Module: Mesa Branch: master Commit: 68fef184390da2fd67acfd99fba0a2dbe4a3b875 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=68fef184390da2fd67acfd99fba0a2dbe4a3b875 Author: Ian Romanick Date: Thu Feb 4 16:15:45 2010 -0800 glx: Fix interval test in glXSwapIntervalMESA It appears that, in spite of what the spec says, the interval parameter to glXSwapIntervalMESA has been an unsigned int since day-1. This made the 'if (interval < 0)' test useless. The test is removed and the spec is updated to note that the interval is an unsigned value. --- docs/MESA_swap_control.spec |7 ++- src/glx/glxcmds.c |4 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/docs/MESA_swap_control.spec b/docs/MESA_swap_control.spec index ecc6746..856978b 100644 --- a/docs/MESA_swap_control.spec +++ b/docs/MESA_swap_control.spec @@ -43,7 +43,7 @@ Issues New Procedures and Functions -int glXSwapIntervalMESA(int interval) +int glXSwapIntervalMESA(unsigned int interval) int glXGetSwapIntervalMESA(void) New Tokens @@ -103,11 +103,8 @@ Additions to the GLX 1.3 Specification Errors -glXSwapIntervalMESA returns GLX_BAD_VALUE if parameter is -less than zero. - glXSwapIntervalMESA returns GLX_BAD_CONTEXT if there is no current -GLXContext. +GLXContext or if the current context is not a direct rendering context. GLX Protocol diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c index 19538f2..c429545 100644 --- a/src/glx/glxcmds.c +++ b/src/glx/glxcmds.c @@ -1951,10 +1951,6 @@ __glXSwapIntervalMESA(unsigned int interval) { GLXContext gc = __glXGetCurrentContext(); - if (interval < 0) { - return GLX_BAD_VALUE; - } - #ifdef __DRI_SWAP_CONTROL if (gc != NULL && gc->driContext) { __GLXscreenConfigs *const psc = GetGLXScreenConfigs(gc->currentDpy, ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): glx: Pass opcode to CreateContext instead of use_glx_1_3 parameter
Module: Mesa Branch: master Commit: 8bffadbc83d19ecd8be8f0107d51463e36477666 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=8bffadbc83d19ecd8be8f0107d51463e36477666 Author: Ian Romanick Date: Thu Feb 4 16:28:52 2010 -0800 glx: Pass opcode to CreateContext instead of use_glx_1_3 parameter Passing the opcode directly instead of having CreateContext infer it from the value of fbconfig and the use_glx_1_3 flag will simplify some changes that are coming. --- src/glx/glxcmds.c | 31 +++ 1 files changed, 23 insertions(+), 8 deletions(-) diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c index c429545..e3f77a0 100644 --- a/src/glx/glxcmds.c +++ b/src/glx/glxcmds.c @@ -366,7 +366,7 @@ CreateContext(Display * dpy, XVisualInfo * vis, const __GLcontextModes * const fbconfig, GLXContext shareList, Bool allowDirect, GLXContextID contextID, - Bool use_glx_1_3, int renderType) + unsigned code, int renderType) { GLXContext gc; #ifdef GLX_DIRECT_RENDERING @@ -425,7 +425,8 @@ CreateContext(Display * dpy, XVisualInfo * vis, #endif LockDisplay(dpy); - if (fbconfig == NULL) { + switch (code) { + case X_GLXCreateContext: { xGLXCreateContextReq *req; /* Send the glXCreateContext request */ @@ -437,8 +438,10 @@ CreateContext(Display * dpy, XVisualInfo * vis, req->screen = vis->screen; req->shareList = shareList ? shareList->xid : None; req->isDirect = GC_IS_DIRECT(gc); +break; } - else if (use_glx_1_3) { + + case X_GLXCreateNewContext: { xGLXCreateNewContextReq *req; /* Send the glXCreateNewContext request */ @@ -451,8 +454,10 @@ CreateContext(Display * dpy, XVisualInfo * vis, req->renderType = renderType; req->shareList = shareList ? shareList->xid : None; req->isDirect = GC_IS_DIRECT(gc); +break; } - else { + + case X_GLXvop_CreateContextWithConfigSGIX: { xGLXVendorPrivateWithReplyReq *vpreq; xGLXCreateContextWithConfigSGIXReq *req; @@ -470,6 +475,14 @@ CreateContext(Display * dpy, XVisualInfo * vis, req->renderType = renderType; req->shareList = shareList ? shareList->xid : None; req->isDirect = GC_IS_DIRECT(gc); +break; + } + + default: +/* What to do here? This case is the sign of an internal error. It + * should never be reachable. + */ +break; } UnlockDisplay(dpy); @@ -491,7 +504,7 @@ glXCreateContext(Display * dpy, XVisualInfo * vis, GLXContext shareList, Bool allowDirect) { return CreateContext(dpy, vis, NULL, shareList, allowDirect, None, -False, 0); +X_GLXCreateContext, 0); } _X_HIDDEN void @@ -1740,7 +1753,8 @@ glXImportContextEXT(Display * dpy, GLXContextID contextID) return NULL; } - ctx = CreateContext(dpy, NULL, NULL, NULL, False, contextID, False, 0); + ctx = CreateContext(dpy, NULL, NULL, NULL, False, contextID, + X_GLXCreateContext, 0); if (NULL != ctx) { if (Success != __glXQueryContextInfo(dpy, ctx)) { return NULL; @@ -1790,7 +1804,7 @@ glXCreateNewContext(Display * dpy, GLXFBConfig config, int renderType, GLXContext shareList, Bool allowDirect) { return CreateContext(dpy, NULL, (__GLcontextModes *) config, shareList, -allowDirect, None, True, renderType); +allowDirect, None, X_GLXCreateNewContext, renderType); } @@ -2278,7 +2292,8 @@ glXCreateContextWithConfigSGIX(Display * dpy, if ((psc != NULL) && __glXExtensionBitIsEnabled(psc, SGIX_fbconfig_bit)) { gc = CreateContext(dpy, NULL, (__GLcontextModes *) config, shareList, - allowDirect, None, False, renderType); + allowDirect, None, +X_GLXvop_CreateContextWithConfigSGIX, renderType); } return gc; ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): glx: Re-indent CreateContext after the previous commit
Module: Mesa Branch: master Commit: bc7b2f0dc33753f6d6b55bd4058e82ddf0997967 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=bc7b2f0dc33753f6d6b55bd4058e82ddf0997967 Author: Ian Romanick Date: Thu Feb 4 16:46:46 2010 -0800 glx: Re-indent CreateContext after the previous commit --- src/glx/glxcmds.c | 191 ++--- 1 files changed, 95 insertions(+), 96 deletions(-) diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c index 48f7049..b08cad8 100644 --- a/src/glx/glxcmds.c +++ b/src/glx/glxcmds.c @@ -382,113 +382,112 @@ CreateContext(Display * dpy, XVisualInfo * vis, if (!gc) return NULL; - if ((vis == NULL) && (fbconfig == NULL)) - return NULL; + if ((vis == NULL) && (fbconfig == NULL)) + return NULL; #ifdef GLX_DIRECT_RENDERING - if (allowDirect && psc->driScreen) { - const __GLcontextModes *mode; - - if (fbconfig == NULL) { -mode = _gl_context_modes_find_visual(psc->visuals, vis->visualid); -if (mode == NULL) { - xError error; - - error.errorCode = BadValue; - error.resourceID = vis->visualid; - error.sequenceNumber = dpy->request; - error.type = X_Error; - error.majorCode = gc->majorOpcode; - error.minorCode = X_GLXCreateContext; - _XError(dpy, &error); - return None; -} -if (renderType == 0) { - /* Initialize renderType now */ - renderType = mode->rgbMode ? GLX_RGBA_TYPE : GLX_COLOR_INDEX_TYPE; -} - } - else { -mode = fbconfig; - } + if (allowDirect && psc->driScreen) { + const __GLcontextModes *mode; + + if (fbconfig == NULL) { +mode = _gl_context_modes_find_visual(psc->visuals, vis->visualid); +if (mode == NULL) { + xError error; + + error.errorCode = BadValue; + error.resourceID = vis->visualid; + error.sequenceNumber = dpy->request; + error.type = X_Error; + error.majorCode = gc->majorOpcode; + error.minorCode = X_GLXCreateContext; + _XError(dpy, &error); + return None; +} +if (renderType == 0) { + /* Initialize renderType now */ + renderType = mode->rgbMode ? GLX_RGBA_TYPE : GLX_COLOR_INDEX_TYPE; +} + } + else { +mode = fbconfig; + } - gc->driContext = psc->driScreen->createContext(psc, mode, gc, -shareList, -renderType); - if (gc->driContext != NULL) { -gc->screen = mode->screen; -gc->psc = psc; -gc->mode = mode; -gc->isDirect = GL_TRUE; - } + gc->driContext = psc->driScreen->createContext(psc, mode, gc, shareList, +renderType); + if (gc->driContext != NULL) { +gc->screen = mode->screen; +gc->psc = psc; +gc->mode = mode; +gc->isDirect = GL_TRUE; } + } #endif - LockDisplay(dpy); - switch (code) { - case X_GLXCreateContext: { - xGLXCreateContextReq *req; - - /* Send the glXCreateContext request */ - GetReq(GLXCreateContext, req); - req->reqType = gc->majorOpcode; - req->glxCode = X_GLXCreateContext; - req->context = gc->xid = XAllocID(dpy); - req->visual = vis->visualid; - req->screen = vis->screen; - req->shareList = shareList ? shareList->xid : None; - req->isDirect = GC_IS_DIRECT(gc); -break; - } + LockDisplay(dpy); + switch (code) { + case X_GLXCreateContext: { + xGLXCreateContextReq *req; + + /* Send the glXCreateContext request */ + GetReq(GLXCreateContext, req); + req->reqType = gc->majorOpcode; + req->glxCode = X_GLXCreateContext; + req->context = gc->xid = XAllocID(dpy); + req->visual = vis->visualid; + req->screen = vis->screen; + req->shareList = shareList ? shareList->xid : None; + req->isDirect = GC_IS_DIRECT(gc); + break; + } - case X_GLXCreateNewContext: { - xGLXCreateNewContextReq *req; - - /* Send the glXCreateNewContext request */ - GetReq(GLXCreateNewContext, req); - req->reqType = gc->majorOpcode; - req->glxCode = X_GLXCreateNewContext; - req->context = gc->xid = XAllocID(dpy); - req->fbconfig = fbconfig->fbconfigID; - req->screen = fbconfig->screen; - req->renderType = renderType; - req->shareList = shareList ? shareList->xid : None; - req->isDirect = GC_IS_DIRECT(gc); -break; - } + case X_GLXCreateNewContext: { + xGLXCreateNewContextReq *req; - case X_GLXvop_C
Mesa (master): glx: Handle imported contexts outside of CreateContext
Module: Mesa Branch: master Commit: 2243029eeec9e31b92079ff0e8fafdc0315053d6 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=2243029eeec9e31b92079ff0e8fafdc0315053d6 Author: Ian Romanick Date: Thu Feb 4 16:43:46 2010 -0800 glx: Handle imported contexts outside of CreateContext A long time ago I was a bit over-agressive in refactoring context creation into a single function. The creation code for glXImportContextEXT does not belong in CreateContext because it does not use any GLX protocol. The big if-statement for the import case routed around almost the entire function anyway. --- src/glx/glxcmds.c | 26 ++ 1 files changed, 10 insertions(+), 16 deletions(-) diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c index 2eee005..48f7049 100644 --- a/src/glx/glxcmds.c +++ b/src/glx/glxcmds.c @@ -365,7 +365,7 @@ static GLXContext CreateContext(Display * dpy, XVisualInfo * vis, const __GLcontextModes * const fbconfig, GLXContext shareList, - Bool allowDirect, GLXContextID contextID, + Bool allowDirect, unsigned code, int renderType, int screen) { GLXContext gc; @@ -382,7 +382,6 @@ CreateContext(Display * dpy, XVisualInfo * vis, if (!gc) return NULL; - if (None == contextID) { if ((vis == NULL) && (fbconfig == NULL)) return NULL; @@ -489,11 +488,6 @@ CreateContext(Display * dpy, XVisualInfo * vis, UnlockDisplay(dpy); SyncHandle(); gc->imported = GL_FALSE; - } - else { - gc->xid = contextID; - gc->imported = GL_TRUE; - } gc->renderType = renderType; @@ -504,7 +498,7 @@ PUBLIC GLXContext glXCreateContext(Display * dpy, XVisualInfo * vis, GLXContext shareList, Bool allowDirect) { - return CreateContext(dpy, vis, NULL, shareList, allowDirect, None, + return CreateContext(dpy, vis, NULL, shareList, allowDirect, X_GLXCreateContext, 0, vis->screen); } @@ -1754,14 +1748,14 @@ glXImportContextEXT(Display * dpy, GLXContextID contextID) return NULL; } - /* FIXME: Why does this call CreateContext? There is no protocol sent for -* FIXME: this function. -*/ - ctx = CreateContext(dpy, NULL, NULL, NULL, False, contextID, - X_GLXCreateContext, 0, 0); + ctx = AllocateGLXContext(dpy); if (NULL != ctx) { + ctx->xid = contextID; + ctx->imported = GL_TRUE; + if (Success != __glXQueryContextInfo(dpy, ctx)) { - return NULL; +__glXFreeContext(ctx); +ctx = NULL; } } return ctx; @@ -1811,7 +1805,7 @@ glXCreateNewContext(Display * dpy, GLXFBConfig config, (const __GLcontextModes *const) config; return CreateContext(dpy, NULL, fbconfig, shareList, -allowDirect, None, X_GLXCreateNewContext, renderType, +allowDirect, X_GLXCreateNewContext, renderType, fbconfig->screen); } @@ -2300,7 +2294,7 @@ glXCreateContextWithConfigSGIX(Display * dpy, if ((psc != NULL) && __glXExtensionBitIsEnabled(psc, SGIX_fbconfig_bit)) { gc = CreateContext(dpy, NULL, (__GLcontextModes *) config, shareList, - allowDirect, None, + allowDirect, X_GLXvop_CreateContextWithConfigSGIX, renderType, fbconfig->screen); } ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): glx: Pass screen number as parameter to CreateContext
Module: Mesa Branch: master Commit: 7bcfb66000557a0ef32bdc6b31949a92f95a9ff6 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=7bcfb66000557a0ef32bdc6b31949a92f95a9ff6 Author: Ian Romanick Date: Thu Feb 4 16:37:59 2010 -0800 glx: Pass screen number as parameter to CreateContext Passing the screen parameter to CreateContext will simplify a couple of changes that are coming. --- src/glx/glxcmds.c | 23 --- 1 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c index e3f77a0..2eee005 100644 --- a/src/glx/glxcmds.c +++ b/src/glx/glxcmds.c @@ -366,12 +366,13 @@ CreateContext(Display * dpy, XVisualInfo * vis, const __GLcontextModes * const fbconfig, GLXContext shareList, Bool allowDirect, GLXContextID contextID, - unsigned code, int renderType) + unsigned code, int renderType, int screen) { GLXContext gc; #ifdef GLX_DIRECT_RENDERING - int screen = (fbconfig == NULL) ? vis->screen : fbconfig->screen; __GLXscreenConfigs *const psc = GetGLXScreenConfigs(dpy, screen); +#else + (void) screen; #endif if (dpy == NULL) @@ -504,7 +505,7 @@ glXCreateContext(Display * dpy, XVisualInfo * vis, GLXContext shareList, Bool allowDirect) { return CreateContext(dpy, vis, NULL, shareList, allowDirect, None, -X_GLXCreateContext, 0); +X_GLXCreateContext, 0, vis->screen); } _X_HIDDEN void @@ -1753,8 +1754,11 @@ glXImportContextEXT(Display * dpy, GLXContextID contextID) return NULL; } + /* FIXME: Why does this call CreateContext? There is no protocol sent for +* FIXME: this function. +*/ ctx = CreateContext(dpy, NULL, NULL, NULL, False, contextID, - X_GLXCreateContext, 0); + X_GLXCreateContext, 0, 0); if (NULL != ctx) { if (Success != __glXQueryContextInfo(dpy, ctx)) { return NULL; @@ -1803,8 +1807,12 @@ PUBLIC GLXContext glXCreateNewContext(Display * dpy, GLXFBConfig config, int renderType, GLXContext shareList, Bool allowDirect) { - return CreateContext(dpy, NULL, (__GLcontextModes *) config, shareList, -allowDirect, None, X_GLXCreateNewContext, renderType); + const __GLcontextModes *const fbconfig = + (const __GLcontextModes *const) config; + + return CreateContext(dpy, NULL, fbconfig, shareList, +allowDirect, None, X_GLXCreateNewContext, renderType, + fbconfig->screen); } @@ -2293,7 +2301,8 @@ glXCreateContextWithConfigSGIX(Display * dpy, && __glXExtensionBitIsEnabled(psc, SGIX_fbconfig_bit)) { gc = CreateContext(dpy, NULL, (__GLcontextModes *) config, shareList, allowDirect, None, -X_GLXvop_CreateContextWithConfigSGIX, renderType); +X_GLXvop_CreateContextWithConfigSGIX, renderType, +fbconfig->screen); } return gc; ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): glx: Move work of converting a visual to an fbconfig
Module: Mesa Branch: master Commit: 52cf8db428909156b062f17a9e6251a38178dec3 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=52cf8db428909156b062f17a9e6251a38178dec3 Author: Ian Romanick Date: Thu Feb 4 16:59:10 2010 -0800 glx: Move work of converting a visual to an fbconfig For the direct rendering case, the DRI createContext function wants an fbconfig. When glXCreateContext is called, we have to convert the visual to an fbconfig. This work was done in CreateContext, but it makes more sense for it to be done in glXCreateContext. --- src/glx/glxcmds.c | 60 +--- 1 files changed, 29 insertions(+), 31 deletions(-) diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c index b08cad8..1be6ff3 100644 --- a/src/glx/glxcmds.c +++ b/src/glx/glxcmds.c @@ -387,37 +387,12 @@ CreateContext(Display * dpy, XVisualInfo * vis, #ifdef GLX_DIRECT_RENDERING if (allowDirect && psc->driScreen) { - const __GLcontextModes *mode; - - if (fbconfig == NULL) { -mode = _gl_context_modes_find_visual(psc->visuals, vis->visualid); -if (mode == NULL) { - xError error; - - error.errorCode = BadValue; - error.resourceID = vis->visualid; - error.sequenceNumber = dpy->request; - error.type = X_Error; - error.majorCode = gc->majorOpcode; - error.minorCode = X_GLXCreateContext; - _XError(dpy, &error); - return None; -} -if (renderType == 0) { - /* Initialize renderType now */ - renderType = mode->rgbMode ? GLX_RGBA_TYPE : GLX_COLOR_INDEX_TYPE; -} - } - else { -mode = fbconfig; - } - - gc->driContext = psc->driScreen->createContext(psc, mode, gc, shareList, -renderType); + gc->driContext = psc->driScreen->createContext(psc, fbconfig, gc, +shareList, renderType); if (gc->driContext != NULL) { -gc->screen = mode->screen; +gc->screen = screen; gc->psc = psc; -gc->mode = mode; +gc->mode = fbconfig; gc->isDirect = GL_TRUE; } } @@ -497,8 +472,31 @@ PUBLIC GLXContext glXCreateContext(Display * dpy, XVisualInfo * vis, GLXContext shareList, Bool allowDirect) { - return CreateContext(dpy, vis, NULL, shareList, allowDirect, -X_GLXCreateContext, 0, vis->screen); + const __GLcontextModes *mode = NULL; + int renderType = 0; + +#ifdef GLX_DIRECT_RENDERING + __GLXscreenConfigs *const psc = GetGLXScreenConfigs(dpy, vis->screen); + + mode = _gl_context_modes_find_visual(psc->visuals, vis->visualid); + if (mode == NULL) { + xError error; + + error.errorCode = BadValue; + error.resourceID = vis->visualid; + error.sequenceNumber = dpy->request; + error.type = X_Error; + error.majorCode = __glXSetupForCommand(dpy); + error.minorCode = X_GLXCreateContext; + _XError(dpy, &error); + return None; + } + + renderType = mode->rgbMode ? GLX_RGBA_TYPE : GLX_COLOR_INDEX_TYPE; +#endif + + return CreateContext(dpy, vis, mode, shareList, allowDirect, +X_GLXCreateContext, renderType, vis->screen); } _X_HIDDEN void ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): glx: Use the screen parameter everywhere instead of vis-> screen, etc.
Module: Mesa Branch: master Commit: c3db1d621e1f7c73006ed76855d31b1034bc3aef URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=c3db1d621e1f7c73006ed76855d31b1034bc3aef Author: Ian Romanick Date: Thu Feb 4 17:01:42 2010 -0800 glx: Use the screen parameter everywhere instead of vis->screen, etc. --- src/glx/glxcmds.c |8 +++- 1 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c index 1be6ff3..9b4a6da 100644 --- a/src/glx/glxcmds.c +++ b/src/glx/glxcmds.c @@ -371,8 +371,6 @@ CreateContext(Display * dpy, XVisualInfo * vis, GLXContext gc; #ifdef GLX_DIRECT_RENDERING __GLXscreenConfigs *const psc = GetGLXScreenConfigs(dpy, screen); -#else - (void) screen; #endif if (dpy == NULL) @@ -409,7 +407,7 @@ CreateContext(Display * dpy, XVisualInfo * vis, req->glxCode = X_GLXCreateContext; req->context = gc->xid = XAllocID(dpy); req->visual = vis->visualid; - req->screen = vis->screen; + req->screen = screen; req->shareList = shareList ? shareList->xid : None; req->isDirect = GC_IS_DIRECT(gc); break; @@ -424,7 +422,7 @@ CreateContext(Display * dpy, XVisualInfo * vis, req->glxCode = X_GLXCreateNewContext; req->context = gc->xid = XAllocID(dpy); req->fbconfig = fbconfig->fbconfigID; - req->screen = fbconfig->screen; + req->screen = screen; req->renderType = renderType; req->shareList = shareList ? shareList->xid : None; req->isDirect = GC_IS_DIRECT(gc); @@ -445,7 +443,7 @@ CreateContext(Display * dpy, XVisualInfo * vis, req->vendorCode = X_GLXvop_CreateContextWithConfigSGIX; req->context = gc->xid = XAllocID(dpy); req->fbconfig = fbconfig->fbconfigID; - req->screen = fbconfig->screen; + req->screen = screen; req->renderType = renderType; req->shareList = shareList ? shareList->xid : None; req->isDirect = GC_IS_DIRECT(gc); ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): glxgears_fbconfig: Use GLX 1. 3 name for function poiner types
Module: Mesa Branch: master Commit: 6518f6037cfcab3783e913b5275f9045799e49b2 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=6518f6037cfcab3783e913b5275f9045799e49b2 Author: Ian Romanick Date: Fri Feb 5 16:14:27 2010 -0800 glxgears_fbconfig: Use GLX 1.3 name for function poiner types --- progs/xdemos/glxgears_fbconfig.c | 34 +++--- 1 files changed, 15 insertions(+), 19 deletions(-) diff --git a/progs/xdemos/glxgears_fbconfig.c b/progs/xdemos/glxgears_fbconfig.c index 2dac00b..316480c 100644 --- a/progs/xdemos/glxgears_fbconfig.c +++ b/progs/xdemos/glxgears_fbconfig.c @@ -46,13 +46,9 @@ #include #include "pbutil.h" -/* I had to use the SGIX versions of these because for some reason glxext.h - * doesn't define the core versions if GLX_VERSION_1_3 is defined, and glx.h - * doesn't define them at all. One or both header files is clearly broken. - */ -static PFNGLXCHOOSEFBCONFIGSGIXPROC choose_fbconfig = NULL; -static PFNGLXGETVISUALFROMFBCONFIGSGIXPROC get_visual_from_fbconfig = NULL; -static PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC create_new_context = NULL; +static PFNGLXCHOOSEFBCONFIGPROC choose_fbconfig = NULL; +static PFNGLXGETVISUALFROMFBCONFIGPROC get_visual_from_fbconfig = NULL; +static PFNGLXCREATENEWCONTEXTPROC create_new_context = NULL; #define BENCHMARK @@ -359,20 +355,20 @@ init_fbconfig_functions(Display *dpy, int scrnum) ext_name, (ext_version_supported) ? "" : "not " ); if ( glx_1_3_supported ) { - choose_fbconfig = (PFNGLXCHOOSEFBCONFIGSGIXPROC) glXGetProcAddressARB( - (GLubyte *) "glXChooseFBConfig"); - get_visual_from_fbconfig = (PFNGLXGETVISUALFROMFBCONFIGSGIXPROC) glXGetProcAddressARB( - (GLubyte *) "glXGetVisualFromFBConfig"); - create_new_context = (PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC) glXGetProcAddressARB( - (GLubyte *) "glXCreateNewContext"); + choose_fbconfig = (PFNGLXCHOOSEFBCONFIGPROC) +glXGetProcAddressARB((GLubyte *) "glXChooseFBConfig"); + get_visual_from_fbconfig = (PFNGLXGETVISUALFROMFBCONFIGPROC) +glXGetProcAddressARB((GLubyte *) "glXGetVisualFromFBConfig"); + create_new_context = (PFNGLXCREATENEWCONTEXTPROC) +glXGetProcAddressARB((GLubyte *) "glXCreateNewContext"); } else if ( ext_version_supported ) { - choose_fbconfig = (PFNGLXCHOOSEFBCONFIGSGIXPROC) glXGetProcAddressARB( - (GLubyte *) "glXChooseFBConfigSGIX"); - get_visual_from_fbconfig = (PFNGLXGETVISUALFROMFBCONFIGSGIXPROC) glXGetProcAddressARB( - (GLubyte *) "glXGetVisualFromFBConfigSGIX"); - create_new_context = (PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC) glXGetProcAddressARB( - (GLubyte *) "glXCreateContextWithConfigSGIX"); + choose_fbconfig = (PFNGLXCHOOSEFBCONFIGPROC) +glXGetProcAddressARB((GLubyte *) "glXChooseFBConfigSGIX"); + get_visual_from_fbconfig = (PFNGLXGETVISUALFROMFBCONFIGPROC) +glXGetProcAddressARB((GLubyte *) "glXGetVisualFromFBConfigSGIX"); + create_new_context = (PFNGLXCREATENEWCONTEXTPROC) +glXGetProcAddressARB((GLubyte *) "glXCreateContextWithConfigSGIX"); } else { printf( "This demo requires either GLX 1.3 or %s be supported.\n", ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): glxgears_fbconfig: Use glXCreateWindow and glXDestroyWindow
Module: Mesa Branch: master Commit: 381d5e209815235911c4aab516037c868c8f695f URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=381d5e209815235911c4aab516037c868c8f695f Author: Ian Romanick Date: Fri Feb 5 19:12:22 2010 -0800 glxgears_fbconfig: Use glXCreateWindow and glXDestroyWindow --- progs/xdemos/glxgears_fbconfig.c | 44 + 1 files changed, 39 insertions(+), 5 deletions(-) diff --git a/progs/xdemos/glxgears_fbconfig.c b/progs/xdemos/glxgears_fbconfig.c index 316480c..36bf731 100644 --- a/progs/xdemos/glxgears_fbconfig.c +++ b/progs/xdemos/glxgears_fbconfig.c @@ -49,6 +49,8 @@ static PFNGLXCHOOSEFBCONFIGPROC choose_fbconfig = NULL; static PFNGLXGETVISUALFROMFBCONFIGPROC get_visual_from_fbconfig = NULL; static PFNGLXCREATENEWCONTEXTPROC create_new_context = NULL; +static PFNGLXCREATEWINDOWPROC create_window = NULL; +static PFNGLXDESTROYWINDOWPROC destroy_window = NULL; #define BENCHMARK @@ -320,6 +322,26 @@ init(void) } +static GLXWindow +dummy_create_window(Display *dpy, GLXFBConfig config, Window win, + const int *attrib_list) +{ + (void) dpy; + (void) config; + (void) attrib_list; + + return (GLXWindow) win; +} + + +static void +dummy_destroy_window(Display *dpy, GLXWindow win) +{ + (void) dpy; + (void) win; +} + + /** * Initialize fbconfig related function pointers. */ @@ -361,6 +383,10 @@ init_fbconfig_functions(Display *dpy, int scrnum) glXGetProcAddressARB((GLubyte *) "glXGetVisualFromFBConfig"); create_new_context = (PFNGLXCREATENEWCONTEXTPROC) glXGetProcAddressARB((GLubyte *) "glXCreateNewContext"); + create_window = (PFNGLXCREATEWINDOWPROC) +glXGetProcAddressARB((GLubyte *) "glXCreateWindow"); + destroy_window = (PFNGLXDESTROYWINDOWPROC) +glXGetProcAddressARB((GLubyte *) "glXDestroyWindow"); } else if ( ext_version_supported ) { choose_fbconfig = (PFNGLXCHOOSEFBCONFIGPROC) @@ -369,6 +395,8 @@ init_fbconfig_functions(Display *dpy, int scrnum) glXGetProcAddressARB((GLubyte *) "glXGetVisualFromFBConfigSGIX"); create_new_context = (PFNGLXCREATENEWCONTEXTPROC) glXGetProcAddressARB((GLubyte *) "glXCreateContextWithConfigSGIX"); + create_window = dummy_create_window; + destroy_window = dummy_destroy_window; } else { printf( "This demo requires either GLX 1.3 or %s be supported.\n", @@ -400,7 +428,7 @@ init_fbconfig_functions(Display *dpy, int scrnum) static void make_window( Display *dpy, const char *name, int x, int y, int width, int height, - Window *winRet, GLXContext *ctxRet) + Window *winRet, GLXWindow *glxWinRet, GLXContext *ctxRet) { int attrib[] = { GLX_DRAWABLE_TYPE, GLX_WINDOW_BIT, GLX_RENDER_TYPE, GLX_RGBA_BIT, @@ -418,6 +446,7 @@ make_window( Display *dpy, const char *name, unsigned long mask; Window root; Window win; + GLXWindow glxWin; GLXContext ctx; XVisualInfo *visinfo; @@ -463,6 +492,8 @@ make_window( Display *dpy, const char *name, None, (char **)NULL, 0, &sizehints); } + glxWin = (*create_window)(dpy, fbconfig[0], win, NULL); + ctx = (*create_new_context)(dpy, fbconfig[0], GLX_RGBA_TYPE, NULL, GL_TRUE); if (!ctx) { printf("Error: glXCreateNewContext failed\n"); @@ -471,13 +502,14 @@ make_window( Display *dpy, const char *name, XFree(fbconfig); + *glxWinRet = glxWin; *winRet = win; *ctxRet = ctx; } static void -event_loop(Display *dpy, Window win) +event_loop(Display *dpy, GLXWindow win) { while (1) { while (XPending(dpy) > 0) { @@ -554,6 +586,7 @@ main(int argc, char *argv[]) { Display *dpy; Window win; + GLXWindow glxWin; GLXContext ctx; const char *dpyName = NULL; GLboolean printInfo = GL_FALSE; @@ -575,9 +608,9 @@ main(int argc, char *argv[]) return -1; } - make_window(dpy, "glxgears", 0, 0, 300, 300, &win, &ctx); + make_window(dpy, "glxgears", 0, 0, 300, 300, &win, &glxWin, &ctx); XMapWindow(dpy, win); - glXMakeCurrent(dpy, win, ctx); + glXMakeCurrent(dpy, glxWin, ctx); if (printInfo) { printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); @@ -588,9 +621,10 @@ main(int argc, char *argv[]) init(); - event_loop(dpy, win); + event_loop(dpy, glxWin); glXDestroyContext(dpy, ctx); + destroy_window(dpy, glxWin); XDestroyWindow(dpy, win); XCloseDisplay(dpy); ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): Merge commit '381d5e209815235911c4aab516037c868c8f695f'
Module: Mesa Branch: master Commit: 7ccbeb41acd2f5c416005bd48c11996a054a869a URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=7ccbeb41acd2f5c416005bd48c11996a054a869a Author: Ian Romanick Date: Wed Feb 17 11:40:09 2010 -0800 Merge commit '381d5e209815235911c4aab516037c868c8f695f' This merges the patches from the series "[PATCH 00/14] More client-side GLX house cleaning" that were posted to the mesa3d-dev mailing list. See http://marc.info/?l=mesa3d-dev&m=126582985214612&w=2 Patches 01 through 04 eliminate a bunch of annoying warnings that I get when building Mesa. Patch 05 fixes an inconsistency between the implementation of glXSwapIntervalMESA and the spec. I chose to favor the code over the spec in this case. This also eliminated a warning. Patches 06 through 12 clean up the way that context creation is performed on the client. When support for GLX_SGIX_fbconfig and the related GLX 1.3 functions was added, I refactored a bunch nuts-and-bolts of context creation to CreateContext. The refactor was a good idea, I just didn't do it right. Patches 13 and 14 update glxgears_fbconfig to use GLX 1.3 interfaces. --- ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): glx: Pass fbconfig ID or visual ID to CreateContext
Module: Mesa Branch: master Commit: d46d30f997c1718217545947ca4d80ec7d18e684 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=d46d30f997c1718217545947ca4d80ec7d18e684 Author: Ian Romanick Date: Thu Feb 4 17:06:18 2010 -0800 glx: Pass fbconfig ID or visual ID to CreateContext Pass either the fbconfig ID or the visual ID, as appropriate, to CreateContext. Now CreateContext does not derefernce fbconfig or vis (which no longer exists as a parameter). --- src/glx/glxcmds.c | 20 ++-- 1 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c index 9b4a6da..706d63b 100644 --- a/src/glx/glxcmds.c +++ b/src/glx/glxcmds.c @@ -362,7 +362,7 @@ AllocateGLXContext(Display * dpy) */ static GLXContext -CreateContext(Display * dpy, XVisualInfo * vis, +CreateContext(Display * dpy, int generic_id, const __GLcontextModes * const fbconfig, GLXContext shareList, Bool allowDirect, @@ -376,11 +376,11 @@ CreateContext(Display * dpy, XVisualInfo * vis, if (dpy == NULL) return NULL; - gc = AllocateGLXContext(dpy); - if (!gc) + if (generic_id == None) return NULL; - if ((vis == NULL) && (fbconfig == NULL)) + gc = AllocateGLXContext(dpy); + if (!gc) return NULL; #ifdef GLX_DIRECT_RENDERING @@ -406,7 +406,7 @@ CreateContext(Display * dpy, XVisualInfo * vis, req->reqType = gc->majorOpcode; req->glxCode = X_GLXCreateContext; req->context = gc->xid = XAllocID(dpy); - req->visual = vis->visualid; + req->visual = generic_id; req->screen = screen; req->shareList = shareList ? shareList->xid : None; req->isDirect = GC_IS_DIRECT(gc); @@ -421,7 +421,7 @@ CreateContext(Display * dpy, XVisualInfo * vis, req->reqType = gc->majorOpcode; req->glxCode = X_GLXCreateNewContext; req->context = gc->xid = XAllocID(dpy); - req->fbconfig = fbconfig->fbconfigID; + req->fbconfig = generic_id; req->screen = screen; req->renderType = renderType; req->shareList = shareList ? shareList->xid : None; @@ -442,7 +442,7 @@ CreateContext(Display * dpy, XVisualInfo * vis, req->glxCode = X_GLXVendorPrivateWithReply; req->vendorCode = X_GLXvop_CreateContextWithConfigSGIX; req->context = gc->xid = XAllocID(dpy); - req->fbconfig = fbconfig->fbconfigID; + req->fbconfig = generic_id; req->screen = screen; req->renderType = renderType; req->shareList = shareList ? shareList->xid : None; @@ -493,7 +493,7 @@ glXCreateContext(Display * dpy, XVisualInfo * vis, renderType = mode->rgbMode ? GLX_RGBA_TYPE : GLX_COLOR_INDEX_TYPE; #endif - return CreateContext(dpy, vis, mode, shareList, allowDirect, + return CreateContext(dpy, vis->visualid, mode, shareList, allowDirect, X_GLXCreateContext, renderType, vis->screen); } @@ -1799,7 +1799,7 @@ glXCreateNewContext(Display * dpy, GLXFBConfig config, const __GLcontextModes *const fbconfig = (const __GLcontextModes *const) config; - return CreateContext(dpy, NULL, fbconfig, shareList, + return CreateContext(dpy, fbconfig->fbconfigID, fbconfig, shareList, allowDirect, X_GLXCreateNewContext, renderType, fbconfig->screen); } @@ -2288,7 +2288,7 @@ glXCreateContextWithConfigSGIX(Display * dpy, psc = GetGLXScreenConfigs(dpy, fbconfig->screen); if ((psc != NULL) && __glXExtensionBitIsEnabled(psc, SGIX_fbconfig_bit)) { - gc = CreateContext(dpy, NULL, (__GLcontextModes *) config, shareList, + gc = CreateContext(dpy, fbconfig->fbconfigID, fbconfig, shareList, allowDirect, X_GLXvop_CreateContextWithConfigSGIX, renderType, fbconfig->screen); ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): glx: Add casts to eliminate ' comparison between signed and unsigned' warnings
Module: Mesa Branch: master Commit: 71a6fb15ceb6619d39029ff897daf2da4858b17e URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=71a6fb15ceb6619d39029ff897daf2da4858b17e Author: Ian Romanick Date: Thu Feb 4 15:59:51 2010 -0800 glx: Add casts to eliminate 'comparison between signed and unsigned' warnings --- src/glx/glxcmds.c | 15 --- 1 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c index a4e626b..504d17f 100644 --- a/src/glx/glxcmds.c +++ b/src/glx/glxcmds.c @@ -1090,7 +1090,7 @@ init_fbconfig_for_chooser(__GLcontextModes * config, #define MATCH_DONT_CARE( param )\ do { \ -if ( (a-> param != GLX_DONT_CARE) \ +if ( ((int) a-> param != (int) GLX_DONT_CARE) \ && (a-> param != b-> param) ) {\ return False; \ } \ @@ -1098,7 +1098,7 @@ init_fbconfig_for_chooser(__GLcontextModes * config, #define MATCH_MINIMUM( param ) \ do { \ -if ( (a-> param != GLX_DONT_CARE) \ +if ( ((int) a-> param != (int) GLX_DONT_CARE) \ && (a-> param > b-> param) ) { \ return False; \ } \ @@ -1165,7 +1165,7 @@ fbconfigs_compatible(const __GLcontextModes * const a, * the (broken) drivers. */ - if (a->transparentPixel != GLX_DONT_CARE && a->transparentPixel != 0) { + if (a->transparentPixel != (int) GLX_DONT_CARE && a->transparentPixel != 0) { if (a->transparentPixel == GLX_NONE) { if (b->transparentPixel != GLX_NONE && b->transparentPixel != 0) return False; @@ -1812,14 +1812,15 @@ glXGetFBConfigs(Display * dpy, int screen, int *nelements) if (priv && (priv->screenConfigs != NULL) && (screen >= 0) && (screen <= ScreenCount(dpy)) && (priv->screenConfigs[screen].configs != NULL) - && (priv->screenConfigs[screen].configs->fbconfigID != GLX_DONT_CARE)) { + && (priv->screenConfigs[screen].configs->fbconfigID + != (int) GLX_DONT_CARE)) { unsigned num_configs = 0; __GLcontextModes *modes; for (modes = priv->screenConfigs[screen].configs; modes != NULL; modes = modes->next) { - if (modes->fbconfigID != GLX_DONT_CARE) { + if (modes->fbconfigID != (int) GLX_DONT_CARE) { num_configs++; } } @@ -1831,7 +1832,7 @@ glXGetFBConfigs(Display * dpy, int screen, int *nelements) i = 0; for (modes = priv->screenConfigs[screen].configs; modes != NULL; modes = modes->next) { -if (modes->fbconfigID != GLX_DONT_CARE) { +if (modes->fbconfigID != (int) GLX_DONT_CARE) { config[i] = modes; i++; } @@ -2295,7 +2296,7 @@ glXGetFBConfigFromVisualSGIX(Display * dpy, XVisualInfo * vis) if ((GetGLXPrivScreenConfig(dpy, vis->screen, &priv, &psc) != Success) && __glXExtensionBitIsEnabled(psc, SGIX_fbconfig_bit) - && (psc->configs->fbconfigID != GLX_DONT_CARE)) { + && (psc->configs->fbconfigID != (int) GLX_DONT_CARE)) { return (GLXFBConfigSGIX) _gl_context_modes_find_visual(psc->configs, vis->visualid); } ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (mesa_7_7_branch): svga: Remove unused buffer download code.
Module: Mesa Branch: mesa_7_7_branch Commit: 3b724f91c5312888b7fe86a957cbd511cd808c34 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=3b724f91c5312888b7fe86a957cbd511cd808c34 Author: José Fonseca Date: Tue Feb 16 16:43:53 2010 + svga: Remove unused buffer download code. Unnecessary now that we never destroy buffer storage. --- src/gallium/drivers/svga/svga_screen_buffer.c | 40 - src/gallium/drivers/svga/svga_screen_buffer.h |5 --- 2 files changed, 0 insertions(+), 45 deletions(-) diff --git a/src/gallium/drivers/svga/svga_screen_buffer.c b/src/gallium/drivers/svga/svga_screen_buffer.c index 6a58ff2..cb4de42 100644 --- a/src/gallium/drivers/svga/svga_screen_buffer.c +++ b/src/gallium/drivers/svga/svga_screen_buffer.c @@ -288,8 +288,6 @@ svga_buffer_upload_flush(struct svga_context *svga, sbuf->hw.svga = NULL; sbuf->hw.boxes = NULL; - sbuf->host_written = TRUE; - /* Decrement reference count */ pipe_buffer_reference((struct pipe_buffer **)&sbuf, NULL); } @@ -419,44 +417,6 @@ svga_buffer_map_range( struct pipe_screen *screen, if(!sbuf->hw.buf) { if(svga_buffer_create_hw_storage(ss, sbuf) != PIPE_OK) return NULL; - - /* Populate the hardware storage if the host surface pre-existed */ - if(sbuf->host_written) { -SVGA3dSurfaceDMAFlags flags; -enum pipe_error ret; -struct pipe_fence_handle *fence = NULL; - -assert(sbuf->handle); - -SVGA_DBG(DEBUG_DMA|DEBUG_PERF, "dma from sid %p (buffer), bytes %u - %u\n", - sbuf->handle, 0, sbuf->base.size); - -memset(&flags, 0, sizeof flags); - -ret = SVGA3D_BufferDMA(ss->swc, - sbuf->hw.buf, - sbuf->handle, - SVGA3D_READ_HOST_VRAM, - sbuf->base.size, - 0, - flags); -if(ret != PIPE_OK) { - ss->swc->flush(ss->swc, NULL); - - ret = SVGA3D_BufferDMA(ss->swc, - sbuf->hw.buf, - sbuf->handle, - SVGA3D_READ_HOST_VRAM, - sbuf->base.size, - 0, - flags); - assert(ret == PIPE_OK); -} - -ss->swc->flush(ss->swc, &fence); -sws->fence_finish(sws, fence, 0); -sws->fence_reference(sws, &fence, NULL); - } } map = sws->buffer_map(sws, sbuf->hw.buf, usage); diff --git a/src/gallium/drivers/svga/svga_screen_buffer.h b/src/gallium/drivers/svga/svga_screen_buffer.h index 448ac10..e0e1b22 100644 --- a/src/gallium/drivers/svga/svga_screen_buffer.h +++ b/src/gallium/drivers/svga/svga_screen_buffer.h @@ -135,11 +135,6 @@ struct svga_buffer */ struct svga_winsys_surface *handle; - /** -* Whether the host has been ever written. -*/ - boolean host_written; - struct { unsigned count; boolean writing; ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (mesa_7_7_branch): mesa: Take back some assertions.
Module: Mesa Branch: mesa_7_7_branch Commit: 13cd4298fb8fd447f86ca92d7571e5c13b5ff9f6 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=13cd4298fb8fd447f86ca92d7571e5c13b5ff9f6 Author: José Fonseca Date: Wed Feb 17 20:02:32 2010 + mesa: Take back some assertions. It seems there are still some places where draw can happen with mapped buffers... Remove the assertions since there is not much more than can be done at this moment. This partially reverts commit af2023e31cde5ad2cf8ce740e20a98c4cbab37ce. --- src/mesa/state_tracker/st_draw.c |2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c index 823c72d..d3b22db 100644 --- a/src/mesa/state_tracker/st_draw.c +++ b/src/mesa/state_tracker/st_draw.c @@ -404,7 +404,6 @@ setup_interleaved_attribs(GLcontext *ctx, vbuffer->buffer_offset = 0; } else { -assert(!bufobj->Pointer); vbuffer->buffer = NULL; pipe_buffer_reference(&vbuffer->buffer, stobj->buffer); vbuffer->buffer_offset = pointer_to_offset(low); @@ -461,7 +460,6 @@ setup_non_interleaved_attribs(GLcontext *ctx, assert(stobj->buffer); /*printf("stobj %u = %p\n", attr, (void*) stobj);*/ - assert(!bufobj->Pointer); vbuffer[attr].buffer = NULL; pipe_buffer_reference(&vbuffer[attr].buffer, stobj->buffer); vbuffer[attr].buffer_offset = pointer_to_offset(arrays[mesaAttr]->Ptr); ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (gallium-winsys-handle): st/drm: Don't use pipe defines
Module: Mesa Branch: gallium-winsys-handle Commit: 5d0b9767ff4c24c404ce34170f75f8c8fbbba141 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=5d0b9767ff4c24c404ce34170f75f8c8fbbba141 Author: Jakob Bornecrantz Date: Wed Feb 17 20:45:12 2010 + st/drm: Don't use pipe defines Don't force winsys to include p_defines to read the flags --- src/gallium/include/state_tracker/drm_api.h |7 +-- src/gallium/state_trackers/xorg/xorg_crtc.c |2 +- src/gallium/state_trackers/xorg/xorg_dri2.c |2 +- src/gallium/state_trackers/xorg/xorg_driver.c |1 + 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/gallium/include/state_tracker/drm_api.h b/src/gallium/include/state_tracker/drm_api.h index bac2137..d3e 100644 --- a/src/gallium/include/state_tracker/drm_api.h +++ b/src/gallium/include/state_tracker/drm_api.h @@ -17,16 +17,19 @@ enum drm_create_screen_mode { DRM_CREATE_MAX }; +#define DRM_API_HANDLE_TYPE_SHARED 0 +#define DRM_API_HANDLE_TYPE_KMS1 + /** * For use with pipe_screen::{texture_from_handle|texture_get_handle}. */ struct winsys_handle { /** -* Unused for texture_from_handle. +* Unused for texture_from_handle, always DRM_API_HANDLE_TYPE_SHARED. * Input to texture_get_handle, use TEXTURE_USAGE to select handle for kms or ipc. */ - unsigned usage; + unsigned type; /** * Input to texture_from_handle. * Output for texture_get_handle. diff --git a/src/gallium/state_trackers/xorg/xorg_crtc.c b/src/gallium/state_trackers/xorg/xorg_crtc.c index 3b20f00..4a77f54 100644 --- a/src/gallium/state_trackers/xorg/xorg_crtc.c +++ b/src/gallium/state_trackers/xorg/xorg_crtc.c @@ -210,7 +210,7 @@ crtc_load_cursor_argb_ga3d(xf86CrtcPtr crtc, CARD32 * image) templat.height0 = 64; memset(&whandle, 0, sizeof(whandle)); - whandle.usage = PIPE_TEXTURE_USAGE_PRIMARY; + whandle.type = DRM_API_HANDLE_TYPE_KMS; crtcp->cursor_tex = ms->screen->texture_create(ms->screen, &templat); diff --git a/src/gallium/state_trackers/xorg/xorg_dri2.c b/src/gallium/state_trackers/xorg/xorg_dri2.c index fe2b305..5472285 100644 --- a/src/gallium/state_trackers/xorg/xorg_dri2.c +++ b/src/gallium/state_trackers/xorg/xorg_dri2.c @@ -155,7 +155,7 @@ dri2_do_create_buffer(DrawablePtr pDraw, DRI2BufferPtr buffer, unsigned int form FatalError("NO TEXTURE IN DRI2\n"); memset(&whandle, 0, sizeof(whandle)); -whandle.usage = PIPE_TEXTURE_USAGE_DISPLAY_TARGET; +whandle.type = DRM_API_HANDLE_TYPE_SHARED; ms->screen->texture_get_handle(ms->screen, tex, &whandle); diff --git a/src/gallium/state_trackers/xorg/xorg_driver.c b/src/gallium/state_trackers/xorg/xorg_driver.c index e35b6e4..a7fb98a 100644 --- a/src/gallium/state_trackers/xorg/xorg_driver.c +++ b/src/gallium/state_trackers/xorg/xorg_driver.c @@ -921,6 +921,7 @@ drv_create_front_buffer_ga3d(ScrnInfoPtr pScrn) return FALSE; memset(&whandle, 0, sizeof(whandle)); +whandle.type = DRM_API_HANDLE_TYPE_KMS; if (!ms->screen->texture_get_handle(ms->screen, tex, &whandle)) goto err_destroy; ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (gallium-winsys-handle): gallium: Reorg texture usage flags
Module: Mesa Branch: gallium-winsys-handle Commit: 26d5bc5ee92b47e75459ec7f8627470bcae58203 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=26d5bc5ee92b47e75459ec7f8627470bcae58203 Author: Jakob Bornecrantz Date: Wed Feb 17 21:08:49 2010 + gallium: Reorg texture usage flags Introduce a new shared usage and rename primary to scanout. The display target usage is more of a windows concept and doesn't mean the same thing as shared. Display target means that the surface should be presentable, for softpipe this means that it should be backed by a hardware buffer. --- src/gallium/drivers/i915/i915_texture.c| 14 +++--- src/gallium/drivers/i965/brw_screen_texture.c |4 ++-- src/gallium/drivers/llvmpipe/lp_texture.c |3 ++- src/gallium/drivers/r300/r300_screen.c |6 -- src/gallium/drivers/softpipe/sp_texture.c |3 ++- src/gallium/drivers/svga/svga_screen_texture.c |6 +- src/gallium/include/pipe/p_defines.h |5 +++-- src/gallium/state_trackers/egl/kms/native_kms.c|2 +- src/gallium/state_trackers/xorg/xorg_crtc.c|2 +- src/gallium/state_trackers/xorg/xorg_dri2.c|2 +- src/gallium/state_trackers/xorg/xorg_exa.c | 10 +- src/gallium/state_trackers/xorg/xvmc/surface.c |2 +- .../winsys/drm/nouveau/drm/nouveau_drm_api.c |2 +- 13 files changed, 35 insertions(+), 26 deletions(-) diff --git a/src/gallium/drivers/i915/i915_texture.c b/src/gallium/drivers/i915/i915_texture.c index e101c86..5ad65a2 100644 --- a/src/gallium/drivers/i915/i915_texture.c +++ b/src/gallium/drivers/i915/i915_texture.c @@ -219,12 +219,12 @@ i915_miptree_layout_2d(struct i915_texture *tex) unsigned nblocksy = util_format_get_nblocksy(pt->format, pt->width0); /* used for scanouts that need special layouts */ - if (pt->tex_usage & PIPE_TEXTURE_USAGE_PRIMARY) + if (pt->tex_usage & PIPE_TEXTURE_USAGE_SCANOUT) if (i915_scanout_layout(tex)) return; - /* for shared buffers we use some very like scanout */ - if (pt->tex_usage & PIPE_TEXTURE_USAGE_DISPLAY_TARGET) + /* shared buffers needs to be compatible with X servers */ + if (pt->tex_usage & PIPE_TEXTURE_USAGE_SHARED) if (i915_display_target_layout(tex)) return; @@ -369,12 +369,12 @@ i945_miptree_layout_2d(struct i915_texture *tex) unsigned nblocksy = util_format_get_nblocksy(pt->format, pt->height0); /* used for scanouts that need special layouts */ - if (tex->base.tex_usage & PIPE_TEXTURE_USAGE_PRIMARY) + if (tex->base.tex_usage & PIPE_TEXTURE_USAGE_SCANOUT) if (i915_scanout_layout(tex)) return; - /* for shared buffers we use some very like scanout */ - if (tex->base.tex_usage & PIPE_TEXTURE_USAGE_DISPLAY_TARGET) + /* shared buffers needs to be compatible with X servers */ + if (tex->base.tex_usage & PIPE_TEXTURE_USAGE_SHARED) if (i915_display_target_layout(tex)) return; @@ -642,7 +642,7 @@ i915_texture_create(struct pipe_screen *screen, /* for scanouts and cursors, cursors arn't scanouts */ - if (templat->tex_usage & PIPE_TEXTURE_USAGE_PRIMARY && templat->width0 != 64) + if (templat->tex_usage & PIPE_TEXTURE_USAGE_SCANOUT && templat->width0 != 64) buf_usage = INTEL_NEW_SCANOUT; else buf_usage = INTEL_NEW_TEXTURE; diff --git a/src/gallium/drivers/i965/brw_screen_texture.c b/src/gallium/drivers/i965/brw_screen_texture.c index feb9d5f..f5f12dd 100644 --- a/src/gallium/drivers/i965/brw_screen_texture.c +++ b/src/gallium/drivers/i965/brw_screen_texture.c @@ -230,8 +230,8 @@ static struct pipe_texture *brw_texture_create( struct pipe_screen *screen, goto fail; - if (templ->tex_usage & (PIPE_TEXTURE_USAGE_DISPLAY_TARGET | - PIPE_TEXTURE_USAGE_PRIMARY)) { + if (templ->tex_usage & (PIPE_TEXTURE_USAGE_SCANOUT | + PIPE_TEXTURE_USAGE_SHARED)) { buffer_type = BRW_BUFFER_TYPE_SCANOUT; } else { diff --git a/src/gallium/drivers/llvmpipe/lp_texture.c b/src/gallium/drivers/llvmpipe/lp_texture.c index 022bf92..9efbebb 100644 --- a/src/gallium/drivers/llvmpipe/lp_texture.c +++ b/src/gallium/drivers/llvmpipe/lp_texture.c @@ -131,7 +131,8 @@ llvmpipe_texture_create(struct pipe_screen *_screen, lpt->base.format = PIPE_FORMAT_Z32_UNORM; if (lpt->base.tex_usage & (PIPE_TEXTURE_USAGE_DISPLAY_TARGET | - PIPE_TEXTURE_USAGE_PRIMARY)) { + PIPE_TEXTURE_USAGE_SCANOUT | + PIPE_TEXTURE_USAGE_SHARED)) { if (!llvmpipe_displaytarget_layout(screen, lpt)) goto fail; } diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c index b892c08..65104c7 100644 --- a/src/gallium/drivers/r300/r300_screen.c +++ b/src/gallium/drivers/r300/r300_screen.c @@ -225,7 +
Mesa (gallium-winsys-handle): i915g: New winsys handle code
Module: Mesa Branch: gallium-winsys-handle Commit: 64abfd29f3c42ce637a46131f5f8dc4057e80505 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=64abfd29f3c42ce637a46131f5f8dc4057e80505 Author: Jakob Bornecrantz Date: Wed Feb 17 21:28:01 2010 + i915g: New winsys handle code --- src/gallium/drivers/i915/i915_texture.c| 104 ++-- src/gallium/drivers/i915/intel_winsys.h| 39 src/gallium/winsys/drm/intel/gem/intel_drm_api.c | 96 -- .../winsys/drm/intel/gem/intel_drm_buffer.c| 63 4 files changed, 137 insertions(+), 165 deletions(-) diff --git a/src/gallium/drivers/i915/i915_texture.c b/src/gallium/drivers/i915/i915_texture.c index 5ad65a2..334959c 100644 --- a/src/gallium/drivers/i915/i915_texture.c +++ b/src/gallium/drivers/i915/i915_texture.c @@ -673,6 +673,58 @@ fail: } static struct pipe_texture * +i915_texture_from_handle(struct pipe_screen * screen, + const struct pipe_texture *templat, + struct winsys_handle *whandle) +{ + struct i915_screen *is = i915_screen(screen); + struct i915_texture *tex; + struct intel_winsys *iws = is->iws; + struct intel_buffer *buffer; + unsigned stride; + + assert(screen); + + buffer = iws->buffer_from_handle(iws, whandle, &stride); + + /* Only supports one type */ + if (templat->target != PIPE_TEXTURE_2D || + templat->last_level != 0 || + templat->depth0 != 1) { + return NULL; + } + + tex = CALLOC_STRUCT(i915_texture); + if (!tex) + return NULL; + + tex->base = *templat; + pipe_reference_init(&tex->base.reference, 1); + tex->base.screen = screen; + + tex->stride = stride; + + i915_miptree_set_level_info(tex, 0, 1, templat->width0, templat->height0, 1); + i915_miptree_set_image_offset(tex, 0, 0, 0, 0); + + tex->buffer = buffer; + + return &tex->base; +} + +static boolean +i915_texture_get_handle(struct pipe_screen * screen, +struct pipe_texture *texture, +struct winsys_handle *whandle) +{ + struct i915_screen *is = i915_screen(screen); + struct i915_texture *tex = (struct i915_texture *)texture; + struct intel_winsys *iws = is->iws; + + return iws->buffer_get_handle(iws, tex->buffer, whandle, tex->stride); +} + +static struct pipe_texture * i915_texture_blanket(struct pipe_screen * screen, const struct pipe_texture *base, const unsigned *stride, @@ -869,6 +921,8 @@ void i915_init_screen_texture_functions(struct i915_screen *is) { is->base.texture_create = i915_texture_create; + is->base.texture_from_handle = i915_texture_from_handle; + is->base.texture_get_handle = i915_texture_get_handle; is->base.texture_blanket = i915_texture_blanket; is->base.texture_destroy = i915_texture_destroy; is->base.get_tex_surface = i915_get_tex_surface; @@ -878,53 +932,3 @@ i915_init_screen_texture_functions(struct i915_screen *is) is->base.transfer_unmap = i915_transfer_unmap; is->base.tex_transfer_destroy = i915_tex_transfer_destroy; } - -struct pipe_texture * -i915_texture_blanket_intel(struct pipe_screen *screen, - struct pipe_texture *base, - unsigned stride, - struct intel_buffer *buffer) -{ - struct i915_texture *tex; - assert(screen); - - /* Only supports one type */ - if (base->target != PIPE_TEXTURE_2D || - base->last_level != 0 || - base->depth0 != 1) { - return NULL; - } - - tex = CALLOC_STRUCT(i915_texture); - if (!tex) - return NULL; - - tex->base = *base; - pipe_reference_init(&tex->base.reference, 1); - tex->base.screen = screen; - - tex->stride = stride; - - i915_miptree_set_level_info(tex, 0, 1, base->width0, base->height0, 1); - i915_miptree_set_image_offset(tex, 0, 0, 0, 0); - - tex->buffer = buffer; - - return &tex->base; -} - -boolean -i915_get_texture_buffer_intel(struct pipe_texture *texture, - struct intel_buffer **buffer, - unsigned *stride) -{ - struct i915_texture *tex = (struct i915_texture *)texture; - - if (!texture) - return FALSE; - - *stride = tex->stride; - *buffer = tex->buffer; - - return TRUE; -} diff --git a/src/gallium/drivers/i915/intel_winsys.h b/src/gallium/drivers/i915/intel_winsys.h index b3a802b..00fd0c1 100644 --- a/src/gallium/drivers/i915/intel_winsys.h +++ b/src/gallium/drivers/i915/intel_winsys.h @@ -33,6 +33,7 @@ struct intel_buffer; struct intel_batchbuffer; struct pipe_texture; struct pipe_fence_handle; +struct winsys_handle; enum intel_buffer_usage { @@ -129,6 +130,25 @@ struct intel_winsys { enum intel_buffer_type type); /** +* Creates a buffer from a handle. +* Used to implement pipe_screen::texture_from_handle. +* Al
Mesa (gallium-winsys-handle): i965g: Work in progress conversion to winsys handle
Module: Mesa Branch: gallium-winsys-handle Commit: 30de87adbda336d71c535af69d88e6cd27cbf675 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=30de87adbda336d71c535af69d88e6cd27cbf675 Author: Jakob Bornecrantz Date: Wed Feb 17 21:45:41 2010 + i965g: Work in progress conversion to winsys handle At least now it compiles, all thats left is the driver stuff. --- src/gallium/winsys/drm/i965/gem/i965_drm_api.c| 126 - src/gallium/winsys/drm/i965/gem/i965_drm_buffer.c | 71 2 files changed, 71 insertions(+), 126 deletions(-) diff --git a/src/gallium/winsys/drm/i965/gem/i965_drm_api.c b/src/gallium/winsys/drm/i965/gem/i965_drm_api.c index a061eef..21e8230 100644 --- a/src/gallium/winsys/drm/i965/gem/i965_drm_api.c +++ b/src/gallium/winsys/drm/i965/gem/i965_drm_api.c @@ -37,129 +37,6 @@ i965_libdrm_get_device_id(unsigned int *device_id) fclose(file); } -static struct i965_libdrm_buffer * -i965_libdrm_buffer_from_handle(struct i965_libdrm_winsys *idws, - const char* name, unsigned handle) -{ - struct i965_libdrm_buffer *buf = CALLOC_STRUCT(i965_libdrm_buffer); - uint32_t swizzle = 0; - - if (BRW_DUMP) - debug_printf("%s\n", __FUNCTION__); - - if (!buf) - return NULL; - pipe_reference_init(&buf->base.reference, 1); - buf->bo = drm_intel_bo_gem_create_from_name(idws->gem, name, handle); - buf->base.size = buf->bo->size; - buf->base.sws = &idws->base; - buf->flinked = TRUE; - buf->flink = handle; - - - if (!buf->bo) - goto err; - - drm_intel_bo_get_tiling(buf->bo, &buf->tiling, &swizzle); - if (buf->tiling != 0) - buf->map_gtt = TRUE; - - return buf; - -err: - FREE(buf); - return NULL; -} - - -/* - * Exported functions - */ - - -static struct pipe_texture * -i965_libdrm_texture_from_shared_handle(struct drm_api *api, - struct pipe_screen *screen, - struct pipe_texture *template, - const char* name, - unsigned pitch, - unsigned handle) -{ - /* XXX: this is silly -- there should be a way to get directly from -* the "drm_api" struct to ourselves, without peering into -* unrelated code: -*/ - struct i965_libdrm_winsys *idws = i965_libdrm_winsys(brw_screen(screen)->sws); - struct i965_libdrm_buffer *buffer; - - if (BRW_DUMP) - debug_printf("%s %s pitch %d handle 0x%x\n", __FUNCTION__, - name, pitch, handle); - - buffer = i965_libdrm_buffer_from_handle(idws, name, handle); - if (!buffer) - return NULL; - - return brw_texture_blanket_winsys_buffer(screen, template, pitch, - buffer->tiling, - &buffer->base); -} - - -static boolean -i965_libdrm_shared_handle_from_texture(struct drm_api *api, - struct pipe_screen *screen, - struct pipe_texture *texture, - unsigned *pitch, - unsigned *handle) -{ - struct i965_libdrm_buffer *buf = NULL; - struct brw_winsys_buffer *buffer = NULL; - - if (BRW_DUMP) - debug_printf("%s\n", __FUNCTION__); - - if (!brw_texture_get_winsys_buffer(texture, &buffer, pitch)) - return FALSE; - - buf = i965_libdrm_buffer(buffer); - if (!buf->flinked) { - if (drm_intel_bo_flink(buf->bo, &buf->flink)) - return FALSE; - buf->flinked = TRUE; - } - - *handle = buf->flink; - - if (BRW_DUMP) - debug_printf(" -> pitch %d handle 0x%x\n", *pitch, *handle); - - return TRUE; -} - -static boolean -i965_libdrm_local_handle_from_texture(struct drm_api *api, - struct pipe_screen *screen, - struct pipe_texture *texture, - unsigned *pitch, - unsigned *handle) -{ - struct brw_winsys_buffer *buffer = NULL; - - if (BRW_DUMP) - debug_printf("%s\n", __FUNCTION__); - - if (!brw_texture_get_winsys_buffer(texture, &buffer, pitch)) - return FALSE; - - *handle = i965_libdrm_buffer(buffer)->bo->handle; - - if (BRW_DUMP) - debug_printf(" -> pitch %d handle 0x%x\n", *pitch, *handle); - - return TRUE; -} - static void i965_libdrm_winsys_destroy(struct brw_winsys_screen *iws) { @@ -225,9 +102,6 @@ struct drm_api i965_libdrm_api = { .name = "i965", .create_screen = i965_libdrm_create_screen, - .texture_from_shared_handle = i965_libdrm_texture_from_shared_handle, - .shared_handle_from_texture = i965_libdrm_shared_handle_from_texture, - .local_handle_from_texture = i965_libdrm_local_handle_from_texture, .destroy = destroy, }; diff --git a/src/gallium/winsys/drm/i965/gem/i965
Mesa (master): st/dri2: Flush FRAME instead of RENDER_CACHE on buffer invalidation.
Module: Mesa Branch: master Commit: 52e3f0949d47c846e3508a135afd75c439f2c49d URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=52e3f0949d47c846e3508a135afd75c439f2c49d Author: Francisco Jerez Date: Tue Feb 16 18:17:11 2010 +0100 st/dri2: Flush FRAME instead of RENDER_CACHE on buffer invalidation. --- src/gallium/state_trackers/dri/dri_drawable.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gallium/state_trackers/dri/dri_drawable.c b/src/gallium/state_trackers/dri/dri_drawable.c index 4d7596a..195ae7b 100644 --- a/src/gallium/state_trackers/dri/dri_drawable.c +++ b/src/gallium/state_trackers/dri/dri_drawable.c @@ -288,11 +288,11 @@ dri_update_buffer(struct pipe_screen *screen, void *context_private) ctx->r_stamp == *ctx->rPriv->pStamp) return; + st_flush(ctx->st, PIPE_FLUSH_FRAME, NULL); + ctx->d_stamp = *ctx->dPriv->pStamp; ctx->r_stamp = *ctx->rPriv->pStamp; - st_flush(ctx->st, PIPE_FLUSH_RENDER_CACHE, NULL); - /* Ask the X server for new renderbuffers. */ dri_get_buffers(ctx->dPriv); if (ctx->dPriv != ctx->rPriv) ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): st/mesa: Make the frontbuffer visible on st_flush( PIPE_FLUSH_FRAME).
Module: Mesa Branch: master Commit: f455ca6490fcb65781b21f81c7117bd923e250d1 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=f455ca6490fcb65781b21f81c7117bd923e250d1 Author: Francisco Jerez Date: Tue Feb 16 17:21:10 2010 +0100 st/mesa: Make the frontbuffer visible on st_flush(PIPE_FLUSH_FRAME). So far the frontbuffer was only being flushed on st_glFlush and st_glFinish, however, a co-state tracker may need to make sure that any frontbuffer changes are already on its way to the actual front. The dri2 state tracker will need this for event-driven GL applications to resize properly (It could also be done calling "dri_flush_frontbuffer", but that way we would flush unnecessarily in the double-buffered case). Additionally this patch avoids flushing the mesa rendering cache if PIPE_FLUSH_RENDER_CACHE wasn't specified. --- src/mesa/state_tracker/st_cb_flush.c | 15 ++- 1 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/mesa/state_tracker/st_cb_flush.c b/src/mesa/state_tracker/st_cb_flush.c index 1329f80..0ddfce4 100644 --- a/src/mesa/state_tracker/st_cb_flush.c +++ b/src/mesa/state_tracker/st_cb_flush.c @@ -91,7 +91,8 @@ display_front_buffer(struct st_context *st) void st_flush( struct st_context *st, uint pipeFlushFlags, struct pipe_fence_handle **fence ) { - FLUSH_CURRENT(st->ctx, 0); + if (pipeFlushFlags & PIPE_FLUSH_RENDER_CACHE) + FLUSH_CURRENT(st->ctx, 0); /* Release any vertex buffers that might potentially be accessed in * successive frames: @@ -102,6 +103,10 @@ void st_flush( struct st_context *st, uint pipeFlushFlags, util_gen_mipmap_flush(st->gen_mipmap); st->pipe->flush( st->pipe, pipeFlushFlags, fence ); + + if ((pipeFlushFlags & PIPE_FLUSH_FRAME) && + is_front_buffer_dirty(st)) + display_front_buffer(st); } @@ -135,10 +140,6 @@ static void st_glFlush(GLcontext *ctx) * problems that need to be fixed elsewhere. */ st_flush(st, PIPE_FLUSH_RENDER_CACHE | PIPE_FLUSH_FRAME, NULL); - - if (is_front_buffer_dirty(st)) { - display_front_buffer(st); - } } @@ -150,10 +151,6 @@ static void st_glFinish(GLcontext *ctx) struct st_context *st = ctx->st; st_finish(st); - - if (is_front_buffer_dirty(st)) { - display_front_buffer(st); - } } ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): dri/nouveau: Some multithreaded rendering fixes.
Module: Mesa Branch: master Commit: 56dcd011b5ec33190f268cf546a4c68f81f5ebd0 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=56dcd011b5ec33190f268cf546a4c68f81f5ebd0 Author: Francisco Jerez Date: Wed Feb 17 18:56:42 2010 +0100 dri/nouveau: Some multithreaded rendering fixes. --- src/mesa/drivers/dri/nouveau/Makefile |3 - src/mesa/drivers/dri/nouveau/nouveau_context.c | 70 +++- src/mesa/drivers/dri/nouveau/nouveau_context.h | 24 ++- src/mesa/drivers/dri/nouveau/nouveau_driver.h |2 - src/mesa/drivers/dri/nouveau/nouveau_screen.c | 42 +-- src/mesa/drivers/dri/nouveau/nouveau_screen.h | 16 - src/mesa/drivers/dri/nouveau/nv04_context.c| 202 +- src/mesa/drivers/dri/nouveau/nv04_context.h|7 +- src/mesa/drivers/dri/nouveau/nv04_driver.h |8 +- src/mesa/drivers/dri/nouveau/nv04_screen.c | 211 --- src/mesa/drivers/dri/nouveau/nv04_state_fb.c |8 +- src/mesa/drivers/dri/nouveau/nv04_surface.c| 134 +++ src/mesa/drivers/dri/nouveau/nv10_context.c| 343 - src/mesa/drivers/dri/nouveau/nv10_driver.h | 11 +- src/mesa/drivers/dri/nouveau/nv10_screen.c | 364 -- src/mesa/drivers/dri/nouveau/nv20_context.c| 463 ++- src/mesa/drivers/dri/nouveau/nv20_driver.h | 11 +- src/mesa/drivers/dri/nouveau/nv20_screen.c | 483 18 files changed, 1124 insertions(+), 1278 deletions(-) Diff: http://cgit.freedesktop.org/mesa/mesa/diff/?id=56dcd011b5ec33190f268cf546a4c68f81f5ebd0 ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): intel: Implement the DRI2 invalidate function properly
Module: Mesa Branch: master Commit: d449627829e1a4a3250a1a723af2f4e3cd5fd194 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=d449627829e1a4a3250a1a723af2f4e3cd5fd194 Author: Kristian Høgsberg Date: Wed Feb 17 21:17:55 2010 -0500 intel: Implement the DRI2 invalidate function properly This uses a stamp mechanisms to mark the DRI drawable as invalid. Instead of immediately updating the buffers we just bump the drawable stamp and call out to DRI2GetBuffers "later". "Later" used to be at LOCK_HARDWARE time, and this patch brings back callouts at the points where we used to call LOCK_HARDWARE. A new function, intel_prepare_render(), is called where we used to call LOCK_HARDWARE, and if the buffers are invalid, we call out to DRI2GetBuffers there. This lets us invalidate buffers only when notified instead of on every glViewport() call. If the loader calls the DRI invalidate entrypoint, we disable viewport triggered buffer invalidation. Additionally, we can clean up the old viewport mechanism a bit, since we can just invalidate the buffers and not worry about reentrancy and whatnot. --- src/mesa/drivers/dri/common/dri_util.c |2 + src/mesa/drivers/dri/common/dri_util.h |5 ++ src/mesa/drivers/dri/i965/brw_draw.c|2 + src/mesa/drivers/dri/intel/intel_blit.c |4 + src/mesa/drivers/dri/intel/intel_buffers.c | 22 +++ src/mesa/drivers/dri/intel/intel_context.c | 71 --- src/mesa/drivers/dri/intel/intel_context.h |1 + src/mesa/drivers/dri/intel/intel_pixel_bitmap.c |2 + src/mesa/drivers/dri/intel/intel_pixel_copy.c |2 + src/mesa/drivers/dri/intel/intel_pixel_read.c |3 + src/mesa/drivers/dri/intel/intel_regions.c |3 + src/mesa/drivers/dri/intel/intel_screen.c |1 - src/mesa/drivers/dri/intel/intel_span.c |1 + src/mesa/drivers/dri/intel/intel_tex_copy.c |1 + src/mesa/drivers/dri/intel/intel_tex_image.c|5 +- src/mesa/drivers/dri/intel/intel_tex_subimage.c |2 + 16 files changed, 79 insertions(+), 48 deletions(-) diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c index b891fca..58a94b5 100644 --- a/src/mesa/drivers/dri/common/dri_util.c +++ b/src/mesa/drivers/dri/common/dri_util.c @@ -585,6 +585,8 @@ driCreateNewContext(__DRIscreen *psp, const __DRIconfig *config, pcp->driDrawablePriv = NULL; pcp->loaderPrivate = data; +pcp->dri2.draw_stamp = 0; +pcp->dri2.read_stamp = 0; /* When the first context is created for a screen, initialize a "dummy" * context. */ diff --git a/src/mesa/drivers/dri/common/dri_util.h b/src/mesa/drivers/dri/common/dri_util.h index 8f0cd4c..2eadb9a 100644 --- a/src/mesa/drivers/dri/common/dri_util.h +++ b/src/mesa/drivers/dri/common/dri_util.h @@ -422,6 +422,11 @@ struct __DRIcontextRec { * The loaders's private context data. This structure is opaque. */ void *loaderPrivate; + +struct { + int draw_stamp; + int read_stamp; +} dri2; }; /** diff --git a/src/mesa/drivers/dri/i965/brw_draw.c b/src/mesa/drivers/dri/i965/brw_draw.c index d510d76..9762490 100644 --- a/src/mesa/drivers/dri/i965/brw_draw.c +++ b/src/mesa/drivers/dri/i965/brw_draw.c @@ -337,6 +337,8 @@ static GLboolean brw_try_draw_prims( GLcontext *ctx, * so can't access it earlier. */ + intel_prepare_render(intel); + for (i = 0; i < nr_prims; i++) { uint32_t hw_prim; diff --git a/src/mesa/drivers/dri/intel/intel_blit.c b/src/mesa/drivers/dri/intel/intel_blit.c index 1fd07e8..5a60a17 100644 --- a/src/mesa/drivers/dri/intel/intel_blit.c +++ b/src/mesa/drivers/dri/intel/intel_blit.c @@ -115,6 +115,8 @@ intelEmitCopyBlit(struct intel_context *intel, break; } while (pass < 2); + intel_prepare_render(intel); + if (pass >= 2) { dri_bo_map(dst_buffer, GL_TRUE); dri_bo_map(src_buffer, GL_FALSE); @@ -241,6 +243,8 @@ intelClearWithBlit(GLcontext *ctx, GLbitfield mask) GLuint buf; all = (cw == fb->Width && ch == fb->Height); + intel_prepare_render(intel); + /* Loop over all renderbuffers */ for (buf = 0; buf < BUFFER_COUNT && mask; buf++) { const GLbitfield bufBit = 1 << buf; diff --git a/src/mesa/drivers/dri/intel/intel_buffers.c b/src/mesa/drivers/dri/intel/intel_buffers.c index 2f03e45..b106930 100644 --- a/src/mesa/drivers/dri/intel/intel_buffers.c +++ b/src/mesa/drivers/dri/intel/intel_buffers.c @@ -271,13 +271,12 @@ intelDrawBuffer(GLcontext * ctx, GLenum mode) intel->is_front_buffer_rendering = (mode == GL_FRONT_LEFT) || (mode == GL_FRONT); - /* If we weren't front-buffer rendering before but we are now, make sure - * that the front-buffer has actually been allocated. + /* If we weren't front-buffer rendering before but we are now, + * invalidate our DRI drawable so we'll ask for new buffers
Mesa (master): winsys/drm: Do not use --whole-archive in Makefile.egl.
Module: Mesa Branch: master Commit: 9a939adf7d25f273048d5f92cf9d96d10e664c23 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=9a939adf7d25f273048d5f92cf9d96d10e664c23 Author: Chia-I Wu Date: Thu Feb 18 12:38:47 2010 +0800 winsys/drm: Do not use --whole-archive in Makefile.egl. --whole-archive is not portable. Have the drivers reference _eglMain as a poor man's --whole-archive. --- src/gallium/winsys/drm/Makefile.egl|3 +-- src/gallium/winsys/drm/i965/egl/dummy.c|4 +++- src/gallium/winsys/drm/intel/egl/dummy.c |4 +++- src/gallium/winsys/drm/nouveau/egl/dummy.c |4 +++- src/gallium/winsys/drm/radeon/egl/dummy.c |4 +++- src/gallium/winsys/drm/swrast/egl/dummy.c |4 +++- src/gallium/winsys/drm/vmware/egl/dummy.c |4 +++- 7 files changed, 19 insertions(+), 8 deletions(-) diff --git a/src/gallium/winsys/drm/Makefile.egl b/src/gallium/winsys/drm/Makefile.egl index b1f2038..8363de6 100644 --- a/src/gallium/winsys/drm/Makefile.egl +++ b/src/gallium/winsys/drm/Makefile.egl @@ -38,8 +38,7 @@ $(EGL_DISPLAY_LIBS): $(TOP)/$(LIB_DIR)/%.so: %.so define mklib-egl $(MKLIB) -o $@ -noprefix -linker '$(CC)' -ldflags '$(LDFLAGS)' \ - $(MKLIB_OPTIONS) $(EGL_DRIVER_OBJECTS) \ - -Wl,--whole-archive $($(1)_ST) -Wl,--no-whole-archive \ + $(MKLIB_OPTIONS) $(EGL_DRIVER_OBJECTS) $($(1)_ST) \ $(EGL_DRIVER_PIPES) $(GALLIUM_AUXILIARIES) $($(1)_LIBS) $(EGL_DRIVER_LIBS) endef diff --git a/src/gallium/winsys/drm/i965/egl/dummy.c b/src/gallium/winsys/drm/i965/egl/dummy.c index 4a1bc28..3181d0b 100644 --- a/src/gallium/winsys/drm/i965/egl/dummy.c +++ b/src/gallium/winsys/drm/i965/egl/dummy.c @@ -1 +1,3 @@ -/* mklib expects at least one object file */ +/* A poor man's --whole-archive for EGL drivers */ +void *_eglMain(void *); +void *_eglWholeArchive = (void *) _eglMain; diff --git a/src/gallium/winsys/drm/intel/egl/dummy.c b/src/gallium/winsys/drm/intel/egl/dummy.c index 4a1bc28..3181d0b 100644 --- a/src/gallium/winsys/drm/intel/egl/dummy.c +++ b/src/gallium/winsys/drm/intel/egl/dummy.c @@ -1 +1,3 @@ -/* mklib expects at least one object file */ +/* A poor man's --whole-archive for EGL drivers */ +void *_eglMain(void *); +void *_eglWholeArchive = (void *) _eglMain; diff --git a/src/gallium/winsys/drm/nouveau/egl/dummy.c b/src/gallium/winsys/drm/nouveau/egl/dummy.c index 4a1bc28..3181d0b 100644 --- a/src/gallium/winsys/drm/nouveau/egl/dummy.c +++ b/src/gallium/winsys/drm/nouveau/egl/dummy.c @@ -1 +1,3 @@ -/* mklib expects at least one object file */ +/* A poor man's --whole-archive for EGL drivers */ +void *_eglMain(void *); +void *_eglWholeArchive = (void *) _eglMain; diff --git a/src/gallium/winsys/drm/radeon/egl/dummy.c b/src/gallium/winsys/drm/radeon/egl/dummy.c index 4a1bc28..3181d0b 100644 --- a/src/gallium/winsys/drm/radeon/egl/dummy.c +++ b/src/gallium/winsys/drm/radeon/egl/dummy.c @@ -1 +1,3 @@ -/* mklib expects at least one object file */ +/* A poor man's --whole-archive for EGL drivers */ +void *_eglMain(void *); +void *_eglWholeArchive = (void *) _eglMain; diff --git a/src/gallium/winsys/drm/swrast/egl/dummy.c b/src/gallium/winsys/drm/swrast/egl/dummy.c index 4a1bc28..3181d0b 100644 --- a/src/gallium/winsys/drm/swrast/egl/dummy.c +++ b/src/gallium/winsys/drm/swrast/egl/dummy.c @@ -1 +1,3 @@ -/* mklib expects at least one object file */ +/* A poor man's --whole-archive for EGL drivers */ +void *_eglMain(void *); +void *_eglWholeArchive = (void *) _eglMain; diff --git a/src/gallium/winsys/drm/vmware/egl/dummy.c b/src/gallium/winsys/drm/vmware/egl/dummy.c index 4a1bc28..3181d0b 100644 --- a/src/gallium/winsys/drm/vmware/egl/dummy.c +++ b/src/gallium/winsys/drm/vmware/egl/dummy.c @@ -1 +1,3 @@ -/* mklib expects at least one object file */ +/* A poor man's --whole-archive for EGL drivers */ +void *_eglMain(void *); +void *_eglWholeArchive = (void *) _eglMain; ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): r300g: add support for all missing non-FP sampler formats
Module: Mesa Branch: master Commit: ca0e88ce9298516087825758dd97dd0636d9f19c URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=ca0e88ce9298516087825758dd97dd0636d9f19c Author: Marek Olšák Date: Thu Feb 18 00:18:23 2010 +0100 r300g: add support for all missing non-FP sampler formats The idea is to directly parse the format description in r300_translate_texformat and return ~0 if the format is unsupported. --- src/gallium/drivers/r300/r300_screen.c| 64 ++- src/gallium/drivers/r300/r300_state_inlines.h |1 - src/gallium/drivers/r300/r300_texture.h | 293 +++-- 3 files changed, 234 insertions(+), 124 deletions(-) diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c index b892c08..5fa1ea0 100644 --- a/src/gallium/drivers/r300/r300_screen.c +++ b/src/gallium/drivers/r300/r300_screen.c @@ -210,6 +210,8 @@ static boolean r300_is_format_supported(struct pipe_screen* screen, { uint32_t retval = 0; boolean is_r500 = r300_screen(screen)->caps->is_r500; +boolean is_z24 = format == PIPE_FORMAT_Z24X8_UNORM || + format == PIPE_FORMAT_Z24S8_UNORM; if (target >= PIPE_MAX_TEXTURE_TYPES) { debug_printf("r300: Implementation error: Received bogus texture " @@ -217,32 +219,18 @@ static boolean r300_is_format_supported(struct pipe_screen* screen, return FALSE; } +/* Check sampler format support. */ +if ((usage & PIPE_TEXTURE_USAGE_SAMPLER) && +(is_r500 || !is_z24) && /* Z24 cannot be sampled from on non-r5xx. */ +r300_translate_texformat(format) != ~0) { +retval |= PIPE_TEXTURE_USAGE_SAMPLER; +} + switch (format) { /* Supported formats. */ /* Colorbuffer */ case PIPE_FORMAT_A8_UNORM: case PIPE_FORMAT_L8_UNORM: -retval = usage & -(PIPE_TEXTURE_USAGE_RENDER_TARGET | - PIPE_TEXTURE_USAGE_DISPLAY_TARGET | - PIPE_TEXTURE_USAGE_PRIMARY); -break; - -/* Texture */ -case PIPE_FORMAT_A8R8G8B8_SRGB: -case PIPE_FORMAT_R8G8B8A8_SRGB: -case PIPE_FORMAT_DXT1_RGB: -case PIPE_FORMAT_DXT1_RGBA: -case PIPE_FORMAT_DXT3_RGBA: -case PIPE_FORMAT_DXT5_RGBA: -case PIPE_FORMAT_YCBCR: -case PIPE_FORMAT_L8_SRGB: -case PIPE_FORMAT_A8L8_SRGB: -case PIPE_FORMAT_A8L8_UNORM: -retval = usage & PIPE_TEXTURE_USAGE_SAMPLER; -break; - -/* Colorbuffer or texture */ case PIPE_FORMAT_R5G6B5_UNORM: case PIPE_FORMAT_A1R5G5B5_UNORM: case PIPE_FORMAT_A4R4G4B4_UNORM: @@ -251,47 +239,23 @@ static boolean r300_is_format_supported(struct pipe_screen* screen, case PIPE_FORMAT_R8G8B8A8_UNORM: case PIPE_FORMAT_R8G8B8X8_UNORM: case PIPE_FORMAT_I8_UNORM: -retval = usage & +retval |= usage & (PIPE_TEXTURE_USAGE_RENDER_TARGET | PIPE_TEXTURE_USAGE_DISPLAY_TARGET | - PIPE_TEXTURE_USAGE_PRIMARY | - PIPE_TEXTURE_USAGE_SAMPLER); + PIPE_TEXTURE_USAGE_PRIMARY); break; -/* Z buffer or texture */ +/* ZS buffer */ case PIPE_FORMAT_Z16_UNORM: -retval = usage & -(PIPE_TEXTURE_USAGE_DEPTH_STENCIL | - PIPE_TEXTURE_USAGE_SAMPLER); -break; - -/* 24bit Z buffer can only be used as a texture on R500. */ case PIPE_FORMAT_Z24X8_UNORM: -/* Z buffer with stencil or texture */ case PIPE_FORMAT_Z24S8_UNORM: -retval = usage & -(PIPE_TEXTURE_USAGE_DEPTH_STENCIL | - (is_r500 ? PIPE_TEXTURE_USAGE_SAMPLER : 0)); +retval = usage & PIPE_TEXTURE_USAGE_DEPTH_STENCIL; break; -/* Definitely unsupported formats. */ -/* Non-usable Z buffer/stencil formats. */ -case PIPE_FORMAT_Z32_UNORM: -case PIPE_FORMAT_S8Z24_UNORM: -case PIPE_FORMAT_X8Z24_UNORM: -SCREEN_DBG(r300_screen(screen), DBG_TEX, - "r300: Note: Got unsupported format: %s in %s\n", - util_format_name(format), __FUNCTION__); -return FALSE; - /* XXX Add all remaining gallium-supported formats, * see util/u_format.csv. */ -default: -/* Unknown format... */ -debug_printf("r300: Warning: Got unknown format: %s in %s\n", -util_format_name(format), __FUNCTION__); -break; +default:; } /* If usage was a mask that contained multiple bits, and not all of them diff --git a/src/gallium/drivers/r300/r300_state_inlines.h b/src/gallium/drivers/r300/r300_state_inlines.h index 6ee6cd0..a608392 100644 --- a/src/gallium/drivers/r300/r300_state_inlines.h +++ b/src/gallium/drivers/r300/
Mesa (master): svga: Silence uninitialized variable warnings.
Module: Mesa Branch: master Commit: 3f7af8440568d083dd9bb1370b785b60f5a141f0 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=3f7af8440568d083dd9bb1370b785b60f5a141f0 Author: Vinson Lee Date: Wed Feb 17 21:38:17 2010 -0800 svga: Silence uninitialized variable warnings. --- src/gallium/drivers/svga/svga_tgsi_insn.c |6 ++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/src/gallium/drivers/svga/svga_tgsi_insn.c b/src/gallium/drivers/svga/svga_tgsi_insn.c index 6debd98..87aed39 100644 --- a/src/gallium/drivers/svga/svga_tgsi_insn.c +++ b/src/gallium/drivers/svga/svga_tgsi_insn.c @@ -1811,6 +1811,8 @@ static boolean emit_exp(struct svga_shader_emitter *emit, fraction = dst; else if (dst.mask & TGSI_WRITEMASK_X) fraction = get_temp( emit ); + else + fraction.value = 0; /* If y is being written, fill it with src0 - floor(src0). */ @@ -2005,10 +2007,14 @@ static boolean emit_log(struct svga_shader_emitter *emit, struct src_register abs_src0; SVGA3dShaderDestToken log2_abs; + abs_tmp.value = 0; + if (dst.mask & TGSI_WRITEMASK_Z) log2_abs = dst; else if (dst.mask & TGSI_WRITEMASK_XY) log2_abs = get_temp( emit ); + else + log2_abs.value = 0; /* If z is being written, fill it with log2( abs( src0 ) ). */ ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): progs/rbug: s/read/rbug_read/
Module: Mesa Branch: master Commit: 56b7a6f6328f4bf73951aceac2c70b39ed787399 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=56b7a6f6328f4bf73951aceac2c70b39ed787399 Author: Vinson Lee Date: Wed Feb 17 21:50:07 2010 -0800 progs/rbug: s/read/rbug_read/ read conflicts with read in /usr/include/unistd.h. --- progs/rbug/bin_to_bmp.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/progs/rbug/bin_to_bmp.c b/progs/rbug/bin_to_bmp.c index 49a5416..346bdea 100644 --- a/progs/rbug/bin_to_bmp.c +++ b/progs/rbug/bin_to_bmp.c @@ -32,7 +32,7 @@ #include "util/u_network.h" #include "util/u_tile.h" -static uint8_t* read(const char *filename, unsigned size); +static uint8_t* rbug_read(const char *filename, unsigned size); static void dump(unsigned src_width, unsigned src_height, unsigned src_stride, enum pipe_format src_format, uint8_t *data, unsigned src_size); @@ -47,7 +47,7 @@ int main(int argc, char** argv) const char *filename = "mybin.bin"; enum pipe_format format = PIPE_FORMAT_A8R8G8B8_UNORM; - dump(width, height, stride, format, read(filename, size), size); + dump(width, height, stride, format, rbug_read(filename, size), size); return 0; } @@ -92,7 +92,7 @@ static void dump(unsigned width, unsigned height, FREE(rgba); } -static uint8_t* read(const char *filename, unsigned size) +static uint8_t* rbug_read(const char *filename, unsigned size) { uint8_t *data; FILE *file = fopen(filename, "rb"); ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): progs/rbug: Add missing header.
Module: Mesa Branch: master Commit: 20a11722a2d4453c614381004b683993428de30e URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=20a11722a2d4453c614381004b683993428de30e Author: Vinson Lee Date: Wed Feb 17 22:10:04 2010 -0800 progs/rbug: Add missing header. --- progs/rbug/bin_to_bmp.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/progs/rbug/bin_to_bmp.c b/progs/rbug/bin_to_bmp.c index 346bdea..18dd57b 100644 --- a/progs/rbug/bin_to_bmp.c +++ b/progs/rbug/bin_to_bmp.c @@ -22,6 +22,8 @@ * USE OR OTHER DEALINGS IN THE SOFTWARE. */ +#include + #include "pipe/p_compiler.h" #include "pipe/p_format.h" #include "pipe/p_state.h" ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): progs/rbug: Use util_format_name().
Module: Mesa Branch: master Commit: 8266f1e5a5a2f066e4dd0e7bf3273d6edcbff760 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=8266f1e5a5a2f066e4dd0e7bf3273d6edcbff760 Author: Vinson Lee Date: Wed Feb 17 22:55:16 2010 -0800 progs/rbug: Use util_format_name(). --- progs/rbug/bin_to_bmp.c |2 +- progs/rbug/tex_dump.c |2 +- progs/rbug/tex_info.c |3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/progs/rbug/bin_to_bmp.c b/progs/rbug/bin_to_bmp.c index 18dd57b..6e9b162 100644 --- a/progs/rbug/bin_to_bmp.c +++ b/progs/rbug/bin_to_bmp.c @@ -74,7 +74,7 @@ static void dump(unsigned width, unsigned height, rgba = MALLOC(dst_size); } - util_snprintf(filename, 512, "%s.bmp", pf_name(src_format)); + util_snprintf(filename, 512, "%s.bmp", util_format_name(src_format)); if (util_format_is_compressed(src_format)) { debug_printf("skipping: %s\n", filename); diff --git a/progs/rbug/tex_dump.c b/progs/rbug/tex_dump.c index 963f8ee..e99f5a7 100644 --- a/progs/rbug/tex_dump.c +++ b/progs/rbug/tex_dump.c @@ -48,7 +48,7 @@ static void dump(rbug_texture_t tex, char filename[512]; util_snprintf(filename, 512, "%llu_%s_%u.bmp", - (unsigned long long)tex, pf_name(info->format), mip); + (unsigned long long)tex, util_format_name(info->format), mip); if (util_format_is_compressed(info->format)) { debug_printf("skipping: %s\n", filename); diff --git a/progs/rbug/tex_info.c b/progs/rbug/tex_info.c index 4a21bae..60ed9e2 100644 --- a/progs/rbug/tex_info.c +++ b/progs/rbug/tex_info.c @@ -24,6 +24,7 @@ #include "pipe/p_compiler.h" #include "pipe/p_format.h" +#include "util/u_format.h" #include "util/u_memory.h" #include "util/u_debug.h" #include "util/u_network.h" @@ -60,7 +61,7 @@ static void talk() info = (struct rbug_proto_texture_info_reply *)header; debug_printf("%llu %s %u x %u x %u, block(%ux%u %u), last_level: %u, nr_samples: %u, usage: %u\n", - (unsigned long long)list->textures[i], pf_name(info->format), + (unsigned long long)list->textures[i], util_format_name(info->format), info->width[0], info->height[0], info->depth[0], info->blockw, info->blockh, info->blocksize, info->last_level, info->nr_samples, info->tex_usage); ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): util: Fix typo of debug_dump_float_rgba_bmp.
Module: Mesa Branch: master Commit: 9f5640d10b3c29260418c0acd0b5466b112f6ecd URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=9f5640d10b3c29260418c0acd0b5466b112f6ecd Author: Vinson Lee Date: Wed Feb 17 23:10:13 2010 -0800 util: Fix typo of debug_dump_float_rgba_bmp. --- src/gallium/auxiliary/util/u_debug.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/gallium/auxiliary/util/u_debug.h b/src/gallium/auxiliary/util/u_debug.h index efcf065..0f4768f 100644 --- a/src/gallium/auxiliary/util/u_debug.h +++ b/src/gallium/auxiliary/util/u_debug.h @@ -337,7 +337,7 @@ void debug_dump_float_rgba_bmp(const char *filename, #define debug_dump_surface(prefix, surface) ((void)0) #define debug_dump_surface_bmp(filename, surface) ((void)0) #define debug_dump_transfer_bmp(filename, transfer) ((void)0) -#define debug_dump_rgba_float_bmp(filename, width, height, rgba, stride) ((void)0) +#define debug_dump_float_rgba_bmp(filename, width, height, rgba, stride) ((void)0) #endif ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): progs/rbug: Add missing headers.
Module: Mesa Branch: master Commit: 869896f162708e820bcc7e45576258d8ff31ccb0 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=869896f162708e820bcc7e45576258d8ff31ccb0 Author: Vinson Lee Date: Wed Feb 17 23:19:24 2010 -0800 progs/rbug: Add missing headers. --- progs/rbug/bin_to_bmp.c |1 + progs/rbug/ctx_rule.c |2 ++ progs/rbug/shdr_disable.c |2 ++ progs/rbug/tex_dump.c |1 + 4 files changed, 6 insertions(+), 0 deletions(-) diff --git a/progs/rbug/bin_to_bmp.c b/progs/rbug/bin_to_bmp.c index 6e9b162..40ae629 100644 --- a/progs/rbug/bin_to_bmp.c +++ b/progs/rbug/bin_to_bmp.c @@ -32,6 +32,7 @@ #include "util/u_debug.h" #include "util/u_format.h" #include "util/u_network.h" +#include "util/u_string.h" #include "util/u_tile.h" static uint8_t* rbug_read(const char *filename, unsigned size); diff --git a/progs/rbug/ctx_rule.c b/progs/rbug/ctx_rule.c index e38b7b4..dccebfb 100644 --- a/progs/rbug/ctx_rule.c +++ b/progs/rbug/ctx_rule.c @@ -22,6 +22,8 @@ * USE OR OTHER DEALINGS IN THE SOFTWARE. */ +#include + #include "pipe/p_compiler.h" #include "pipe/p_format.h" #include "util/u_memory.h" diff --git a/progs/rbug/shdr_disable.c b/progs/rbug/shdr_disable.c index e6b1207..a80a841 100644 --- a/progs/rbug/shdr_disable.c +++ b/progs/rbug/shdr_disable.c @@ -22,6 +22,8 @@ * USE OR OTHER DEALINGS IN THE SOFTWARE. */ +#include + #include "pipe/p_compiler.h" #include "pipe/p_format.h" #include "util/u_memory.h" diff --git a/progs/rbug/tex_dump.c b/progs/rbug/tex_dump.c index e99f5a7..dd30d30 100644 --- a/progs/rbug/tex_dump.c +++ b/progs/rbug/tex_dump.c @@ -29,6 +29,7 @@ #include "util/u_debug.h" #include "util/u_format.h" #include "util/u_network.h" +#include "util/u_string.h" #include "util/u_tile.h" #include "rbug/rbug.h" ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): progs/rbug: Silence printf format warning.
Module: Mesa Branch: master Commit: 64d18b819b4a1d3ecaac7741d1906ecc7aa3f49e URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=64d18b819b4a1d3ecaac7741d1906ecc7aa3f49e Author: Vinson Lee Date: Wed Feb 17 23:22:51 2010 -0800 progs/rbug: Silence printf format warning. --- progs/rbug/shdr_info.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/progs/rbug/shdr_info.c b/progs/rbug/shdr_info.c index b6864e9..ec8d776 100644 --- a/progs/rbug/shdr_info.c +++ b/progs/rbug/shdr_info.c @@ -51,7 +51,7 @@ static void shader_info(struct rbug_connection *con, rbug_context_t ctx) assert(header->opcode == RBUG_OP_SHADER_INFO_REPLY); info = (struct rbug_proto_shader_info_reply *)header; - debug_printf("% 15llu |% 15llu |% 15u |\n", + debug_printf("%15llu | %15llu | %15u |\n", (unsigned long long)ctx, (unsigned long long)list->shaders[i], (unsigned)info->disabled); ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit