[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[Git][xorg-team/lib/libglvnd][debian-unstable] 16 commits: build: Find Python the Autotools way



Title: GitLab

Timo Aaltonen pushed to branch debian-unstable at X Strike Force / lib / libglvnd

Commits:

16 changed files:

Changes:

  • configure.ac
    ... ... @@ -2,7 +2,7 @@ dnl configure.ac
    2 2
     dnl Process this file with autoconf to produce a configure script.
    
    3 3
     
    
    4 4
     AC_PREREQ([2.63])
    
    5
    -AC_INIT([libglvnd], [1.1.0], [kbrenneman@nvidia.com])
    
    5
    +AC_INIT([libglvnd], [1.1.1], [kbrenneman@nvidia.com])
    
    6 6
     AC_CONFIG_SRCDIR([config.h.in])
    
    7 7
     AC_CONFIG_HEADERS([config.h])
    
    8 8
     
    
    ... ... @@ -27,7 +27,15 @@ AC_PROG_LN_S
    27 27
     AC_PROG_MAKE_SET
    
    28 28
     AC_PROG_LIBTOOL
    
    29 29
     AC_PROG_MKDIR_P
    
    30
    -AC_CHECK_PROGS([PYTHON2], [python2.7 python2 python])
    
    30
    +
    
    31
    +# The tarball from "make dist" already contains all of the generated files. If
    
    32
    +# we're building from that, then we won't need Python.
    
    33
    +if test -e "$srcdir/src/GLdispatch/vnd-glapi/g_glapi_mapi_gl_tmp.h" ; then
    
    34
    +    AM_PATH_PYTHON([2.7],, [:])
    
    35
    +else
    
    36
    +    AM_PATH_PYTHON([2.7])
    
    37
    +fi
    
    38
    +AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != :])
    
    31 39
     
    
    32 40
     if test "x$ac_cv_prog_cc_c99" = xno; then
    
    33 41
             AC_MSG_ERROR([Building libglvnd requires a C99-enabled compiler])
    

  • debian/changelog
    1
    +libglvnd (1.1.1-1) UNRELEASED; urgency=medium
    
    2
    +
    
    3
    +  * New upstream release. (LP: #1816004)
    
    4
    +
    
    5
    + -- Timo Aaltonen <tjaalton@debian.org>  Wed, 13 Mar 2019 20:05:49 +0200
    
    6
    +
    
    1 7
     libglvnd (1.1.0-1) unstable; urgency=medium
    
    2 8
     
    
    3 9
       * New upstream release.
    

  • include/GL/gl.h
    ... ... @@ -1736,9 +1736,6 @@ GLAPI void GLAPIENTRY glSeparableFilter2D( GLenum target,
    1736 1736
     GLAPI void GLAPIENTRY glGetSeparableFilter( GLenum target, GLenum format,
    
    1737 1737
     	GLenum type, GLvoid *row, GLvoid *column, GLvoid *span );
    
    1738 1738
     
    
    1739
    -typedef void (APIENTRYP PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
    
    1740
    -typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode);
    
    1741
    -
    
    1742 1739
     
    
    1743 1740
     
    
    1744 1741
     /*
    
    ... ... @@ -2189,22 +2186,6 @@ typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEATIPROC) (GLenum modeRGB, GLen
    2189 2186
     #endif /* GL_ATI_blend_equation_separate */
    
    2190 2187
     
    
    2191 2188
     
    
    2192
    -/* GL_OES_EGL_image */
    
    2193
    -#ifndef GL_OES_EGL_image
    
    2194
    -typedef void* GLeglImageOES;
    
    2195
    -#endif
    
    2196
    -
    
    2197
    -#ifndef GL_OES_EGL_image
    
    2198
    -#define GL_OES_EGL_image 1
    
    2199
    -#ifdef GL_GLEXT_PROTOTYPES
    
    2200
    -GLAPI void APIENTRY glEGLImageTargetTexture2DOES (GLenum target, GLeglImageOES image);
    
    2201
    -GLAPI void APIENTRY glEGLImageTargetRenderbufferStorageOES (GLenum target, GLeglImageOES image);
    
    2202
    -#endif
    
    2203
    -typedef void (APIENTRYP PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) (GLenum target, GLeglImageOES image);
    
    2204
    -typedef void (APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLeglImageOES image);
    
    2205
    -#endif
    
    2206
    -
    
    2207
    -
    
    2208 2189
     /**
    
    2209 2190
      ** NOTE!!!!!  If you add new functions to this file, or update
    
    2210 2191
      ** glext.h be sure to regenerate the gl_mangle.h file.  See comments
    

  • include/glheader.h
    ... ... @@ -65,11 +65,6 @@ extern "C" {
    65 65
     typedef int GLclampx;
    
    66 66
     
    
    67 67
     
    
    68
    -#ifndef GL_OES_EGL_image
    
    69
    -typedef void *GLeglImageOES;
    
    70
    -#endif
    
    71
    -
    
    72
    -
    
    73 68
     #ifndef GL_OES_EGL_image_external
    
    74 69
     #define GL_TEXTURE_EXTERNAL_OES                                 0x8D65
    
    75 70
     #define GL_SAMPLER_EXTERNAL_OES                                 0x8D66
    

  • src/EGL/Makefile.am
    ... ... @@ -86,6 +86,7 @@ libEGL_dispatch_stubs_la_SOURCES = \
    86 86
     	egldispatchstubs.c \
    
    87 87
     	g_egldispatchstubs.c
    
    88 88
     
    
    89
    +if HAVE_PYTHON
    
    89 90
     BUILT_SOURCES = g_egldispatchstubs.c g_egldispatchstubs.h
    
    90 91
     CLEANFILES = $(BUILT_SOURCES)
    
    91 92
     
    
    ... ... @@ -100,7 +101,8 @@ GENERATE_DEPS = \
    100 101
     	$(GENERATE_LIST_FILES)
    
    101 102
     
    
    102 103
     g_egldispatchstubs.c : $(GENERATE_DEPS)
    
    103
    -	$(VM_V_GEN)$(PYTHON2) $(GENERATE_DISPATCH_SCRIPT) source $(GENERATE_LIST_FILES) > $@
    
    104
    +	$(AM_V_GEN)$(PYTHON) $(GENERATE_DISPATCH_SCRIPT) source $(GENERATE_LIST_FILES) > $@
    
    104 105
     
    
    105 106
     g_egldispatchstubs.h : $(GENERATE_DEPS)
    
    106
    -	$(VM_V_GEN)$(PYTHON2) $(GENERATE_DISPATCH_SCRIPT) header $(GENERATE_LIST_FILES) > $@
    107
    +	$(AM_V_GEN)$(PYTHON) $(GENERATE_DISPATCH_SCRIPT) header $(GENERATE_LIST_FILES) > $@
    
    108
    +endif

  • src/GL/Makefile.am
    ... ... @@ -37,6 +37,7 @@ libGL_la_SOURCES = \
    37 37
     	libgl.c             \
    
    38 38
     	g_libglglxwrapper.c
    
    39 39
     
    
    40
    +if HAVE_PYTHON
    
    40 41
     BUILT_SOURCES = g_libglglxwrapper.c
    
    41 42
     CLEANFILES = $(BUILT_SOURCES)
    
    42 43
     
    
    ... ... @@ -50,8 +51,8 @@ glapi_gen_libglglxstubs_deps = \
    50 51
     	$(glapi_gen_glx_xml)
    
    51 52
     
    
    52 53
     g_libglglxwrapper.c : $(glapi_gen_libglglxstubs_deps)
    
    53
    -	$(AM_V_GEN)$(PYTHON2) $(PYTHON_FLAGS) \
    
    54
    -	$(glapi_gen_libglglxstubs_script) $(glapi_gen_glx_xml) > $@
    
    54
    +	$(AM_V_GEN)$(PYTHON) $(PYTHON_FLAGS) $(glapi_gen_libglglxstubs_script) $(glapi_gen_glx_xml) > $@
    
    55
    +endif
    
    55 56
     
    
    56 57
     libGL_la_CFLAGS = \
    
    57 58
     	-I$(top_srcdir)/include
    

  • src/GLdispatch/GLdispatch.c
    ... ... @@ -764,11 +764,11 @@ void __glDispatchCheckMultithreaded(void)
    764 764
                     _glapi_set_multithread();
    
    765 765
                 }
    
    766 766
             }
    
    767
    -        UnlockDispatch();
    
    768 767
     
    
    769 768
             if (stubCurrentPatchCb != NULL && stubCurrentPatchCb->threadAttach != NULL) {
    
    770 769
                 stubCurrentPatchCb->threadAttach();
    
    771 770
             }
    
    771
    +        UnlockDispatch();
    
    772 772
         }
    
    773 773
     }
    
    774 774
     
    

  • src/GLdispatch/vnd-glapi/Makefile.am
    ... ... @@ -4,6 +4,7 @@ MAPI_PREFIX = src/GLdispatch/vnd-glapi
    4 4
     
    
    5 5
     include $(top_srcdir)/src/GLdispatch/vnd-glapi/entry_files.mk
    
    6 6
     
    
    7
    +if HAVE_PYTHON
    
    7 8
     glapi_gen_gl_xml := \
    
    8 9
     	$(top_srcdir)/src/generate/xml/gl.xml \
    
    9 10
     	$(top_srcdir)/src/generate/xml/gl_other.xml
    
    ... ... @@ -12,7 +13,10 @@ glapi_gen_mapi_deps = \
    12 13
     	$(glapi_gen_mapi_script) \
    
    13 14
     	$(top_srcdir)/src/generate/genCommon.py \
    
    14 15
     	$(glapi_gen_gl_xml)
    
    15
    -glapi_gen_mapi = $(AM_V_GEN)$(PYTHON2) $(PYTHON_FLAGS) $(glapi_gen_mapi_script)
    
    16
    +glapi_gen_mapi = $(AM_V_GEN)$(PYTHON) $(PYTHON_FLAGS) $(glapi_gen_mapi_script)
    
    17
    +endif
    
    18
    +
    
    19
    +BUILT_SOURCES =
    
    16 20
     
    
    17 21
     noinst_HEADERS = \
    
    18 22
     	glapi.h \
    
    ... ... @@ -45,11 +49,12 @@ endif
    45 49
     libglapi_la_LDFLAGS = -no-undefined
    
    46 50
     libglapi_la_LIBADD = $(top_builddir)/src/util/libutils_misc.la
    
    47 51
     
    
    52
    +noinst_HEADERS += glapi_mapi_tmp.h
    
    53
    +if HAVE_PYTHON
    
    54
    +BUILT_SOURCES += glapi_mapi_tmp.h
    
    48 55
     glapi_mapi_tmp.h : $(glapi_gen_mapi_deps)
    
    49 56
     	$(glapi_gen_mapi) gldispatch $(glapi_gen_gl_xml) > $@
    
    50
    -
    
    51
    -BUILT_SOURCES = glapi_mapi_tmp.h
    
    52
    -noinst_HEADERS += glapi_mapi_tmp.h
    
    57
    +endif
    
    53 58
     
    
    54 59
     COMMON_CPPFLAGS = \
    
    55 60
     	$(DEFINES) \
    
    ... ... @@ -77,35 +82,43 @@ libglapi_gl_la_SOURCES = $(ENTRYPOINT_SOURCES)
    77 82
     libglapi_gl_la_CPPFLAGS = $(ENTRYPOINT_CPPFLAGS) \
    
    78 83
     	-DMAPI_ABI_HEADER=\"$(builddir)/g_glapi_mapi_gl_tmp.h\"
    
    79 84
     noinst_HEADERS += g_glapi_mapi_gl_tmp.h
    
    85
    +if HAVE_PYTHON
    
    80 86
     BUILT_SOURCES += g_glapi_mapi_gl_tmp.h
    
    81 87
     g_glapi_mapi_gl_tmp.h : $(glapi_gen_mapi_deps)
    
    82 88
     	$(glapi_gen_mapi) gl $(glapi_gen_gl_xml) > $@
    
    89
    +endif
    
    83 90
     
    
    84 91
     noinst_LTLIBRARIES += libglapi_opengl.la
    
    85 92
     libglapi_opengl_la_SOURCES = $(ENTRYPOINT_SOURCES)
    
    86 93
     libglapi_opengl_la_CPPFLAGS = $(ENTRYPOINT_CPPFLAGS) \
    
    87 94
     	-DMAPI_ABI_HEADER=\"$(builddir)/g_glapi_mapi_opengl_tmp.h\"
    
    88 95
     noinst_HEADERS += g_glapi_mapi_opengl_tmp.h
    
    96
    +if HAVE_PYTHON
    
    89 97
     BUILT_SOURCES += g_glapi_mapi_opengl_tmp.h
    
    90 98
     g_glapi_mapi_opengl_tmp.h : $(glapi_gen_mapi_deps)
    
    91 99
     	$(glapi_gen_mapi) opengl $(glapi_gen_gl_xml) > $@
    
    100
    +endif
    
    92 101
     
    
    93 102
     noinst_LTLIBRARIES += libglapi_glesv1.la
    
    94 103
     libglapi_glesv1_la_SOURCES = $(ENTRYPOINT_SOURCES)
    
    95 104
     libglapi_glesv1_la_CPPFLAGS = $(ENTRYPOINT_CPPFLAGS) \
    
    96 105
     	-DMAPI_ABI_HEADER=\"$(builddir)/g_glapi_mapi_glesv1_tmp.h\"
    
    97 106
     noinst_HEADERS += g_glapi_mapi_glesv1_tmp.h
    
    107
    +if HAVE_PYTHON
    
    98 108
     BUILT_SOURCES += g_glapi_mapi_glesv1_tmp.h
    
    99 109
     g_glapi_mapi_glesv1_tmp.h : $(glapi_gen_mapi_deps)
    
    100 110
     	$(glapi_gen_mapi) glesv1 $(glapi_gen_gl_xml) > $@
    
    111
    +endif
    
    101 112
     
    
    102 113
     noinst_LTLIBRARIES += libglapi_glesv2.la
    
    103 114
     libglapi_glesv2_la_SOURCES = $(ENTRYPOINT_SOURCES)
    
    104 115
     libglapi_glesv2_la_CPPFLAGS = $(ENTRYPOINT_CPPFLAGS) \
    
    105 116
     	-DMAPI_ABI_HEADER=\"$(builddir)/g_glapi_mapi_glesv2_tmp.h\"
    
    106 117
     noinst_HEADERS += g_glapi_mapi_glesv2_tmp.h
    
    118
    +if HAVE_PYTHON
    
    107 119
     BUILT_SOURCES += g_glapi_mapi_glesv2_tmp.h
    
    108 120
     g_glapi_mapi_glesv2_tmp.h : $(glapi_gen_mapi_deps)
    
    109 121
     	$(glapi_gen_mapi) glesv2 $(glapi_gen_gl_xml) > $@
    
    122
    +endif
    
    110 123
     
    
    111 124
     CLEANFILES = $(BUILT_SOURCES)

  • src/GLdispatch/vnd-glapi/entry_ppc64le_tls.c
    ... ... @@ -62,7 +62,8 @@ __asm__(".balign " U_STRINGIFY(GLDISPATCH_PAGE_SIZE) "\n"
    62 62
         "  ld     11, _glapi_tls_Current@got@tprel@l(11)\n\t"       \
    
    63 63
         "  add    11, 11,_glapi_tls_Current@tls\n\t"                \
    
    64 64
         "  ld     11, 0(11)\n\t"                                    \
    
    65
    -    "  ld     12, " slot "*8(11)\n\t"                           \
    
    65
    +    "  addis  11, 11, (" slot "*8)@ha\n" \
    
    66
    +    "  ld     12, (" slot "*8)@l (11)\n" \
    
    66 67
         "  mtctr  12\n\t"                                           \
    
    67 68
         "  bctr\n"                                                  \
    
    68 69
         // Conceptually, this is:
    

  • src/GLdispatch/vnd-glapi/entry_ppc64le_tsd.c
    ... ... @@ -57,48 +57,42 @@ __asm__(".balign " U_STRINGIFY(GLDISPATCH_PAGE_SIZE) "\n"
    57 57
         "  .localentry  " func ", .-" func "\n\t"
    
    58 58
     
    
    59 59
     #define STUB_ASM_CODE(slot)                             \
    
    60
    -    "  addis  11, 2, _glapi_Current@got@ha\n\t"         \
    
    61
    -    "  ld     11, _glapi_Current@got@l(11)\n\t"         \
    
    62
    -    "  ld     11, 0(11)\n\t"                            \
    
    63
    -    "  cmpldi 11, 0\n\t"                                \
    
    64
    -    "  beq    2000f\n"                                  \
    
    65
    -    "1050:\n\t"                                         \
    
    66
    -    "  ld     12, " slot "*8(11)\n\t"                   \
    
    67
    -    "  mtctr  12\n\t"                                   \
    
    68
    -    "  bctr\n"                                          \
    
    69
    -    "2000:\n\t"                                         \
    
    70
    -    "  mflr   0\n\t"                                    \
    
    71
    -    "  std    0, 16(1)\n\t"                             \
    
    72
    -    "  std    2, 40(1)\n\t"                             \
    
    73
    -    "  stdu   1, -144(1)\n\t"                           \
    
    74
    -    "  std    3, 56(1)\n\t"                             \
    
    75
    -    "  std    4, 64(1)\n\t"                             \
    
    76
    -    "  std    5, 72(1)\n\t"                             \
    
    77
    -    "  std    6, 80(1)\n\t"                             \
    
    78
    -    "  std    7, 88(1)\n\t"                             \
    
    79
    -    "  std    8, 96(1)\n\t"                             \
    
    80
    -    "  std    9, 104(1)\n\t"                            \
    
    81
    -    "  std    10, 112(1)\n\t"                           \
    
    82
    -    "  std    12, 128(1)\n\t"                           \
    
    83
    -    "  addis  12, 2, _glapi_get_current@got@ha\n\t"     \
    
    84
    -    "  ld     12, _glapi_get_current@got@l(12)\n\t"     \
    
    85
    -    "  mtctr  12\n\t"                                   \
    
    86
    -    "  bctrl\n\t"                                       \
    
    87
    -    "  ld     2, 144+40(1)\n\t"                         \
    
    88
    -    "  mr     11, 3\n\t"                                \
    
    89
    -    "  ld     3, 56(1)\n\t"                             \
    
    90
    -    "  ld     4, 64(1)\n\t"                             \
    
    91
    -    "  ld     5, 72(1)\n\t"                             \
    
    92
    -    "  ld     6, 80(1)\n\t"                             \
    
    93
    -    "  ld     7, 88(1)\n\t"                             \
    
    94
    -    "  ld     8, 96(1)\n\t"                             \
    
    95
    -    "  ld     9, 104(1)\n\t"                            \
    
    96
    -    "  ld     10, 112(1)\n\t"                           \
    
    97
    -    "  ld     12, 128(1)\n\t"                           \
    
    98
    -    "  addi   1, 1, 144\n\t"                            \
    
    99
    -    "  ld     0, 16(1)\n\t"                             \
    
    100
    -    "  mtlr   0\n\t"                                    \
    
    101
    -    "  b      1050b\n"
    
    60
    +    "  addis  11, 2, _glapi_Current@got@ha\n" \
    
    61
    +    "  ld     11, _glapi_Current@got@l(11)\n" \
    
    62
    +    "  ld     11, 0(11)\n" \
    
    63
    +    "  cmpldi 11, 0\n" \
    
    64
    +    "  bne    1000f\n" \
    
    65
    +    "  mflr   0\n" \
    
    66
    +    "  std    0, 16(1)\n" \
    
    67
    +    "  stdu   1, -120(1)\n" \
    
    68
    +    "  std    3, 56(1)\n" \
    
    69
    +    "  std    4, 64(1)\n" \
    
    70
    +    "  std    5, 72(1)\n" \
    
    71
    +    "  std    6, 80(1)\n" \
    
    72
    +    "  std    7, 88(1)\n" \
    
    73
    +    "  std    8, 96(1)\n" \
    
    74
    +    "  std    9, 104(1)\n" \
    
    75
    +    "  std    10, 112(1)\n" \
    
    76
    +    "  bl _glapi_get_current\n" \
    
    77
    +    "  nop\n" \
    
    78
    +    "  mr     11, 3\n" \
    
    79
    +    "  ld     3, 56(1)\n" \
    
    80
    +    "  ld     4, 64(1)\n" \
    
    81
    +    "  ld     5, 72(1)\n" \
    
    82
    +    "  ld     6, 80(1)\n" \
    
    83
    +    "  ld     7, 88(1)\n" \
    
    84
    +    "  ld     8, 96(1)\n" \
    
    85
    +    "  ld     9, 104(1)\n" \
    
    86
    +    "  ld     10, 112(1)\n" \
    
    87
    +    "  addi   1, 1, 120\n" \
    
    88
    +    "  ld     0, 16(1)\n" \
    
    89
    +    "  mtlr   0\n" \
    
    90
    +    "1000:\n" \
    
    91
    +    "  addis  11, 11, (" slot "*8)@ha\n" \
    
    92
    +    "  ld     12, (" slot "*8)@l (11)\n" \
    
    93
    +    "  mtctr  12\n" \
    
    94
    +    "  bctr\n" \
    
    95
    +
    
    102 96
         // Conceptually, this is:
    
    103 97
         // {
    
    104 98
         //     void **dispatchTable = _glapi_Current[GLAPI_CURRENT_DISPATCH];
    
    ... ... @@ -135,52 +129,52 @@ static const uint32_t ENTRY_TEMPLATE[] =
    135 129
         // This representation is correct for both little- and big-endian systems.
    
    136 130
         // However, more work needs to be done for big-endian Linux because it
    
    137 131
         // adheres to an older, AIX-compatible ABI that uses function descriptors.
    
    138
    -    // 1000:
    
    139
    -    // 1000:
    
    140
    -    0x7C0802A6,    // <ENTRY+000>:    mflr   0
    
    141
    -    0xF8010010,    // <ENTRY+004>:    std    0, 16(1)
    
    142
    -    0xE96C0098,    // <ENTRY+008>:    ld     11, 9000f-1000b+0(12)
    
    143
    -    0xE96B0000,    // <ENTRY+012>:    ld     11, 0(11)
    
    144
    -    0x282B0000,    // <ENTRY+016>:    cmpldi 11, 0
    
    145
    -    0x41820014,    // <ENTRY+020>:    beq    2000f
    
    146
    -    // 1050:
    
    147
    -    0xE80C00A8,    // <ENTRY+024>:    ld     0, 9000f-1000b+16(12)
    
    148
    -    0x7D8B002A,    // <ENTRY+028>:    ldx    12, 11, 0
    
    149
    -    0x7D8903A6,    // <ENTRY+032>:    mtctr  12
    
    150
    -    0x4E800420,    // <ENTRY+036>:    bctr
    
    151
    -    // 2000:
    
    152
    -    0xF8410028,    // <ENTRY+040>:    std    2, 40(1)
    
    153
    -    0xF821FF71,    // <ENTRY+044>:    stdu   1, -144(1)
    
    154
    -    0xF8610038,    // <ENTRY+048>:    std    3, 56(1)
    
    155
    -    0xF8810040,    // <ENTRY+052>:    std    4, 64(1)
    
    156
    -    0xF8A10048,    // <ENTRY+056>:    std    5, 72(1)
    
    157
    -    0xF8C10050,    // <ENTRY+060>:    std    6, 80(1)
    
    158
    -    0xF8E10058,    // <ENTRY+064>:    std    7, 88(1)
    
    159
    -    0xF9010060,    // <ENTRY+068>:    std    8, 96(1)
    
    160
    -    0xF9210068,    // <ENTRY+072>:    std    9, 104(1)
    
    161
    -    0xF9410070,    // <ENTRY+076>:    std    10, 112(1)
    
    162
    -    0xF9810080,    // <ENTRY+080>:    std    12, 128(1)
    
    163
    -    0xE98C00A0,    // <ENTRY+084>:    ld     12, 9000f-1000b+8(12)
    
    164
    -    0x7D8903A6,    // <ENTRY+088>:    mtctr  12
    
    165
    -    0x4E800421,    // <ENTRY+092>:    bctrl
    
    166
    -    0xE9410070,    // <ENTRY+096>:    ld     10, 112(1)
    
    167
    -    0x7C6B1B78,    // <ENTRY+100>:    mr     11, 3
    
    168
    -    0xE8610038,    // <ENTRY+104>:    ld     3, 56(1)
    
    169
    -    0xE8810040,    // <ENTRY+108>:    ld     4, 64(1)
    
    170
    -    0xE8A10048,    // <ENTRY+112>:    ld     5, 72(1)
    
    171
    -    0xE8C10050,    // <ENTRY+116>:    ld     6, 80(1)
    
    172
    -    0xE8E10058,    // <ENTRY+120>:    ld     7, 88(1)
    
    173
    -    0xE9010060,    // <ENTRY+124>:    ld     8, 96(1)
    
    174
    -    0xE9210068,    // <ENTRY+128>:    ld     9, 104(1)
    
    175
    -    0xE9810080,    // <ENTRY+132>:    ld     12, 128(1)
    
    176
    -    0x38210090,    // <ENTRY+136>:    addi   1, 1, 144
    
    177
    -    0xE8010010,    // <ENTRY+140>:    ld     0, 16(1)
    
    178
    -    0x7C0803A6,    // <ENTRY+144>:    mtlr   0
    
    179
    -    0x4BFFFF84,    // <ENTRY+148>:    b      1050b
    
    180
    -    // 9000:
    
    181
    -    0, 0,          // <ENTRY+152>:    .quad _glapi_Current
    
    182
    -    0, 0,          // <ENTRY+160>:    .quad _glapi_get_current
    
    183
    -    0, 0           // <ENTRY+168>:    .quad <slot>*8
    
    132
    +                //              1000:
    
    133
    +    0x7c0802a6, // <ENTRY+000>: mflr   0
    
    134
    +    0xf8010010, // <ENTRY+004>: std    0, 16(1)
    
    135
    +    0xe96c009c, // <ENTRY+008>: ld     11, 9000f-1000b+0(12)
    
    136
    +    0xe96b0000, // <ENTRY+012>: ld     11, 0(11)
    
    137
    +    0x282b0000, // <ENTRY+016>: cmpldi 11, 0
    
    138
    +    0x41820014, // <ENTRY+020>: beq    2000f
    
    139
    +                //              1050:
    
    140
    +    0xe80c00ac, // <ENTRY+024>: ld     0, 9000f-1000b+16(12)
    
    141
    +    0x7d8b002a, // <ENTRY+028>: ldx    12, 11, 0
    
    142
    +    0x7d8903a6, // <ENTRY+032>: mtctr  12
    
    143
    +    0x4e800420, // <ENTRY+036>: bctr
    
    144
    +                //              2000:
    
    145
    +    0xf821ff71, // <ENTRY+040>: stdu   1, -144(1)
    
    146
    +    0xf8410018, // <ENTRY+044>: std    2, 24(1)
    
    147
    +    0xf8610038, // <ENTRY+048>: std    3, 56(1)
    
    148
    +    0xf8810040, // <ENTRY+052>: std    4, 64(1)
    
    149
    +    0xf8a10048, // <ENTRY+056>: std    5, 72(1)
    
    150
    +    0xf8c10050, // <ENTRY+060>: std    6, 80(1)
    
    151
    +    0xf8e10058, // <ENTRY+064>: std    7, 88(1)
    
    152
    +    0xf9010060, // <ENTRY+068>: std    8, 96(1)
    
    153
    +    0xf9210068, // <ENTRY+072>: std    9, 104(1)
    
    154
    +    0xf9410070, // <ENTRY+076>: std    10, 112(1)
    
    155
    +    0xf9810080, // <ENTRY+080>: std    12, 128(1)
    
    156
    +    0xe98c00a4, // <ENTRY+084>: ld     12, 9000f-1000b+8(12)
    
    157
    +    0x7d8903a6, // <ENTRY+088>: mtctr  12
    
    158
    +    0x4e800421, // <ENTRY+092>: bctrl
    
    159
    +    0xe8410018, // <ENTRY+096>: ld     2, 24(1)
    
    160
    +    0xe9410070, // <ENTRY+100>: ld     10, 112(1)
    
    161
    +    0x7c6b1b78, // <ENTRY+104>: mr     11, 3
    
    162
    +    0xe8610038, // <ENTRY+108>: ld     3, 56(1)
    
    163
    +    0xe8810040, // <ENTRY+112>: ld     4, 64(1)
    
    164
    +    0xe8a10048, // <ENTRY+116>: ld     5, 72(1)
    
    165
    +    0xe8c10050, // <ENTRY+120>: ld     6, 80(1)
    
    166
    +    0xe8e10058, // <ENTRY+124>: ld     7, 88(1)
    
    167
    +    0xe9010060, // <ENTRY+128>: ld     8, 96(1)
    
    168
    +    0xe9210068, // <ENTRY+132>: ld     9, 104(1)
    
    169
    +    0xe9810080, // <ENTRY+136>: ld     12, 128(1)
    
    170
    +    0x38210090, // <ENTRY+140>: addi   1, 1, 144
    
    171
    +    0xe8010010, // <ENTRY+144>: ld     0, 16(1)
    
    172
    +    0x7c0803a6, // <ENTRY+148>: mtlr   0
    
    173
    +    0x4bffff80, // <ENTRY+152>: b      1050b
    
    174
    +                //              9000:
    
    175
    +    0, 0,       // <ENTRY+156>: .quad _glapi_Current
    
    176
    +    0, 0,       // <ENTRY+164>: .quad _glapi_get_current
    
    177
    +    0, 0,       // <ENTRY+172>: .quad <slot>*8
    
    184 178
     };
    
    185 179
     
    
    186 180
     // These are the offsets in ENTRY_TEMPLATE of the values that we have to patch.
    

  • src/util/glvnd_genentry.c
    ... ... @@ -314,8 +314,8 @@ void SetDispatchFuncPointer(GLVNDGenEntrypoint *entry,
    314 314
         *((uintptr_t *)(code + DISPATCH_FUNC_OFFSET)) = (uintptr_t)dispatch;
    
    315 315
     
    
    316 316
         // See http://community.arm.com/groups/processors/blog/2010/02/17/caches-and-self-modifying-code
    
    317
    -    __builtin___clear_cache((char *)entry->entrypointExec - 1,
    
    318
    -                            (char *)entry->entrypointExec - 1 + sizeof(STUB_TEMPLATE));
    
    317
    +    __builtin___clear_cache((char *)entry->entrypointExec,
    
    318
    +                            (char *)entry->entrypointExec + sizeof(STUB_TEMPLATE));
    
    319 319
     
    
    320 320
     #elif defined(USE_PPC64LE_ASM)
    
    321 321
     
    

  • tests/Makefile.am
    ... ... @@ -57,18 +57,23 @@ AM_CFLAGS = \
    57 57
     
    
    58 58
     
    
    59 59
     TESTS += testgldispatch_static.sh
    
    60
    +TESTS += testgldispatch_static_thr.sh
    
    60 61
     TESTS += testgldispatch_generated.sh
    
    62
    +TESTS += testgldispatch_generated_thr.sh
    
    61 63
     TESTS += testgldispatch_patched.sh
    
    64
    +TESTS += testgldispatch_patched_thr.sh
    
    62 65
     check_PROGRAMS += testgldispatch
    
    63 66
     testgldispatch_SOURCES = \
    
    64 67
     	testgldispatch.c
    
    65 68
     testgldispatch_CFLAGS = \
    
    66 69
     	-I$(top_srcdir)/include \
    
    67
    -	-I$(top_srcdir)/src/GLdispatch
    
    70
    +	-I$(top_srcdir)/src/GLdispatch \
    
    71
    +	$(PTHREAD_CFLAGS)
    
    68 72
     testgldispatch_LDADD = $(top_builddir)/src/GLdispatch/libGLdispatch.la
    
    69 73
     testgldispatch_LDADD += $(top_builddir)/src/OpenGL/libOpenGL.la
    
    70 74
     testgldispatch_LDADD += dummy/libpatchentrypoints.la
    
    71 75
     testgldispatch_LDADD += $(top_builddir)/src/util/libutils_misc.la
    
    76
    +testgldispatch_LDADD += $(PTHREAD_LIBS)
    
    72 77
     
    
    73 78
     # Start of GLX-specific tests.
    
    74 79
     # Notes that the TESTS_GLX variable must be defined outside the conditional, so
    

  • tests/testgldispatch.c
    ... ... @@ -31,6 +31,7 @@
    31 31
     #include <stdlib.h>
    
    32 32
     #include <string.h>
    
    33 33
     #include <getopt.h>
    
    34
    +#include <pthread.h>
    
    34 35
     #include <GL/gl.h>
    
    35 36
     
    
    36 37
     #include <GLdispatch.h>
    
    ... ... @@ -68,6 +69,8 @@ typedef struct DummyVendorLibRec {
    68 69
     static void InitDummyVendors(void);
    
    69 70
     static void CleanupDummyVendors(void);
    
    70 71
     
    
    72
    +static void *ForceMultiThreadedProc(void *param);
    
    73
    +
    
    71 74
     static GLboolean TestDispatch(int vendorIndex,
    
    72 75
             GLboolean testStatic, GLboolean testGenerated);
    
    73 76
     
    
    ... ... @@ -103,13 +106,14 @@ static pfn_glVertex3fv ptr_glDummyTestProc;
    103 106
     static GLboolean enableStaticTest = GL_FALSE;
    
    104 107
     static GLboolean enableGeneratedTest = GL_FALSE;
    
    105 108
     static GLboolean enablePatching = GL_FALSE;
    
    109
    +static GLboolean forceMultiThreaded = GL_FALSE;
    
    106 110
     
    
    107 111
     int main(int argc, char **argv)
    
    108 112
     {
    
    109 113
         int i;
    
    110 114
     
    
    111 115
         while (1) {
    
    112
    -        int opt = getopt(argc, argv, "sgp");
    
    116
    +        int opt = getopt(argc, argv, "sgpt");
    
    113 117
             if (opt == -1) {
    
    114 118
                 break;
    
    115 119
             }
    
    ... ... @@ -123,6 +127,9 @@ int main(int argc, char **argv)
    123 127
             case 'p':
    
    124 128
                 enablePatching = GL_TRUE;
    
    125 129
                 break;
    
    130
    +        case 't':
    
    131
    +            forceMultiThreaded = GL_TRUE;
    
    132
    +            break;
    
    126 133
             default:
    
    127 134
                 return 1;
    
    128 135
             }
    
    ... ... @@ -131,6 +138,15 @@ int main(int argc, char **argv)
    131 138
         __glDispatchInit();
    
    132 139
         InitDummyVendors();
    
    133 140
     
    
    141
    +    if (forceMultiThreaded) {
    
    142
    +        pthread_t thr;
    
    143
    +
    
    144
    +        printf("Forcing libGLdispatch into multi-threaded mode.\n");
    
    145
    +        __glDispatchCheckMultithreaded();
    
    146
    +        pthread_create(&thr, NULL, ForceMultiThreadedProc, NULL);
    
    147
    +        pthread_join(thr, NULL);
    
    148
    +    }
    
    149
    +
    
    134 150
         ptr_glVertex3fv = (pfn_glVertex3fv) __glDispatchGetProcAddress("glVertex3fv");
    
    135 151
         if (ptr_glVertex3fv == NULL) {
    
    136 152
             printf("Can't find dispatch function for glVertex3fv\n");
    
    ... ... @@ -154,6 +170,12 @@ int main(int argc, char **argv)
    154 170
         return 0;
    
    155 171
     }
    
    156 172
     
    
    173
    +static void *ForceMultiThreadedProc(void *param)
    
    174
    +{
    
    175
    +    __glDispatchCheckMultithreaded();
    
    176
    +    return NULL;
    
    177
    +}
    
    178
    +
    
    157 179
     static void InitDummyVendors(void)
    
    158 180
     {
    
    159 181
         int i;
    

  • tests/testgldispatch_generated_thr.sh
    1
    +#!/bin/sh
    
    2
    +
    
    3
    +./testgldispatch -g -t
    
    4
    +

  • tests/testgldispatch_patched_thr.sh
    1
    +#!/bin/sh
    
    2
    +
    
    3
    +./testgldispatch -s -g -p
    
    4
    +

  • tests/testgldispatch_static_thr.sh
    1
    +#!/bin/sh
    
    2
    +
    
    3
    +./testgldispatch -s -t
    
    4
    +


  • Reply to: