From e708bebcc029873004ade4241f347ce8c58896af Mon Sep 17 00:00:00 2001 From: marha Date: Fri, 11 Jul 2014 18:00:29 +0200 Subject: fontconfig libX11 xserver mkfontscale mesa git update 11 July 2014 xserver commit 9de3cc8daa4c6e877d30a0e8ccfe0cc159f1dbe3 libX11 commit ff9a5c199251a84fa59d14fd48dadb3f8920b54b mkfontscale commit 47908fd7a0d061fdcd21e3498da4e223ca9136d9 fontconfig commit dca5d0feee5eb6428bec48b1aff4396cf92c76c0 mesa commit f381c27c548aa28b003c8e188f5d627ab4105f76 --- fontconfig/src/fcmatch.c | 15 +- fontconfig/src/fcobjs.h | 2 +- fontconfig/test/test-migration.c | 2 +- libX11/modules/lc/def/lcDefConv.c | 38 +++-- libX11/nls/en_US.UTF-8/Compose.pre | 3 + libX11/specs/libX11/AppC.xml | 6 +- libX11/specs/libX11/AppD.xml | 5 +- libX11/specs/libX11/CH03.xml | 46 ++--- libX11/specs/libX11/CH04.xml | 11 +- libX11/specs/libX11/CH05.xml | 17 +- libX11/specs/libX11/CH06.xml | 34 ++-- libX11/specs/libX11/CH07.xml | 38 +++-- libX11/specs/libX11/CH08.xml | 77 ++++++--- libX11/specs/libX11/CH09.xml | 3 +- libX11/specs/libX11/CH12.xml | 23 +-- libX11/specs/libX11/CH13.xml | 18 +- libX11/specs/libX11/CH14.xml | 2 +- libX11/specs/libX11/CH16.xml | 47 ++--- mesalib/configure.ac | 16 +- mesalib/docs/index.html | 14 ++ mesalib/docs/relnotes.html | 1 + mesalib/docs/relnotes/10.2.3.html | 130 ++++++++++++++ mesalib/src/gallium/Automake.inc | 41 ----- mesalib/src/gallium/SConscript | 1 - mesalib/src/gallium/auxiliary/util/u_blitter.c | 9 + mesalib/src/gallium/auxiliary/util/u_transfer.c | 4 +- mesalib/src/glsl/ast_type.cpp | 10 ++ mesalib/src/glsl/glcpp/glcpp-lex.l | 33 ++-- mesalib/src/glsl/glcpp/glcpp-parse.y | 189 ++++++++++++++++----- mesalib/src/glsl/glcpp/glcpp.h | 9 +- mesalib/src/glsl/list.h | 6 +- mesalib/src/mesa/drivers/common/meta.c | 2 +- mesalib/src/mesa/drivers/dri/common/SConscript | 70 ++++---- mesalib/src/mesa/main/context.c | 3 + mesalib/src/mesa/main/ff_fragment_shader.cpp | 30 ++-- mesalib/src/mesa/main/multisample.c | 2 +- mesalib/src/mesa/main/shared.c | 1 + mesalib/src/mesa/state_tracker/st_atom_blend.c | 9 +- .../src/mesa/state_tracker/st_atom_rasterizer.c | 2 +- mesalib/src/mesa/state_tracker/st_atom_shader.c | 6 +- mesalib/src/mesa/state_tracker/st_cb_msaa.c | 6 +- mesalib/src/mesa/state_tracker/st_context.c | 1 + mesalib/src/mesa/state_tracker/st_format.c | 7 +- mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 5 +- mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.h | 2 +- mesalib/src/mesa/state_tracker/st_program.c | 16 +- mesalib/src/mesa/state_tracker/st_program.h | 3 + mkfontscale/mkfontscale.c | 4 - xorg-server/configure.ac | 6 +- xorg-server/hw/xfree86/common/xf86AutoConfig.c | 2 +- xorg-server/hw/xfree86/common/xf86pciBus.c | 24 ++- xorg-server/hw/xfree86/common/xf86pciBus.h | 5 +- xorg-server/hw/xfree86/common/xf86platformBus.c | 85 ++++++++- xorg-server/hw/xfree86/man/xorg.conf.man | 77 +++++++++ .../hw/xfree86/os-support/linux/lnx_platform.c | 17 +- xorg-server/hw/xfree86/parser/Makefile.am | 1 + xorg-server/hw/xfree86/parser/OutputClass.c | 167 ++++++++++++++++++ xorg-server/hw/xfree86/parser/configProcs.h | 5 + xorg-server/hw/xfree86/parser/read.c | 6 + xorg-server/hw/xfree86/parser/write.c | 2 + xorg-server/hw/xfree86/parser/xf86Parser.h | 9 + xorg-server/hw/xwin/Makefile.am | 2 +- xorg-server/include/hotplug.h | 2 + 63 files changed, 1048 insertions(+), 381 deletions(-) create mode 100644 mesalib/docs/relnotes/10.2.3.html create mode 100644 xorg-server/hw/xfree86/parser/OutputClass.c diff --git a/fontconfig/src/fcmatch.c b/fontconfig/src/fcmatch.c index 0c0a0670e..78255186f 100644 --- a/fontconfig/src/fcmatch.c +++ b/fontconfig/src/fcmatch.c @@ -245,16 +245,8 @@ FcCompareFilename (FcValue *v1, FcValue *v2) return 3.0; } -static double -FcCompareHash (FcValue *v1, FcValue *v2) -{ - const FcChar8 *s1 = FcValueString (v1), *s2 = FcValueString (v2); - /* Do not match an empty string */ - if (!s1 || !s2 || !s1[0] || !s2[0]) - return 1.0; - return FcCompareString (v1, v2); -} +/* Define priorities to -1 for objects that don't have a compare function. */ #define PRI_NULL(n) \ PRI_ ## n ## _STRONG = -1, \ @@ -269,7 +261,6 @@ FcCompareHash (FcValue *v1, FcValue *v2) #define PRI_FcCompareCharSet(n) PRI1(n) #define PRI_FcCompareLang(n) PRI1(n) #define PRI_FcComparePostScript(n) PRI1(n) -#define PRI_FcCompareHash(n) PRI1(n) #define PRI_FcCompareSizeRange(n) PRI1(n) #define FC_OBJECT(NAME, Type, Cmp) PRI_##Cmp(NAME) @@ -280,6 +271,9 @@ typedef enum _FcMatcherPriorityDummy { #undef FC_OBJECT + +/* Canonical match priority order. */ + #undef PRI1 #define PRI1(n) \ PRI_ ## n, \ @@ -287,7 +281,6 @@ typedef enum _FcMatcherPriorityDummy { PRI_ ## n ## _WEAK = PRI_ ## n typedef enum _FcMatcherPriority { - PRI1(HASH), PRI1(FILE), PRI1(FONTFORMAT), PRI1(SCALABLE), diff --git a/fontconfig/src/fcobjs.h b/fontconfig/src/fcobjs.h index dc3d83404..bfdf4b58b 100644 --- a/fontconfig/src/fcobjs.h +++ b/fontconfig/src/fcobjs.h @@ -66,6 +66,6 @@ FC_OBJECT (LCD_FILTER, FcTypeInteger, NULL) FC_OBJECT (NAMELANG, FcTypeString, NULL) FC_OBJECT (FONT_FEATURES, FcTypeString, NULL) FC_OBJECT (PRGNAME, FcTypeString, NULL) -FC_OBJECT (HASH, FcTypeString, FcCompareHash) /* deprecated */ +FC_OBJECT (HASH, FcTypeString, NULL) /* deprecated */ FC_OBJECT (POSTSCRIPT_NAME, FcTypeString, FcComparePostScript) /* ^-------------- Add new objects here. */ diff --git a/fontconfig/test/test-migration.c b/fontconfig/test/test-migration.c index 9366edbf1..bcd805df8 100644 --- a/fontconfig/test/test-migration.c +++ b/fontconfig/test/test-migration.c @@ -56,7 +56,7 @@ mkdir_p(const char *dir) if (strlen (dir) == 0) return FcFalse; - parent = (char *) FcStrDirname (dir); + parent = (char *) FcStrDirname ((const FcChar8 *)dir); if (!parent) return FcFalse; if (access (parent, F_OK) == 0) diff --git a/libX11/modules/lc/def/lcDefConv.c b/libX11/modules/lc/def/lcDefConv.c index e1f02289b..51ad2f8e7 100644 --- a/libX11/modules/lc/def/lcDefConv.c +++ b/libX11/modules/lc/def/lcDefConv.c @@ -149,14 +149,16 @@ def_mbstowcs( XPointer *args, int num_args) { - const char *src = (const char *) *from; - wchar_t *dst = (wchar_t *) * to; + const char *src; + wchar_t *dst = (wchar_t *) *to; State state = (State) conv->state; int unconv = 0; if (from == NULL || *from == NULL) return 0; + src = (const char *) *from; + while (*from_left && *to_left) { (*from_left)--; if (state->MBtoWC (state, src++, dst)) { @@ -181,7 +183,7 @@ def_wcstombs( XPointer *args, int num_args) { - const wchar_t *src = (const wchar_t *) * from; + const wchar_t *src; char *dst = (char *) *to; State state = (State) conv->state; char ch[MB_LEN_MAX]; @@ -190,6 +192,8 @@ def_wcstombs( if (from == NULL || *from == NULL) return 0; + src = (const wchar_t *) *from; + while (*from_left && *to_left) { (*from_left)--; if (state->WCtoMB (state, *src++, ch)) { @@ -214,7 +218,7 @@ mbstostr( XPointer *args, int num_args) { - const char *src = (const char *) *from; + const char *src; char *dst = (char *) *to; CodeSet codeset; State state = (State) conv->state; @@ -224,6 +228,8 @@ mbstostr( if (from == NULL || *from == NULL) return 0; + src = (const char *) *from; + while (*from_left && *to_left) { ch = *src++; (*from_left)--; @@ -251,7 +257,7 @@ wcstostr( XPointer *args, int num_args) { - const wchar_t *src = (const wchar_t *) *from; + const wchar_t *src; char *dst = (char *) *to; CodeSet codeset; State state = (State) conv->state; @@ -261,6 +267,8 @@ wcstostr( if (from == NULL || *from == NULL) return 0; + src = (const wchar_t *) *from; + while (*from_left && *to_left) { (*from_left)--; if (state->WCtoMB (state, *src++, ch)) { @@ -290,7 +298,7 @@ mbstocs( XPointer *args, int num_args) { - const char *src = (const char *) *from; + const char *src; char *dst = (char *) *to; int length; State state = (State) conv->state; @@ -300,6 +308,7 @@ mbstocs( if (from == NULL || *from == NULL) return 0; + src = (const char *) *from; length = min(*from_left, *to_left); cur_side = *src & GR; @@ -336,7 +345,7 @@ wcstocs( XPointer *args, int num_args) { - const wchar_t *src = (const wchar_t *) * from; + const wchar_t *src; char *dst = (char *) *to; State state = (State) conv->state; char cur_side = 0, ch[MB_LEN_MAX]; @@ -346,6 +355,8 @@ wcstocs( if (from == NULL || *from == NULL) return 0; + src = (const wchar_t *) *from; + while (*from_left) { if ((found = state->WCtoMB (state, *src, ch))) break; @@ -398,7 +409,7 @@ cstombs( XPointer *args, int num_args) { - const char *src = (const char *) *from; + const char *src; char *dst = (char *) *to; CodeSet codeset; XlcCharSet charset; @@ -410,6 +421,8 @@ cstombs( if (from == NULL || *from == NULL) return 0; + src = (const char *) *from; + if (num_args > 0) { charset = (XlcCharSet) args[0]; if (charset == NULL) @@ -467,8 +480,8 @@ cstowcs( XPointer *args, int num_args) { - const char *src = (const char *) *from; - wchar_t *dst = (wchar_t *) * to; + const char *src; + wchar_t *dst = (wchar_t *) *to; CodeSet codeset; XlcCharSet charset; State state = (State) conv->state; @@ -479,6 +492,8 @@ cstowcs( if (from == NULL || *from == NULL) return 0; + src = (const char *) *from; + if (num_args > 0) { charset = (XlcCharSet) args[0]; if (charset == NULL) @@ -539,13 +554,14 @@ strtombs( XPointer *args, int num_args) { - const char *src = (const char *) *from; + const char *src; char *dst = (char *) *to; int length; if (from == NULL || *from == NULL) return 0; + src = (const char *) *from; length = min(*from_left, *to_left); while (length) { *dst++ = *src++; diff --git a/libX11/nls/en_US.UTF-8/Compose.pre b/libX11/nls/en_US.UTF-8/Compose.pre index 068a3d305..23829b4cc 100644 --- a/libX11/nls/en_US.UTF-8/Compose.pre +++ b/libX11/nls/en_US.UTF-8/Compose.pre @@ -275,6 +275,9 @@ XCOMM Other symbols : "☺" U263A # WHITE SMILING FACE : "☹" U2639 # WHITE FROWNING FACE + : "🖕" U1F595 # REVERSED HAND WITH MIDDLE FINGER EXTENDED +

: "🖖" U1F596 # RAISED HAND WITH PART BETWEEN MIDDLE AND RING FINGERS + XCOMM Part 2 XCOMM Compose map for Korean Hangul(Choseongul) Conjoining Jamos automatically diff --git a/libX11/specs/libX11/AppC.xml b/libX11/specs/libX11/AppC.xml index 0b37048f1..7f4904c91 100644 --- a/libX11/specs/libX11/AppC.xml +++ b/libX11/specs/libX11/AppC.xml @@ -3056,7 +3056,7 @@ critical section: char *_XAllocScratch Display *display - unsignedlong nbytes + unsigned long nbytes @@ -3113,7 +3113,7 @@ critical sections: char *_XAllocTemp Display *display - unsignedlong nbytes + unsigned long nbytes @@ -3153,7 +3153,7 @@ The following function returns the storage: void _XFreeTemp Display *display char *buf - unsignedlong nbytes + unsigned long nbytes diff --git a/libX11/specs/libX11/AppD.xml b/libX11/specs/libX11/AppD.xml index fdea46894..83837970f 100644 --- a/libX11/specs/libX11/AppD.xml +++ b/libX11/specs/libX11/AppD.xml @@ -864,8 +864,9 @@ This function has been superseded by Display *display int screen char*position, *default_position - unsignedint bwidth - unsignedintfwidth, fheight + unsigned int bwidth + unsigned int fwidth + unsigned int fheight intxadder, yadder int*x_return, *y_return int*width_return, *height_return diff --git a/libX11/specs/libX11/CH03.xml b/libX11/specs/libX11/CH03.xml index 4e599da3b..d003717ab 100644 --- a/libX11/specs/libX11/CH03.xml +++ b/libX11/specs/libX11/CH03.xml @@ -1256,13 +1256,15 @@ To create an unmapped window and set its window attributes, use Window XCreateWindow Display *display Window parent - intx, y - unsignedintwidth, height - unsignedint border_width + int x + int y + unsigned int width + unsigned int height + unsigned int border_width int depth - unsignedint class + unsigned int class Visual *visual - unsignedlong valuemask + unsigned long valuemask XSetWindowAttributes *attributes @@ -1520,11 +1522,13 @@ subwindow of a given parent window, use Window XCreateSimpleWindow Display *display Window parent - intx, y - unsignedintwidth, height - unsignedint border_width - unsignedlong border - unsignedlong background + int x + int y + unsigned int width + unsigned int height + unsigned int border_width + unsigned long border + unsigned long background @@ -2535,7 +2539,7 @@ To configure a window's size, location, stacking, or border, use XConfigureWindow Display *display Window w - unsignedint value_mask + unsigned int value_mask XWindowChanges *values @@ -2640,7 +2644,8 @@ To move a window without changing its size, use XMoveWindow Display *display Window w - intx, y + int x + int y @@ -2741,7 +2746,8 @@ To change a window's size without changing the upper-left coordinate, use XResizeWindow Display *display Window w - unsignedintwidth, height + unsigned int width + unsigned int height @@ -2843,8 +2849,10 @@ To change the size and location of a window, use XMoveResizeWindow Display *display Window w - intx, y - unsignedintwidth, height + int x + int y + unsigned int width + unsigned int height @@ -2962,7 +2970,7 @@ To change the border width of a given window, use XSetWindowBorderWidth Display *display Window w - unsignedint width + unsigned int width @@ -3504,7 +3512,7 @@ To change one or more attributes for a given window, use XChangeWindowAttributes Display *display Window w - unsignedlong valuemask + unsigned long valuemask XSetWindowAttributes *attributes @@ -3662,7 +3670,7 @@ To set the background of a window to a given pixel, use XSetWindowBackground Display *display Window w - unsignedlong background_pixel + unsigned long background_pixel @@ -3831,7 +3839,7 @@ To change and repaint a window's border to a given pixel, use XSetWindowBorder Display *display Window w - unsignedlong border_pixel + unsigned long border_pixel diff --git a/libX11/specs/libX11/CH04.xml b/libX11/specs/libX11/CH04.xml index b8e73a469..a147b1848 100644 --- a/libX11/specs/libX11/CH04.xml +++ b/libX11/specs/libX11/CH04.xml @@ -49,7 +49,7 @@ a given window, use Window *root_return Window *parent_return Window **children_return - unsignedint *nchildren_return + unsigned int *nchildren_return @@ -378,9 +378,10 @@ To obtain the current geometry of a given drawable, use Drawable d Window *root_return int*x_return, *y_return - unsignedint*width_return, *height_return - unsignedint *border_width_return - unsignedint *depth_return + unsigned int *width_return + unsigned int *height_return + unsigned int *border_width_return + unsigned int *depth_return @@ -673,7 +674,7 @@ or to determine the pointer coordinates relative to a specified window, use Window*root_return, *child_return int*root_x_return, *root_y_return int*win_x_return, *win_y_return - unsignedint *mask_return + unsigned int *mask_return diff --git a/libX11/specs/libX11/CH05.xml b/libX11/specs/libX11/CH05.xml index c37eaddb8..a2fa8f739 100644 --- a/libX11/specs/libX11/CH05.xml +++ b/libX11/specs/libX11/CH05.xml @@ -30,8 +30,9 @@ To create a pixmap of a given size, use Pixmap XCreatePixmap Display *display Drawable d - unsignedintwidth, height - unsignedint depth + unsigned int width + unsigned int height + unsigned int depth @@ -231,7 +232,7 @@ To create a cursor from the standard cursor font, use Cursor XCreateFontCursor Display *display - unsignedint shape + unsigned int shape @@ -300,7 +301,7 @@ To create a cursor from font glyphs, use Cursor XCreateGlyphCursor Display *display Fontsource_font, mask_font - unsignedintsource_char, mask_char + unsigned int source_char, mask_char XColor *foreground_color XColor *background_color @@ -442,7 +443,7 @@ use Pixmap mask XColor *foreground_color XColor *background_color - unsignedintx, y + unsigned int x, y @@ -586,8 +587,10 @@ To determine useful cursor sizes, use Status XQueryBestCursor Display *display Drawable d - unsignedintwidth, height - unsignedint*width_return, *height_return + unsigned int width + unsigned int height + unsigned int *width_return + unsigned int *height_return diff --git a/libX11/specs/libX11/CH06.xml b/libX11/specs/libX11/CH06.xml index a82a5e231..4f10019ac 100644 --- a/libX11/specs/libX11/CH06.xml +++ b/libX11/specs/libX11/CH06.xml @@ -1915,10 +1915,10 @@ model, use Display *display Colormap colormap Bool contig - unsignedlong plane_masks_return[] - unsignedint nplanes - unsignedlong pixels_return[] - unsignedint npixels + unsigned long plane_masks_return[] + unsigned int nplanes + unsigned long pixels_return[] + unsigned int npixels @@ -2069,10 +2069,10 @@ model, use Display *display Colormap colormap Bool contig - unsignedlong pixels_return[] + unsigned long pixels_return[] int ncolors intnreds,ngreens, nblues - unsignedlong*rmask_return,*gmask_return, *bmask_return + unsigned long *rmask_return,*gmask_return, *bmask_return @@ -2270,9 +2270,9 @@ To free colormap cells, use XFreeColors Display *display Colormap colormap - unsignedlong pixels[] + unsigned long pixels[] int npixels - unsignedlong planes + unsigned long planes @@ -2866,7 +2866,7 @@ To store a color specified by name in a single colormap cell, use Display *display Colormap colormap char *color - unsignedlong pixel + unsigned long pixel int flags @@ -3249,7 +3249,7 @@ To query the color of multiple colormap cells in an arbitrary format, use Display *display Colormap colormap XcmsColor colors_in_out[] - unsignedint ncolors + unsigned int ncolors XcmsColorFormat result_format @@ -4186,7 +4186,7 @@ to a single destination format, use Status XcmsConvertColors XcmsCCC ccc XcmsColor colors_in_out[] - unsignedint ncolors + unsigned int ncolors XcmsColorFormat target_format Bool compression_flags_return[] @@ -4330,8 +4330,8 @@ following: typedef Status(*XcmsCompressionProc) XcmsCCC ccc XcmsColor colors_in_out[] - unsignedint ncolors - unsignedint index + unsigned int ncolors + unsigned int index Bool compression_flags_return[] @@ -4660,7 +4660,7 @@ The white point adjustment procedure interface must adhere to the following: XcmsColor *target_white_point XcmsColorFormat target_format XcmsColor colors_in_out[] - unsignedint ncolors + unsigned int ncolors Bool compression_flags_return[] @@ -6273,7 +6273,7 @@ Chroma at which the maximum Values are reached, use XcmsCCC ccc XcmsFloat hue XcmsColor colors_return[] - unsignedint nsamples + unsigned int nsamples @@ -6813,7 +6813,7 @@ following software interface specification: XcmsCCC ccc XcmsColor *white_point XcmsColor *colors_in_out - unsignedint ncolors + unsigned int ncolors @@ -6881,7 +6881,7 @@ following software interface specification: Status ConversionProc XcmsCCC ccc XcmsColor *colors_in_out - unsignedint ncolors + unsigned int ncolors Bool compression_flags_return[] diff --git a/libX11/specs/libX11/CH07.xml b/libX11/specs/libX11/CH07.xml index fc3f44d18..28cc8791c 100644 --- a/libX11/specs/libX11/CH07.xml +++ b/libX11/specs/libX11/CH07.xml @@ -971,7 +971,7 @@ depth of drawable, use GC XCreateGC Display *display Drawable d - unsignedlong valuemask + unsigned long valuemask XGCValues *values @@ -1059,7 +1059,7 @@ To copy components from a source GC to a destination GC, use XCopyGC Display *display GCsrc, dest - unsignedlong valuemask + unsigned long valuemask @@ -1145,7 +1145,7 @@ To change the components in a given GC, use XChangeGC Display *display GC gc - unsignedlong valuemask + unsigned long valuemask XGCValues *values @@ -1241,7 +1241,7 @@ To obtain components of a given GC, use Status XGetGCValues Display *display GC gc - unsignedlong valuemask + unsigned long valuemask XGCValues *values_return @@ -1536,9 +1536,9 @@ for a given GC, use XSetState Display *display GC gc - unsignedlongforeground, background + unsigned long foreground, background int function - unsignedlong plane_mask + unsigned long plane_mask @@ -1629,7 +1629,7 @@ To set the foreground of a given GC, use XSetForeground Display *display GC gc - unsignedlong foreground + unsigned long foreground @@ -1688,7 +1688,7 @@ To set the background of a given GC, use XSetBackground Display *display GC gc - unsignedlong background + unsigned long background @@ -1807,7 +1807,7 @@ To set the plane mask of a given GC, use XSetPlaneMask Display *display GC gc - unsignedlong plane_mask + unsigned long plane_mask @@ -1872,7 +1872,7 @@ To set the line drawing components of a given GC, use XSetLineAttributes Display *display GC gc - unsignedint line_width + unsigned int line_width int line_style int cap_style int join_style @@ -2257,8 +2257,10 @@ To obtain the best size of a tile, stipple, or cursor, use Display *display int class Drawable which_screen - unsignedintwidth, height - unsignedint*width_return, *height_return + unsigned int width + unsigned int height + unsigned int *width_return + unsigned int *height_return @@ -2399,8 +2401,10 @@ To obtain the best fill tile shape, use Status XQueryBestTile Display *display Drawable which_screen - unsignedintwidth, height - unsignedint*width_return, *height_return + unsigned int width + unsigned int height + unsigned int *width_return + unsigned int *height_return @@ -2505,8 +2509,10 @@ To obtain the best stipple shape, use Status XQueryBestStipple Display *display Drawable which_screen - unsignedintwidth, height - unsignedint*width_return, *height_return + unsigned int width + unsigned int height + unsigned int *width_return + unsigned int *height_return diff --git a/libX11/specs/libX11/CH08.xml b/libX11/specs/libX11/CH08.xml index fb76c84d8..cdf4df87b 100644 --- a/libX11/specs/libX11/CH08.xml +++ b/libX11/specs/libX11/CH08.xml @@ -49,8 +49,10 @@ To clear a rectangular area of a given window, use XClearArea Display *display Window w - intx, y - unsignedintwidth, height + int x + int y + unsigned int width + unsigned int height Bool exposures @@ -275,7 +277,8 @@ root and depth, use Drawablesrc, dest GC gc intsrc_x, src_y - unsignedintwidth, height + unsigned int width + unsigned int height intdest_x, dest_y @@ -468,9 +471,10 @@ To copy a single bit plane of a given drawable, use Drawablesrc, dest GC gc intsrc_x, src_y - unsignedintwidth, height + unsigned int width + unsigned int height intdest_x, dest_y - unsignedlong plane + unsigned long plane @@ -770,7 +774,8 @@ To draw a single point in a given drawable, use Display *display Drawable d GC gc - intx, y + int x + int y @@ -1335,8 +1340,10 @@ To draw the outline of a single rectangle in a given drawable, use Display *display Drawable d GC gc - intx, y - unsignedintwidth, height + int x + int y + unsigned int width + unsigned int height @@ -1566,8 +1573,10 @@ To draw a single arc in a given drawable, use Display *display Drawable d GC gc - intx, y - unsignedintwidth, height + int x + int y + unsigned int width + unsigned int height intangle1, angle2 @@ -1923,8 +1932,10 @@ To fill a single rectangular area in a given drawable, use Display *display Drawable d GC gc - intx, y - unsignedintwidth, height + int x + int y + unsigned int width + unsigned int height @@ -2353,8 +2364,10 @@ To fill a single arc in a given drawable, use Display *display Drawable d GC gc - intx, y - unsignedintwidth, height + int x + int y + unsigned int width + unsigned int height intangle1, angle2 @@ -3285,7 +3298,7 @@ To return a given font property, use Bool XGetFontProperty XFontStruct *font_struct Atom atom - unsignedlong *value_return + unsigned long *value_return @@ -4481,7 +4494,8 @@ To draw 8-bit characters in a given drawable, use Display *display Drawable d GC gc - intx, y + int x + int y XTextItem *items int nitems @@ -4576,7 +4590,8 @@ To draw 2-byte characters in a given drawable, use Display *display Drawable d GC gc - intx, y + int x + int y XTextItem16 *items int nitems @@ -4831,7 +4846,8 @@ To draw 2-byte characters in a given drawable, use Display *display Drawable d GC gc - intx, y + int x + int y XChar2b *string int length @@ -4974,7 +4990,8 @@ To draw 8-bit image text characters in a given drawable, use Display *display Drawable d GC gc - intx, y + int x + int y char *string int length @@ -5069,7 +5086,8 @@ To draw 2-byte image text characters in a given drawable, use Display *display Drawable d GC gc - intx, y + int x + int y XChar2b *string int length @@ -5374,7 +5392,8 @@ use XImage *image intsrc_x, src_y intdest_x, dest_y - unsignedintwidth, height + unsigned int width + unsigned int height @@ -5558,9 +5577,11 @@ This function specifically supports rudimentary screen dumps. XImage *XGetImage Display *display Drawable d - intx, y - unsignedintwidth, height - unsignedlong plane_mask + int x + int y + unsigned int width + unsigned int height + unsigned long plane_mask int format @@ -5744,9 +5765,11 @@ to a location within a preexisting image structure, use XImage *XGetSubImage Display *display Drawable d - intx, y - unsignedintwidth, height - unsignedlong plane_mask + int x + int y + unsigned int width + unsigned int height + unsigned long plane_mask int format XImage *dest_image intdest_x, dest_y diff --git a/libX11/specs/libX11/CH09.xml b/libX11/specs/libX11/CH09.xml index d5d93d0a0..6be5285e1 100644 --- a/libX11/specs/libX11/CH09.xml +++ b/libX11/specs/libX11/CH09.xml @@ -42,7 +42,8 @@ There is no way to move a window between screens. Display *display Window w Window parent - intx, y + int x + int y diff --git a/libX11/specs/libX11/CH12.xml b/libX11/specs/libX11/CH12.xml index 43953e16b..42ceb1315 100644 --- a/libX11/specs/libX11/CH12.xml +++ b/libX11/specs/libX11/CH12.xml @@ -166,7 +166,7 @@ To grab the pointer, use Display *display Window grab_window Bool owner_events - unsignedint event_mask + unsigned int event_mask intpointer_mode, keyboard_mode Window confine_to Cursor cursor @@ -498,7 +498,7 @@ To change an active pointer grab, use XChangeActivePointerGrab Display *display - unsignedint event_mask + unsigned int event_mask Cursor cursor Time time @@ -586,11 +586,11 @@ To grab a pointer button, use XGrabButton Display *display - unsignedint button - unsignedint modifiers + unsigned int button + unsigned int modifiers Window grab_window Bool owner_events - unsignedint event_mask + unsigned int event_mask intpointer_mode, keyboard_mode Window confine_to Cursor cursor @@ -829,8 +829,8 @@ To ungrab a pointer button, use XUngrabButton Display *display - unsignedint button - unsignedint modifiers + unsigned int button + unsigned int modifiers Window grab_window @@ -1205,7 +1205,7 @@ To passively grab a single key of the keyboard, use XGrabKey Display *display int keycode - unsignedint modifiers + unsigned int modifiers Window grab_window Bool owner_events intpointer_mode, keyboard_mode @@ -1409,7 +1409,7 @@ To ungrab a key, use XUngrabKey Display *display int keycode - unsignedint modifiers + unsigned int modifiers Window grab_window @@ -1767,7 +1767,8 @@ To move the pointer to an arbitrary point in a window, use Display *display Windowsrc_w, dest_w intsrc_x, src_y - unsignedintsrc_width, src_height + unsigned int src_width + unsigned int src_height intdest_x, dest_y @@ -2328,7 +2329,7 @@ If an error is generated, a subset of the controls may have been altered. XChangeKeyboardControl Display *display - unsignedlong value_mask + unsigned long value_mask XKeyboardControl *values diff --git a/libX11/specs/libX11/CH13.xml b/libX11/specs/libX11/CH13.xml index 096d86097..a471caaa9 100644 --- a/libX11/specs/libX11/CH13.xml +++ b/libX11/specs/libX11/CH13.xml @@ -3555,7 +3555,8 @@ or Display *display Drawable d GC gc - intx, y + int x + int y XmbTextItem *items int nitems @@ -3567,7 +3568,8 @@ or Display *display Drawable d GC gc - intx, y + int x + int y XwcTextItem *items int nitems @@ -3707,7 +3709,8 @@ or Drawable d XFontSet font_set GC gc - intx, y + int x + int y char *string int num_bytes @@ -3720,7 +3723,8 @@ or Drawable d XFontSet font_set GC gc - intx, y + int x + int y wchar_t *string int num_wchars @@ -3853,7 +3857,8 @@ or Drawable d XFontSet font_set GC gc - intx, y + int x + int y char *string int num_bytes @@ -3866,7 +3871,8 @@ or Drawable d XFontSet font_set GC gc - intx, y + int x + int y wchar_t *string int num_wchars diff --git a/libX11/specs/libX11/CH14.xml b/libX11/specs/libX11/CH14.xml index d7bbf5e67..678f979c4 100644 --- a/libX11/specs/libX11/CH14.xml +++ b/libX11/specs/libX11/CH14.xml @@ -419,7 +419,7 @@ To request that a top-level window be reconfigured, use Display *display Window w int screen_number - unsignedint value_mask + unsigned int value_mask XWindowChanges *values diff --git a/libX11/specs/libX11/CH16.xml b/libX11/specs/libX11/CH16.xml index 790cb0118..7253722bc 100644 --- a/libX11/specs/libX11/CH16.xml +++ b/libX11/specs/libX11/CH16.xml @@ -895,7 +895,7 @@ To allocate some memory you will never give back, use char *Xpermalloc - unsignedint size + unsigned int size @@ -930,7 +930,8 @@ To parse standard window geometry strings, use int XParseGeometry char *parsestring int*x_return, *y_return - unsignedint*width_return, *height_return + unsigned int *width_return + unsigned int *height_return @@ -1066,7 +1067,7 @@ To construct a window's geometry information, use int screen char *user_geom char *def_geom - unsignedint bwidth + unsigned int bwidth XSizeHints *hints int*x_return, *y_return int *width_return @@ -1975,7 +1976,8 @@ To determine if a specified point resides in a specified region, use Bool XPointInRegion Region r - intx, y + int x + int y @@ -2033,8 +2035,10 @@ To determine if a specified rectangle is inside a region, use int XRectInRegion Region r - intx, y - unsignedintwidth, height + int x + int y + unsigned int width + unsigned int height @@ -2740,12 +2744,12 @@ structure and initialize it with image format values from a display, use XImage *XCreateImage Display *display Visual *visual - unsignedint depth + unsigned int depth int format int offset char *data - unsignedint width - unsignedint height + unsigned int width + unsigned int height int bitmap_pad int bytes_per_line @@ -2985,7 +2989,7 @@ To set a pixel value in an image, use XImage *ximage int x int y - unsignedlong pixel + unsigned long pixel @@ -3057,8 +3061,8 @@ To create a subimage, use XImage *ximage int x int y - unsignedint subimage_width - unsignedint subimage_height + unsigned int subimage_width + unsigned int subimage_height @@ -3279,7 +3283,8 @@ To read a bitmap from a file and store it in a pixmap, use Display *display Drawable d char *filename - unsignedint*width_return, *height_return + unsigned int *width_return + unsigned int *height_return Pixmap *bitmap_return int*x_hot_return, *y_hot_return @@ -3431,7 +3436,8 @@ To read a bitmap from a file and return it as data, use int XReadBitmapFileData char *filename - unsignedint*width_return, *height_return + unsigned int *width_return + unsigned int *height_return unsignedchar *data_return int*x_hot_return, *y_hot_return @@ -3530,7 +3536,8 @@ To write out a bitmap from a pixmap to a file, use Display *display char *filename Pixmap bitmap - unsignedintwidth, height + unsigned int width + unsigned int height intx_hot, y_hot @@ -3657,9 +3664,10 @@ To create a pixmap and then store bitmap-format data into it, use Display *display Drawable d char *data - unsignedintwidth, height - unsignedlongfg, bg - unsignedint depth + unsigned int width + unsigned int height + unsigned long fg, bg + unsigned int depth @@ -3788,7 +3796,8 @@ in a program directly, as opposed to reading it in every time at run time, use Display *display Drawable d char *data - unsignedintwidth, height + unsigned int width + unsigned int height diff --git a/mesalib/configure.ac b/mesalib/configure.ac index 4646212be..48f5f815e 100644 --- a/mesalib/configure.ac +++ b/mesalib/configure.ac @@ -159,20 +159,13 @@ solaris*) DEFINES="$DEFINES -DHAVE_PTHREAD -DSVR4" ;; cygwin*) - DEFINES="$DEFINES -DHAVE_PTHREAD" + DEFINES="$DEFINES -D_XOPEN_SOURCE=700 -DHAVE_PTHREAD" ;; esac dnl Add flags for gcc and g++ if test "x$GCC" = xyes; then - case "$host_os" in - cygwin*) - CFLAGS="$CFLAGS -Wall -std=gnu99" - ;; - *) - CFLAGS="$CFLAGS -Wall -std=c99" - ;; - esac + CFLAGS="$CFLAGS -Wall -std=c99" # Enable -Werror=implicit-function-declaration and # -Werror=missing-prototypes, if available, or otherwise, just @@ -1992,7 +1985,7 @@ if test -n "$with_gallium_drivers"; then fi if test "x$enable_dri" = xyes; then - GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS dri-swrast" + GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS dri/swrast" fi ;; *) @@ -2196,8 +2189,6 @@ AC_CONFIG_FILES([Makefile src/gallium/state_trackers/Makefile src/gallium/state_trackers/clover/Makefile src/gallium/state_trackers/dri/Makefile - src/gallium/state_trackers/dri/drm/Makefile - src/gallium/state_trackers/dri/sw/Makefile src/gallium/state_trackers/egl/Makefile src/gallium/state_trackers/gbm/Makefile src/gallium/state_trackers/glx/xlib/Makefile @@ -2208,7 +2199,6 @@ AC_CONFIG_FILES([Makefile src/gallium/state_trackers/xa/Makefile src/gallium/state_trackers/xvmc/Makefile src/gallium/targets/Makefile - src/gallium/targets/dri-swrast/Makefile src/gallium/targets/dri/Makefile src/gallium/targets/egl-static/Makefile src/gallium/targets/gbm/Makefile diff --git a/mesalib/docs/index.html b/mesalib/docs/index.html index fc36c3db0..d3882f063 100644 --- a/mesalib/docs/index.html +++ b/mesalib/docs/index.html @@ -16,6 +16,20 @@

News

+

July 7, 2014

+

+Mesa 10.2.3 is released. +This is a bug-fix release. +

+ +

July 5, 2014

+ +

+Mesa demos 8.2.0 is released. +See the announcement for more information about the release. +You can download it from ftp.freedesktop.org/pub/mesa/demos/8.2.0/. +

+

June 24, 2014

Mesa 10.1.6 diff --git a/mesalib/docs/relnotes.html b/mesalib/docs/relnotes.html index 67c19555c..ba88d1a26 100644 --- a/mesalib/docs/relnotes.html +++ b/mesalib/docs/relnotes.html @@ -21,6 +21,7 @@ The release notes summarize what's new or changed in each Mesa release.

    +
  • 10.2.3 release notes
  • 10.2.2 release notes
  • 10.2.1 release notes
  • 10.2 release notes diff --git a/mesalib/docs/relnotes/10.2.3.html b/mesalib/docs/relnotes/10.2.3.html new file mode 100644 index 000000000..a47822898 --- /dev/null +++ b/mesalib/docs/relnotes/10.2.3.html @@ -0,0 +1,130 @@ + + + + + Mesa Release Notes + + + + +
    +

    The Mesa 3D Graphics Library

    +
    + + +
    + +

    Mesa 10.2.3 Release Notes / July 7, 2014

    + +

    +Mesa 10.2.3 is a bug fix release which fixes bugs found since the 10.2.2 release. +

    +

    +Mesa 10.2.3 implements the OpenGL 3.3 API, but the version reported by +glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) / +glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used. +Some drivers don't support all the features required in OpenGL 3.3. OpenGL +3.3 is only available if requested at context creation +because compatibility contexts are not supported. +

    + + +

    SHA256 checksums

    +
    +e482a96170c98b17d6aba0d6e4dda4b9a2e61c39587bb64ac38cadfa4aba4aeb  MesaLib-10.2.3.tar.bz2
    +96cffacaa1c52ae659b3b0f91be2eebf5528b748934256751261fb79ea3d6636  MesaLib-10.2.3.tar.gz
    +82cab6ff14c8038ee39842dbdea0d447a78d119efd8d702d1497bc7c246434e9  MesaLib-10.2.3.zip
    +
    + + +

    New features

    +

    None

    + +

    Bug fixes

    + +

    This list is likely incomplete.

    + + + +

    Changes

    + +

    Aaron Watry (1):

    +
      +
    • radeon/llvm: Allocate space for kernel metadata operands
    • +
    + +

    Carl Worth (2):

    +
      +
    • docs: Add sha256 sums for the 10.2.2 release
    • +
    • cherry-ignore: Add a patch that's been rejected
    • +
    + +

    Ilia Mirkin (4):

    +
      +
    • nouveau: dup fd before passing it to device
    • +
    • nv50: disable dedicated ubo upload method
    • +
    • nv50: do an explicit flush on draw when there are persistent buffers
    • +
    • nvc0: add a memory barrier when there are persistent UBOs
    • +
    + +

    Jasper St. Pierre (1):

    +
      +
    • glxext: Send the Drawable's ID in the GLX_BufferSwapComplete event
    • +
    + +

    Kenneth Graunke (3):

    +
      +
    • i965: Don't emit SURFACE_STATEs for gather workarounds on Broadwell.
    • +
    • i965: Include marketing names for Broadwell GPUs.
    • +
    • i965/disasm: Fix INTEL_DEBUG=fs on Broadwell for ARB_fp applications.
    • +
    + +

    Michel Dänzer (1):

    +
      +
    • radeon/llvm: Use the llvm.rsq.clamped intrinsic for RSQ
    • +
    + +

    Rob Clark (9):

    +
      +
    • xa: fix segfault
    • +
    • freedreno: use OUT_RELOCW when buffer is written
    • +
    • freedreno/a3xx: fix depth/stencil GMEM positioning
    • +
    • freedreno/a3xx: fix depth/stencil gmem restore
    • +
    • freedreno/a3xx: fix blend opcode
    • +
    • freedreno: few caps fixes
    • +
    • freedreno/a3xx: texture fixes
    • +
    • freedreno: fix for null textures
    • +
    • freedreno/a3xx: vtx formats
    • +
    + +

    Roland Scheidegger (1):

    +
      +
    • draw: (trivial) fix clamping of viewport index
    • +
    + +

    Takashi Iwai (1):

    +
      +
    • llvmpipe: Fix zero-division in llvmpipe_texture_layout()
    • +
    + +

    Thomas Hellstrom (1):

    +
      +
    • st/xa: Don't close the drm fd on failure v2
    • +
    + +

    Tobias Klausmann (1):

    +
      +
    • nv50/ir: allow gl_ViewportIndex to work on non-provoking vertices
    • +
    + +
    + + diff --git a/mesalib/src/gallium/Automake.inc b/mesalib/src/gallium/Automake.inc index e70a1363e..73d65a4d1 100644 --- a/mesalib/src/gallium/Automake.inc +++ b/mesalib/src/gallium/Automake.inc @@ -26,19 +26,6 @@ GALLIUM_DRIVER_CXXFLAGS = \ $(DEFINES) \ $(VISIBILITY_CXXFLAGS) -GALLIUM_DRI_CFLAGS = \ - -I$(top_srcdir)/include \ - -I$(top_srcdir)/src/gallium/include \ - -I$(top_srcdir)/src/gallium/auxiliary \ - -I$(top_srcdir)/src/gallium/drivers \ - -I$(top_srcdir)/src/gallium/winsys \ - -I$(top_srcdir)/src/mesa \ - -I$(top_srcdir)/src/mapi \ - $(DEFINES) \ - $(PTHREAD_CFLAGS) \ - $(LIBDRM_CFLAGS) \ - $(VISIBILITY_CFLAGS) - GALLIUM_TARGET_CFLAGS = \ -I$(top_srcdir)/include \ -I$(top_srcdir)/src/loader \ @@ -51,35 +38,12 @@ GALLIUM_TARGET_CFLAGS = \ $(LIBDRM_CFLAGS) \ $(VISIBILITY_CFLAGS) - -GALLIUM_DRI_LINKER_FLAGS = \ - -shared \ - -shrext .so \ - -module \ - -avoid-version \ - $(GC_SECTIONS) - -if HAVE_LD_VERSION_SCRIPT -GALLIUM_DRI_LINKER_FLAGS += \ - -Wl,--version-script=$(top_srcdir)/src/gallium/targets/dri/dri.sym - -endif - - GALLIUM_COMMON_LIB_DEPS = \ -lm \ $(CLOCK_LIB) \ $(PTHREAD_LIBS) \ $(DLOPEN_LIBS) -GALLIUM_DRI_LIB_DEPS = \ - $(top_builddir)/src/mesa/libmesagallium.la \ - $(top_builddir)/src/gallium/auxiliary/libgallium.la \ - $(SELINUX_LIBS) \ - $(LIBDRM_LIBS) \ - $(EXPAT_LIBS) \ - $(GALLIUM_COMMON_LIB_DEPS) - GALLIUM_WINSYS_CFLAGS = \ -I$(top_srcdir)/include \ -I$(top_srcdir)/src/gallium/include \ @@ -87,11 +51,6 @@ GALLIUM_WINSYS_CFLAGS = \ $(DEFINES) \ $(VISIBILITY_CFLAGS) -if HAVE_MESA_LLVM -GALLIUM_DRI_LINKER_FLAGS += $(LLVM_LDFLAGS) -GALLIUM_DRI_LIB_DEPS += $(LLVM_LIBS) -endif - GALLIUM_PIPE_LOADER_WINSYS_LIBS = \ $(top_builddir)/src/gallium/winsys/sw/null/libws_null.la diff --git a/mesalib/src/gallium/SConscript b/mesalib/src/gallium/SConscript index df71b9aea..8d9849e00 100644 --- a/mesalib/src/gallium/SConscript +++ b/mesalib/src/gallium/SConscript @@ -107,7 +107,6 @@ if not env['embedded']: if env['dri']: SConscript([ - 'targets/dri-swrast/SConscript', 'targets/dri/SConscript', ]) diff --git a/mesalib/src/gallium/auxiliary/util/u_blitter.c b/mesalib/src/gallium/auxiliary/util/u_blitter.c index db0d1b894..20fbd80d5 100644 --- a/mesalib/src/gallium/auxiliary/util/u_blitter.c +++ b/mesalib/src/gallium/auxiliary/util/u_blitter.c @@ -383,6 +383,15 @@ void util_blitter_destroy(struct blitter_context *blitter) if (ctx->fs_texfetch_stencil[i]) ctx->delete_fs_state(pipe, ctx->fs_texfetch_stencil[i]); + if (ctx->fs_texfetch_col_msaa[i]) + ctx->delete_fs_state(pipe, ctx->fs_texfetch_col_msaa[i]); + if (ctx->fs_texfetch_depth_msaa[i]) + ctx->delete_fs_state(pipe, ctx->fs_texfetch_depth_msaa[i]); + if (ctx->fs_texfetch_depthstencil_msaa[i]) + ctx->delete_fs_state(pipe, ctx->fs_texfetch_depthstencil_msaa[i]); + if (ctx->fs_texfetch_stencil_msaa[i]) + ctx->delete_fs_state(pipe, ctx->fs_texfetch_stencil_msaa[i]); + for (j = 0; j< Elements(ctx->fs_resolve[i]); j++) for (f = 0; f < 2; f++) if (ctx->fs_resolve[i][j][f]) diff --git a/mesalib/src/gallium/auxiliary/util/u_transfer.c b/mesalib/src/gallium/auxiliary/util/u_transfer.c index 7804f2a82..71da35d6d 100644 --- a/mesalib/src/gallium/auxiliary/util/u_transfer.c +++ b/mesalib/src/gallium/auxiliary/util/u_transfer.c @@ -25,8 +25,8 @@ void u_default_transfer_inline_write( struct pipe_context *pipe, usage |= PIPE_TRANSFER_WRITE; /* transfer_inline_write implicitly discards the rewritten buffer range */ - /* XXX this looks very broken for non-buffer resources having more than one dim. */ - if (box->x == 0 && box->width == resource->width0) { + if (resource->target == PIPE_BUFFER && + box->x == 0 && box->width == resource->width0) { usage |= PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE; } else { usage |= PIPE_TRANSFER_DISCARD_RANGE; diff --git a/mesalib/src/glsl/ast_type.cpp b/mesalib/src/glsl/ast_type.cpp index de4c1a410..b596cd59e 100644 --- a/mesalib/src/glsl/ast_type.cpp +++ b/mesalib/src/glsl/ast_type.cpp @@ -168,6 +168,16 @@ ast_type_qualifier::merge_qualifier(YYLTYPE *loc, this->max_vertices = q.max_vertices; } + if (q.flags.q.invocations) { + if (this->flags.q.invocations && this->invocations != q.invocations) { + _mesa_glsl_error(loc, state, + "geometry shader set conflicting invocations " + "(%d and %d)", this->invocations, q.invocations); + return false; + } + this->invocations = q.invocations; + } + if (state->stage == MESA_SHADER_GEOMETRY && state->has_explicit_attrib_stream()) { if (q.flags.q.stream && q.stream >= state->ctx->Const.MaxVertexStreams) { diff --git a/mesalib/src/glsl/glcpp/glcpp-lex.l b/mesalib/src/glsl/glcpp/glcpp-lex.l index 188e45466..a1a8e76af 100644 --- a/mesalib/src/glsl/glcpp/glcpp-lex.l +++ b/mesalib/src/glsl/glcpp/glcpp-lex.l @@ -76,6 +76,7 @@ NEWLINE [\n] HSPACE [ \t] HASH ^{HSPACE}*#{HSPACE}* IDENTIFIER [_a-zA-Z][_a-zA-Z0-9]* +PP_NUMBER [.]?[0-9]([._a-zA-Z0-9]|[eEpP][-+])* PUNCTUATION [][(){}.&*~!/%<>^|;,=+-] /* The OTHER class is simply a catch-all for things that the CPP @@ -137,14 +138,15 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]? * 2. The skip_stack is NULL meaning that we've reached * the last #endif. * - * 3. The lexing_if bit is set. This indicates that we - * are lexing the expression following an "#if" of - * "#elif". Even inside an "#if 0" we need to lex this - * expression so the parser can correctly update the - * skip_stack state. + * 3. The lexing_directive bit is set. This indicates that we are + * lexing a pre-processor directive, (such as #if, #elif, or + * #else). For the #if and #elif directives we always need to + * parse the conditions, (even if otherwise within an #if + * 0). And for #else, we want to be able to generate an error + * if any garbage follows #else. */ if (YY_START == INITIAL || YY_START == SKIP) { - if (parser->lexing_if || + if (parser->lexing_directive || parser->skip_stack == NULL || parser->skip_stack->type == SKIP_NO_SKIP) { @@ -178,7 +180,7 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]? /* glcpp doesn't handle #extension, #version, or #pragma directives. * Simply pass them through to the main compiler's lexer/parser. */ -{HASH}(extension|pragma)[^\n]+ { +{HASH}(extension|pragma)[^\n]* { if (parser->commented_newlines) BEGIN NEWLINE_CATCHUP; yylval->str = ralloc_strdup (yyextra, yytext); @@ -193,25 +195,25 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]? { {HASH}ifdef { - yyextra->lexing_if = 1; + yyextra->lexing_directive = 1; yyextra->space_tokens = 0; return HASH_IFDEF; } {HASH}ifndef { - yyextra->lexing_if = 1; + yyextra->lexing_directive = 1; yyextra->space_tokens = 0; return HASH_IFNDEF; } {HASH}if/[^_a-zA-Z0-9] { - yyextra->lexing_if = 1; + yyextra->lexing_directive = 1; yyextra->space_tokens = 0; return HASH_IF; } {HASH}elif/[^_a-zA-Z0-9] { - yyextra->lexing_if = 1; + yyextra->lexing_directive = 1; yyextra->space_tokens = 0; return HASH_ELIF; } @@ -329,6 +331,11 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]? return IDENTIFIER; } +{PP_NUMBER} { + yylval->str = ralloc_strdup (yyextra, yytext); + return OTHER; +} + {PUNCTUATION} { return yytext[0]; } @@ -348,7 +355,7 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]? if (parser->commented_newlines) { BEGIN NEWLINE_CATCHUP; } - yyextra->lexing_if = 0; + yyextra->lexing_directive = 0; yylineno++; yycolumn = 0; return NEWLINE; @@ -357,7 +364,7 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]? /* Handle missing newline at EOF. */ <> { BEGIN DONE; /* Don't keep matching this rule forever. */ - yyextra->lexing_if = 0; + yyextra->lexing_directive = 0; return NEWLINE; } diff --git a/mesalib/src/glsl/glcpp/glcpp-parse.y b/mesalib/src/glsl/glcpp/glcpp-parse.y index ccf810559..084078eb0 100644 --- a/mesalib/src/glsl/glcpp/glcpp-parse.y +++ b/mesalib/src/glsl/glcpp/glcpp-parse.y @@ -166,7 +166,8 @@ add_builtin_define(glcpp_parser_t *parser, const char *name, int value); %expect 0 %token COMMA_FINAL DEFINED ELIF_EXPANDED HASH HASH_DEFINE FUNC_IDENTIFIER OBJ_IDENTIFIER HASH_ELIF HASH_ELSE HASH_ENDIF HASH_IF HASH_IFDEF HASH_IFNDEF HASH_LINE HASH_UNDEF HASH_VERSION IDENTIFIER IF_EXPANDED INTEGER INTEGER_STRING LINE_EXPANDED NEWLINE OTHER PLACEHOLDER SPACE %token PASTE -%type expression INTEGER operator SPACE integer_constant +%type INTEGER operator SPACE integer_constant +%type expression %type IDENTIFIER FUNC_IDENTIFIER OBJ_IDENTIFIER INTEGER_STRING OTHER %type identifier_list %type preprocessing_token conditional_token @@ -216,10 +217,14 @@ line: expanded_line: IF_EXPANDED expression NEWLINE { - _glcpp_parser_skip_stack_push_if (parser, & @1, $2); + if (parser->is_gles && $2.undefined_macro) + glcpp_error(& @1, parser, "undefined macro %s in expression (illegal in GLES)", $2.undefined_macro); + _glcpp_parser_skip_stack_push_if (parser, & @1, $2.value); } | ELIF_EXPANDED expression NEWLINE { - _glcpp_parser_skip_stack_change_if (parser, & @1, "elif", $2); + if (parser->is_gles && $2.undefined_macro) + glcpp_error(& @1, parser, "undefined macro %s in expression (illegal in GLES)", $2.undefined_macro); + _glcpp_parser_skip_stack_change_if (parser, & @1, "elif", $2.value); } | LINE_EXPANDED integer_constant NEWLINE { parser->has_new_line_number = 1; @@ -260,7 +265,14 @@ control_line: | HASH_UNDEF { glcpp_parser_resolve_implicit_version(parser); } IDENTIFIER NEWLINE { - macro_t *macro = hash_table_find (parser->defines, $3); + macro_t *macro; + if (strcmp("__LINE__", $3) == 0 + || strcmp("__FILE__", $3) == 0 + || strcmp("__VERSION__", $3) == 0) + glcpp_error(& @1, parser, "Built-in (pre-defined)" + " macro names can not be undefined."); + + macro = hash_table_find (parser->defines, $3); if (macro) { hash_table_remove (parser->defines, $3); ralloc_free (macro); @@ -358,7 +370,7 @@ control_line: glcpp_warning(& @1, parser, "ignoring illegal #elif without expression"); } } -| HASH_ELSE { +| HASH_ELSE { parser->lexing_directive = 1; } NEWLINE { if (parser->skip_stack && parser->skip_stack->has_else) { @@ -370,7 +382,7 @@ control_line: if (parser->skip_stack) parser->skip_stack->has_else = true; } - } NEWLINE + } | HASH_ENDIF { _glcpp_parser_skip_stack_pop (parser, & @1); } NEWLINE @@ -406,87 +418,176 @@ integer_constant: } expression: - integer_constant + integer_constant { + $$.value = $1; + $$.undefined_macro = NULL; + } | IDENTIFIER { + $$.value = 0; if (parser->is_gles) - glcpp_error(& @1, parser, "undefined macro %s in expression (illegal in GLES)", $1); - $$ = 0; + $$.undefined_macro = ralloc_strdup (parser, $1); + else + $$.undefined_macro = NULL; } | expression OR expression { - $$ = $1 || $3; + $$.value = $1.value || $3.value; + + /* Short-circuit: Only flag undefined from right side + * if left side evaluates to false. + */ + if ($1.undefined_macro) + $$.undefined_macro = $1.undefined_macro; + else if (! $1.value) + $$.undefined_macro = $3.undefined_macro; } | expression AND expression { - $$ = $1 && $3; + $$.value = $1.value && $3.value; + + /* Short-circuit: Only flag undefined from right-side + * if left side evaluates to true. + */ + if ($1.undefined_macro) + $$.undefined_macro = $1.undefined_macro; + else if ($1.value) + $$.undefined_macro = $3.undefined_macro; } | expression '|' expression { - $$ = $1 | $3; + $$.value = $1.value | $3.value; + if ($1.undefined_macro) + $$.undefined_macro = $1.undefined_macro; + else + $$.undefined_macro = $3.undefined_macro; } | expression '^' expression { - $$ = $1 ^ $3; + $$.value = $1.value ^ $3.value; + if ($1.undefined_macro) + $$.undefined_macro = $1.undefined_macro; + else + $$.undefined_macro = $3.undefined_macro; } | expression '&' expression { - $$ = $1 & $3; + $$.value = $1.value & $3.value; + if ($1.undefined_macro) + $$.undefined_macro = $1.undefined_macro; + else + $$.undefined_macro = $3.undefined_macro; } | expression NOT_EQUAL expression { - $$ = $1 != $3; + $$.value = $1.value != $3.value; + if ($1.undefined_macro) + $$.undefined_macro = $1.undefined_macro; + else + $$.undefined_macro = $3.undefined_macro; } | expression EQUAL expression { - $$ = $1 == $3; + $$.value = $1.value == $3.value; + if ($1.undefined_macro) + $$.undefined_macro = $1.undefined_macro; + else + $$.undefined_macro = $3.undefined_macro; } | expression GREATER_OR_EQUAL expression { - $$ = $1 >= $3; + $$.value = $1.value >= $3.value; + if ($1.undefined_macro) + $$.undefined_macro = $1.undefined_macro; + else + $$.undefined_macro = $3.undefined_macro; } | expression LESS_OR_EQUAL expression { - $$ = $1 <= $3; + $$.value = $1.value <= $3.value; + if ($1.undefined_macro) + $$.undefined_macro = $1.undefined_macro; + else + $$.undefined_macro = $3.undefined_macro; } | expression '>' expression { - $$ = $1 > $3; + $$.value = $1.value > $3.value; + if ($1.undefined_macro) + $$.undefined_macro = $1.undefined_macro; + else + $$.undefined_macro = $3.undefined_macro; } | expression '<' expression { - $$ = $1 < $3; + $$.value = $1.value < $3.value; + if ($1.undefined_macro) + $$.undefined_macro = $1.undefined_macro; + else + $$.undefined_macro = $3.undefined_macro; } | expression RIGHT_SHIFT expression { - $$ = $1 >> $3; + $$.value = $1.value >> $3.value; + if ($1.undefined_macro) + $$.undefined_macro = $1.undefined_macro; + else + $$.undefined_macro = $3.undefined_macro; } | expression LEFT_SHIFT expression { - $$ = $1 << $3; + $$.value = $1.value << $3.value; + if ($1.undefined_macro) + $$.undefined_macro = $1.undefined_macro; + else + $$.undefined_macro = $3.undefined_macro; } | expression '-' expression { - $$ = $1 - $3; + $$.value = $1.value - $3.value; + if ($1.undefined_macro) + $$.undefined_macro = $1.undefined_macro; + else + $$.undefined_macro = $3.undefined_macro; } | expression '+' expression { - $$ = $1 + $3; + $$.value = $1.value + $3.value; + if ($1.undefined_macro) + $$.undefined_macro = $1.undefined_macro; + else + $$.undefined_macro = $3.undefined_macro; } | expression '%' expression { - if ($3 == 0) { + if ($3.value == 0) { yyerror (& @1, parser, "zero modulus in preprocessor directive"); } else { - $$ = $1 % $3; + $$.value = $1.value % $3.value; } + if ($1.undefined_macro) + $$.undefined_macro = $1.undefined_macro; + else + $$.undefined_macro = $3.undefined_macro; } | expression '/' expression { - if ($3 == 0) { + if ($3.value == 0) { yyerror (& @1, parser, "division by 0 in preprocessor directive"); } else { - $$ = $1 / $3; + $$.value = $1.value / $3.value; } + if ($1.undefined_macro) + $$.undefined_macro = $1.undefined_macro; + else + $$.undefined_macro = $3.undefined_macro; } | expression '*' expression { - $$ = $1 * $3; + $$.value = $1.value * $3.value; + if ($1.undefined_macro) + $$.undefined_macro = $1.undefined_macro; + else + $$.undefined_macro = $3.undefined_macro; } | '!' expression %prec UNARY { - $$ = ! $2; + $$.value = ! $2.value; + $$.undefined_macro = $2.undefined_macro; } | '~' expression %prec UNARY { - $$ = ~ $2; + $$.value = ~ $2.value; + $$.undefined_macro = $2.undefined_macro; } | '-' expression %prec UNARY { - $$ = - $2; + $$.value = - $2.value; + $$.undefined_macro = $2.undefined_macro; } | '+' expression %prec UNARY { - $$ = + $2; + $$.value = + $2.value; + $$.undefined_macro = $2.undefined_macro; } | '(' expression ')' { $$ = $2; @@ -525,7 +626,7 @@ replacement_list: junk: /* empty */ | pp_tokens { - glcpp_warning(&@1, parser, "extra tokens at end of directive"); + glcpp_error(&@1, parser, "extra tokens at end of directive"); } ; @@ -933,14 +1034,16 @@ _token_list_equal_ignoring_space (token_list_t *a, token_list_t *b) if (node_a == NULL || node_b == NULL) return 0; - - if (node_a->token->type == SPACE) { - node_a = node_a->next; - continue; - } - - if (node_b->token->type == SPACE) { - node_b = node_b->next; + /* Make sure whitespace appears in the same places in both. + * It need not be exactly the same amount of whitespace, + * though. + */ + if (node_a->token->type == SPACE + && node_b->token->type == SPACE) { + while (node_a->token->type == SPACE) + node_a = node_a->next; + while (node_b->token->type == SPACE) + node_b = node_b->next; continue; } @@ -1203,7 +1306,7 @@ glcpp_parser_create (const struct gl_extensions *extensions, gl_api api) parser->defines = hash_table_ctor (32, hash_table_string_hash, hash_table_string_compare); parser->active = NULL; - parser->lexing_if = 0; + parser->lexing_directive = 0; parser->space_tokens = 1; parser->newline_as_space = 0; parser->in_control_line = 0; diff --git a/mesalib/src/glsl/glcpp/glcpp.h b/mesalib/src/glsl/glcpp/glcpp.h index 79ccb234f..64b487202 100644 --- a/mesalib/src/glsl/glcpp/glcpp.h +++ b/mesalib/src/glsl/glcpp/glcpp.h @@ -37,6 +37,12 @@ /* Some data types used for parser values. */ +typedef struct expression_value { + intmax_t value; + char *undefined_macro; +} expression_value_t; + + typedef struct string_node { const char *str; struct string_node *next; @@ -53,6 +59,7 @@ typedef struct token_list token_list_t; typedef union YYSTYPE { intmax_t ival; + expression_value_t expression_value; char *str; string_list_t *string_list; token_t *token; @@ -168,7 +175,7 @@ struct glcpp_parser { yyscan_t scanner; struct hash_table *defines; active_list_t *active; - int lexing_if; + int lexing_directive; int space_tokens; int newline_as_space; int in_control_line; diff --git a/mesalib/src/glsl/list.h b/mesalib/src/glsl/list.h index 922bd68ab..a4444bda9 100644 --- a/mesalib/src/glsl/list.h +++ b/mesalib/src/glsl/list.h @@ -565,9 +565,9 @@ inline void exec_node::insert_before(exec_list *before) !(__inst)->is_tail_sentinel(); \ (__inst) = (__type *)(__inst)->next) -#define foreach_in_list_reverse(__type, __inst, __list) \ - for (__type *(__inst) = (__type *)(__list)->head; \ - !(__inst)->is_head_sentinel(); \ +#define foreach_in_list_reverse(__type, __inst, __list) \ + for (__type *(__inst) = (__type *)(__list)->tail_pred; \ + !(__inst)->is_head_sentinel(); \ (__inst) = (__type *)(__inst)->prev) /** diff --git a/mesalib/src/mesa/drivers/common/meta.c b/mesalib/src/mesa/drivers/common/meta.c index f1f57297c..89d7a157c 100644 --- a/mesalib/src/mesa/drivers/common/meta.c +++ b/mesalib/src/mesa/drivers/common/meta.c @@ -217,6 +217,7 @@ _mesa_meta_compile_and_link_program(struct gl_context *ctx, fs_source); *program = _mesa_CreateProgram(); + _mesa_ObjectLabel(GL_PROGRAM, *program, -1, name); _mesa_AttachShader(*program, fs); _mesa_DeleteShader(fs); _mesa_AttachShader(*program, vs); @@ -224,7 +225,6 @@ _mesa_meta_compile_and_link_program(struct gl_context *ctx, _mesa_BindAttribLocation(*program, 0, "position"); _mesa_BindAttribLocation(*program, 1, "texcoords"); _mesa_meta_link_program_with_debug(ctx, *program); - _mesa_ObjectLabel(GL_PROGRAM, *program, -1, name); _mesa_UseProgram(*program); } diff --git a/mesalib/src/mesa/drivers/dri/common/SConscript b/mesalib/src/mesa/drivers/dri/common/SConscript index 41f6356c3..d003139bf 100644 --- a/mesalib/src/mesa/drivers/dri/common/SConscript +++ b/mesalib/src/mesa/drivers/dri/common/SConscript @@ -27,58 +27,50 @@ drienv.Replace(CPPPATH = [ '#src/egl/drivers/dri', ]) -driswenv = drienv.Clone() -driswenv.Append(CPPDEFINES = [ - '__NOT_HAVE_DRM_H', - 'HAVE_DLADDR', +drienv.AppendUnique(LIBS = [ + 'expat', ]) +# if HAVE_DRI2 drienv.PkgUseModules('DRM') +# else +#env.Append(CPPDEFINES = ['__NOT_HAVE_DRM_H']) -dri_common_utils = drienv.SharedObject( - target = 'utils.o', - source = '#src/mesa/drivers/dri/common/utils.c' -) +sources = drienv.ParseSourceList('Makefile.sources', 'DRI_COMMON_FILES') -dri_common_xmlconfig = drienv.SharedObject( - target = 'xmlconfig.o', - source = '#src/mesa/drivers/dri/common/xmlconfig.c' +dri_common = drienv.ConvenienceLibrary( + target = 'dri_common', + source = sources, ) -dri_common_dri_util = drienv.SharedObject( - target = 'dri_util.o', - source = '#src/mesa/drivers/dri/common/dri_util.c' -) - -dri_common_drisw_util = driswenv.SharedObject( - target = 'drisw_util.o', - source = '#src/mesa/drivers/dri/common/dri_util.c' -) +# +# megadrivers_stub +# +env = env.Clone() +env.Append(CPPPATH = [ + '#/include', + '#/src/', + '#/src/mapi', + '#/src/mesa', +]) -COMMON_DRI_SW_OBJECTS = [ - dri_common_utils, - dri_common_xmlconfig, - dri_common_drisw_util, -] +env.Append(CPPDEFINES = [ + '__NOT_HAVE_DRM_H', + 'HAVE_DLADDR', +]) -COMMON_DRI_DRM_OBJECTS = [ - dri_common_utils, - dri_common_xmlconfig, - dri_common_dri_util, -] +sources = env.ParseSourceList('Makefile.sources', 'megadriver_stub_FILES') -drienv.AppendUnique(LIBS = [ - 'expat', -]) +megadrivers_stub = env.ConvenienceLibrary( + target = 'megadrivers_stub', + source = sources, +) -driswenv.AppendUnique(LIBS = [ - 'expat', -]) +env.Alias('megadrivers_stub', megadrivers_stub) Export([ 'drienv', - 'driswenv', - 'COMMON_DRI_SW_OBJECTS', - 'COMMON_DRI_DRM_OBJECTS', + 'dri_common', + 'megadrivers_stub', ]) diff --git a/mesalib/src/mesa/main/context.c b/mesalib/src/mesa/main/context.c index b08215950..50aae8bf6 100644 --- a/mesalib/src/mesa/main/context.c +++ b/mesalib/src/mesa/main/context.c @@ -1215,6 +1215,9 @@ _mesa_free_context_data( struct gl_context *ctx ) _mesa_reference_vertprog(ctx, &ctx->VertexProgram._Current, NULL); _mesa_reference_vertprog(ctx, &ctx->VertexProgram._TnlProgram, NULL); + _mesa_reference_geomprog(ctx, &ctx->GeometryProgram.Current, NULL); + _mesa_reference_geomprog(ctx, &ctx->GeometryProgram._Current, NULL); + _mesa_reference_fragprog(ctx, &ctx->FragmentProgram.Current, NULL); _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._Current, NULL); _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._TexEnvProgram, NULL); diff --git a/mesalib/src/mesa/main/ff_fragment_shader.cpp b/mesalib/src/mesa/main/ff_fragment_shader.cpp index 2c4f3d7df..8758b5e9d 100644 --- a/mesalib/src/mesa/main/ff_fragment_shader.cpp +++ b/mesalib/src/mesa/main/ff_fragment_shader.cpp @@ -914,54 +914,54 @@ static void load_texture( texenv_fragment_program *p, GLuint unit ) switch (texTarget) { case TEXTURE_1D_INDEX: if (p->state->unit[unit].shadow) - sampler_type = p->shader->symbols->get_type("sampler1DShadow"); + sampler_type = glsl_type::sampler1DShadow_type; else - sampler_type = p->shader->symbols->get_type("sampler1D"); + sampler_type = glsl_type::sampler1D_type; coords = 1; break; case TEXTURE_1D_ARRAY_INDEX: if (p->state->unit[unit].shadow) - sampler_type = p->shader->symbols->get_type("sampler1DArrayShadow"); + sampler_type = glsl_type::sampler1DArrayShadow_type; else - sampler_type = p->shader->symbols->get_type("sampler1DArray"); + sampler_type = glsl_type::sampler1DArray_type; coords = 2; break; case TEXTURE_2D_INDEX: if (p->state->unit[unit].shadow) - sampler_type = p->shader->symbols->get_type("sampler2DShadow"); + sampler_type = glsl_type::sampler2DShadow_type; else - sampler_type = p->shader->symbols->get_type("sampler2D"); + sampler_type = glsl_type::sampler2D_type; coords = 2; break; case TEXTURE_2D_ARRAY_INDEX: if (p->state->unit[unit].shadow) - sampler_type = p->shader->symbols->get_type("sampler2DArrayShadow"); + sampler_type = glsl_type::sampler2DArrayShadow_type; else - sampler_type = p->shader->symbols->get_type("sampler2DArray"); + sampler_type = glsl_type::sampler2DArray_type; coords = 3; break; case TEXTURE_RECT_INDEX: if (p->state->unit[unit].shadow) - sampler_type = p->shader->symbols->get_type("sampler2DRectShadow"); + sampler_type = glsl_type::sampler2DRectShadow_type; else - sampler_type = p->shader->symbols->get_type("sampler2DRect"); + sampler_type = glsl_type::sampler2DRect_type; coords = 2; break; case TEXTURE_3D_INDEX: assert(!p->state->unit[unit].shadow); - sampler_type = p->shader->symbols->get_type("sampler3D"); + sampler_type = glsl_type::sampler3D_type; coords = 3; break; case TEXTURE_CUBE_INDEX: if (p->state->unit[unit].shadow) - sampler_type = p->shader->symbols->get_type("samplerCubeShadow"); + sampler_type = glsl_type::samplerCubeShadow_type; else - sampler_type = p->shader->symbols->get_type("samplerCube"); + sampler_type = glsl_type::samplerCube_type; coords = 3; break; case TEXTURE_EXTERNAL_INDEX: assert(!p->state->unit[unit].shadow); - sampler_type = p->shader->symbols->get_type("samplerExternalOES"); + sampler_type = glsl_type::samplerExternalOES_type; coords = 2; break; } @@ -1241,7 +1241,7 @@ create_new_program(struct gl_context *ctx, struct state_key *key) state->symbols->add_function(main_f); ir_function_signature *main_sig = - new(p.mem_ctx) ir_function_signature(p.shader->symbols->get_type("void")); + new(p.mem_ctx) ir_function_signature(glsl_type::void_type); main_sig->is_defined = true; main_f->add_signature(main_sig); diff --git a/mesalib/src/mesa/main/multisample.c b/mesalib/src/mesa/main/multisample.c index 599cdee74..1f3fa0c15 100644 --- a/mesalib/src/mesa/main/multisample.c +++ b/mesalib/src/mesa/main/multisample.c @@ -89,7 +89,7 @@ _mesa_GetMultisamplefv(GLenum pname, GLuint index, GLfloat * val) /* winsys FBOs are upside down */ if (_mesa_is_winsys_fbo(ctx->DrawBuffer)) - val[1] = 1 - val[1]; + val[1] = 1.0f - val[1]; return; } diff --git a/mesalib/src/mesa/main/shared.c b/mesalib/src/mesa/main/shared.c index dc22025c2..5ae7014b1 100644 --- a/mesalib/src/mesa/main/shared.c +++ b/mesalib/src/mesa/main/shared.c @@ -312,6 +312,7 @@ free_shared_state(struct gl_context *ctx, struct gl_shared_state *shared) _mesa_DeleteHashTable(shared->Programs); _mesa_reference_vertprog(ctx, &shared->DefaultVertexProgram, NULL); + _mesa_reference_geomprog(ctx, &shared->DefaultGeometryProgram, NULL); _mesa_reference_fragprog(ctx, &shared->DefaultFragmentProgram, NULL); _mesa_HashDeleteAll(shared->ATIShaders, delete_fragshader_cb, ctx); diff --git a/mesalib/src/mesa/state_tracker/st_atom_blend.c b/mesalib/src/mesa/state_tracker/st_atom_blend.c index 50d240a7b..064e0c14f 100644 --- a/mesalib/src/mesa/state_tracker/st_atom_blend.c +++ b/mesalib/src/mesa/state_tracker/st_atom_blend.c @@ -263,16 +263,13 @@ update_blend( struct st_context *st ) blend->rt[i].colormask |= PIPE_MASK_A; } - if (ctx->Color.DitherFlag) - blend->dither = 1; + blend->dither = ctx->Color.DitherFlag; if (ctx->Multisample.Enabled) { /* unlike in gallium/d3d10 these operations are only performed if msaa is enabled */ - if (ctx->Multisample.SampleAlphaToCoverage) - blend->alpha_to_coverage = 1; - if (ctx->Multisample.SampleAlphaToOne) - blend->alpha_to_one = 1; + blend->alpha_to_coverage = ctx->Multisample.SampleAlphaToCoverage; + blend->alpha_to_one = ctx->Multisample.SampleAlphaToOne; } cso_set_blend(st->cso_context, blend); diff --git a/mesalib/src/mesa/state_tracker/st_atom_rasterizer.c b/mesalib/src/mesa/state_tracker/st_atom_rasterizer.c index ee5e9e574..2bad64334 100644 --- a/mesalib/src/mesa/state_tracker/st_atom_rasterizer.c +++ b/mesalib/src/mesa/state_tracker/st_atom_rasterizer.c @@ -245,7 +245,7 @@ static void update_raster_state( struct st_context *st ) } /* _NEW_TRANSFORM */ - raster->depth_clip = ctx->Transform.DepthClamp == GL_FALSE; + raster->depth_clip = !ctx->Transform.DepthClamp; raster->clip_plane_enable = ctx->Transform.ClipPlanesEnabled; cso_set_rasterizer(st->cso_context, raster); diff --git a/mesalib/src/mesa/state_tracker/st_atom_shader.c b/mesalib/src/mesa/state_tracker/st_atom_shader.c index 67c615713..6515a98a3 100644 --- a/mesalib/src/mesa/state_tracker/st_atom_shader.c +++ b/mesalib/src/mesa/state_tracker/st_atom_shader.c @@ -89,6 +89,10 @@ update_fp( struct st_context *st ) key.clamp_color = st->clamp_frag_color_in_shader && st->ctx->Color._ClampFragmentColor; + /* Ignore sample qualifier while computing this flag. */ + key.persample_shading = + _mesa_get_min_invocations_per_fragment(st->ctx, &stfp->Base, true) > 1; + st->fp_variant = st_get_fp_variant(st, stfp, &key); st_reference_fragprog(st, &st->fp, stfp); @@ -108,7 +112,7 @@ update_fp( struct st_context *st ) const struct st_tracked_state st_update_fp = { "st_update_fp", /* name */ { /* dirty */ - _NEW_BUFFERS, /* mesa */ + _NEW_BUFFERS | _NEW_MULTISAMPLE, /* mesa */ ST_NEW_FRAGMENT_PROGRAM /* st */ }, update_fp /* update */ diff --git a/mesalib/src/mesa/state_tracker/st_cb_msaa.c b/mesalib/src/mesa/state_tracker/st_cb_msaa.c index bbf2b2c5c..e9955b62b 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_msaa.c +++ b/mesalib/src/mesa/state_tracker/st_cb_msaa.c @@ -40,7 +40,7 @@ static void st_GetSamplePosition(struct gl_context *ctx, struct gl_framebuffer *fb, GLuint index, - GLfloat *outValue) + GLfloat *outPos) { struct st_context *st = st_context(ctx); @@ -48,7 +48,9 @@ st_GetSamplePosition(struct gl_context *ctx, if (st->pipe->get_sample_position) st->pipe->get_sample_position(st->pipe, (unsigned) fb->Visual.samples, - index, outValue); + index, outPos); + else + outPos[0] = outPos[1] = 0.5f; } diff --git a/mesalib/src/mesa/state_tracker/st_context.c b/mesalib/src/mesa/state_tracker/st_context.c index c7f3ec6be..c805a094b 100644 --- a/mesalib/src/mesa/state_tracker/st_context.c +++ b/mesalib/src/mesa/state_tracker/st_context.c @@ -307,6 +307,7 @@ void st_destroy_context( struct st_context *st ) cso_release_all(st->cso_context); st_reference_fragprog(st, &st->fp, NULL); + st_reference_geomprog(st, &st->gp, NULL); st_reference_vertprog(st, &st->vp, NULL); /* release framebuffer surfaces */ diff --git a/mesalib/src/mesa/state_tracker/st_format.c b/mesalib/src/mesa/state_tracker/st_format.c index 38d4ccfea..409079bd4 100644 --- a/mesalib/src/mesa/state_tracker/st_format.c +++ b/mesalib/src/mesa/state_tracker/st_format.c @@ -83,6 +83,8 @@ st_mesa_format_to_pipe_format(mesa_format mesaFormat) return PIPE_FORMAT_B2G3R3_UNORM; case MESA_FORMAT_B10G10R10A2_UNORM: return PIPE_FORMAT_B10G10R10A2_UNORM; + case MESA_FORMAT_R10G10B10A2_UNORM: + return PIPE_FORMAT_R10G10B10A2_UNORM; case MESA_FORMAT_L4A4_UNORM: return PIPE_FORMAT_L4A4_UNORM; case MESA_FORMAT_L8A8_UNORM: @@ -439,6 +441,8 @@ st_pipe_format_to_mesa_format(enum pipe_format format) return MESA_FORMAT_B2G3R3_UNORM; case PIPE_FORMAT_B10G10R10A2_UNORM: return MESA_FORMAT_B10G10R10A2_UNORM; + case PIPE_FORMAT_R10G10B10A2_UNORM: + return MESA_FORMAT_R10G10B10A2_UNORM; case PIPE_FORMAT_L4A4_UNORM: return MESA_FORMAT_L4A4_UNORM; case PIPE_FORMAT_L8A8_UNORM: @@ -857,7 +861,8 @@ static const struct format_mapping format_map[] = { }, { { GL_RGB10_A2, 0 }, - { PIPE_FORMAT_B10G10R10A2_UNORM, DEFAULT_RGBA_FORMATS } + { PIPE_FORMAT_B10G10R10A2_UNORM, PIPE_FORMAT_R10G10B10A2_UNORM, + DEFAULT_RGBA_FORMATS } }, { { 4, GL_RGBA, GL_RGBA8, 0 }, diff --git a/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp index 9e1943139..f47cd7d53 100644 --- a/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp +++ b/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp @@ -4848,6 +4848,7 @@ emit_edgeflags(struct st_translate *t) * \param inputSemanticIndex the semantic index (ex: which texcoord) for * each input * \param interpMode the TGSI_INTERPOLATE_LINEAR/PERSP mode for each input + * \param interpLocation the TGSI_INTERPOLATE_LOC_* location for each input * \param numOutputs number of output registers used * \param outputMapping maps Mesa fragment program outputs to TGSI * generic outputs @@ -4869,7 +4870,7 @@ st_translate_program( const ubyte inputSemanticName[], const ubyte inputSemanticIndex[], const GLuint interpMode[], - const GLboolean is_centroid[], + const GLuint interpLocation[], GLuint numOutputs, const GLuint outputMapping[], const ubyte outputSemanticName[], @@ -4915,7 +4916,7 @@ st_translate_program( inputSemanticName[i], inputSemanticIndex[i], interpMode[i], 0, - is_centroid[i]); + interpLocation[i]); } if (proginfo->InputsRead & VARYING_BIT_POS) { diff --git a/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.h b/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.h index a3fe91f7e..2e7cb78d5 100644 --- a/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.h +++ b/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.h @@ -45,7 +45,7 @@ enum pipe_error st_translate_program( const ubyte inputSemanticName[], const ubyte inputSemanticIndex[], const GLuint interpMode[], - const GLboolean is_centroid[], + const GLuint interpLocation[], GLuint numOutputs, const GLuint outputMapping[], const ubyte outputSemanticName[], diff --git a/mesalib/src/mesa/state_tracker/st_program.c b/mesalib/src/mesa/state_tracker/st_program.c index 3570557fe..9d7b7c475 100644 --- a/mesalib/src/mesa/state_tracker/st_program.c +++ b/mesalib/src/mesa/state_tracker/st_program.c @@ -351,7 +351,7 @@ st_translate_vertex_program(struct st_context *st, NULL, /* input semantic name */ NULL, /* input semantic index */ NULL, /* interp mode */ - NULL, /* is centroid */ + NULL, /* interp location */ /* outputs */ num_outputs, stvp->result_to_output, @@ -481,6 +481,7 @@ st_translate_fragment_program(struct st_context *st, GLuint outputMapping[FRAG_RESULT_MAX]; GLuint inputMapping[VARYING_SLOT_MAX]; GLuint interpMode[PIPE_MAX_SHADER_INPUTS]; /* XXX size? */ + GLuint interpLocation[PIPE_MAX_SHADER_INPUTS]; GLuint attr; GLbitfield64 inputsRead; struct ureg_program *ureg; @@ -489,7 +490,6 @@ st_translate_fragment_program(struct st_context *st, ubyte input_semantic_name[PIPE_MAX_SHADER_INPUTS]; ubyte input_semantic_index[PIPE_MAX_SHADER_INPUTS]; - GLboolean is_centroid[PIPE_MAX_SHADER_INPUTS]; uint fs_num_inputs = 0; ubyte fs_output_semantic_name[PIPE_MAX_SHADER_OUTPUTS]; @@ -541,7 +541,15 @@ st_translate_fragment_program(struct st_context *st, const GLuint slot = fs_num_inputs++; inputMapping[attr] = slot; - is_centroid[slot] = (stfp->Base.IsCentroid & BITFIELD64_BIT(attr)) != 0; + if (stfp->Base.IsCentroid & BITFIELD64_BIT(attr)) + interpLocation[slot] = TGSI_INTERPOLATE_LOC_CENTROID; + else if (stfp->Base.IsSample & BITFIELD64_BIT(attr)) + interpLocation[slot] = TGSI_INTERPOLATE_LOC_SAMPLE; + else + interpLocation[slot] = TGSI_INTERPOLATE_LOC_CENTER; + + if (key->persample_shading) + interpLocation[slot] = TGSI_INTERPOLATE_LOC_SAMPLE; switch (attr) { case VARYING_SLOT_POS: @@ -768,7 +776,7 @@ st_translate_fragment_program(struct st_context *st, input_semantic_name, input_semantic_index, interpMode, - is_centroid, + interpLocation, /* outputs */ fs_num_outputs, outputMapping, diff --git a/mesalib/src/mesa/state_tracker/st_program.h b/mesalib/src/mesa/state_tracker/st_program.h index ce9174f67..9a5b6a847 100644 --- a/mesalib/src/mesa/state_tracker/st_program.h +++ b/mesalib/src/mesa/state_tracker/st_program.h @@ -58,6 +58,9 @@ struct st_fp_variant_key /** for ARB_color_buffer_float */ GLuint clamp_color:1; + + /** for ARB_sample_shading */ + GLuint persample_shading:1; }; diff --git a/mkfontscale/mkfontscale.c b/mkfontscale/mkfontscale.c index 036a0b4ce..da93e0c0d 100644 --- a/mkfontscale/mkfontscale.c +++ b/mkfontscale/mkfontscale.c @@ -242,10 +242,6 @@ main(int argc, char **argv) } bigEncodingFuzz = atof(argv[argn + 1]) / 100.0; argn += 2; - } else if (strcmp(argv[argn], "-r") == 0) { /* ignore for now */ - argn++; - } else if (strcmp(argv[argn], "-n") == 0) { - argn++; } else if (strcmp(argv[argn], "-v") == 0) { printf("%s\n", PACKAGE_STRING); exit(0); diff --git a/xorg-server/configure.ac b/xorg-server/configure.ac index 2daa6beec..c214638d3 100644 --- a/xorg-server/configure.ac +++ b/xorg-server/configure.ac @@ -26,9 +26,9 @@ dnl dnl Process this file with autoconf to create configure. AC_PREREQ(2.60) -AC_INIT([xorg-server], 1.15.99.903, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server) -RELEASE_DATE="2014-06-04" -RELEASE_NAME="Strawberry Shortcake" +AC_INIT([xorg-server], 1.15.99.904, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server) +RELEASE_DATE="2014-07-07" +RELEASE_NAME="Netarts Bay Oysters" AC_CONFIG_SRCDIR([Makefile.am]) AC_CONFIG_MACRO_DIR([m4]) AM_INIT_AUTOMAKE([foreign dist-bzip2]) diff --git a/xorg-server/hw/xfree86/common/xf86AutoConfig.c b/xorg-server/hw/xfree86/common/xf86AutoConfig.c index 4eb86de22..2b53b908a 100644 --- a/xorg-server/hw/xfree86/common/xf86AutoConfig.c +++ b/xorg-server/hw/xfree86/common/xf86AutoConfig.c @@ -265,7 +265,7 @@ listPossibleVideoDrivers(char *matches[], int nmatches) #endif #ifdef XSERVER_LIBPCIACCESS if (i < (nmatches - 1)) - i = xf86PciMatchDriver(matches, nmatches); + i += xf86PciMatchDriver(&matches[i], nmatches - i); #endif #if defined(__linux__) diff --git a/xorg-server/hw/xfree86/common/xf86pciBus.c b/xorg-server/hw/xfree86/common/xf86pciBus.c index 0f76a03ee..c06b04033 100644 --- a/xorg-server/hw/xfree86/common/xf86pciBus.c +++ b/xorg-server/hw/xfree86/common/xf86pciBus.c @@ -1320,8 +1320,9 @@ xchomp(char *line) * don't export their PCI ID's properly. If distros don't end up using this * feature it can and should be removed because the symbol-based resolution * scheme should be the primary one */ -void -xf86MatchDriverFromFiles(char **matches, uint16_t match_vendor, uint16_t match_chip) +int +xf86MatchDriverFromFiles(uint16_t match_vendor, uint16_t match_chip, + char *matches[], int nmatches) { DIR *idsdir; FILE *fp; @@ -1331,11 +1332,11 @@ xf86MatchDriverFromFiles(char **matches, uint16_t match_vendor, uint16_t match_c ssize_t read; char path_name[256], vendor_str[5], chip_str[5]; uint16_t vendor, chip; - int i, j; + int i = 0, j; idsdir = opendir(PCI_TXT_IDS_PATH); if (!idsdir) - return; + return 0; xf86Msg(X_INFO, "Scanning %s directory for additional PCI ID's supported by the drivers\n", @@ -1386,10 +1387,6 @@ xf86MatchDriverFromFiles(char **matches, uint16_t match_vendor, uint16_t match_c } } if (vendor == match_vendor && chip == match_chip) { - i = 0; - while (matches[i]) { - i++; - } matches[i] = (char *) malloc(sizeof(char) * strlen(direntry->d_name) - 3); @@ -1412,6 +1409,7 @@ xf86MatchDriverFromFiles(char **matches, uint16_t match_vendor, uint16_t match_c } xf86Msg(X_INFO, "Matched %s from file name %s\n", matches[i], direntry->d_name); + i++; } } else { @@ -1425,6 +1423,7 @@ xf86MatchDriverFromFiles(char **matches, uint16_t match_vendor, uint16_t match_c end: free(line); closedir(idsdir); + return i; } #endif /* __linux__ */ @@ -1435,7 +1434,7 @@ xf86MatchDriverFromFiles(char **matches, uint16_t match_vendor, uint16_t match_c int xf86PciMatchDriver(char *matches[], int nmatches) { - int i; + int i = 0; struct pci_device *info = NULL; struct pci_device_iterator *iter; @@ -1450,13 +1449,10 @@ xf86PciMatchDriver(char *matches[], int nmatches) pci_iterator_destroy(iter); #ifdef __linux__ if (info) - xf86MatchDriverFromFiles(matches, info->vendor_id, info->device_id); + i += xf86MatchDriverFromFiles(info->vendor_id, info->device_id, + matches, nmatches); #endif - for (i = 0; (i < nmatches) && (matches[i]); i++) { - /* find end of matches list */ - } - if ((info != NULL) && (i < nmatches)) { i += xf86VideoPtrToDriverList(info, &(matches[i]), nmatches - i); } diff --git a/xorg-server/hw/xfree86/common/xf86pciBus.h b/xorg-server/hw/xfree86/common/xf86pciBus.h index b497a7f2d..45b5a0fee 100644 --- a/xorg-server/hw/xfree86/common/xf86pciBus.h +++ b/xorg-server/hw/xfree86/common/xf86pciBus.h @@ -47,8 +47,9 @@ void xf86PciConfigureNewDev(void *busData, struct pci_device *pVideo, ((x)->func == (y)->func) && \ ((x)->dev == (y)->dev)) -void -xf86MatchDriverFromFiles(char **matches, uint16_t match_vendor, uint16_t match_chip); +int +xf86MatchDriverFromFiles(uint16_t match_vendor, uint16_t match_chip, + char *matches[], int nmatches); int xf86VideoPtrToDriverList(struct pci_device *dev, char *returnList[], int returnListMax); diff --git a/xorg-server/hw/xfree86/common/xf86platformBus.c b/xorg-server/hw/xfree86/common/xf86platformBus.c index dd118a285..eb1a3fb5d 100644 --- a/xorg-server/hw/xfree86/common/xf86platformBus.c +++ b/xorg-server/hw/xfree86/common/xf86platformBus.c @@ -47,6 +47,7 @@ #include "xf86Bus.h" #include "Pci.h" #include "xf86platformBus.h" +#include "xf86Config.h" #include "randrstr.h" int platformSlotClaimed; @@ -199,6 +200,81 @@ xf86_check_platform_slot(const struct xf86_platform_device *pd) return TRUE; } +static Bool +MatchToken(const char *value, struct xorg_list *patterns, + int (*compare)(const char *, const char *)) +{ + const xf86MatchGroup *group; + + /* If there are no patterns, accept the match */ + if (xorg_list_is_empty(patterns)) + return TRUE; + + /* If there are patterns but no attribute, reject the match */ + if (!value) + return FALSE; + + /* + * Otherwise, iterate the list of patterns ensuring each entry has a + * match. Each list entry is a separate Match line of the same type. + */ + xorg_list_for_each_entry(group, patterns, entry) { + Bool match = FALSE; + char *const *cur; + + for (cur = group->values; *cur; cur++) { + if ((*compare)(value, *cur) == 0) { + match = TRUE; + break; + } + } + + if (!match) + return FALSE; + } + + /* All the entries in the list matched the attribute */ + return TRUE; +} + +static Bool +OutputClassMatches(const XF86ConfOutputClassPtr oclass, int index) +{ + char *driver = xf86_get_platform_attrib(index, ODEV_ATTRIB_DRIVER); + + if (!MatchToken(driver, &oclass->match_driver, strcmp)) + return FALSE; + + return TRUE; +} + +static int +xf86OutputClassDriverList(int index, char *matches[], int nmatches) +{ + XF86ConfOutputClassPtr cl; + int i = 0; + + if (nmatches == 0) + return 0; + + for (cl = xf86configptr->conf_outputclass_lst; cl; cl = cl->list.next) { + if (OutputClassMatches(cl, index)) { + char *path = xf86_get_platform_attrib(index, ODEV_ATTRIB_PATH); + + xf86Msg(X_INFO, "Applying OutputClass \"%s\" to %s\n", + cl->identifier, path); + xf86Msg(X_NONE, "\tloading driver: %s\n", cl->driver); + + matches[i++] = xstrdup(cl->driver); + } + + if (i >= nmatches) + break; + } + + return i; +} + /** * @return The numbers of found devices that match with the current system * drivers. @@ -218,16 +294,15 @@ xf86PlatformMatchDriver(char *matches[], int nmatches) else if (!xf86IsPrimaryPlatform(&xf86_platform_devices[i]) && (pass == 0)) continue; + j += xf86OutputClassDriverList(i, &matches[j], nmatches - j); + info = xf86_platform_devices[i].pdev; #ifdef __linux__ if (info) - xf86MatchDriverFromFiles(matches, info->vendor_id, info->device_id); + j += xf86MatchDriverFromFiles(info->vendor_id, info->device_id, + &matches[j], nmatches - j); #endif - for (j = 0; (j < nmatches) && (matches[j]); j++) { - /* find end of matches list */ - } - if ((info != NULL) && (j < nmatches)) { j += xf86VideoPtrToDriverList(info, &(matches[j]), nmatches - j); } diff --git a/xorg-server/hw/xfree86/man/xorg.conf.man b/xorg-server/hw/xfree86/man/xorg.conf.man index cadd87b7b..bc33df197 100644 --- a/xorg-server/hw/xfree86/man/xorg.conf.man +++ b/xorg-server/hw/xfree86/man/xorg.conf.man @@ -171,6 +171,7 @@ The section names are: .BR "Extensions " "Extension enabling" .BR "InputDevice " "Input device description" .BR "InputClass " "Input class description" +.BR "OutputClass " "Output class description" .BR "Device " "Graphics device description" .BR "VideoAdaptor " "Xv video adaptor description" .BR "Monitor " "Monitor description" @@ -1190,6 +1191,82 @@ entries. This optional entry specifies that the device should be ignored entirely, and not added to the server. This can be useful when the device is handled by another program and no X events should be generated. +.SH "OUTPUTCLASS SECTION" +The config file may have multiple +.B OutputClass +sections. +These sections are optional and are used to provide configuration for a +class of output devices as they are automatically added. +An output device can match more than one +.B OutputClass +section. +Each class can override settings from a previous class, so it is best to +arrange the sections with the most generic matches first. +.PP +.B OutputClass +sections have the following format: +.PP +.RS 4 +.nf +.B "Section \*qOutputClass\*q" +.BI " Identifier \*q" name \*q +.I " entries" +.I " ..." +.B "EndSection" +.fi +.RE +.PP +The +.B Identifier +entry is required in all +.B OutputClass +sections. +All other entries are optional. +.PP +The +.B Identifier +entry specifies the unique name for this output class. +The +.B Driver +entry specifies the name of the driver to use for this output device. +After all classes have been examined, the +.RI \*q outputdriver \*q +module from the first +.B Driver +entry will be enabled when using the loadable server. +.PP +When an output device is automatically added, its characteristics are +checked against all +.B OutputClass +sections. +Each section can contain optional entries to narrow the match of the class. +If none of the optional entries appear, the +.B OutputClass +section is generic and will match any output device. +If more than one of these entries appear, they all must match for the +configuration to apply. +.PP +The following list of tokens can be matched against attributes of the device. +An entry can be constructed to match attributes from different devices by +separating arguments with a '|' character. +.PP +For example: +.PP +.RS 4 +.nf +.B "Section \*qOutputClass\*q" +.B " Identifier \*qMy Class\*q" +.B " # kernel driver must be either foo or bar +.B " MatchDriver \*qfoo|bar\*q +.I " ..." +.B "EndSection" +.fi +.RE +.TP 7 +.BI "MatchDriver \*q" matchdriver \*q +Check the case-sensitive string +.RI \*q matchdriver \*q +against the kernel driver of the device. .SH "DEVICE SECTION" The config file may have multiple .B Device diff --git a/xorg-server/hw/xfree86/os-support/linux/lnx_platform.c b/xorg-server/hw/xfree86/os-support/linux/lnx_platform.c index 308275ab4..d660761c5 100644 --- a/xorg-server/hw/xfree86/os-support/linux/lnx_platform.c +++ b/xorg-server/hw/xfree86/os-support/linux/lnx_platform.c @@ -24,6 +24,7 @@ static Bool get_drm_info(struct OdevAttributes *attribs, char *path, int delayed_index) { drmSetVersion sv; + drmVersionPtr v; char *buf; int major, minor, fd; int err = 0; @@ -57,8 +58,9 @@ get_drm_info(struct OdevAttributes *attribs, char *path, int delayed_index) err = drmSetInterfaceVersion(fd, &sv); if (err) { - ErrorF("setversion 1.4 failed: %s\n", strerror(-err)); - goto out; + xf86Msg(X_ERROR, "%s: failed to set DRM interface version 1.4: %s\n", + path, strerror(-err)); + goto out; } /* for a delayed probe we've already added the device */ @@ -74,6 +76,17 @@ get_drm_info(struct OdevAttributes *attribs, char *path, int delayed_index) xf86_add_platform_device_attrib(delayed_index, ODEV_ATTRIB_BUSID, buf); drmFreeBusid(buf); + + v = drmGetVersion(fd); + if (!v) { + xf86Msg(X_ERROR, "%s: failed to query DRM version\n", path); + goto out; + } + + xf86_add_platform_device_attrib(delayed_index, ODEV_ATTRIB_DRIVER, + v->name); + drmFreeVersion(v); + out: if (!server_fd) close(fd); diff --git a/xorg-server/hw/xfree86/parser/Makefile.am b/xorg-server/hw/xfree86/parser/Makefile.am index 3bf62e8af..4d0bb4fd8 100644 --- a/xorg-server/hw/xfree86/parser/Makefile.am +++ b/xorg-server/hw/xfree86/parser/Makefile.am @@ -14,6 +14,7 @@ INTERNAL_SOURCES= \ Flags.c \ Input.c \ InputClass.c \ + OutputClass.c \ Layout.c \ Module.c \ Video.c \ diff --git a/xorg-server/hw/xfree86/parser/OutputClass.c b/xorg-server/hw/xfree86/parser/OutputClass.c new file mode 100644 index 000000000..7e9a8ac1a --- /dev/null +++ b/xorg-server/hw/xfree86/parser/OutputClass.c @@ -0,0 +1,167 @@ +/* + * Copyright (c) 2014 NVIDIA Corporation. All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifdef HAVE_XORG_CONFIG_H +#include +#endif + +#include "os.h" +#include "xf86Parser.h" +#include "xf86tokens.h" +#include "Configint.h" + +static +xf86ConfigSymTabRec OutputClassTab[] = { + {ENDSECTION, "endsection"}, + {IDENTIFIER, "identifier"}, + {DRIVER, "driver"}, + {MATCH_DRIVER, "matchdriver"}, + {-1, ""}, +}; + +#define CLEANUP xf86freeOutputClassList + +#define TOKEN_SEP "|" + +static void +add_group_entry(struct xorg_list *head, char **values) +{ + xf86MatchGroup *group; + + group = malloc(sizeof(*group)); + if (group) { + group->values = values; + xorg_list_add(&group->entry, head); + } +} + +XF86ConfOutputClassPtr +xf86parseOutputClassSection(void) +{ + int has_ident = FALSE; + int token; + + parsePrologue(XF86ConfOutputClassPtr, XF86ConfOutputClassRec) + + /* Initialize MatchGroup lists */ + xorg_list_init(&ptr->match_driver); + + while ((token = xf86getToken(OutputClassTab)) != ENDSECTION) { + switch (token) { + case COMMENT: + ptr->comment = xf86addComment(ptr->comment, xf86_lex_val.str); + break; + case IDENTIFIER: + if (xf86getSubToken(&(ptr->comment)) != STRING) + Error(QUOTE_MSG, "Identifier"); + if (has_ident == TRUE) + Error(MULTIPLE_MSG, "Identifier"); + ptr->identifier = xf86_lex_val.str; + has_ident = TRUE; + break; + case DRIVER: + if (xf86getSubToken(&(ptr->comment)) != STRING) + Error(QUOTE_MSG, "Driver"); + else + ptr->driver = xf86_lex_val.str; + break; + case MATCH_DRIVER: + if (xf86getSubToken(&(ptr->comment)) != STRING) + Error(QUOTE_MSG, "MatchDriver"); + add_group_entry(&ptr->match_driver, + xstrtokenize(xf86_lex_val.str, TOKEN_SEP)); + free(xf86_lex_val.str); + break; + case EOF_TOKEN: + Error(UNEXPECTED_EOF_MSG); + break; + default: + Error(INVALID_KEYWORD_MSG, xf86tokenString()); + break; + } + } + + if (!has_ident) + Error(NO_IDENT_MSG); + +#ifdef DEBUG + printf("OutputClass section parsed\n"); +#endif + + return ptr; +} +void +xf86printOutputClassSection(FILE * cf, XF86ConfOutputClassPtr ptr) +{ + const xf86MatchGroup *group; + char *const *cur; + + while (ptr) { + fprintf(cf, "Section \"OutputClass\"\n"); + if (ptr->comment) + fprintf(cf, "%s", ptr->comment); + if (ptr->identifier) + fprintf(cf, "\tIdentifier \"%s\"\n", ptr->identifier); + if (ptr->driver) + fprintf(cf, "\tDriver \"%s\"\n", ptr->driver); + + xorg_list_for_each_entry(group, &ptr->match_driver, entry) { + fprintf(cf, "\tMatchDriver \""); + for (cur = group->values; *cur; cur++) + fprintf(cf, "%s%s", cur == group->values ? "" : TOKEN_SEP, + *cur); + fprintf(cf, "\"\n"); + } + + fprintf(cf, "EndSection\n\n"); + ptr = ptr->list.next; + } +} + +void +xf86freeOutputClassList(XF86ConfOutputClassPtr ptr) +{ + XF86ConfOutputClassPtr prev; + + while (ptr) { + xf86MatchGroup *group, *next; + char **list; + + TestFree(ptr->identifier); + TestFree(ptr->comment); + TestFree(ptr->driver); + + xorg_list_for_each_entry_safe(group, next, &ptr->match_driver, entry) { + xorg_list_del(&group->entry); + for (list = group->values; *list; list++) + free(*list); + free(group); + } + + prev = ptr; + ptr = ptr->list.next; + free(prev); + } +} diff --git a/xorg-server/hw/xfree86/parser/configProcs.h b/xorg-server/hw/xfree86/parser/configProcs.h index 60509dcd8..774e2a2da 100644 --- a/xorg-server/hw/xfree86/parser/configProcs.h +++ b/xorg-server/hw/xfree86/parser/configProcs.h @@ -57,6 +57,11 @@ XF86ConfInputClassPtr xf86parseInputClassSection(void); void xf86printInputClassSection(FILE * f, XF86ConfInputClassPtr ptr); void xf86freeInputClassList(XF86ConfInputClassPtr ptr); +/* OutputClass.c */ +XF86ConfOutputClassPtr xf86parseOutputClassSection(void); +void xf86printOutputClassSection(FILE * f, XF86ConfOutputClassPtr ptr); +void xf86freeOutputClassList(XF86ConfOutputClassPtr ptr); + /* Layout.c */ XF86ConfLayoutPtr xf86parseLayoutSection(void); void xf86printLayoutSection(FILE * cf, XF86ConfLayoutPtr ptr); diff --git a/xorg-server/hw/xfree86/parser/read.c b/xorg-server/hw/xfree86/parser/read.c index 2478b074b..22f6e6af4 100644 --- a/xorg-server/hw/xfree86/parser/read.c +++ b/xorg-server/hw/xfree86/parser/read.c @@ -165,6 +165,12 @@ xf86readConfigFile(void) HANDLE_LIST(conf_inputclass_lst, xf86parseInputClassSection, XF86ConfInputClassPtr); } + else if (xf86nameCompare(xf86_lex_val.str, "outputclass") == 0) { + free(xf86_lex_val.str); + xf86_lex_val.str = NULL; + HANDLE_LIST(conf_outputclass_lst, xf86parseOutputClassSection, + XF86ConfOutputClassPtr); + } else if (xf86nameCompare(xf86_lex_val.str, "module") == 0) { free(xf86_lex_val.str); xf86_lex_val.str = NULL; diff --git a/xorg-server/hw/xfree86/parser/write.c b/xorg-server/hw/xfree86/parser/write.c index 26739b933..472b27ba1 100644 --- a/xorg-server/hw/xfree86/parser/write.c +++ b/xorg-server/hw/xfree86/parser/write.c @@ -114,6 +114,8 @@ doWriteConfigFile(const char *filename, XF86ConfigPtr cptr) xf86printInputClassSection(cf, cptr->conf_inputclass_lst); + xf86printOutputClassSection(cf, cptr->conf_outputclass_lst); + xf86printVideoAdaptorSection(cf, cptr->conf_videoadaptor_lst); xf86printModesSection(cf, cptr->conf_modes_lst); diff --git a/xorg-server/hw/xfree86/parser/xf86Parser.h b/xorg-server/hw/xfree86/parser/xf86Parser.h index c95423a1f..3fa5b716d 100644 --- a/xorg-server/hw/xfree86/parser/xf86Parser.h +++ b/xorg-server/hw/xfree86/parser/xf86Parser.h @@ -327,6 +327,14 @@ typedef struct { char *comment; } XF86ConfInputClassRec, *XF86ConfInputClassPtr; +typedef struct { + GenericListRec list; + char *identifier; + char *driver; + struct xorg_list match_driver; + char *comment; +} XF86ConfOutputClassRec, *XF86ConfOutputClassPtr; + /* Values for adj_where */ #define CONF_ADJ_OBSOLETE -1 #define CONF_ADJ_ABSOLUTE 0 @@ -411,6 +419,7 @@ typedef struct { XF86ConfScreenPtr conf_screen_lst; XF86ConfInputPtr conf_input_lst; XF86ConfInputClassPtr conf_inputclass_lst; + XF86ConfOutputClassPtr conf_outputclass_lst; XF86ConfLayoutPtr conf_layout_lst; XF86ConfVendorPtr conf_vendor_lst; XF86ConfDRIPtr conf_dri; diff --git a/xorg-server/hw/xwin/Makefile.am b/xorg-server/hw/xwin/Makefile.am index cf42cfd2d..4ee963227 100644 --- a/xorg-server/hw/xwin/Makefile.am +++ b/xorg-server/hw/xwin/Makefile.am @@ -155,7 +155,7 @@ XWIN_LIBS += $(top_builddir)/pseudoramiX/libPseudoramiX.la \ $(top_builddir)/Xi/libXistubs.la XWin_DEPENDENCIES = $(MULTIWINDOWEXTWM_LIBS) $(XWIN_GLX_LIBS) $(XWIN_LIBS) $(XSERVER_LIBS) XWin_LDADD = $(MULTIWINDOW_LIBS) $(MULTIWINDOWEXTWM_LIBS) $(XWIN_GLX_LIBS) $(XWIN_GLX_LINK_FLAGS) $(XWIN_LIBS) $(MAIN_LIB) $(XSERVER_LIBS) $(XSERVER_SYS_LIBS) $(XWIN_SYS_LIBS) -XWin_LDFLAGS = -mwindows -static -Wl,--disable-stdcall-fixup +XWin_LDFLAGS = -mwindows -Wl,--disable-stdcall-fixup $(LD_EXPORT_SYMBOLS_FLAG) .rc.o: diff --git a/xorg-server/include/hotplug.h b/xorg-server/include/hotplug.h index cefc164ae..c4268a0c4 100644 --- a/xorg-server/include/hotplug.h +++ b/xorg-server/include/hotplug.h @@ -87,6 +87,8 @@ config_odev_free_attributes(struct OdevAttributes *attribs); #define ODEV_ATTRIB_MAJOR 5 /* Minor number of the device node pointed to by ODEV_ATTRIB_PATH */ #define ODEV_ATTRIB_MINOR 6 +/* kernel driver name */ +#define ODEV_ATTRIB_DRIVER 4 typedef void (*config_odev_probe_proc_ptr)(struct OdevAttributes *attribs); void config_odev_probe(config_odev_probe_proc_ptr probe_callback); -- cgit v1.2.3