diff options
39 files changed, 321 insertions, 189 deletions
diff --git a/mesalib/src/mesa/main/api_validate.c b/mesalib/src/mesa/main/api_validate.c index 02495a15a..631bceecf 100644 --- a/mesalib/src/mesa/main/api_validate.c +++ b/mesalib/src/mesa/main/api_validate.c @@ -272,7 +272,7 @@ _mesa_validate_DrawElements(struct gl_context *ctx, GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex) { - ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE); + ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, GL_FALSE); if (count <= 0) { if (count < 0) @@ -318,6 +318,76 @@ _mesa_validate_DrawElements(struct gl_context *ctx, /** + * Error checking for glMultiDrawElements(). Includes parameter checking + * and VBO bounds checking. + * \return GL_TRUE if OK to render, GL_FALSE if error found + */ +GLboolean +_mesa_validate_MultiDrawElements(struct gl_context *ctx, + GLenum mode, const GLsizei *count, + GLenum type, const GLvoid * const *indices, + GLuint primcount, const GLint *basevertex) +{ + unsigned i; + + ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, GL_FALSE); + + for (i = 0; i < primcount; i++) { + if (count[i] <= 0) { + if (count[i] < 0) + _mesa_error(ctx, GL_INVALID_VALUE, + "glMultiDrawElements(count)" ); + return GL_FALSE; + } + } + + if (!_mesa_valid_prim_mode(ctx, mode, "glMultiDrawElements")) { + return GL_FALSE; + } + + if (type != GL_UNSIGNED_INT && + type != GL_UNSIGNED_BYTE && + type != GL_UNSIGNED_SHORT) + { + _mesa_error(ctx, GL_INVALID_ENUM, "glMultiDrawElements(type)" ); + return GL_FALSE; + } + + if (!check_valid_to_render(ctx, "glMultiDrawElements")) + return GL_FALSE; + + /* Vertex buffer object tests */ + if (_mesa_is_bufferobj(ctx->Array.ArrayObj->ElementArrayBufferObj)) { + /* use indices in the buffer object */ + /* make sure count doesn't go outside buffer bounds */ + for (i = 0; i < primcount; i++) { + if (index_bytes(type, count[i]) > + ctx->Array.ArrayObj->ElementArrayBufferObj->Size) { + _mesa_warning(ctx, + "glMultiDrawElements index out of buffer bounds"); + return GL_FALSE; + } + } + } + else { + /* not using a VBO */ + for (i = 0; i < primcount; i++) { + if (!indices[i]) + return GL_FALSE; + } + } + + for (i = 0; i < primcount; i++) { + if (!check_index_bounds(ctx, count[i], type, indices[i], + basevertex ? basevertex[i] : 0)) + return GL_FALSE; + } + + return GL_TRUE; +} + + +/** * Error checking for glDrawRangeElements(). Includes parameter checking * and VBO bounds checking. * \return GL_TRUE if OK to render, GL_FALSE if error found @@ -328,7 +398,7 @@ _mesa_validate_DrawRangeElements(struct gl_context *ctx, GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex) { - ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE); + ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, GL_FALSE); if (count <= 0) { if (count < 0) @@ -386,7 +456,7 @@ GLboolean _mesa_validate_DrawArrays(struct gl_context *ctx, GLenum mode, GLint start, GLsizei count) { - ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE); + ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, GL_FALSE); if (count <= 0) { if (count < 0) @@ -414,7 +484,7 @@ GLboolean _mesa_validate_DrawArraysInstanced(struct gl_context *ctx, GLenum mode, GLint first, GLsizei count, GLsizei numInstances) { - ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE); + ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, GL_FALSE); if (count <= 0) { if (count < 0) @@ -458,7 +528,7 @@ _mesa_validate_DrawElementsInstanced(struct gl_context *ctx, const GLvoid *indices, GLsizei numInstances, GLint basevertex) { - ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE); + ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, GL_FALSE); if (count <= 0) { if (count < 0) @@ -519,7 +589,7 @@ _mesa_validate_DrawTransformFeedback(struct gl_context *ctx, GLenum mode, struct gl_transform_feedback_object *obj) { - ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE); + ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, GL_FALSE); if (!_mesa_valid_prim_mode(ctx, mode, "glDrawTransformFeedback")) { return GL_FALSE; diff --git a/mesalib/src/mesa/main/api_validate.h b/mesalib/src/mesa/main/api_validate.h index d92fd433f..59f329768 100644 --- a/mesalib/src/mesa/main/api_validate.h +++ b/mesalib/src/mesa/main/api_validate.h @@ -56,6 +56,12 @@ _mesa_validate_DrawElements(struct gl_context *ctx, const GLvoid *indices, GLint basevertex); extern GLboolean +_mesa_validate_MultiDrawElements(struct gl_context *ctx, + GLenum mode, const GLsizei *count, + GLenum type, const GLvoid * const *indices, + GLuint primcount, const GLint *basevertex); + +extern GLboolean _mesa_validate_DrawRangeElements(struct gl_context *ctx, GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, diff --git a/mesalib/src/mesa/main/bufferobj.c b/mesalib/src/mesa/main/bufferobj.c index ea48af97e..7d72092a2 100644 --- a/mesalib/src/mesa/main/bufferobj.c +++ b/mesalib/src/mesa/main/bufferobj.c @@ -869,7 +869,7 @@ _mesa_DeleteBuffersARB(GLsizei n, const GLuint *ids) if (ctx->TransformFeedback.CurrentBuffer == bufObj) { _mesa_BindBufferARB( GL_TRANSFORM_FEEDBACK_BUFFER, 0 ); } - for (j = 0; j < MAX_FEEDBACK_ATTRIBS; j++) { + for (j = 0; j < MAX_FEEDBACK_BUFFERS; j++) { if (ctx->TransformFeedback.CurrentObject->Buffers[j] == bufObj) { _mesa_BindBufferBase( GL_TRANSFORM_FEEDBACK_BUFFER, j, 0 ); } diff --git a/mesalib/src/mesa/main/config.h b/mesalib/src/mesa/main/config.h index 1d5a0622d..ead1d323c 100644 --- a/mesalib/src/mesa/main/config.h +++ b/mesalib/src/mesa/main/config.h @@ -249,6 +249,7 @@ #define SUPPORTED_ATI_BUMP_UNITS 0xff /** For GL_EXT_transform_feedback */ +#define MAX_FEEDBACK_BUFFERS 4 #define MAX_FEEDBACK_ATTRIBS 32 /** For GL_ARB_geometry_shader4 */ diff --git a/mesalib/src/mesa/main/context.c b/mesalib/src/mesa/main/context.c index 643476b94..7de714b81 100644 --- a/mesalib/src/mesa/main/context.c +++ b/mesalib/src/mesa/main/context.c @@ -652,7 +652,7 @@ _mesa_init_constants(struct gl_context *ctx) ctx->Const.QuadsFollowProvokingVertexConvention = GL_TRUE; /* GL_EXT_transform_feedback */ - ctx->Const.MaxTransformFeedbackSeparateAttribs = MAX_FEEDBACK_ATTRIBS; + ctx->Const.MaxTransformFeedbackBuffers = MAX_FEEDBACK_BUFFERS; ctx->Const.MaxTransformFeedbackSeparateComponents = 4 * MAX_FEEDBACK_ATTRIBS; ctx->Const.MaxTransformFeedbackInterleavedComponents = 4 * MAX_FEEDBACK_ATTRIBS; diff --git a/mesalib/src/mesa/main/get.c b/mesalib/src/mesa/main/get.c index 67732521c..a83d36721 100644 --- a/mesalib/src/mesa/main/get.c +++ b/mesalib/src/mesa/main/get.c @@ -1232,7 +1232,7 @@ static const struct value_desc values[] = { CONTEXT_INT(Const.MaxTransformFeedbackInterleavedComponents), extra_EXT_transform_feedback }, { GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS, - CONTEXT_INT(Const.MaxTransformFeedbackSeparateAttribs), + CONTEXT_INT(Const.MaxTransformFeedbackBuffers), extra_EXT_transform_feedback }, { GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS, CONTEXT_INT(Const.MaxTransformFeedbackSeparateComponents), @@ -2544,7 +2544,7 @@ find_value_indexed(const char *func, GLenum pname, int index, union value *v) return TYPE_INT_4; case GL_TRANSFORM_FEEDBACK_BUFFER_START: - if (index >= ctx->Const.MaxTransformFeedbackSeparateAttribs) + if (index >= ctx->Const.MaxTransformFeedbackBuffers) goto invalid_value; if (!ctx->Extensions.EXT_transform_feedback) goto invalid_enum; @@ -2552,7 +2552,7 @@ find_value_indexed(const char *func, GLenum pname, int index, union value *v) return TYPE_INT64; case GL_TRANSFORM_FEEDBACK_BUFFER_SIZE: - if (index >= ctx->Const.MaxTransformFeedbackSeparateAttribs) + if (index >= ctx->Const.MaxTransformFeedbackBuffers) goto invalid_value; if (!ctx->Extensions.EXT_transform_feedback) goto invalid_enum; @@ -2560,7 +2560,7 @@ find_value_indexed(const char *func, GLenum pname, int index, union value *v) return TYPE_INT64; case GL_TRANSFORM_FEEDBACK_BUFFER_BINDING: - if (index >= ctx->Const.MaxTransformFeedbackSeparateAttribs) + if (index >= ctx->Const.MaxTransformFeedbackBuffers) goto invalid_value; if (!ctx->Extensions.EXT_transform_feedback) goto invalid_enum; diff --git a/mesalib/src/mesa/main/mtypes.h b/mesalib/src/mesa/main/mtypes.h index d37c1f3de..5768ed7cd 100644 --- a/mesalib/src/mesa/main/mtypes.h +++ b/mesalib/src/mesa/main/mtypes.h @@ -1795,7 +1795,7 @@ struct gl_transform_feedback_info * hardware back-ends to determine the correct stride when interleaving * multiple transform feedback outputs in the same buffer. */ - unsigned BufferStride[MAX_FEEDBACK_ATTRIBS]; + unsigned BufferStride[MAX_FEEDBACK_BUFFERS]; }; @@ -1812,13 +1812,13 @@ struct gl_transform_feedback_object at least once? */ /** The feedback buffers */ - GLuint BufferNames[MAX_FEEDBACK_ATTRIBS]; - struct gl_buffer_object *Buffers[MAX_FEEDBACK_ATTRIBS]; + GLuint BufferNames[MAX_FEEDBACK_BUFFERS]; + struct gl_buffer_object *Buffers[MAX_FEEDBACK_BUFFERS]; /** Start of feedback data in dest buffer */ - GLintptr Offset[MAX_FEEDBACK_ATTRIBS]; + GLintptr Offset[MAX_FEEDBACK_BUFFERS]; /** Max data to put into dest buffer (in bytes) */ - GLsizeiptr Size[MAX_FEEDBACK_ATTRIBS]; + GLsizeiptr Size[MAX_FEEDBACK_BUFFERS]; }; @@ -2834,7 +2834,7 @@ struct gl_constants GLbitfield ProfileMask; /**< Mask of CONTEXT_x_PROFILE_BIT */ /** GL_EXT_transform_feedback */ - GLuint MaxTransformFeedbackSeparateAttribs; + GLuint MaxTransformFeedbackBuffers; GLuint MaxTransformFeedbackSeparateComponents; GLuint MaxTransformFeedbackInterleavedComponents; diff --git a/mesalib/src/mesa/main/transformfeedback.c b/mesalib/src/mesa/main/transformfeedback.c index d02b6a056..6f8221201 100644 --- a/mesalib/src/mesa/main/transformfeedback.c +++ b/mesalib/src/mesa/main/transformfeedback.c @@ -447,7 +447,7 @@ _mesa_bind_buffer_range_transform_feedback(struct gl_context *ctx, return; } - if (index >= ctx->Const.MaxTransformFeedbackSeparateAttribs) { + if (index >= ctx->Const.MaxTransformFeedbackBuffers) { _mesa_error(ctx, GL_INVALID_VALUE, "glBindBufferRange(index=%d)", index); return; } @@ -490,7 +490,7 @@ _mesa_bind_buffer_base_transform_feedback(struct gl_context *ctx, return; } - if (index >= ctx->Const.MaxTransformFeedbackSeparateAttribs) { + if (index >= ctx->Const.MaxTransformFeedbackBuffers) { _mesa_error(ctx, GL_INVALID_VALUE, "glBindBufferBase(index=%d)", index); return; } @@ -531,7 +531,7 @@ _mesa_BindBufferOffsetEXT(GLenum target, GLuint index, GLuint buffer, return; } - if (index >= ctx->Const.MaxTransformFeedbackSeparateAttribs) { + if (index >= ctx->Const.MaxTransformFeedbackBuffers) { _mesa_error(ctx, GL_INVALID_VALUE, "glBindBufferOffsetEXT(index=%d)", index); return; @@ -590,7 +590,7 @@ _mesa_TransformFeedbackVaryings(GLuint program, GLsizei count, if (count < 0 || (bufferMode == GL_SEPARATE_ATTRIBS && - (GLuint) count > ctx->Const.MaxTransformFeedbackSeparateAttribs)) { + (GLuint) count > ctx->Const.MaxTransformFeedbackBuffers)) { _mesa_error(ctx, GL_INVALID_VALUE, "glTransformFeedbackVaryings(count=%d)", count); return; diff --git a/mesalib/src/mesa/state_tracker/st_extensions.c b/mesalib/src/mesa/state_tracker/st_extensions.c index dacad9bfb..6fea1fa08 100644 --- a/mesalib/src/mesa/state_tracker/st_extensions.c +++ b/mesalib/src/mesa/state_tracker/st_extensions.c @@ -236,8 +236,9 @@ void st_init_limits(struct st_context *st) c->UniformBooleanTrue = ~0; - c->MaxTransformFeedbackSeparateAttribs = + c->MaxTransformFeedbackBuffers = screen->get_param(screen, PIPE_CAP_MAX_STREAM_OUTPUT_BUFFERS); + c->MaxTransformFeedbackBuffers = MIN2(c->MaxTransformFeedbackBuffers, MAX_FEEDBACK_BUFFERS); c->MaxTransformFeedbackSeparateComponents = screen->get_param(screen, PIPE_CAP_MAX_STREAM_OUTPUT_SEPARATE_COMPONENTS); c->MaxTransformFeedbackInterleavedComponents = diff --git a/mesalib/src/mesa/vbo/vbo_exec_array.c b/mesalib/src/mesa/vbo/vbo_exec_array.c index 6f6a2983a..d2854dd6c 100644 --- a/mesalib/src/mesa/vbo/vbo_exec_array.c +++ b/mesalib/src/mesa/vbo/vbo_exec_array.c @@ -666,8 +666,6 @@ vbo_exec_DrawArrays(GLenum mode, GLint start, GLsizei count) _mesa_debug(ctx, "glDrawArrays(%s, %d, %d)\n", _mesa_lookup_enum_by_nr(mode), start, count); - FLUSH_CURRENT(ctx, 0); - if (!_mesa_validate_DrawArrays( ctx, mode, start, count )) return; @@ -695,8 +693,6 @@ vbo_exec_DrawArraysInstanced(GLenum mode, GLint start, GLsizei count, _mesa_debug(ctx, "glDrawArraysInstanced(%s, %d, %d, %d)\n", _mesa_lookup_enum_by_nr(mode), start, count, numInstances); - FLUSH_CURRENT(ctx, 0); - if (!_mesa_validate_DrawArraysInstanced(ctx, mode, start, count, numInstances)) return; @@ -728,11 +724,6 @@ vbo_exec_DrawArraysInstancedBaseInstance(GLenum mode, GLint first, GLsizei count numInstances)) return; - FLUSH_CURRENT(ctx, 0); - - if (!_mesa_valid_to_render(ctx, "glDrawArraysInstancedBaseInstance")) - return; - if (0) check_draw_arrays_data(ctx, first, count); @@ -902,8 +893,6 @@ vbo_exec_DrawRangeElementsBaseVertex(GLenum mode, _mesa_lookup_enum_by_nr(mode), start, end, count, _mesa_lookup_enum_by_nr(type), indices, basevertex); - FLUSH_CURRENT(ctx, 0); - if (!_mesa_validate_DrawRangeElements( ctx, mode, start, end, count, type, indices, basevertex )) return; @@ -1002,8 +991,6 @@ vbo_exec_DrawElements(GLenum mode, GLsizei count, GLenum type, _mesa_lookup_enum_by_nr(mode), count, _mesa_lookup_enum_by_nr(type), indices); - FLUSH_CURRENT(ctx, 0); - if (!_mesa_validate_DrawElements( ctx, mode, count, type, indices, 0 )) return; @@ -1026,8 +1013,6 @@ vbo_exec_DrawElementsBaseVertex(GLenum mode, GLsizei count, GLenum type, _mesa_lookup_enum_by_nr(mode), count, _mesa_lookup_enum_by_nr(type), indices, basevertex); - FLUSH_CURRENT(ctx, 0); - if (!_mesa_validate_DrawElements( ctx, mode, count, type, indices, basevertex )) return; @@ -1051,8 +1036,6 @@ vbo_exec_DrawElementsInstanced(GLenum mode, GLsizei count, GLenum type, _mesa_lookup_enum_by_nr(mode), count, _mesa_lookup_enum_by_nr(type), indices, numInstances); - FLUSH_CURRENT(ctx, 0); - if (!_mesa_validate_DrawElementsInstanced(ctx, mode, count, type, indices, numInstances, 0)) return; @@ -1078,8 +1061,6 @@ vbo_exec_DrawElementsInstancedBaseVertex(GLenum mode, GLsizei count, GLenum type _mesa_lookup_enum_by_nr(type), indices, numInstances, basevertex); - FLUSH_CURRENT(ctx, 0); - if (!_mesa_validate_DrawElementsInstanced(ctx, mode, count, type, indices, numInstances, basevertex)) return; @@ -1273,15 +1254,10 @@ vbo_exec_MultiDrawElements(GLenum mode, GLsizei primcount) { GET_CURRENT_CONTEXT(ctx); - GLint i; - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - for (i = 0; i < primcount; i++) { - if (!_mesa_validate_DrawElements(ctx, mode, count[i], type, indices[i], - 0)) - return; - } + if (!_mesa_validate_MultiDrawElements(ctx, mode, count, type, indices, + primcount, NULL)) + return; vbo_validated_multidrawelements(ctx, mode, count, type, indices, primcount, NULL); @@ -1296,15 +1272,10 @@ vbo_exec_MultiDrawElementsBaseVertex(GLenum mode, const GLsizei *basevertex) { GET_CURRENT_CONTEXT(ctx); - GLint i; - - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - for (i = 0; i < primcount; i++) { - if (!_mesa_validate_DrawElements(ctx, mode, count[i], type, indices[i], - basevertex[i])) - return; - } + if (!_mesa_validate_MultiDrawElements(ctx, mode, count, type, indices, + primcount, basevertex)) + return; vbo_validated_multidrawelements(ctx, mode, count, type, indices, primcount, basevertex); @@ -1363,8 +1334,6 @@ vbo_exec_DrawTransformFeedback(GLenum mode, GLuint name) _mesa_debug(ctx, "glDrawTransformFeedback(%s, %d)\n", _mesa_lookup_enum_by_nr(mode), name); - FLUSH_CURRENT(ctx, 0); - if (!_mesa_validate_DrawTransformFeedback(ctx, mode, obj)) { return; } diff --git a/pixman/pixman/pixman-sse2.c b/pixman/pixman/pixman-sse2.c index 0604254ac..ef82a18c3 100644 --- a/pixman/pixman/pixman-sse2.c +++ b/pixman/pixman/pixman-sse2.c @@ -5377,17 +5377,16 @@ FAST_NEAREST_MAINLOOP_COMMON (sse2_8888_n_8888_none_OVER, #define BILINEAR_INTERPOLATE_ONE_PIXEL(pix) \ do { \ __m128i xmm_wh, xmm_lo, xmm_hi, a; \ - /* fetch 2x2 pixel block into sse2 register */ \ - uint32_t tl = src_top [pixman_fixed_to_int (vx)]; \ - uint32_t tr = src_top [pixman_fixed_to_int (vx) + 1]; \ - uint32_t bl = src_bottom [pixman_fixed_to_int (vx)]; \ - uint32_t br = src_bottom [pixman_fixed_to_int (vx) + 1]; \ - a = _mm_set_epi32 (tr, tl, br, bl); \ + /* fetch 2x2 pixel block into sse2 registers */ \ + __m128i tltr = _mm_loadl_epi64 ( \ + (__m128i *)&src_top[pixman_fixed_to_int (vx)]); \ + __m128i blbr = _mm_loadl_epi64 ( \ + (__m128i *)&src_bottom[pixman_fixed_to_int (vx)]); \ vx += unit_x; \ /* vertical interpolation */ \ - a = _mm_add_epi16 (_mm_mullo_epi16 (_mm_unpackhi_epi8 (a, xmm_zero), \ + a = _mm_add_epi16 (_mm_mullo_epi16 (_mm_unpacklo_epi8 (tltr, xmm_zero), \ xmm_wt), \ - _mm_mullo_epi16 (_mm_unpacklo_epi8 (a, xmm_zero), \ + _mm_mullo_epi16 (_mm_unpacklo_epi8 (blbr, xmm_zero), \ xmm_wb)); \ /* calculate horizontal weights */ \ xmm_wh = _mm_add_epi16 (xmm_addc, \ diff --git a/pixman/test/lowlevel-blt-bench.c b/pixman/test/lowlevel-blt-bench.c index b44b9f819..3afa926b0 100644 --- a/pixman/test/lowlevel-blt-bench.c +++ b/pixman/test/lowlevel-blt-bench.c @@ -80,10 +80,28 @@ bench_memcpy () return (double)total / (t2 - t1); } +static pixman_bool_t use_scaling = FALSE; +static pixman_filter_t filter = PIXMAN_FILTER_NEAREST; + +/* nearly 1x scale factor */ +static pixman_transform_t m = +{ + { + { pixman_fixed_1 + 1, 0, 0 }, + { 0, pixman_fixed_1, 0 }, + { 0, 0, pixman_fixed_1 } + } +}; + static void pixman_image_composite_wrapper (pixman_implementation_t *impl, pixman_composite_info_t *info) { + if (use_scaling) + { + pixman_image_set_filter (info->src_image, filter, NULL, 0); + pixman_image_set_transform(info->src_image, &m); + } pixman_image_composite (info->op, info->src_image, info->mask_image, info->dest_image, info->src_x, info->src_y, @@ -96,6 +114,11 @@ static void pixman_image_composite_empty (pixman_implementation_t *impl, pixman_composite_info_t *info) { + if (use_scaling) + { + pixman_image_set_filter (info->src_image, filter, NULL, 0); + pixman_image_set_transform(info->src_image, &m); + } pixman_image_composite (info->op, info->src_image, info->mask_image, info->dest_image, 0, 0, 0, 0, 0, 0, 1, 1); @@ -669,7 +692,35 @@ main (int argc, char *argv[]) { double x; int i; - char *pattern = argc > 1 ? argv[1] : "all"; + const char *pattern = NULL; + for (i = 1; i < argc; i++) + { + if (argv[i][0] == '-') + { + if (strchr (argv[i] + 1, 'b')) + { + use_scaling = TRUE; + filter = PIXMAN_FILTER_BILINEAR; + } + else if (strchr (argv[i] + 1, 'n')) + { + use_scaling = TRUE; + filter = PIXMAN_FILTER_NEAREST; + } + } + else + { + pattern = argv[i]; + } + } + + if (!pattern) + { + printf ("Usage: lowlevel-blt-bench [-b] [-n] pattern\n"); + printf (" -n : benchmark nearest scaling\n"); + printf (" -b : benchmark bilinear scaling\n"); + return 1; + } src = aligned_malloc (4096, BUFSIZE * 3); memset (src, 0xCC, BUFSIZE * 3); @@ -706,6 +757,16 @@ main (int argc, char *argv[]) bandwidth = x = bench_memcpy (); printf ("reference memcpy speed = %.1fMB/s (%.1fMP/s for 32bpp fills)\n", x / 1000000., x / 4000000); + if (use_scaling) + { + printf ("---\n"); + if (filter == PIXMAN_FILTER_BILINEAR) + printf ("BILINEAR scaling\n"); + else if (filter == PIXMAN_FILTER_NEAREST) + printf ("NEAREST scaling\n"); + else + printf ("UNKNOWN scaling\n"); + } printf ("---\n"); for (i = 0; i < ARRAY_LENGTH (tests_tbl); i++) diff --git a/pixman/test/utils.c b/pixman/test/utils.c index 0abc32c66..563b33d52 100644 --- a/pixman/test/utils.c +++ b/pixman/test/utils.c @@ -686,9 +686,9 @@ gettime (void) uint32_t get_random_seed (void) { - double d = gettime(); - - lcg_srand (*(uint32_t *)&d); + union { double d; uint32_t u32; } t; + t.d = gettime(); + lcg_srand (t.u32); return lcg_rand_u32 (); } diff --git a/xorg-server/composite/compalloc.c b/xorg-server/composite/compalloc.c index b958b0942..cc69c68f2 100644 --- a/xorg-server/composite/compalloc.c +++ b/xorg-server/composite/compalloc.c @@ -560,8 +560,8 @@ compNewPixmap(WindowPtr pWin, int x, int y, int w, int h) } } else { - PictFormatPtr pSrcFormat = compWindowFormat(pParent); - PictFormatPtr pDstFormat = compWindowFormat(pWin); + PictFormatPtr pSrcFormat = PictureWindowFormat(pParent); + PictFormatPtr pDstFormat = PictureWindowFormat(pWin); XID inferiors = IncludeInferiors; int error; diff --git a/xorg-server/composite/compint.h b/xorg-server/composite/compint.h index 9e2713e93..30b724e3e 100644 --- a/xorg-server/composite/compint.h +++ b/xorg-server/composite/compint.h @@ -272,8 +272,6 @@ void #define compCheckTree(s) #endif -PictFormatPtr compWindowFormat(WindowPtr pWin); - void compSetPixmap(WindowPtr pWin, PixmapPtr pPixmap); diff --git a/xorg-server/composite/compwindow.c b/xorg-server/composite/compwindow.c index 6eb624b11..d0bcd183f 100644 --- a/xorg-server/composite/compwindow.c +++ b/xorg-server/composite/compwindow.c @@ -631,28 +631,6 @@ compGetRedirectBorderClip(WindowPtr pWin) return &cw->borderClip; } -static VisualPtr -compGetWindowVisual(WindowPtr pWin) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - VisualID vid = wVisual(pWin); - int i; - - for (i = 0; i < pScreen->numVisuals; i++) - if (pScreen->visuals[i].vid == vid) - return &pScreen->visuals[i]; - return 0; -} - -PictFormatPtr -compWindowFormat(WindowPtr pWin) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - - return PictureMatchVisual(pScreen, pWin->drawable.depth, - compGetWindowVisual(pWin)); -} - static void compWindowUpdateAutomatic(WindowPtr pWin) { @@ -660,8 +638,8 @@ compWindowUpdateAutomatic(WindowPtr pWin) ScreenPtr pScreen = pWin->drawable.pScreen; WindowPtr pParent = pWin->parent; PixmapPtr pSrcPixmap = (*pScreen->GetWindowPixmap) (pWin); - PictFormatPtr pSrcFormat = compWindowFormat(pWin); - PictFormatPtr pDstFormat = compWindowFormat(pWin->parent); + PictFormatPtr pSrcFormat = PictureWindowFormat(pWin); + PictFormatPtr pDstFormat = PictureWindowFormat(pWin->parent); int error; RegionPtr pRegion = DamageRegion(cw->damage); PicturePtr pSrcPicture = CreatePicture(0, &pSrcPixmap->drawable, diff --git a/xorg-server/configure.ac b/xorg-server/configure.ac index fb3d12092..7576dae1d 100644 --- a/xorg-server/configure.ac +++ b/xorg-server/configure.ac @@ -1879,8 +1879,9 @@ if test "x$XWIN" = xyes; then XWIN_SYS_LIBS=-lws2_32 ;; esac + XWIN_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $RANDR_LIB $RENDER_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $DAMAGE_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $OS_LIB" - XWIN_SYS_LIBS="$XWIN_SYS_LIBS $XWINMODULES_LIBS" + XWIN_SYS_LIBS="$XWIN_SYS_LIBS $XWINMODULES_LIBS $GLX_SYS_LIBS" AC_SUBST(XWIN_LIBS) AC_SUBST(XWIN_SERVER_NAME) AC_SUBST(XWIN_SYS_LIBS) diff --git a/xorg-server/dix/getevents.c b/xorg-server/dix/getevents.c index baa26c4b8..75708520f 100644 --- a/xorg-server/dix/getevents.c +++ b/xorg-server/dix/getevents.c @@ -35,6 +35,7 @@ #include <X11/keysym.h> #include <X11/Xproto.h> #include <math.h> +#include <limits.h> #include "misc.h" #include "resource.h" @@ -756,6 +757,29 @@ clipAbsolute(DeviceIntPtr dev, ValuatorMask *mask) } } +static void +add_to_scroll_valuator(DeviceIntPtr dev, ValuatorMask *mask, int valuator, double value) +{ + double v; + + if (!valuator_mask_fetch_double(mask, valuator, &v)) + return; + + /* protect against scrolling overflow. INT_MAX for double, because + * we'll eventually write this as 32.32 fixed point */ + if ((value > 0 && v > INT_MAX - value) || (value < 0 && v < INT_MIN - value)) { + v = 0; + + /* reset last.scroll to avoid a button storm */ + valuator_mask_set_double(dev->last.scroll, valuator, 0); + } + else + v += value; + + valuator_mask_set_double(mask, valuator, v); +} + + /** * Move the device's pointer by the values given in @valuators. * @@ -774,13 +798,17 @@ moveRelative(DeviceIntPtr dev, ValuatorMask *mask) if (!valuator_mask_isset(mask, i)) continue; - val += valuator_mask_get_double(mask, i); + + add_to_scroll_valuator(dev, mask, i, val); + /* x & y need to go over the limits to cross screens if the SD * isn't currently attached; otherwise, clip to screen bounds. */ if (valuator_get_mode(dev, i) == Absolute && - ((i != 0 && i != 1) || clip_xy)) + ((i != 0 && i != 1) || clip_xy)) { + val = valuator_mask_get_double(mask, i); clipAxis(dev, i, &val); - valuator_mask_set_double(mask, i, val); + valuator_mask_set_double(mask, i, val); + } } } @@ -1506,6 +1534,7 @@ emulate_scroll_button_events(InternalEvent *events, return num_events; } + /** * Generate a complete series of InternalEvents (filled into the EventList) * representing pointer motion, or button presses. If the device is a slave @@ -1560,7 +1589,7 @@ GetPointerEvents(InternalEvent *events, DeviceIntPtr pDev, int type, * necessary. This only needs to cater for the XIScrollFlagPreferred * axis (if more than one scrolling axis is present) */ if (type == ButtonPress) { - double val, adj; + double adj; int axis; int h_scroll_axis = -1; int v_scroll_axis = -1; @@ -1596,8 +1625,7 @@ GetPointerEvents(InternalEvent *events, DeviceIntPtr pDev, int type, if (adj != 0.0 && axis != -1) { adj *= pDev->valuator->axes[axis].scroll.increment; - val = valuator_mask_get_double(&mask, axis) + adj; - valuator_mask_set_double(&mask, axis, val); + add_to_scroll_valuator(pDev, &mask, axis, adj); type = MotionNotify; buttons = 0; flags |= POINTER_EMULATED; diff --git a/xorg-server/dix/window.c b/xorg-server/dix/window.c index 98f5604c9..5cc3a502d 100644 --- a/xorg-server/dix/window.c +++ b/xorg-server/dix/window.c @@ -3660,3 +3660,16 @@ SetRootClip(ScreenPtr pScreen, Bool enable) WindowsRestructured(); FlushAllOutput(); } + +VisualPtr +WindowGetVisual(WindowPtr pWin) +{ + ScreenPtr pScreen = pWin->drawable.pScreen; + VisualID vid = wVisual(pWin); + int i; + + for (i = 0; i < pScreen->numVisuals; i++) + if (pScreen->visuals[i].vid == vid) + return &pScreen->visuals[i]; + return 0; +} diff --git a/xorg-server/hw/xfree86/dri2/dri2.c b/xorg-server/hw/xfree86/dri2/dri2.c index d0f17896d..d3b3c73f8 100644 --- a/xorg-server/hw/xfree86/dri2/dri2.c +++ b/xorg-server/hw/xfree86/dri2/dri2.c @@ -1111,14 +1111,14 @@ DRI2Connect(ScreenPtr pScreen, unsigned int driverType, int *fd, return TRUE; } -static Bool +static int DRI2AuthMagic (ScreenPtr pScreen, uint32_t magic) { DRI2ScreenPtr ds = DRI2GetScreen(pScreen); - if (ds == NULL || (*ds->LegacyAuthMagic) (ds->fd, magic)) - return FALSE; + if (ds == NULL) + return -EINVAL; - return TRUE; + return (*ds->LegacyAuthMagic) (ds->fd, magic); } Bool diff --git a/xorg-server/hw/xfree86/modes/xf86Rotate.c b/xorg-server/hw/xfree86/modes/xf86Rotate.c index 6a661e195..31e03727e 100644 --- a/xorg-server/hw/xfree86/modes/xf86Rotate.c +++ b/xorg-server/hw/xfree86/modes/xf86Rotate.c @@ -46,28 +46,6 @@ /* borrowed from composite extension, move to Render and publish? */ -static VisualPtr -compGetWindowVisual(WindowPtr pWin) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - VisualID vid = wVisual(pWin); - int i; - - for (i = 0; i < pScreen->numVisuals; i++) - if (pScreen->visuals[i].vid == vid) - return &pScreen->visuals[i]; - return 0; -} - -static PictFormatPtr -compWindowFormat(WindowPtr pWin) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - - return PictureMatchVisual(pScreen, pWin->drawable.depth, - compGetWindowVisual(pWin)); -} - #define F(x) IntToxFixed(x) #define toF(x) ((float) (x) / 65536.0f) @@ -79,7 +57,7 @@ xf86RotateCrtcRedisplay(xf86CrtcPtr crtc, RegionPtr region) ScreenPtr screen = scrn->pScreen; WindowPtr root = screen->root; PixmapPtr dst_pixmap = crtc->rotatedPixmap; - PictFormatPtr format = compWindowFormat(screen->root); + PictFormatPtr format = PictureWindowFormat(screen->root); int error; PicturePtr src, dst; int n = RegionNumRects(region); diff --git a/xorg-server/hw/xwin/glx/gen_gl_wrappers.py b/xorg-server/hw/xwin/glx/gen_gl_wrappers.py index e2d960ec6..15f7ef868 100644 --- a/xorg-server/hw/xwin/glx/gen_gl_wrappers.py +++ b/xorg-server/hw/xwin/glx/gen_gl_wrappers.py @@ -67,7 +67,7 @@ if dispatchheader : fh = open(dispatchheader) dispatchh = fh.readlines() - dispatch_regex = re.compile(r'#define\sSET_(\S*)\(') + dispatch_regex = re.compile(r'^SET_(\S*)\(') for line in dispatchh : line = line.strip() @@ -308,12 +308,20 @@ for w in sorted(wrappers.keys()) : if dispatchheader : print 'void glWinSetupDispatchTable(void)' print '{' - print ' struct _glapi_table *disp = _glapi_get_dispatch();' + print ' static struct _glapi_table *disp = NULL;' + print '' + print ' if (!disp)' + print ' {' + print ' disp = calloc(sizeof(void *), _glapi_get_dispatch_table_size());' + print ' assert(disp);' for d in sorted(dispatch.keys()) : if wrappers.has_key(d) : - print ' SET_'+ d + '(disp, (void *)' + prefix + d + 'Wrapper);' + print ' SET_'+ d + '(disp, (void *)' + prefix + d + 'Wrapper);' else : print '#warning No wrapper for ' + prefix + d + ' !' + print ' }' + print '' + print ' _glapi_set_dispatch(disp);' print '}' diff --git a/xorg-server/hw/xwin/glx/indirect.c b/xorg-server/hw/xwin/glx/indirect.c index 56f677a8f..3f34146e5 100644 --- a/xorg-server/hw/xwin/glx/indirect.c +++ b/xorg-server/hw/xwin/glx/indirect.c @@ -398,7 +398,9 @@ fbConfigsDump(unsigned int n, __GLXconfig * c) static __GLXscreen *glxWinScreenProbe(ScreenPtr pScreen); static __GLXcontext *glxWinCreateContext(__GLXscreen * screen, __GLXconfig * modes, - __GLXcontext * baseShareContext); + __GLXcontext * baseShareContext, + unsigned num_attribs, + const uint32_t * attribs, int *error); static __GLXdrawable *glxWinCreateDrawable(ClientPtr client, __GLXscreen * screen, DrawablePtr pDraw, @@ -473,7 +475,7 @@ static void glxLogExtensions(const char *prefix, const char *extensions) { int length = 0; - char *strl; + const char *strl; char *str = strdup(extensions); if (str == NULL) { @@ -482,6 +484,8 @@ glxLogExtensions(const char *prefix, const char *extensions) } strl = strtok(str, " "); + if (strl == NULL) + strl = ""; ErrorF("%s%s", prefix, strl); length = strlen(prefix) + strlen(strl); @@ -515,6 +519,7 @@ glxWinScreenProbe(ScreenPtr pScreen) { glxWinScreen *screen; const char *gl_extensions; + const char *gl_renderer; const char *wgl_extensions; HWND hwnd; HDC hdc; @@ -538,14 +543,6 @@ glxWinScreenProbe(ScreenPtr pScreen) if (NULL == screen) return NULL; - /* Wrap RealizeWindow, UnrealizeWindow and CopyWindow on this screen */ - screen->RealizeWindow = pScreen->RealizeWindow; - pScreen->RealizeWindow = glxWinRealizeWindow; - screen->UnrealizeWindow = pScreen->UnrealizeWindow; - pScreen->UnrealizeWindow = glxWinUnrealizeWindow; - screen->CopyWindow = pScreen->CopyWindow; - pScreen->CopyWindow = glxWinCopyWindow; - /* Dump out some useful information about the native renderer */ // create window class @@ -595,7 +592,8 @@ glxWinScreenProbe(ScreenPtr pScreen) ErrorF("GL_VERSION: %s\n", glGetStringWrapperNonstatic(GL_VERSION)); ErrorF("GL_VENDOR: %s\n", glGetStringWrapperNonstatic(GL_VENDOR)); - ErrorF("GL_RENDERER: %s\n", glGetStringWrapperNonstatic(GL_RENDERER)); + gl_renderer = (const char *) glGetStringWrapperNonstatic(GL_RENDERER); + ErrorF("GL_RENDERER: %s\n", gl_renderer); gl_extensions = (const char *) glGetStringWrapperNonstatic(GL_EXTENSIONS); glxLogExtensions("GL_EXTENSIONS: ", gl_extensions); wgl_extensions = wglGetExtensionsStringARBWrapper(hdc); @@ -603,6 +601,13 @@ glxWinScreenProbe(ScreenPtr pScreen) wgl_extensions = ""; glxLogExtensions("WGL_EXTENSIONS: ", wgl_extensions); + if (strcasecmp(gl_renderer, "GDI Generic") == 0) { + free(screen); + LogMessage(X_ERROR, + "AIGLX: Won't use generic native renderer as it is not accelerated\n"); + return NULL; + } + // Can you see the problem here? The extensions string is DC specific // Different DCs for windows on a multimonitor system driven by multiple cards // might have completely different capabilities. Of course, good luck getting @@ -720,9 +725,6 @@ glxWinScreenProbe(ScreenPtr pScreen) __glXScreenInit(&screen->base, pScreen); - // dump out fbConfigs now fbConfigIds and visualIDs have been assigned - fbConfigsDump(screen->base.numFBConfigs, screen->base.fbconfigs); - // Override the GL extensions string set by __glXScreenInit() screen->base.GLextensions = strdup(gl_extensions); @@ -765,6 +767,17 @@ glxWinScreenProbe(ScreenPtr pScreen) ReleaseDC(hwnd, hdc); DestroyWindow(hwnd); + // dump out fbConfigs now fbConfigIds and visualIDs have been assigned + fbConfigsDump(screen->base.numFBConfigs, screen->base.fbconfigs); + + /* Wrap RealizeWindow, UnrealizeWindow and CopyWindow on this screen */ + screen->RealizeWindow = pScreen->RealizeWindow; + pScreen->RealizeWindow = glxWinRealizeWindow; + screen->UnrealizeWindow = pScreen->UnrealizeWindow; + pScreen->UnrealizeWindow = glxWinUnrealizeWindow; + screen->CopyWindow = pScreen->CopyWindow; + pScreen->CopyWindow = glxWinCopyWindow; + return &screen->base; } @@ -1571,7 +1584,8 @@ glxWinContextDestroy(__GLXcontext * base) static __GLXcontext * glxWinCreateContext(__GLXscreen * screen, - __GLXconfig * modes, __GLXcontext * baseShareContext) + __GLXconfig * modes, __GLXcontext * baseShareContext, + unsigned num_attribs, const uint32_t * attribs, int *error) { __GLXWinContext *context; __GLXWinContext *shareContext = (__GLXWinContext *) baseShareContext; diff --git a/xorg-server/include/window.h b/xorg-server/include/window.h index 64c56aeb3..7842b4d58 100644 --- a/xorg-server/include/window.h +++ b/xorg-server/include/window.h @@ -229,4 +229,5 @@ extern _X_EXPORT void EnableMapUnmapEvents(WindowPtr /* pWin */ ); extern _X_EXPORT void SetRootClip(ScreenPtr pScreen, Bool enable); extern _X_EXPORT void PrintWindowTree(void); +extern _X_EXPORT VisualPtr WindowGetVisual(WindowPtr /*pWin*/); #endif /* WINDOW_H */ diff --git a/xorg-server/include/xkbsrv.h b/xorg-server/include/xkbsrv.h index a19c8fb29..d58478543 100644 --- a/xorg-server/include/xkbsrv.h +++ b/xorg-server/include/xkbsrv.h @@ -301,6 +301,11 @@ extern _X_EXPORT const char *XkbBinDirectory; extern _X_EXPORT CARD32 xkbDebugFlags; #define _XkbLibError(c,l,d) /* Epoch fail */ + +/* "a" is a "unique" numeric identifier that just defines which error + * code statement it is. _XkbErrCode2(4, foo) means "this is the 4th error + * statement in this function". lovely. + */ #define _XkbErrCode2(a,b) ((XID)((((unsigned int)(a))<<24)|((b)&0xffffff))) #define _XkbErrCode3(a,b,c) _XkbErrCode2(a,(((unsigned int)(b))<<16)|(c)) #define _XkbErrCode4(a,b,c,d) _XkbErrCode3(a,b,((((unsigned int)(c))<<8)|(d))) diff --git a/xorg-server/mi/midispcur.c b/xorg-server/mi/midispcur.c index 9ee824283..df141cdc7 100644 --- a/xorg-server/mi/midispcur.c +++ b/xorg-server/mi/midispcur.c @@ -151,19 +151,6 @@ miDCRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor) #ifdef ARGB_CURSOR #define EnsurePicture(picture,draw,win) (picture || miDCMakePicture(&picture,draw,win)) -static VisualPtr -miDCGetWindowVisual(WindowPtr pWin) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - VisualID vid = wVisual(pWin); - int i; - - for (i = 0; i < pScreen->numVisuals; i++) - if (pScreen->visuals[i].vid == vid) - return &pScreen->visuals[i]; - return 0; -} - static PicturePtr miDCMakePicture(PicturePtr * ppPicture, DrawablePtr pDraw, WindowPtr pWin) { @@ -174,10 +161,7 @@ miDCMakePicture(PicturePtr * ppPicture, DrawablePtr pDraw, WindowPtr pWin) PicturePtr pPicture; int error; - pVisual = miDCGetWindowVisual(pWin); - if (!pVisual) - return 0; - pFormat = PictureMatchVisual(pScreen, pDraw->depth, pVisual); + pFormat = PictureWindowFormat(pWin); if (!pFormat) return 0; pPicture = CreatePicture(0, pDraw, pFormat, diff --git a/xorg-server/os/connection.c b/xorg-server/os/connection.c index 039942f91..344147220 100644 --- a/xorg-server/os/connection.c +++ b/xorg-server/os/connection.c @@ -353,6 +353,7 @@ NotifyParentProcess(void) #if !defined(WIN32) if (dynamic_display[0]) { write(displayfd, dynamic_display, strlen(dynamic_display)); + write(displayfd, "\n", 1); close(displayfd); } if (RunFromSmartParent) { diff --git a/xorg-server/randr/randr.c b/xorg-server/randr/randr.c index 4d4298af9..103da48d7 100644 --- a/xorg-server/randr/randr.c +++ b/xorg-server/randr/randr.c @@ -446,6 +446,9 @@ RRFirstOutput(ScreenPtr pScreen) RROutputPtr output; int i, j; + if (!pScrPriv) + return NULL; + if (pScrPriv->primaryOutput && pScrPriv->primaryOutput->crtc) return pScrPriv->primaryOutput; diff --git a/xorg-server/randr/rrcrtc.c b/xorg-server/randr/rrcrtc.c index 36caa5822..0c596dd4c 100644 --- a/xorg-server/randr/rrcrtc.c +++ b/xorg-server/randr/rrcrtc.c @@ -825,10 +825,9 @@ ProcRRSetCrtcConfig(ClientPtr client) int numOutputs; RROutputPtr *outputs = NULL; RROutput *outputIds; - TimeStamp configTime; TimeStamp time; Rotation rotation; - int rc, i, j; + int ret, i, j; REQUEST_AT_LEAST_SIZE(xRRSetCrtcConfigReq); numOutputs = (stuff->length - bytes_to_int32(SIZEOF(xRRSetCrtcConfigReq))); @@ -855,11 +854,11 @@ ProcRRSetCrtcConfig(ClientPtr client) outputIds = (RROutput *) (stuff + 1); for (i = 0; i < numOutputs; i++) { - rc = dixLookupResourceByType((pointer *) (outputs + i), outputIds[i], + ret = dixLookupResourceByType((pointer *) (outputs + i), outputIds[i], RROutputType, client, DixSetAttrAccess); - if (rc != Success) { + if (ret != Success) { free(outputs); - return rc; + return ret; } /* validate crtc for this output */ for (j = 0; j < outputs[i]->numCrtcs; j++) @@ -904,7 +903,6 @@ ProcRRSetCrtcConfig(ClientPtr client) pScrPriv = rrGetScrPriv(pScreen); time = ClientTimeToServerTime(stuff->timestamp); - configTime = ClientTimeToServerTime(stuff->configTimestamp); if (!pScrPriv) { time = currentTime; diff --git a/xorg-server/randr/rrinfo.c b/xorg-server/randr/rrinfo.c index 114ec3471..1408d6f64 100644 --- a/xorg-server/randr/rrinfo.c +++ b/xorg-server/randr/rrinfo.c @@ -82,6 +82,7 @@ RRScanOldConfig(ScreenPtr pScreen, Rotation rotations) int i; CARD16 minWidth = MAXSHORT, minHeight = MAXSHORT; CARD16 maxWidth = 0, maxHeight = 0; + CARD16 width, height; /* * First time through, create a crtc and output and hook @@ -141,11 +142,11 @@ RRScanOldConfig(ScreenPtr pScreen, Rotation rotations) /* find size bounds */ for (i = 0; i < output->numModes + output->numUserModes; i++) { - RRModePtr mode = (i < output->numModes ? + mode = (i < output->numModes ? output->modes[i] : output->userModes[i - output->numModes]); - CARD16 width = mode->mode.width; - CARD16 height = mode->mode.height; + width = mode->mode.width; + height = mode->mode.height; if (width < minWidth) minWidth = width; diff --git a/xorg-server/randr/rrmode.c b/xorg-server/randr/rrmode.c index b637c06b9..49a45c7f6 100644 --- a/xorg-server/randr/rrmode.c +++ b/xorg-server/randr/rrmode.c @@ -173,7 +173,7 @@ RRModesForScreen(ScreenPtr pScreen, int *num_ret) */ for (o = 0; o < pScrPriv->numOutputs; o++) { RROutputPtr output = pScrPriv->outputs[o]; - int m, n; + int n; for (m = 0; m < output->numModes + output->numUserModes; m++) { RRModePtr mode = (m < output->numModes ? @@ -285,7 +285,6 @@ ProcRRCreateMode(ClientPtr client) xRRCreateModeReply rep = { 0 }; WindowPtr pWin; ScreenPtr pScreen; - rrScrPrivPtr pScrPriv; xRRModeInfo *modeInfo; long units_after; char *name; @@ -298,7 +297,6 @@ ProcRRCreateMode(ClientPtr client) return rc; pScreen = pWin->drawable.pScreen; - pScrPriv = rrGetScrPriv(pScreen); modeInfo = &stuff->modeInfo; name = (char *) (stuff + 1); diff --git a/xorg-server/randr/rroutput.c b/xorg-server/randr/rroutput.c index 0890c55b5..fbd0e32b3 100644 --- a/xorg-server/randr/rroutput.c +++ b/xorg-server/randr/rroutput.c @@ -528,13 +528,13 @@ ProcRRSetOutputPrimary(ClientPtr client) RROutputPtr output = NULL; WindowPtr pWin; rrScrPrivPtr pScrPriv; - int rc; + int ret; REQUEST_SIZE_MATCH(xRRSetOutputPrimaryReq); - rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); - if (rc != Success) - return rc; + ret = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); + if (ret != Success) + return ret; if (stuff->output) { VERIFY_RR_OUTPUT(stuff->output, output, DixReadAccess); @@ -546,7 +546,8 @@ ProcRRSetOutputPrimary(ClientPtr client) } pScrPriv = rrGetScrPriv(pWin->drawable.pScreen); - RRSetPrimaryOutput(pWin->drawable.pScreen, pScrPriv, output); + if (pScrPriv) + RRSetPrimaryOutput(pWin->drawable.pScreen, pScrPriv, output); return Success; } diff --git a/xorg-server/randr/rrscreen.c b/xorg-server/randr/rrscreen.c index f570afaf4..55110e088 100644 --- a/xorg-server/randr/rrscreen.c +++ b/xorg-server/randr/rrscreen.c @@ -248,6 +248,9 @@ ProcRRSetScreenSize(ClientPtr client) pScreen = pWin->drawable.pScreen; pScrPriv = rrGetScrPriv(pScreen); + if (!pScrPriv) + return BadMatch; + if (stuff->width < pScrPriv->minWidth || pScrPriv->maxWidth < stuff->width) { client->errorValue = stuff->width; return BadValue; diff --git a/xorg-server/render/picture.c b/xorg-server/render/picture.c index 788785354..ebbfa29e9 100644 --- a/xorg-server/render/picture.c +++ b/xorg-server/render/picture.c @@ -50,6 +50,14 @@ RESTYPE PictFormatType; RESTYPE GlyphSetType; int PictureCmapPolicy = PictureCmapPolicyDefault; +PictFormatPtr +PictureWindowFormat(WindowPtr pWindow) +{ + ScreenPtr pScreen = pWindow->drawable.pScreen; + return PictureMatchVisual(pScreen, pWindow->drawable.depth, + WindowGetVisual(pWindow)); +} + Bool PictureDestroyWindow(WindowPtr pWindow) { diff --git a/xorg-server/render/picturestr.h b/xorg-server/render/picturestr.h index 6da56563d..1cda88a80 100644 --- a/xorg-server/render/picturestr.h +++ b/xorg-server/render/picturestr.h @@ -377,6 +377,9 @@ extern _X_EXPORT RESTYPE GlyphSetType; } \ } \ +extern _X_EXPORT PictFormatPtr + PictureWindowFormat(WindowPtr pWindow); + extern _X_EXPORT Bool PictureDestroyWindow(WindowPtr pWindow); diff --git a/xorg-server/test/.gitignore b/xorg-server/test/.gitignore index 5d4fdfa99..23d4c8f4f 100644 --- a/xorg-server/test/.gitignore +++ b/xorg-server/test/.gitignore @@ -1,4 +1,5 @@ fixes +hashtabletest input list misc diff --git a/xorg-server/test/Makefile.am b/xorg-server/test/Makefile.am index b2a53aa64..a5a2e5c2b 100644 --- a/xorg-server/test/Makefile.am +++ b/xorg-server/test/Makefile.am @@ -20,7 +20,7 @@ INCLUDES += -I$(top_srcdir)/hw/xfree86/parser \ -I$(top_srcdir)/hw/xfree86/i2c -I$(top_srcdir)/hw/xfree86/modes \ -I$(top_srcdir)/hw/xfree86/ramdac endif -TEST_LDADD=libxservertest.la $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS) +TEST_LDADD=libxservertest.la $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS) $(GLX_SYS_LIBS) if XORG if SPECIAL_DTRACE_OBJECTS diff --git a/xorg-server/test/xi2/Makefile.am b/xorg-server/test/xi2/Makefile.am index 913ba0f8b..9de7abf5d 100644 --- a/xorg-server/test/xi2/Makefile.am +++ b/xorg-server/test/xi2/Makefile.am @@ -18,7 +18,7 @@ TESTS_ENVIRONMENT = $(XORG_MALLOC_DEBUG_ENV) AM_CFLAGS = $(DIX_CFLAGS) @XORG_CFLAGS@ INCLUDES = @XORG_INCS@ -TEST_LDADD=../libxservertest.la $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS) +TEST_LDADD=../libxservertest.la $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS) $(GLX_SYS_LIBS) COMMON_SOURCES=protocol-common.h protocol-common.c if SPECIAL_DTRACE_OBJECTS diff --git a/xorg-server/xkeyboard-config/symbols/keypad b/xorg-server/xkeyboard-config/symbols/keypad index b362ebcd5..85d4d6e20 100644 --- a/xorg-server/xkeyboard-config/symbols/keypad +++ b/xorg-server/xkeyboard-config/symbols/keypad @@ -577,7 +577,7 @@ xkb_symbols "atm" { }; -partial default modifier_keys +partial modifier_keys xkb_symbols "pointerkeys" { key <NMLK> { [ Num_Lock, Pointer_EnableKeys ] }; }; |