Alan Coopersmith [Mon, 21 Apr 2014 22:18:45 +0000 (15:18 -0700)]
dmxConfigCanvasUpdate: Delay dereference until after checking for NULL
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>
Peter Harris [Fri, 11 Apr 2014 21:44:59 +0000 (17:44 -0400)]
fb: Fix origin of source picture in fbGlyphs
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;
}
Michel Dänzer [Fri, 11 Apr 2014 02:01:51 +0000 (11:01 +0900)]
glamor: Add remaining header files to SOURCES
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>
Jasper St. Pierre [Mon, 21 Apr 2014 20:30:49 +0000 (16:30 -0400)]
dixfonts: Turn a missing directory ErrorF into a DebugF
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>
Keith Packard [Mon, 21 Apr 2014 21:59:51 +0000 (14:59 -0700)]
Merge remote-tracking branch 'krh/xwayland-for-keithp'
Kristian Høgsberg [Tue, 25 Mar 2014 21:57:12 +0000 (14:57 -0700)]
.gitignore: Add new autotools file 'test-driver'
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>
Julien Cristau [Mon, 14 Apr 2014 13:27:19 +0000 (15:27 +0200)]
configure: require xproto 7.0.26 for pointer typedef removal
Signed-off-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
Julien Cristau [Mon, 14 Apr 2014 13:27:18 +0000 (15:27 +0200)]
configure: require fontsproto 2.1.3 for pointer typedef removal
Signed-off-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
Robert Morell [Sat, 19 Apr 2014 01:29:44 +0000 (18:29 -0700)]
randr: Implement RandR 1.4 request swapping
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>
Robert Morell [Sat, 19 Apr 2014 01:29:43 +0000 (18:29 -0700)]
randr: Fix size checks for SetProvider* reqs
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>
Robert Morell [Sat, 19 Apr 2014 01:29:42 +0000 (18:29 -0700)]
randr: Fix crash for NULL swap dispatch procs
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>
Kristian Høgsberg [Mon, 21 Apr 2014 18:14:51 +0000 (11:14 -0700)]
xwayland: Remove left-over ErrorF logging
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Jamey Sharp [Fri, 18 Apr 2014 19:22:19 +0000 (12:22 -0700)]
DRI2SwapBuffers: Fix uninitialized target SBC.
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>
Jamey Sharp [Fri, 18 Apr 2014 19:22:18 +0000 (12:22 -0700)]
DRI2SwapBuffers: Don't reuse swap_target variable.
swap_target is an out-parameter that needs to be set to the value that
SBC will take on after this SwapBuffers request completes.
However, it was also being used as a temporary variable to hold the MSC
at which the SwapBuffers request got scheduled to occur. This confusion
makes it harder to reason about whether swap_target is being set
correctly for its out-parameter usage. (Hint: It isn't.)
For the latter use, it makes more sense to use the existing target_msc
variable, which already has the right value unless target_msc, divisor,
and remainder are all 0, in which case we can set it using swap_interval
as usual.
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>
Kristian Høgsberg [Tue, 8 Apr 2014 16:23:42 +0000 (09:23 -0700)]
configure.ac: Remove check for WAYLAND_SCANNER_RULES
This makes configure fail if the wayland autoconf macros aren't found.
We don't need the scanner for shm-only xwayland so just drop this line for
now.
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Kristian Høgsberg [Tue, 8 Apr 2014 16:19:13 +0000 (09:19 -0700)]
xwayland: Build without xshmfence
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Kristian Høgsberg [Tue, 8 Apr 2014 16:17:51 +0000 (09:17 -0700)]
xwayland: Build without GLX extension
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Keith Packard [Fri, 18 Apr 2014 22:12:14 +0000 (15:12 -0700)]
xkb: Verify reads of compiled keymap header and TOC
Check the return values from fread to make sure the elements are
actually getting read from the file.
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Keith Packard [Fri, 18 Apr 2014 22:09:50 +0000 (15:09 -0700)]
os: Ignore log file write failures
There's no place to log the message if writing to the log file fails,
and we surely don't want to crash in that case, so just ignore errors
and keep going.
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Keith Packard [Fri, 18 Apr 2014 22:05:00 +0000 (15:05 -0700)]
os: Make sure that writing our pid to the lock file actually worked
There's no sense verifying that we can create the lock file and then
ignoring the return value from write.
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Keith Packard [Fri, 18 Apr 2014 22:00:30 +0000 (15:00 -0700)]
os: FatalError if -displayfd writes fail
When the server is started with the -displayfd option, check to make
sure that the writes succeed and give up running if they don't.
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Keith Packard [Fri, 18 Apr 2014 22:00:35 +0000 (15:00 -0700)]
os: Clear the -displayfd option after closing the file
Failing to clear this means that we'll attempt to write the display
number to a random file descriptor on subsequent X server generations.
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Keith Packard [Fri, 18 Apr 2014 21:54:02 +0000 (14:54 -0700)]
kdrive: Ignore failure to chown console tty to current user
I'm not sure what we'd do in this case anyways, other than fatal
error.
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Keith Packard [Fri, 18 Apr 2014 21:50:14 +0000 (14:50 -0700)]
kdrive: Explicitly ignore errors from the -switchCmd script
Make it clear that we intentionally ignore the -switchCmd return
value. This keeps GCC from emitting a warning when the server is
compiled with -D_FORTIFY_SOURCE=2.
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Keith Packard [Fri, 18 Apr 2014 21:47:00 +0000 (14:47 -0700)]
test: [v2] Validate server log reading more carefully in signal-logging test
Check return value from fgets and strchr instead of assuming they
worked.
[v2]
Don't do any necessary work inside the assert call.
Also make sure the return value was long enough.
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Gaetan Nadon [Fri, 4 Apr 2014 18:59:21 +0000 (14:59 -0400)]
test: create a link to the generated hw/xfree86/sdksyms.c at build time
Automake 1.14 gives us warning about source code specified in _SOURCES
that comes from directories other than the current one. It suggests to enable
the subdir-objects feature which only supports code in sub directories.
The test directory needs source from hw/xfree86 which is neither under test
nor under a sub directory of test. In 1.14 we get a warning, in 2.0 it will
break as it will overwrite the object code in xfree86.
The solution in this case is to create a link to hw/xfree86/sdksyms.c at build
time. It's just like any other built source file.
There are no links created in git.
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
Adam Jackson [Thu, 17 Apr 2014 14:49:46 +0000 (10:49 -0400)]
dri1: Don't bother asking the loader about drmGetLibVersion
This was added for DRM_IOCTL_SET_VERSION support, which has been around
for over ten years now. Since we require ≥2.3.0 in configure.ac this
would really only protect you if you managed to build against a modern
libdrm but run against one that's more than 7½ years old, which, doctor
it hurts when I do this.
Archaeology: http://cgit.freedesktop.org/~ajax/dri/commit/xc/programs/Xserver/GL/dri/dri.c?id=
77d62efca033dced96ab7998b7c62a4e2df907d5
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
Hans de Goede [Fri, 18 Apr 2014 09:30:16 +0000 (11:30 +0200)]
Xorg.wrap manpages: use __appmansuffix__ instead of hardcoding 1
Cc: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
Hans de Goede [Fri, 18 Apr 2014 09:26:00 +0000 (11:26 +0200)]
man/Makefile.am: Fix Xorg.wrap.man Xwrapper.config.man missing from make dist
Fix suggested by: Gaetan Nadon <memsize@videotron.ca>
Cc: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
Guillem Jover [Mon, 14 Apr 2014 16:13:25 +0000 (18:13 +0200)]
Xorg.wrap: Make the console check portable
Handle the unported case by issuing a build-time and run-time warning.
And add support for FreeBSD kernel based systems, by using the
VT_GETINDEX ioctl to check if the file descriptor is on a virtual
console.
Signed-off-by: Guillem Jover <guillem@hadrons.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Guillem Jover [Mon, 14 Apr 2014 16:13:24 +0000 (18:13 +0200)]
Xorg.wrap: Clarify error messages
Not printing the program name produces very confusing messages that
might be difficult to attribute while trying to diagnose problems,
let's be explicit about who we are.
Also add a missing "/" between SUID_WRAPPER_DIR and "Xorg.bin".
Signed-off-by: Guillem Jover <guillem@hadrons.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Guillem Jover [Mon, 14 Apr 2014 16:13:23 +0000 (18:13 +0200)]
Xorg.wrap: Use <drm.h> instead of hardcoding libdrm include path
The libdrm.pc file gives us the correct include path, do not try to
hardcode it on the source, as it might vary on the installed system,
for example on Debian-based systems it's under /user/include/libdrm/.
Signed-off-by: Guillem Jover <guillem@hadrons.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Guillem Jover [Mon, 14 Apr 2014 16:13:22 +0000 (18:13 +0200)]
Xorg: Add Xorg.wrap to hw/xfree86/.gitignore
Signed-off-by: Guillem Jover <guillem@hadrons.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Julien Cristau [Sun, 13 Apr 2014 17:14:34 +0000 (19:14 +0200)]
configure: fix help text for dmx
As of
93fa64e17d7bd600ebf18ecab85f5b2d17fe30ce it's disabled by default,
so stop saying it's automatically enabled in configure --help.
Signed-off-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Keith Packard [Tue, 8 Apr 2014 08:01:28 +0000 (01:01 -0700)]
glamor: Always allocate precisely the requested pixmap size
Using a pixmap as a tile or stipple means that we must have the
underlying FBO match the pixmap geometry exactly. We may want to add
some complexity here to migrate pixmaps into exact sized objects as
necessary, but for now, make the server work correctly by skipping
this optimization.
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Keith Packard [Thu, 10 Apr 2014 04:59:17 +0000 (21:59 -0700)]
Merge remote-tracking branch 'jeremyhu/master'
Keith Packard [Tue, 8 Apr 2014 21:25:18 +0000 (14:25 -0700)]
Bump to version 1.15.99.902. Closing the 1.16 merge window.
Signed-off-by: Keith Packard <keithp@keithp.com>
Keith Packard [Fri, 4 Apr 2014 23:28:43 +0000 (16:28 -0700)]
dri3: Fix dri3_open API change by adding new dri3_open_client
Xwayland will eventually need the current client in dri3_open. Simply
changing that API is not an option though as other drivers that
implement DRI3 will not have a matching function signature and will
crash when called.
Add a new dri3_open_client function pointer and bump
DRI3_SCREEN_INFO_VERSION so that drivers can be aware of the new
function which will be used in preference to the old function when
available.
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anhole <eric@anholt.net>
Jeremy Huddleston Sequoia [Sun, 6 Apr 2014 12:32:00 +0000 (05:32 -0700)]
XQuartz: Ensure we wait for the server thread to terminate
AKA: XQuartz 2.7.5 doesn't delete its /tmp/.X$d-lock
http://xquartz.macosforge.org/trac/ticket/823
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Michael Thayer [Mon, 31 Mar 2014 09:21:42 +0000 (11:21 +0200)]
Add a return value to load_cursor_argb() to allow it to report failure
load_cursor_argb() may need to be able to fail and have the server fall back
to a software cursor in at least the following circumstances.
1) The hardware can only support some ARGB cursors and this does not just
depend on cursor size.
2) Virtual hardware may not wish to pass through a cursor to the host at a
particular time but may wish to accept the same cursor at another time.
This patch adds a return value to the API and makes the server do the
software fall-back on failure.
Signed-off-by: Michael Thayer <michael.thayer@oracle.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
Michael Thayer [Mon, 31 Mar 2014 09:19:16 +0000 (11:19 +0200)]
Set a flag property on the root window to say if the X server VT is active
An X11 client may need to know whether the X server virtual terminal is
currently the active one. This change adds a root window property which
provides that information. Intended interface user: the VirtualBox Guest
Additions.
Signed-off-by: Michael Thayer <michael.thayer@oracle.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
Daniel Stone [Thu, 3 Apr 2014 17:22:50 +0000 (18:22 +0100)]
Add pScreen->NameWindowPixmap hook
This hook allows drivers to be notified when a pixmap gains a new ID.
(ABI break.)
Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
Keith Packard [Thu, 3 Apr 2014 22:35:01 +0000 (15:35 -0700)]
Merge remote-tracking branch 'krh/xwayland-for-keithp'
Kristian Høgsberg [Tue, 11 Mar 2014 23:11:39 +0000 (16:11 -0700)]
Xwayland DDX
Started out as an Xorg module to be used from Xorg drivers to let
Xorg run under a wayland server. The idea was to be able to reuse the
2D acceleration from the Xorg driver. Now with glamor being credible,
a better plan is to just make Xwayland its own DDX, similar to Xwin
and Xquartz. This is a much better fit, as much of the code in the
original approach had to hack around Xorg doing Xorg things like take
over the VT, probe input devices and read config files. Another big win
is that Xwayland dosn't need to be setuid root.
The Xwayland support for DRI3, Glamor and render nodes was done by
Axel Davy <axel.davy@ens.fr>, who also did a lot of work on the rebase
to the Xwayland DDX.
Contributions from:
Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
Corentin Chary <corentin.chary@gmail.com>
Daniel Stone <daniel@fooishbar.org>
Kristian Høgsberg <krh@bitplanet.net>
Robert Bragg <robert@linux.intel.com>
Scott Moreau <oreaus@gmail.com>
Tiago Vignatti <tiago.vignatti@intel.com>
Giovanni Campagna <gcampagn@redhat.com>
Jonas Ådahl <jadahl@gmail.com>
Ray Strode <rstrode@redhat.com>
Trevor McCort <tjmccort@gmail.com>
Rui Matos <tiagomatos@gmail.com>
Axel Davy <axel.davy@ens.fr>
Jasper St. Pierre <jstpierre@mecheye.net>
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Axel Davy <axel.davy@ens.fr>
Keith Packard [Wed, 2 Apr 2014 04:15:48 +0000 (21:15 -0700)]
glamor: Add glamor_program based poly_text and image_text
Accelerates text painting with GPU-based geometry computation and stippling
v2: Simplify get_glyphs, expand single character variable names to
more descriptive ones. (Markus Wick)
v3: Rebase against the glamor_prepare_* un-renaming (changes by anholt).
Improves x11perf -f8text by 417.908% +/- 11.0144% (n=10)
Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Keith Packard [Wed, 2 Apr 2014 04:15:47 +0000 (21:15 -0700)]
glamor: Use glamor_program for glamor_glyphblt
This constructs suitable shaders using the glamor_program
infrastructure for poly glyph blt, and then gets rid of the no-op
wrapper of miImageGlyphBlt.
Improves x11perf -f8text by 11.6221% +/- 1.04585% (n=10)
Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Keith Packard [Wed, 2 Apr 2014 04:15:46 +0000 (21:15 -0700)]
glamor: Add glamor_program based poly_fill_rect
This accelerates poly_fill_rect using GPU-based geometry computation
Improves x11perf -rect100 by 41.5127% +/- 7.63888% (n=10)
Improves x11perf -rect10 by 3745.72% +/- 94.7503% (n=6)
v2: Rebase on skipping the prepare rewrite for now, and fix the GLSL
1.20 and GLES2 cases (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>
Keith Packard [Wed, 2 Apr 2014 04:15:45 +0000 (21:15 -0700)]
glamor: Add glamor_program based fill/set/get spans
This accelerates spans operations using GPU-based geometry computation
-wellipse500 goes from about 4k/sec before the patch, to ~8k/sec in
the GLES2 fallback loop, to ~100k/sec in desktop mode.
v2: Rebase on skipping the prepare rewrite for now, and fix the GLSL
1.20 and GLES2 cases (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>
Keith Packard [Wed, 2 Apr 2014 04:15:43 +0000 (21:15 -0700)]
glamor: Add simple upload/download functions in glamor_transfer
These use glTexSubimage2D for upload and glReadPixels for
download. There are a variety of interfaces to the basic function as
needed by the callers.
Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Keith Packard [Wed, 2 Apr 2014 04:15:42 +0000 (21:15 -0700)]
glamor: Use plain GLSL 1.20 features for fill code.
This prevents performance regressions from losing acceleration support
on older hardware as we transition to using glamor_program.c for
acceleration.
Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Keith Packard [Wed, 2 Apr 2014 04:15:42 +0000 (21:15 -0700)]
glamor: Compute supported GLSL version and save in screen private
This currently computes the GLSL version in a fairly naïve fashion,
and leaves that in the screen private for other users. This will let
us update the version computation in one place later on.
v2: Drop an accidental rebase-squashed hunk (change 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>
Keith Packard [Wed, 2 Apr 2014 04:15:41 +0000 (21:15 -0700)]
fb: Publish fbGlyphs and fbUnrealizeGlyph
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>
Keith Packard [Wed, 2 Apr 2014 03:54:22 +0000 (20:54 -0700)]
glamor: Bail from composite when pixmap cannot be uploaded
I think the sense of the return value was just flipped here; if you
return TRUE, then the calling code assumes that the pixmap *has* been
uploaded and that an FBO is available. When it tries to use it, it
crashes though. Returning false makes the caller bail back to software.
Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Keith Packard [Wed, 2 Apr 2014 03:54:21 +0000 (20:54 -0700)]
glamor: Remove warning message when pixmap cannot be stored in a texture
This happens when you have 4bpp pixmaps; it's not an error, so stop
flooding the log file when it happens.
Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Keith Packard [Wed, 2 Apr 2014 03:54:20 +0000 (20:54 -0700)]
glamor: Public polyLines function is glamor_poly_lines_nf
There was a spurious declaratoin in glamor.h for glamor_poly_line_nf
Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Keith Packard [Wed, 2 Apr 2014 03:54:19 +0000 (20:54 -0700)]
glamor: Initialize XV shaders from glamor_xv_init instead of glamor_init
The glamor_init calls to glamor_init_xv_shader were never getting run
because GLAMOR_XV was never defined. Instead of trying to make that
work, fix glamor_xv_init to make the call instead.
Further, just get rid of the glamor_fini_xv_shader function entirely
as the shader program will be destroyed when the context is destroyed
at server reset time.
Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Keith Packard [Wed, 2 Apr 2014 03:54:18 +0000 (20:54 -0700)]
glamor: SetWindowPixmap is not related to RENDER
Move the configuration of screen->SetWindowPixmap out from under it.
Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Keith Packard [Wed, 2 Apr 2014 03:54:15 +0000 (20:54 -0700)]
glamor: glamor_poly_point_nf cannot fail for non-DDX pixmaps
All of the glamor _nf functions must check to see if the DDX can
access the pixmap directly before returning failure back to the
driver; this restructures the point code to split out the _nf checking
from the _gl code.
Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Eric Anholt [Fri, 21 Mar 2014 20:13:27 +0000 (13:13 -0700)]
Revert "glx: Make sure we get an FBConfig the root window's visual."
This reverts commit
b5a61239e2fef167c229154d7919ff862503e3f3.
Not only did I screw up and introduce a warning, it turns out
glXChooseFBConfig() explicitly ignores this attribute. Thanks, GLX.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Keith Packard [Thu, 3 Apr 2014 17:44:28 +0000 (10:44 -0700)]
Merge remote-tracking branch 'whot/for-keith'
Peter Hutterer [Wed, 2 Apr 2014 03:55:10 +0000 (13:55 +1000)]
Revert "xkb: ProcesssPointerEvent must work on the VCP if it gets the VCP"
This was the wrong fix to the problem, and it triggered a change in XKB
behavior: previously a button event would unlock a latched modifier, now it
doesn't anymore.
https://bugs.freedesktop.org/show_bug.cgi?id=73155
Note that the new behavior is is strictly spec compliant but we've had the
other behavior for a long time so we shouldn't break it.
The bug this patch originally fixed was a null-pointer dereference when
releasing button events on server shutdown. This was addressed by the commit
below, so the need for this patch has gone away anyway.
commit
3e4be4033aed78b2bb3a18d51f0963989efd1af3
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date: Fri Jan 25 11:47:32 2013 +1000
dix: when shutting down slave devices, shut down xtest devices last
This reverts commit
2decff6393a44b56d80d53570718f95354fde454.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Hans de Goede [Tue, 1 Apr 2014 09:24:17 +0000 (11:24 +0200)]
xf86LogInit: log to XDG_DATA_HOME when not running as root
When no logfile was specified (xf86LogFileFrom == X_DEFAULT) and we're not
running as root log to $XDG_DATA_HOME/xorg/Xorg.#.log as Xorg won't be able to
log to the default /var/log/... when it is not running as root.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Kristian Høgsberg [Tue, 1 Apr 2014 01:04:07 +0000 (18:04 -0700)]
glamor: Expose glamor_destroy_pixmap()
When we create a glamor pixmap by calling glamor_create_pixmap()
directly, we need to call glamor_destroy_pixmap() to destroy it.
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Kristian Høgsberg [Tue, 1 Apr 2014 01:00:54 +0000 (18:00 -0700)]
glamor: Add new GLAMOR_CREATE_PIXMAP_NO_TEXTURE pixmap create flag
This flag lets a DDX allocate a glamor pixmap without allocating the
texture that backs it. The DDX can then allocate the texture itself
and then set it later.
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Kristian Høgsberg [Tue, 1 Apr 2014 00:59:18 +0000 (17:59 -0700)]
glamor: Move glamor_egl_screen_init() prototype to glamor.h
A DDX that implements the glamor EGL functions need to pull in this
prototype but shouldn't need to pull in glamor_priv.h
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Kristian Høgsberg [Fri, 28 Mar 2014 06:47:59 +0000 (23:47 -0700)]
dri3: Allow asynchronous implementation for dri3_open
By passing the client pointer to the dri3_open implementation, we allow
the clients to implement the open callback asynchronously. If the
client ignore count is positive after returning from dri3_open, we
assume that authentication is in progress and doesn't send the reply.
The code to send the reply is moved into a helper function, which the
implementation can call upon receiving its authenticaion reply.
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Kristian Høgsberg [Fri, 28 Mar 2014 05:15:28 +0000 (22:15 -0700)]
composite: Add exception mechanism for implicit redirection policy
Normally composite will decide to add implicit redirection when a
window with an alternate visual is a parent of a window with a regular
visual or vice versa. This uses extra pixmap memory and incurs an extra
copy. This exception mechanism provides a way for a DDX to override this
if the DDX knows that its acceleration architecture will render correctly.
The relevant case is that of an RGB window reparented into a ARGB parent
frame window. If the DDX knows that the acceleration architecture in use
will pad the alpha channel to opaque when rendering to the RGB window,
the implicit redirection can be avoided.
This patch adds a new composite function:
CompositeRegisterImplicitRedirectionException()
which lets a DDX register a pair of parent and child window visuals, that
will not be implicitly redirected even if the normal policy would have
made that choice.
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Keith Packard [Tue, 1 Apr 2014 06:55:25 +0000 (23:55 -0700)]
Make XYToWindow a screen function
This allows DDXen to override the window picking to account for
native windows not seen by the X server. The bulk of the picking logic
is exposed as a new helper function, miSpriteTrace(). This function
completes the sprite trace filled out by the caller, and can be set up
to start the search from a given toplevel window.
v2: Leave existing XYToWindow API in place for API compatibility
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Hans de Goede [Wed, 26 Mar 2014 11:24:49 +0000 (12:24 +0100)]
configure: Change DEFAULT_LOGPREFIX to really be a filename prefix
Rather then a full path prefix, this is a preparation patch for adding
support for logging to another location when not running as root.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Keith Packard [Tue, 1 Apr 2014 06:24:56 +0000 (23:24 -0700)]
Merge remote-tracking branch 'jturney/master'
Adam Jackson [Thu, 27 Mar 2014 15:48:39 +0000 (11:48 -0400)]
mi: Hush extension initialization (#75870)
Printing these as ErrorF is fairly obnoxious, since it means the
non-hardware servers now spew stuff to the console for entirely routine
events. And actually, printing these at all is fairly obnoxious, since
a) we're printing a line for every extension, whether it's enabled or
not, and b) we're not actually initializing the extension at this point.
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
Keith Packard [Tue, 25 Mar 2014 15:21:16 +0000 (08:21 -0700)]
fb: fix fast-path blt detection
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>
Jon TURNEY [Mon, 11 Mar 2013 14:34:32 +0000 (14:34 +0000)]
Handle -displayfd and an explicit display number sensibly
Handle -displayfd and an explicit display number sensibly, e.g. use the
explicitly specified display number, and write it to the displayfd
v2: displayfd might be 0, so use -1 as invalid value
v3: Rebase for addition of NoListenAll flag
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Jon TURNEY [Mon, 24 Mar 2014 17:32:10 +0000 (17:32 +0000)]
Fix build when configured --enable-debug
Include os.h for ErrorF() to fix implicit-function-declaration warnings when
configured with --enable-debug.
hw/xfree86/parser/DRI.c: In function 'xf86parseDRISection':
hw/xfree86/parser/DRI.c:87:5: error: implicit declaration of function 'ErrorF' [-Werror=implicit-function-declaration]
hw/xfree86/parser/Extensions.c: In function 'xf86parseExtensionsSection':
hw/xfree86/parser/Extensions.c:77:5: error: implicit declaration of function 'ErrorF' [-Werror=implicit-function-declaration]
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Jon TURNEY [Mon, 24 Mar 2014 17:32:09 +0000 (17:32 +0000)]
Fix ephyr build with --disable-glamor
See http://tinderbox.x.org/builds/2014-03-23-0010/logs/xserver/#build
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Tested-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Jon TURNEY [Mon, 24 Feb 2014 20:45:51 +0000 (20:45 +0000)]
Build fbcmap_mi.c once, rather than once for each DDX
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>
Jon TURNEY [Fri, 21 Feb 2014 18:11:33 +0000 (18:11 +0000)]
Build Xi/stubs.c once as a convenience library, rather than once for each DDX which wants to use it
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
Jon TURNEY [Wed, 7 Sep 2011 11:50:20 +0000 (12:50 +0100)]
Build dpmsstubs.c once as a convenience library, rather than once for each DDX which wants to use it
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
Julien Cristau [Wed, 26 Mar 2014 22:24:20 +0000 (23:24 +0100)]
Xephyr: restore initial window resize lost in xcb conversion
The XResizeWindow call wasn't replaced by the xcb equivalent, so we
were no longer setting the initial window size, only wm size hints.
Regression from commit a2b73da "Xephyr: start converting hostx.c over to
xcb"
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74849
Signed-off-by: Julien Cristau <jcristau@debian.org>
Reported-by: Laércio de Sousa <lbsousajr@gmail.com>
Tested-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Keith Packard <keithp@keithp.com>
Keith Packard [Wed, 12 Mar 2014 21:35:27 +0000 (14:35 -0700)]
glamor: Add glamor_program PolyPoint implementation
This accelerates poly point when possible by off-loading all geometry
computation to the GPU.
Improves x11perf -dot performance by 28109.5% +/- 1022.01% (n=3)
Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Keith Packard [Sat, 22 Mar 2014 22:20:49 +0000 (15:20 -0700)]
glamor: Move glamor_poly_segment to separate glamor_segment.c file
There's no reason to mix PolyPoint and PolySegment in the same file.
Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-off-by: Eric Anholt <eric@anholt.net>
Keith Packard [Wed, 12 Mar 2014 21:27:59 +0000 (14:27 -0700)]
glamor: Add infrastructure for generating shaders on the fly
This just adds a bunch of support code to construct shaders from
'facets', which bundle attributes needed for each layer of the
rendering system. At this point, that includes only the primitive and
the fill stuff.
v2: Correct comment in glamor transform about 1/2 pixel correction needed
for GL_POINT. (Eric Anholt)
v3: Rebase on Markus's cleanups (change 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>
Keith Packard [Fri, 14 Mar 2014 06:12:27 +0000 (23:12 -0700)]
glamor: Add helper functions to walk pixmap tiling
This adds a few helper functions to make pixmap fbo access symmetrical
between the single fbo and tiled cases.
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Eric Anholt <eric@anholt.net>
Keith Packard [Fri, 14 Mar 2014 06:11:40 +0000 (23:11 -0700)]
glamor: Add bounding box to one-fbo pixmaps
This lets code treat the one-fbo pixmaps more symmetrically with the
tiled pixmaps.
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Eric Anholt <eric@anholt.net>
Keith Packard [Wed, 19 Mar 2014 04:23:24 +0000 (21:23 -0700)]
glamor: Get testing code using small FBOs working again
Glamor has a mode where pixmaps will be constructed from numerous
small FBOs. This allows testing of the tiled pixmap code without
needing to create huge pixmaps.
However, the render glyph code assumed that it could create a pixmap
large enough for the glyph atlas. Instead of attempting to fix that
(which would be disruptive and not helpful), I've added a new pixmap
creation usage, GLAMOR_CREATE_NO_LARGE which forces allocation of a
single large FBO.
Now that we have pixmaps with varying FBO sizes, I then went around
and fixed the few places using the global FBO max size and replaced
that with the per-pixmap FBO tiling sizes, which were already present
in each large pixmap.
Xephyr has been changed to pass GLAMOR_CREATE_NO_LARGE when it creates
the screen pixmap as it doesn't want to deal with tiling either.
Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Keith Packard [Wed, 19 Mar 2014 04:35:41 +0000 (21:35 -0700)]
mi: miPutImage with XYPixmap failed at depth 32 on 64-bit machines
The X server still has 'unsigned long' in a few places to hold 32 bit
values. One of those is in miPutImage where it's holding the temporary
planemask for XYPixmap format images.
It computed the highest plane in the source image with 1 << (depth -
1). On 64-bit machines, taking that value and storing it in an
unsigned long promotes it to a signed 64-bit value
(0xffffffff80000000).
Then, it loops over that value, shifting one bit right each time,
waiting for it to go to zero.. That takes 64 iterations, and ends up
with some mystic planemask values *and* walking off the end of the
source image data and out into space.
A simple cast is all that is required to compute the correct initial
plane mask (0x0000000080000000), at which point the loop operates
correctly once again.
Checking the fbPutImage code, I note that this same bug was fixed
in 2006 by Aaron Plattner in commit
f39fd4242902eaa862321d39337f429dd14ebacf
Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Keith Packard [Sun, 16 Mar 2014 06:53:53 +0000 (23:53 -0700)]
dix: Allow NULL stipple in ChangeGC
miOpqStipDrawable resets the stipple after painting. When that stipple
was NULL, ChangeGC needs to handle that and not crash.
Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-off-by: Eric Anholt <eric@anholt.net>
Markus Wick [Tue, 18 Mar 2014 08:42:55 +0000 (09:42 +0100)]
glamor: Drop feature dependent optimization on startup.
We don't care that much about startup time to write different code paths...
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Markus Wick [Tue, 18 Mar 2014 08:42:54 +0000 (09:42 +0100)]
glamor: Remove unneeded unbindings.
They are already cleared in glamor_put_vbo_space.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Markus Wick [Tue, 18 Mar 2014 08:42:53 +0000 (09:42 +0100)]
glamor: Always keep GL_ELEMENT_ARRAY_BUFFER bound to the same IB.
We never used glDrawElements() with a different index buffer.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Markus Wick [Tue, 18 Mar 2014 08:42:52 +0000 (09:42 +0100)]
glamor: Select VBO path by ARB_mbr extension.
The mbr path was hard coded enabled for desktop gl and disabled for
gles. But there are both desktop without mbr and GLES with mbr.
v2: Don't forget to update the fini path, too (change by anholt)
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Markus Wick [Tue, 18 Mar 2014 08:42:51 +0000 (09:42 +0100)]
glamor: Update GL requirements to 2.1.
We will never ever run on OpenGL 1.2 as we use shaders everywhere.
2.0 may be enough, but we also often use PBOs and our big shaders
won't fit into the first GLSL limits.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Markus Wick [Tue, 18 Mar 2014 08:42:50 +0000 (09:42 +0100)]
glamor: Use epoxy_gl_version() instead of rolling our own.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Markus Wick [Tue, 18 Mar 2014 08:42:49 +0000 (09:42 +0100)]
glamor: Use epoxy_has_gl_extension() instead of rolling our own.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Markus Wick [Tue, 18 Mar 2014 08:42:48 +0000 (09:42 +0100)]
glamor: Use glsl "fract/mod" instead of "while" in gradient shaders.
This fixes gtkperf. It seemed to hang forever.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Eric Anholt [Tue, 18 Mar 2014 08:42:47 +0000 (09:42 +0100)]
kdrive: Remove duplicated definitions of some XV-related structs.
v2: Fix crash because of removed strdup. (by Markus Wick)
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net> (v2)
Gaetan Nadon [Wed, 19 Mar 2014 15:28:57 +0000 (11:28 -0400)]
xfree86: glamor_egl subdir must be distributed - breaks distcheck
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Gaetan Nadon [Wed, 19 Mar 2014 18:17:15 +0000 (14:17 -0400)]
ephyr: typo where "()" should be "$()" in the Makefile - breaks make dist
make[3]: Entering directory `/home/nadon/xorg/src/xserver/hw/kdrive/ephyr'
make[3]: *** No rule to make target `()', needed by `distdir'. Stop.
make[3]: Leaving directory `/home/nadon/xorg/src/xserver/hw/kdrive/ephyr'
make[2]: *** [distdir] Error 1
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Hans de Goede [Mon, 24 Mar 2014 15:32:01 +0000 (16:32 +0100)]
systemd-logind: Monitor systemd-logind going away
When we're using server managed-fds through systemd-logind, systemd-logind
*must* keep running while we are using it, as it does things like drmSetMaster
and drmDropMaster for us on vt-switch.
On a systemd-logind restart, we cannot simply re-connect since we will then
get a different fd for the /dev/dri/card# node, and we've tied a lot of
state to the old fd. I've discussed this with the systemd people, and in the
future there may be a restart mechanism were systemd-logind passed fds from
the old logind to the new logind. But for now there answer is simply:
"Don't restart systemd-logind", and there never really is a good reason to
restart it.
So to ensure unpleasentness if people do decide to restart systemd-logind
anyways (or when it crashes), monitor logind going away and make this a fatal
error. This avoids getting a hard-hung machine on the next vt-switch and will
hopefully quickly educate users to not restart systemd-logind while they have
an X session using it active.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Hans de Goede [Mon, 24 Mar 2014 15:31:59 +0000 (16:31 +0100)]
Buildsys: Create SUID_WRAPPER_DIR before using it
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>