summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2014-04-30dbus: don't dispatch dbus events on select() EINTRRay Strode1-2/+2
wakeup handlers are called even when select() returns EINTR, and when they're called the passed fd set is undefined. This commit fixes the dbus wakeup handler to avoid dispatching into dbus spuriously. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Ray Strode <rstrode@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2014-04-29Merge remote-tracking branch 'whot/for-keith'Keith Packard2-11/+0
2014-04-29dix: remove a now-superfluous commentPeter Hutterer1-6/+0
Obsolete since 93945b0a74aa8156a88f52b8ba77f1210042f396 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-04-29input: Remove invalid bug checks.Michal Srb1-5/+0
Commit 2f1aedcaed8fd99b823d451bf1fb02330c078f67 added several bug checks. Some of them are not correct. Checks in Init(Ptr|String|Bell|Led|Integer)FeedbackClassDeviceStruct verify that no feedback struct was set yet, but that is not required. If any feedback structs are already present, the function will chain them behind the new one. Signed-off-by: Michal Srb <msrb@suse.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-04-27xfree86: int10: Fix build on ARMThierry Reding1-1/+0
Commit 7353ec7cb6fc235b03e59e35425201429c83ee72 "xfree86: Switch int10 code to stdint types" uses designated initializers to setup the fields of the X86EMU_pioFuncs. This breaks compilation on ARM, since out{b,w,l}() are redefined using the preprocessor and therefore cause the compiler to complain about non-existent fields being assigned to. It seems like the compiler.h header that contains these redefinitions isn't actually needed in xf86x86emu.c, so the easiest "fix" is to not include it. Signed-off-by: Thierry Reding <treding@nvidia.com> Reviewed-by: Rob Clark <robdclark@gmail.com>
2014-04-27int10: fix build errorRob Clark1-1/+1
Fixes: stub.c:66:1: error: conflicting types for 'xf86int10Addr' In file included from stub.c:14:0: xf86int10.h:72:53: note: previous declaration of 'xf86int10Addr' was here Signed-off-by: Rob Clark <robdclark@gmail.com>
2014-04-27default to stub int10 implementation on armRob Clark1-0/+1
There should be no reason to need a real int10 implementation on arm, and switching to stub is an easy way to fix: xf86x86emu.c: In function 'xf86Int10ExecSetup': xf86x86emu.c:56:9: error: unknown field 'xf_outb' specified in initializer xf86x86emu.c:57:9: error: unknown field 'xf_outw' specified in initializer xf86x86emu.c:58:9: error: unknown field 'xf_outl' specified in initializer which is caused by the following in compiler.h: #define outb xf_outb #define outw xf_outw #define outl xf_outl Signed-off-by: Rob Clark <robdclark@gmail.com> Acked-by: Daniel Stone <daniels@collabora.com>
2014-04-25hw/xfree86: Restore API compatibility for cursor loading functionsKeith Packard6-25/+95
Create load_cursor_image_check, load_cursor_argb_check, LoadCursorImageCheck and LoadCursorARGBCheck that can return failure and use them in preference to the old unchecked variants. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Michael Thayer <michael.thayer@oracle.com>
2014-04-23Add a command line argument for disabling indirect GLX.Eric Anholt3-0/+20
The attack surface for indirect GLX is huge, and it's of no use to most people (if you get an indirect GL context, you're better served by a immediate X error than actually trying to use an indirect GL context and finding out that it doesn't support doing anything you want, slowly). This flag gives you a chance to disable indirect GLX in environments where you just don't need it. I put in both the '+' and '-' arguments right now, so that it's easy to patch the value to change the default policy. Signed-off-by: Eric Anholt <eric@anholt.net> Acked-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2014-04-23glamor: Fallback to system memory when fail to allocate one big fbo.Zhigang Gong2-15/+23
Even when create a pixmap which smaller than the max_fbo_size, it may fail due to some low level driver limitation. If that is the case, we don't need to crash the xserver. We just need to fallback to system memory. See the related bug at: https://bugs.freedesktop.org/show_bug.cgi?id=71190 Signed-off-by: Zhigang Gong <zhigang.gong@intel.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Tested-by: Kai Wasserbach <kai@dev.carbon-project.org> Tested-by: Erich Seifert <eseifert@error-reports.org> Signed-off-by: Michel Dänzer <michel.daenzer@amd.com> Signed-off-by: Eric Anholt <eric@anholt.net>
2014-04-23glamor: Fix memory leak in _glamor_copy_n_to_n()Michel Dänzer1-2/+3
It would leak the memory allocated for the region rects in some cases. Found with valgrind. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com> Signed-off-by: Michel Dänzer <michel.daenzer@amd.com> Signed-off-by: Eric Anholt <eric@anholt.net>
2014-04-23glamor: Fix coordinates handling for composite source/mask picturesAnthony Waters1-8/+8
There were actually two issues with the original code I believe, the first is that the call to glamor_convert_gradient_picture wasn't properly referencing the coordinates of the source/mask pictures. The second, was that the updated references (x_temp/y_temp) were also improperly set, they should always be 0 because the temp pictures are new ones that start at (0, 0). The reason it worked in certain cases and it didn't in others (notably the tray icons) was due to the numbers working out based on the call to glamor_composite. In the cases that it did work extent->x1 would equal x_dest and extent->y1 would equal y_dest, making it so what was actually passed into glamor_convert_gradient_picture and the settings for x_temp/y_temp were correct. However, for the case when extent->x1 wouldn't equal x_dest and extent->y1 wouldn't equal y_dest (for example with the tray icons) then the wrong parameters get passed into glamor_convert_gradient_picture and x_temp/y_temp are set improperly. Fixes issues with tray icons not appearing properly in certain cases. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=64738 Signed-Off-by: Anthony Waters <awaters1@gmail.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com> Signed-off-by: Michel Dänzer <michel.daenzer@amd.com> Signed-off-by: Eric Anholt <eric@anholt.net>
2014-04-23glamor: Add glamor_transfer based glamor_get_image and glamor_put_imageKeith Packard6-275/+190
These use the upload_boxes and download_boxes helpers to provide reasonably efficient image transfer. Fixes segfaults in Xephyr with x11perf -reps 1. Performance improvements: Improves -putimage10 by 548.218% +/- 88.601% (n=10). Improves -putimage500 by 3.71014% +/- 1.5049% (n=10). Improves -getimage10 by 8.37004% +/- 4.58274% (n=10). No statistically significant difference on -getimage500 (n=10). v2: Fix rebase failures, don't forget to check/prepare the gc in putimage fallbacks (changes by anholt). Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net>
2014-04-23glamor: Wire alpha to 1 for pictures without alpha bitsKeith Packard1-1/+4
When sourcing a picture that has no alpha values, make sure any texture fetches wire the alpha value to one. This ensures that bits beyond the depth of the pixmap, or bits other than the RGB values aren't used. Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net>
2014-04-23glx: If DRI2GetBuffers changes the GL context, call it againMichel Dänzer1-0/+15
By changing the context, it may also invalidate the DRI2 buffer information, so we need to get that again. Fixes crashes due to use-after-free with LIBGL_ALWAYS_INDIRECT=1 glxgears and piglit. Signed-off-by: Michel Dänzer <michel.daenzer@amd.com> Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Adam Jackson <ajax@redhat.com>
2014-04-23glamor: Move a make_current before the first GL call entrypoint.Eric Anholt1-1/+1
Fixes a usage of the wrong context with swrast GLX's GetImage entrypoint. Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2014-04-23glamor: Do the same MakeCurrent(None) for GLX as we do for EGL.Eric Anholt1-0/+8
Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2014-04-23glamor: Explain the weird EGL_NO_CONTEXT code.Eric Anholt1-0/+7
Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2014-04-23glamor: Replace glamor_get/put_context() with just glamor_make_current().Eric Anholt24-223/+81
Now that we have the DIX global state for the current context, we don't need to track nesting to try to reduce MakeCurrent overhead. v2: Fix a mistaken replacement of a put_context with make_current in glamor_fill_spans_gl() (caught by keithp). Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> (v1) Reviewed-by: Adam Jackson <ajax@redhat.com> (v1)
2014-04-23glamor: Stop unsetting the EGL context in put_context().Eric Anholt1-5/+1
This matches the Xephyr behavior. Now that we know when to reset the context in the presence of GLX, we don't need to try to keep our stuff from being smashed by GLX. Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2014-04-23glamor: Use lastGLContext to coordinate the context with GLX.Eric Anholt3-15/+10
This gets us some more context changes that are needed to make sure the two sides render to the right drawables and manipulate the right objects. Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2014-04-23glx: Make sure that DRI2/swrast calls haven't changed the GL context.Eric Anholt2-8/+63
These functions are called from the GL driver, in some series of GL calls by GLX. If some server component (like glamor CreatePixmap for GetBuffers()) changes the GL context on us, we need to set it back or the later GL calls will land in the glamor context instead of the GLX context. Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2014-04-23glx: Refactor DRI2CopyRegion calls.Eric Anholt1-27/+21
I needed to add some code to each one, so it's a good time to make a helper func. Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2014-04-23glx: Unconditionally clear lastGLContext on loseCurrent().Eric Anholt1-2/+2
This hook calls unbindContext in the DRI driver interface, which unsets the dispatch table, regardless of whether the context argument was the current one or not. Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2014-04-23glx: Move GLX MakeCurrent lastGLContext updates next to makeCurrent().Eric Anholt2-5/+4
We want to make sure that lastGLContext is set correctly during makeCurrent, because we may have recursive GL context changes in the DRI2 interfaces due to glamor. Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2014-04-23glx: Move the GLX variable caching what GL context is current to dix.Eric Anholt5-26/+39
GLX is trying to track whether the context it wants is current, to avoid the glFlush() (and the rest of the overhead) that occurs on all MakeCurrent calls. However, its cache can be incorrect now that glamor exists. This is a step toward getting glamor to coordinate with GLX. Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2014-04-23glamor: Fix a missing set of the GL context.Eric Anholt1-5/+12
Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Keith Packard <keithp@keithp.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2014-04-22glamor: Fix accelerated rendering of GTK's ARGB vs xBGR composites.Eric Anholt1-0/+10
There is some complicated code to support tweaking the format as we upload from a SHM pixmap (aka the GTK icon cache), but if we weren't sourcing from a SHM pixmap we just forgot to check that the formats matched at all. We could potentially be a little more discerning here (xRGB source and ARGB mask would be fine, for example), but this will all change with texture views anyway, so just get the rendering working for 1.16 release. Fixes the new rendercheck gtk_argb_xbgr test. v2: Squash in keithp's fix for checking that we have a non-NULL pixmap, and reword the comment even more. Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2014-04-22Make glamor build with --enable-debug.Jamey Sharp1-1/+1
Bad anholt, no biscuit. Broken in commit 4c9a20072552c52b3763bd73e7a7e9b9cb8b4993. Signed-off-by: Jamey Sharp <jamey@minilop.net> Cc: Eric Anholt <eric@anholt.net> Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net>
2014-04-22xfixes: Forbid manipulating clip for source-only pictures (#28968)Adam Jackson2-1/+7
Just throw BadPicture instead of crashing. It's not currently a meaningful thing to do anyway, RenderSetPictureRectangles would error if you tried (which this patch changes to BadPicture as well for consistency). The problem with trying to do it is if the clip is specified as a pixmap then we try to convert it to a region, and ->BitmapToRegion requires a ScreenPtr, and source-only pictures don't have one. I can imagine a use for client clip on source-only pictures, so if we really wanted to allow this, probably the way forward is to always store the clip as a region internally, and when setting the clip _from_ a pixmap, look up BitmapToRegion relative to the pixmap not the picture. But since clearly nobody can be relying on it working... Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2014-04-21xf86RandR12: use correct gamma size when allocating gamma tableDominik Behr1-3/+4
When setting crtc->gamma_size to randr_crtc->gammaSize we should use randr_crtc->gammaSize to allocate new gamma table in crtc. Currently, if randr_crtc->gammaSize > crtc->gammaSize the subsequent memcpy will overwrite memory beyond the end of gamma table. Signed-off-by: Dominik Behr <dbehr@chromium.org> Reviewed-by: Stéphane Marchesin <marcheu@chromium.org> Signed-off-by: Keith Packard <keithp@keithp.com>
2014-04-21os: Initialize the set of signals to be suppressed during our handler.Eric Anholt1-0/+1
Fixes a valgrind complaint: ==8805== Syscall param rt_sigaction(act->sa_mask) points to uninitialised byte(s) ==8805== at 0x5EB8315: __libc_sigaction (sigaction.c:66) ==8805== by 0x5B13DA: busfault_init (busfault.c:145) ==8805== by 0x5A60A2: OsInit (osinit.c:191) ==8805== by 0x46EBA2: dix_main (main.c:163) Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2014-04-21Fix hw/xfree86/common/compiler.h for mips64YunQiang Su1-1/+2
Mark mips64 as 64bit Use long as PORT_SIZE Signed-off-by: YunQiang Su <wzssyqa@gmail.com> Reviewed-by: Matt Turner <mattst88@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2014-04-21xres: Fix size estimation for <8bpp pixmaps (#69057)Adam Jackson1-2/+2
Just use floats, it's not like this is a performance path. Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Keith Packard <keithp@keithp.com>
2014-04-21shadowfb: Fix compilation errorsKeith Packard1-5/+4
Ok, that's embarassing -- I didn't even make sure Adam's patch compiled. These are minimal fixes to make it build. Signed-off-by: Keith Packard <keithp@keithp.com>
2014-04-21shadowfb: Port to miext/damage (#31303, #65547)Adam Jackson1-1529/+58
Somewhat shocking how much simpler this is, isn't it? We no longer need to wrap the screen or GC or Picture, because damage does it for us, which is doubly great since the old shadowfb code didn't wrap _enough_ things (border updates and Render glyphs, at least). The only real difference now between this and shadow is a) shadow will let you track arbitrary pixmaps, and b) shadow's update hook runs off the BlockHandler whereas shadowfb is immediate. Tested on nouveau. Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2014-04-21composite: Fix memory leak in compCopyWindowPeter Harris1-0/+1
Signed-off-by: Peter Harris <pharris@opentext.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2014-04-21dmxConfigCanvasUpdate: Delay dereference until after checking for NULLAlan Coopersmith1-1/+2
Flagged by cppcheck 1.64: [hw/dmx/config/xdmxconfig.c:306] -> [hw/dmx/config/xdmxconfig.c:323]: (warning) Possible null pointer dereference: fs - otherwise it is redundant to check it against null. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2014-04-21fb: Fix origin of source picture in fbGlyphsPeter Harris1-1/+1
If a source picture doesn't repeat and a mask format is specified, the incorrect calulation of the origin of the glyphs caused the glyphs to not be drawn at all. Noticed when running gtk-demo from RHEL 6.5 and selecting "Rotated Text". Signed-off-by: Peter Harris <pharris@opentext.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com> /* Test for this bug cc -std=c99 -o glyph glyph.c `pkg-config --cflags --libs xcb-render` */ // 16 x 16 pictfmt_a8 "glyph" static const char glyph[] = { 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0, 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0, 0, 0, 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0, 0, 0, 0, 0, 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0, 0, 0, 0, 0, 0, 0, 0xff, 0, 0, 0, 0, 0, 0, 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0, 0, 0, 0, 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0, 0, 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0, 0, 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0, 0, 0, 0, 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0, 0, 0, 0, 0, 0, 0xff, 0, 0, 0, 0, 0, 0, 0, 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0, 0, 0, 0, 0, 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0, 0, 0, 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0, 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, }; static struct { uint8_t len; uint8_t pad[3]; uint16_t deltax, deltay; uint8_t glyph; uint8_t pad2[3]; } elt = { len:1, glyph:1, deltax:WIN_SIZE/2 - GLYPH_SIZE/2, deltay:WIN_SIZE/2 - GLYPH_SIZE/2 }; int main(int argc, char *argv[]) { int screen; xcb_connection_t *c = xcb_connect(NULL, &screen); if (!c || xcb_connection_has_error(c)) { fprintf(stderr, "Cannot open default display \"%s\"\n", getenv("DISPLAY")); return EXIT_FAILURE; } // Find root window and depth const xcb_setup_t *setup = xcb_get_setup(c); if (screen >= setup->roots_len) screen = 0; xcb_screen_iterator_t si = xcb_setup_roots_iterator(setup); for (int i=0; i < screen; i++) xcb_screen_next(&si); xcb_window_t root = si.data->root; uint8_t depth = si.data->root_depth; xcb_visualid_t visual = si.data->root_visual; // Find picture formats xcb_render_query_pict_formats_reply_t *qpf; qpf = xcb_render_query_pict_formats_reply(c, xcb_render_query_pict_formats(c), NULL); if (!qpf) { fprintf(stderr, "Cannot query RENDER picture formats\n"); return EXIT_FAILURE; } xcb_render_pictformat_t fmt_a8 = 0; xcb_render_pictforminfo_iterator_t pfi = xcb_render_query_pict_formats_formats_iterator(qpf); for (int i = 0; i < xcb_render_query_pict_formats_formats_length(qpf); i++) { if (pfi.data->depth == 8 && pfi.data->type == XCB_RENDER_PICT_TYPE_DIRECT && pfi.data->direct.alpha_mask == 0xFF) { fmt_a8 = pfi.data->id; break; } xcb_render_pictforminfo_next(&pfi); } if (!fmt_a8) { fprintf(stderr, "Cannot find a8 RENDER picture format\n"); return EXIT_FAILURE; } xcb_render_pictformat_t fmt_visual = 0; xcb_render_pictscreen_iterator_t psi = xcb_render_query_pict_formats_screens_iterator(qpf); for (int i = 0; i < xcb_render_query_pict_formats_screens_length(qpf); i++) { xcb_render_pictdepth_iterator_t pdi = xcb_render_pictscreen_depths_iterator(psi.data); for (int j = 0; i < xcb_render_pictscreen_depths_length(psi.data); i++) { xcb_render_pictvisual_iterator_t pvi = xcb_render_pictdepth_visuals_iterator(pdi.data); for (int k = 0; k < xcb_render_pictdepth_visuals_length(pdi.data); i++) { if (pvi.data->visual == visual) { fmt_visual = pvi.data->format; goto found_visual; } xcb_render_pictvisual_next(&pvi); } xcb_render_pictdepth_next(&pdi); } xcb_render_pictscreen_next(&psi); } found_visual: if (!fmt_visual) { fprintf(stderr, "Cannot find visual RENDER picture format\n"); return EXIT_FAILURE; } xcb_render_glyphset_t glyphset = xcb_generate_id(c); xcb_render_create_glyph_set(c, glyphset, fmt_a8); uint32_t glyph_ids[] = {1}; xcb_render_add_glyphs(c, glyphset, 1, glyph_ids, &(xcb_render_glyphinfo_t){width:GLYPH_SIZE, height:GLYPH_SIZE}, sizeof(glyph), glyph); // Create window, pixmap, and gc xcb_window_t window = xcb_generate_id(c); uint32_t list[] = { si.data->black_pixel, XCB_EVENT_MASK_EXPOSURE }; xcb_create_window(c, XCB_COPY_FROM_PARENT, window, root, 0, 0, WIN_SIZE, WIN_SIZE, 0, XCB_WINDOW_CLASS_INPUT_OUTPUT, XCB_COPY_FROM_PARENT, XCB_CW_BACK_PIXEL | XCB_CW_EVENT_MASK, list); xcb_map_window(c, window); xcb_render_picture_t winpic = xcb_generate_id(c); xcb_render_create_picture(c, winpic, window, fmt_visual, 0, NULL); xcb_pixmap_t pixmap = xcb_generate_id(c); xcb_create_pixmap(c, depth, pixmap, window, GLYPH_SIZE, GLYPH_SIZE); xcb_render_picture_t pixpic = xcb_generate_id(c); xcb_render_create_picture(c, pixpic, pixmap, fmt_visual, 0, NULL); xcb_render_fill_rectangles(c, XCB_RENDER_PICT_OP_SRC, pixpic, (xcb_render_color_t){green:0xFFFF, alpha:0xFFFF}, 1, &(xcb_rectangle_t){width:GLYPH_SIZE, height:GLYPH_SIZE} ); xcb_flush(c); for (xcb_generic_event_t *ev = xcb_wait_for_event(c); ev; ev = xcb_wait_for_event(c)) { int type = ev->response_type; free(ev); if (type == XCB_EXPOSE) { xcb_clear_area(c, 0, window, 0, 0, 0, 0); xcb_render_composite_glyphs_8(c, XCB_RENDER_PICT_OP_SRC, pixpic, winpic, fmt_a8, glyphset, 0, 0, sizeof(elt), (uint8_t *)&elt); xcb_flush(c); } } return EXIT_SUCCESS; }
2014-04-21glamor: Add remaining header files to SOURCESMichel Dänzer1-0/+3
It wasn't possible to build glamor from tarballs. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=64297#c9 Signed-off-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2014-04-21dixfonts: Turn a missing directory ErrorF into a DebugFJasper St. Pierre1-1/+1
On systems without these directories, we don't need to be complaining loudly. Reviewed-by: Kristian Hoegsberg <krh@bitplanet.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2014-04-21Merge remote-tracking branch 'krh/xwayland-for-keithp'Keith Packard2-4/+7
2014-04-21.gitignore: Add new autotools file 'test-driver'Kristian Høgsberg2-0/+3
Automake 1.12 introduces a new parallel test framework that uses a shell script helper and generates *.log and *.trs files. Add to .gitignore. Signed-off-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com>
2014-04-21configure: require xproto 7.0.26 for pointer typedef removalJulien Cristau1-1/+1
Signed-off-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2014-04-21configure: require fontsproto 2.1.3 for pointer typedef removalJulien Cristau1-1/+1
Signed-off-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2014-04-21randr: Implement RandR 1.4 request swappingRobert Morell1-0/+138
The protocol handlers all have support for swapping variable data and replies, but the top-level dispatch plumbing was missing. Signed-off-by: Robert Morell <rmorell@nvidia.com> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2014-04-21randr: Fix size checks for SetProvider* reqsRobert Morell1-2/+2
Both xRRSetProviderOutputSourceReq and xRRSetProviderOffloadSinkReq are fixed-size requests, so the length on the wire should match exactly. Signed-off-by: Robert Morell <rmorell@nvidia.com> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2014-04-21randr: Fix crash for NULL swap dispatch procsRobert Morell1-1/+1
The previous code was checking the wrong table for function pointers. Signed-off-by: Robert Morell <rmorell@nvidia.com> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2014-04-21xwayland: Remove left-over ErrorF loggingKristian Høgsberg1-1/+0
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net> Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2014-04-21DRI2SwapBuffers: Fix uninitialized target SBC.Jamey Sharp1-5/+8
Fixes Piglit test "swapbuffersmsc-return swap_interval 0". Ensure that *swap_target gets initialized on any 'return Success' path, even if the swap request can't be completed by the driver and the server falls back to a simple blit. That path can also be triggered by setting swap_interval to 0, which disables sync to vertical retrace. We originally found this bug because for some reason SDL2 automatically sets swap_interval to 0, when we were trying to test OML_sync_control in an SDL2 test application. We then discovered that the above-mentioned Piglit test has been failing for the same reason since it was introduced. Signed-off-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Theo Hill <Theo0x48@gmail.com> Reviewed-by: Keith Packard <keithp@keithp.com> Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Keith Packard <keithp@keithp.com>