summaryrefslogtreecommitdiff
path: root/fb
AgeCommit message (Collapse)AuthorFilesLines
2017-09-13fb: Check whether the window is enabled directlyAdam Jackson1-1/+1
... instead of its root window. Xwayland's rootless mode empties the root window border clip since its root window has no storage, but redirected windows (the only kind it can show) will have a non-empty border clip anyway, cf. the #ifdef COMPOSITE in miComputeClips. With this change, non-glamor Xwayland's GetImage actually works. Other acceleration layers may need to change to account for this, but this appears to be safe for the existing open source drivers. Only the xfree86 DDX has any problem with losing its framebuffer on VT switch, and even then only for UMS drivers (which excludes glamor, uxa, and sna from consideration). This leaves exa, which already contains code to evict pixmaps to host memory on VT switch. Since the xfree86 core will still empty the root clip on VT switch, while the root window itself may not contain a valid image we won't try to touch it, but GetImage from a redirected window will now work even when switched away. Acked-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-05-29fb: remove some superfluous empty linesPeter Hutterer1-5/+0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-04-27meson: Build libwfb.soAdam Jackson1-0/+11
Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-04-26Add a Meson build system alongside autotools.Eric Anholt1-0/+36
This is a work in progress that builds Xvfb, Xephyr, Xwayland, Xnest, and Xdmx so far. The outline of Xquartz/Xwin support is in tree, but hasn't been built yet. The unit tests are also not done. The intent is to build this as a complete replacement for the autotools system, then eventually replace autotools. meson is faster to generate the build, faster to run the bulid, shorter to write the build files in, and less error-prone than autotools. v2: Fix indentation nits, move version declaration to project(), use existing meson_options for version-config.h's vendor name/web. Signed-off-by: Eric Anholt <eric@anholt.net> Acked-by: Keith Packard <keithp@keithp.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-20fb: Handle ZPixmap planemask in GetImage the other way aroundAdam Jackson1-3/+6
Formerly we'd zero the image data and then pull out a plane at a time. It's faster to apply the planemask after the fact, since that turns the GetImage into a memcpy: 100000.0 101000.0 (1.010) (copy 0xaaaaaaaa) ShmGetImage 10x10 square 42400.0 59400.0 (1.401) (copy 0xaaaaaaaa) ShmGetImage 100x100 square 3040.0 5280.0 (1.737) (copy 0xaaaaaaaa) ShmGetImage 500x500 square 96100.0 95200.0 (0.991) (0xaaaaaaaa) GetImage 10x10 square 29600.0 36800.0 (1.243) (0xaaaaaaaa) GetImage 100x100 square 1850.0 2620.0 (1.416) (0xaaaaaaaa) GetImage 500x500 square Measured with Xvfb at depth 24 on Skylake i7-6560U. Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-03-17fb: Remove 24bpp support (v3)Adam Jackson24-2129/+87
v2: - Require power-of-two bpp in ScreenInit - Eliminate fbCreatePixmapBpp v3 - Squash in the exa and glamor changes so we can remove pRotatedPixmap in the same stroke. Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-02-16fb: Remove stray references to fbHasVisualTypesAdam Jackson2-5/+0
Removed in 84e8de12. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-02-16fb: Remove unused fbGetFreeCompClip macroAdam Jackson1-1/+0
Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-02-16wfb: Hide init function decls behind FB_ACCESS_WRAPPERAdam Jackson1-3/+2
Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-02-16wfb: Add missing rename for fbGlyphsAdam Jackson1-0/+1
Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-10-04fb: XYPixmap format PutImage includes all planes in depthKeith Packard1-1/+1
Unlike GetImage, for which the provided planemask restricts the data delivered, for PutImage in XYPixmap format, all of the planes in the drawable depth are sent and those outside the plane mask are simply ignored. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2015-09-29Fix alphamap interactions with wfbArcady Goldmints-Orlov1-2/+11
Set a destructor function on pixman images and call fbFinishAccess() from there, rather than directly from free_pixman_pict(). This ensures that fbFinishAccess() gets called even if pixman still has a reference to the image after free_pixman_pict(), as is the case for alphamaps. [ajax: Squash an unused variable warning in the non-wfb build] Reviewed-by: Aaron Plattner <aplattner@nvidia.com> Signed-off-by: Arcady Goldmints-Orlov <arcadyg@nvidia.com> Reviewed-by: Søren Sandmann <ssp@redhat.com>
2015-07-08fb: Make rootless-agnosticAdam Jackson1-5/+0
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
2015-04-21Convert exa & fb to new *allocarray functionsAlan Coopersmith2-2/+2
v2: fixup whitespace Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-11-12Drop trailing whitespacesPeter Hutterer11-17/+17
sed -i "s/[ ]\+$//g" **/*.(c|h) happy reviewing... git diff -w is an empty diff. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-10-27fb: Fix Bresenham algorithms for commonly used small segments.Alex Orange1-9/+11
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=54168 Fix errors introducted in 863d528a9f76d0e8f122aebf19f8564a4c67a938. Said patch does indeed remove the problematic writes to bad memory, however it also introduces errors in the algoritm. This patch has the effect of reverting said patch and adding an if in the proper location to catch the out of bounds memory write without causing problems to the overall algorithm. Signed-off-by: Alex Orange <crazycasta@gmail.com> Reviewed-by: Peter Harris <pharris@opentext.com> Tested-by: Peter Harris <pharris@opentext.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2014-10-27fb: Hide fbPush{Pattern,Fill}Adam Jackson2-16/+2
Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-27fb: Hide fbDotsAdam Jackson2-11/+1
Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-27fb: Hide Bresenham line detailsAdam Jackson2-35/+9
Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-27fb: Hide some zero-width line detailsAdam Jackson3-13/+2
Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-27fb: Hide glyph implementation detailsAdam Jackson5-18/+3
Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-27fb: Remove even/odd tile slow-pathingAdam Jackson5-206/+38
Again, clearly meant to be a fast path, but this turns out not to be the case. Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-27fb: Remove unused fbReduceRasterOpAdam Jackson3-83/+0
Appears to have been cargo-culted in from cfb and then never used. Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-27fb: Move fbStipple*Bits near their only consumerAdam Jackson4-121/+111
And remove fbStippleTable since gcc can't figure that out itself. Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-27fb: Remove even/odd stipple slow-pathingAdam Jackson7-460/+60
This is clearly meant to be a fast path, but it appears to be a net loss at this point. If you really wanted to ricer-tune here, note that the inner loop of fbBltOne is a bit too complicated for gcc (at least 4.8.2), it doesn't specialize the loop for the handful of legal values of bitsPerDst, which means computing at runtime what could have been const-propped. Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-27fb: FB_SHIFT is 5 (and FB_UNIT is 32)Adam Jackson9-723/+9
The other paths don't build or work, PCI and other buses are almost always 32 bit data paths, and X doesn't really support pixels bigger than that anyway. Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-27fb: Eliminate fbLaneTable, staticize fb{8,16,32}LaneAdam Jackson2-22/+15
gcc doesn't appear to be smart enough to fold away the indirection here, even if you make fbLaneTable const. Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-23render: Always store client clip as a regionAdam Jackson1-1/+1
This does have one semantic change. FixesCreateRegionFromPicture used to throw BadImplementation if you tried to create a region from a picture with no client clip. I changed that to BadMatch here since that more honestly describes what's going on. Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2014-10-09fb: fb{Map,Unmap}Window -> fb{Realize,Unrealize}WindowAdam Jackson4-8/+8
Make the function names match the screen slot name. Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-09mi: Drop plane argument from miHandleExposuresAdam Jackson1-1/+1
This existed to be passed to the bs recovery routine; since we back all planes, we don't care. Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-09dix: Drop the third argument from WindowExposuresProcPtrAdam Jackson2-6/+3
A careful read shows that it was always NULL. It hasn't always been; as the DDX spec indicates, it was the "occluded region that has backing store", but since that backing store code is long gone, we can nuke it. mi{,Overlay}WindowExposures get slightly simpler here, and will get even simpler in just a moment. Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-08-21fb: Fix invalid bpp for 24bit depth windowTakashi Iwai1-1/+1
We have a hack in fb layer for a 24bpp screen to use 32bpp images, and fbCreateWindow() replaces its drawable.bitsPerPixel field appropriately. But, the problem is that it always replaces when 32bpp is passed. If the depth is 32, this results in bpp < depth, which is actually invalid. Meanwhile, fbCreatePixmap() has a more check and it creates with 24bpp only when the passed depth <= 24 for avoiding such a problem. This oneliner patch just adds the similar check in fbCreateWindow(). This (hopefully) fixes the long-standing broken graphics mess of cirrus KMS with 24bpp. Signed-off-by: Takashi Iwai <tiwai@suse.de> Reviewed-by: Keith Packard <keithp@keithp.com>
2014-07-03fb: Don't free NULL pixmap in fbCloseScreen. Bug #80313Keith Packard1-1/+2
We fixed fbCloseScreen to use the FreePixmap function so that the private counts would be updated correctly during CloseScreen. Xvfb calls FreePixmap and sets devPrivate to NULL before fbCloseScreen is called; not checking devPrivate before calling would result in a NULL pointer dereference. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Julien Cristau <jcristau@debian.org>
2014-06-04fb: fix screen pixmap leak on server resetBrendan King1-1/+1
Call FreePixmap() instead of free() to destroy the screen pixmap in fbCloseScreen(). Signed-off-by: Frank Binns <frank.binns@imgtec.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-03fb: Publish fbGlyphs and fbUnrealizeGlyphKeith Packard2-3/+16
This lets other code jump directly into the fb code for fallbacks Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-31Merge remote-tracking branch 'jturney/master'Keith Packard1-2/+1
2014-03-27fb: fix fast-path blt detectionKeith Packard1-27/+33
The width parameter is used to disable the blit fast-path (memcpy) when source and destination rows overlap in memory. This check was added in [0]. Unfortunately, the calculation to determine if source and destination lines overlapped was incorrect: (1) it converts width from pixels to bytes, but width is actually in bits, not pixels. (2) it adds this byte offset to dst/srcLine, which implicitly converts the offset from bytes to sizeof(FbBits). Fix both of these by converting addresses to byte pointers and width to bytes and doing comparisons on the resulting byte address. For example: A 32-bpp 1366 pixel-wide row will have width = 1366 * 32 = 43712 bits bpp = 32 (bpp >> 3) = 4 width * (bpp >> 3) = 174848 FbBits (FbBits *)width => 699392 bytes So, "careful" was true if the destination line was within 699392 bytes, instead of just within its 1366 * 4 = 5464 byte row. This bug causes us to take the slow path for large non-overlapping rows that are "close" in memory. As a data point, XGetImage(1366x768) on my ARM chromebook was taking ~140 ms, but with this fixed, it now takes about 60 ms. XGetImage() -> exaGetImage() -> fbGetImage -> fbBlt() [0] commit e32cc0b4c85c78cd8743a6e1680dcc79054b57ce Author: Adam Jackson <ajax@redhat.com> Date: Thu Apr 21 16:37:11 2011 -0400 fb: Fix memcpy abuse The memcpy fast path implicitly assumes that the copy walks left-to-right. That's not something memcpy guarantees, and newer glibc on some processors will indeed break that assumption. Since we walk a line at a time, check the source and destination against the width of the blit to determine whether we can be sloppy enough to allow memcpy. (Having done this, we can remove the check for !reverse as well.) v3: Convert to byte units This first checks to make sure the blt is byte aligned, converts all of the data to byte units and then compares for byte address range overlap between source and dest. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
2014-03-27Build fbcmap_mi.c once, rather than once for each DDXJon TURNEY1-2/+1
Build fbcmap_mi.c once, rather than once for each DDX, and make it part of libfb or libwfb convenience library. Since 84e8de1271bb11b5b4b9747ae4647f47333a8ab7 we don't have fbcmap.c This is a sort of revert of 17d85387d1e6851d35474b65929e268ca64ef65b v2: Remove libkdrivestubs.la from configure.ac Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
2014-01-12Replace 'pointer' type with 'void *'Keith Packard8-31/+31
This lets us stop using the 'pointer' typedef in Xdefs.h as 'pointer' is used throughout the X server for other things, and having duplicate names generates compiler warnings. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2013-09-10fb: Remove unused compatibility wrappersAdam Jackson2-61/+0
Originally added in early 2009, not being used elsewhere anymore. Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-04-30dix: allow pixmap dirty helper to be used for non-shared pixmapsDave Airlie1-0/+1
this allows the pixmap dirty helper to be used for reverse optimus, where the GPU wants to copy from the shared pixmap to its VRAM copy. [airlied: slave_dst is wrong name now but pointless ABI churn at this point] Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-03-18Merge remote-tracking branch 'whot/next'Keith Packard1-6/+2
2013-03-07fb: Rename wfbDestroyGlyphCacheAaron Plattner1-0/+1
Renaming this function was missed in commit 9cbcb5bd6a5360a128d15b77a02d8d3351f74366, so both libfb.so and libwfb.so define functions named fbDestroyGlyphCache. Signed-off-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Søren Sandmann <ssp@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2013-02-15fb: drop two unneeded shadowing variablesPeter Hutterer1-6/+2
fbpict.c: In function 'fbGlyphs': fbpict.c:188:6: warning: declaration of 'x' shadows a previous local [-Wshadow] fbpict.c:111:9: warning: shadowed declaration is here [-Wshadow] fbpict.c:188:9: warning: declaration of 'y' shadows a previous local [-Wshadow] fbpict.c:111:12: warning: shadowed declaration is here [-Wshadow] Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Soren Sandmann <ssp@redhat.com> Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
2012-12-05Fix formatting of address operatorsYaakov Selkowitz1-2/+2
The formatter confused address operators preceded by casts with bitwise-and expressions, placing spaces on either side of both. That syntax isn't used by ordinary address operators, however, so fix them for consistency. Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-11-05fb: fix shadow warningsYaakov Selkowitz2-10/+10
fbblt.c: In function 'fbBlt': fbblt.c:76:16: warning: declaration of 'src' shadows a previous local fbblt.c:52:13: warning: shadowed declaration is here fbblt.c:77:16: warning: declaration of 'dst' shadows a previous local fbblt.c:52:19: warning: shadowed declaration is here fbbltone.c: In function 'fbBltPlane': fbbltone.c:742:13: warning: declaration of 'w' shadows a previous local fbbltone.c:725:9: warning: shadowed declaration is here Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-10-25Use new pixman_glyph_cache_t API that will be in pixman 0.28.0Søren Sandmann Pedersen3-1/+156
This new API allows glyphs to be cached in a data structure in pixman, and entire glyph strings to be composited in one go. Also bump pixman dependency to 0.27.2. Results from the cairo peformance test suite running against Xvfb with a screen size of 1680x1050@32bpp: Speedups ======== xlib firefox-talos-gfx 12416.63 -> 3603.93 3.45x speedup ██▌ xlib xfce4-terminal-a1 1727.57 -> 1048.85: 1.65x speedup ▋ xlib evolution 1370.49 -> 869.34: 1.58x speedup ▋ xlib gnome-terminal-vim 1832.83 -> 1251.94: 1.46x speedup ▌ xlib poppler 1519.70 -> 1204.05: 1.26x speedup ▎ xlib firefox-planet-gnome 6982.55 -> 5598.16: 1.25x speedup ▎ xlib ocitysmap 1142.77 -> 1071.53: 1.07x speedup ▏ No slowdowns were reported. Results of x11perf -aa10text: Before: 8000000 reps @ 0.0007 msec (1450000.0/sec) 8000000 reps @ 0.0007 msec (1460000.0/sec) 8000000 reps @ 0.0007 msec (1460000.0/sec) 8000000 reps @ 0.0007 msec (1470000.0/sec) 8000000 reps @ 0.0007 msec (1480000.0/sec) 40000000 trep @ 0.0007 msec (1460000.0/sec) After: 32000000 reps @ 0.0002 msec (4910000.0/sec) 32000000 reps @ 0.0002 msec (4830000.0/sec) 32000000 reps @ 0.0002 msec (4890000.0/sec) 32000000 reps @ 0.0002 msec (4830000.0/sec) 32000000 reps @ 0.0002 msec (4900000.0/sec) 160000000 trep @ 0.0002 msec (4870000.0/sec) Version 2: Destroy the glyph cache at server regen time Acked-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Soren Sandmann <ssp@redhat.com>
2012-09-23dix: Remove #includes of mibstore.hDaniel Martin1-1/+0
Remove more backing store leftovers. Reviewed-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2012-08-14fb: reorder Bresenham error correction to avoid overshoot.Simon Schubert1-9/+9
When fbBresSolid draws a line, it can happen that after the last pixel, the Bresenham error term overflows, and fbBresSolid paints another pixel before adjusting the error term. However, if this happens on the last pixel (len=0), this extra pixel might overshoot the boundary, and, in rare cases, lead to a segfault. Fix this issue by adjusting for the Bresenham error term before drawing the main pixel, not after. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=24274 Signed-off-by: Simon Schubert <2@0x2c.or> Tested-by: Mitch Davis <mjd+freedesktop.org@afork.com> Signed-off-by: Matt Turner <mattst88@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com>