Commit Graph

13756 Commits

Author SHA1 Message Date
Colin Harrison
6804acfe4f hw/xwin: Remove prototype for non-existent winMWExtWMUpdateIcon()
winMWExtWMUpdateIcon() was removed in commit 527cf13135

Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2014-03-22 17:16:56 +00:00
Colin Harrison
7fb5d765ba hw/xwin: Use AllocDevicePair()
Use AllocDevicePair() rather than allocating Windows keyboard and pointer
devices individually.

Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2014-03-22 17:16:54 +00:00
Colin Harrison
061e5eba00 hw/xwin: Consistently use 'L' for long int constants
Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2014-03-22 17:16:51 +00:00
Colin Harrison
46df614784 hw/xwin: Remove an unneeded include
Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2014-03-22 17:16:48 +00:00
Colin Harrison
d48749492d hw/xwin: Use boolean AND rather than bitwise AND in WIN_POLLING_MOUSE_TIMER_ID
For clarity, use boolean AND rather than bitwise AND in
WIN_POLLING_MOUSE_TIMER_ID processing.

Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2014-03-22 17:16:46 +00:00
Colin Harrison
80ac4a85d5 hw/xwin: Fix declaration after statement warning in ddxGiveUp()
Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2014-03-22 17:16:43 +00:00
Colin Harrison
cf59f4888e hw/xwin: Fix typo in comment
Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2014-03-22 17:16:41 +00:00
Jon TURNEY
561bca469d hw/xwin: Fix const discarded warning in winGenerateAuthorization()
Fix const discarded warning in winGenerateAuthorization() in !XCSECURITY case

In function ‘winGenerateAuthorization’:
hw/xwin/winauth.c:123:38: warning: passing argument 2 of ‘GenerateAuthorization’ discards ‘const’ qualifier from pointer target type [enabled by default]
hw/xwin/winauth.c:99:1: note: expected ‘char *’ but argument is of type ‘const char *’

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2014-03-22 17:16:38 +00:00
Keith Packard
4fb31e4824 Merge remote-tracking branch 'whot/for-keith' 2014-03-19 06:43:14 -07:00
Kristian Høgsberg
0e531fbb97 xkb: add XkbLoadKeymapFromString
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-03-19 08:37:15 +10:00
Keith Packard
d18d3f6d18 Merge remote-tracking branch 'anholt/glamor-megaseries' 2014-03-17 17:29:56 -07:00
Michel Dänzer
6649d0059e glamor: Move up glamor_priv->flags assignment in glamor_init()
It wasn't assigned yet when it was tested for GLAMOR_NO_DRI3.

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>
2014-03-17 14:43:28 -07:00
Eric Anholt
b5a61239e2 glx: Make sure we get an FBConfig the root window's visual.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2014-03-17 14:30:58 -07:00
Markus Wick
9999a66013 glamor: don't reset the GLSL program
We don't use fixed function rendering, so there is no need to reset
the program at all.  This lets the driver avoid checking for state
changes between draw calls when we rebind the same program.

Improves xephyr x11perf -f8text performance by 6.03062% +/- 1.64928%
(n=20)

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-17 14:30:58 -07:00
Markus Wick
aa2635b804 glamor: remove disabled code
This block was disabled since 2011, so there is likely no need to keep it any more.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-17 14:30:58 -07:00
Alan Coopersmith
6227f07b69 Remove duplicate assignment of repeat_type_uniform_location
Flagged by cppcheck 1.64:
[glamor/glamor_gradient.c:987] -> [glamor/glamor_gradient.c:991]:
    (performance) Variable 'repeat_type_uniform_location' is
             reassigned a value before the old one has been used.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Eric Anholt <eric@anholt.net>
2014-03-17 14:30:57 -07:00
Eric Anholt
1a4b249939 glamor: Apply debug labels to our shaders.
This will help tools like fips, apitrace, or INTEL_DEBUG=shader_time
provide useful information about the shaders in use.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>
2014-03-17 14:30:57 -07:00
Eric Anholt
d07d2c3c5f glamor: Don't forget to unmap our PBOs before using them to upload.
From the GL_ARB_vertex_buffer_object spec:

    After the client has specified the contents of a mapped data store,
    and before the data in that store are dereferenced by any GL commands,
    the mapping must be relinquished by calling

        boolean UnmapBufferARB(enum target);

Our mappings were only getting reaped at PBO destroy time, after the
upload.  If the GL implementation wasn't coherent, it would have used
stale data to do the texture upload.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>
2014-03-17 14:30:57 -07:00
Eric Anholt
64146e4560 glamor: Add an assert about an invariant the upload code relies on.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>
2014-03-17 14:30:57 -07:00
Eric Anholt
7eb2bafe22 glamor: Fix ignoring the ALU during SetSpans().
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>
2014-03-17 14:30:57 -07:00
Eric Anholt
923c8db7ed glamor: Improve the performance of line fallbacks.
If the lines aren't solid-filled vert/horiz solid-filled rectangles,
we fall back.  libreoffice has some diagonal lines, and the
performance of the fallback path was atrocious.  Just fall back to
mi's spans instead, so that we don't do an upload/download.

Improves x11perf -seg100 by 863.652% +/- 9.8968% (n=5)

Signed-off-by: Eric Anholt <eric@anholt.net>
2014-03-17 14:30:57 -07:00
Eric Anholt
b695304556 glamor: Improve the performance of PolyGlyphBlt.
Using the same idea as the previous PushPixels code, just make points
for each point in the glyph.  This is an advantage over the pushpixels
fallback because we can batch the BO mappings and draw calls across
glyphs.

Improves performance of x11perf -f8text by 773.389% +/- 3.50754% (n=10).

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>
2014-03-17 14:30:56 -07:00
Eric Anholt
b885a63914 glamor: Improve the performance of PushPixels by, well, pushing pixels.
Otherwise, mi will fall back to GetSpans()ing the bitmap, walking the
bitmap, computing spans to be filled, and calling FillSpans().

Improves x11perf -f8text by 759.373% +/- 3.33096% (n=166)

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>
2014-03-17 14:30:56 -07:00
Eric Anholt
ab68982dcc glamor: Add missing prepares on the GC during fb fallbacks.
We had regressions in CopyPlane reported by xts5, because we were
(successfully!) dereferencing the null pixmap->devPrivate.ptr for a
tile or stipple without having done a prepare.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>
2014-03-17 14:30:56 -07:00
Eric Anholt
93f1824a0b glamor: Rely on nested mappings to handle src==dst and !prepare bugs.
Now that the core deals with that for us, we can avoid all this extra
carefulness.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>
2014-03-17 14:30:56 -07:00
Eric Anholt
4c9a200725 glamor: Allow nested mapping of pixmaps.
The common pattern is to do nested if statements making calls to
prepare_access() and then pop those mappings back off in each set of
braces.  Some cases checked for src == dst to avoid leaking mappings,
but others didn't.  Others didn't even do the nested mappings, so a
failure in the outer map would result in trying to umap the inner and
failing.

By allowing nested mappings, we can fix both problems by not requiring
the care from the caller, plus we can allow a simpler nesting of all
the prepares in one if statement.

v2: Add a comment about nested unmap behavior, and just reuse the
    glamor_access_t enum.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>
2014-03-17 14:30:56 -07:00
Eric Anholt
d86eacedab glamor: Drop unused GLAMOR_ACCESS_WO.
Nothing was using it, and it was going to complicate the
glamor_prepare_access bugfixing I'm going to do next.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>
2014-03-17 14:30:56 -07:00
Eric Anholt
c36b903f24 glamor: Drop stale comment.
The old Xephyr codebase was using the GL window system framebuffer for
the screen pixmap, but that meant you couldn't texture from it to do
operations sourcing from the screen, so in the version that landed I
instead had the screen just be a plain texture.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2014-03-17 14:30:52 -07:00
Eric Anholt
f7cd1189d0 glamor: Replace some goofy enum-likes with a real enum.
This unpacks the bitfield into an int size, but my experience has been
that packing bitfields doesn't matter for performance.

v2: Convert more comparisons against numbers or implicit bool
    comparisons to comparisons against the enum names, and fix up some
    comments.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>
2014-03-17 14:30:51 -07:00
Eric Anholt
575e3e1bf0 glamor: Fix up doxygen for glamor_fill.c.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>
2014-03-17 14:30:50 -07:00
Eric Anholt
53996e252e glamor: Rename more solid fill variables to clean up the code.
Now the error path of allocation is more obvious: We leave things in
the a-few-boxes-at-a-time stack memory state.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>
2014-03-17 14:30:50 -07:00
Eric Anholt
ec3ab2f67b glamor: Rename a variable to be more descriptive.
The "valid_" prefix was used above to describe our allocation that
gets reused multiple times, which is totally unrelated.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>
2014-03-17 14:30:50 -07:00
Eric Anholt
01e30d2043 glamor: Fix some integer overflow errors.
Imagine a nbox that was (UINT_MAX + small number) / (4 * 2 *
sizeof(float)).  We'd malloc a few bytes after the integer overflow,
but glamor_set_normalize_vcoords would write over gigabytes of heap.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>
2014-03-17 14:30:50 -07:00
Eric Anholt
20bcda9777 glamor: Drop bogus _X_UNLIKELY.
nbox > 4 is actually quite common for spans handling.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>
2014-03-17 14:30:50 -07:00
Eric Anholt
ad3dd80720 glamor: Fix stack overflow in glamor_solid vertex handling.
ARRAY_SIZE(vertices) is 32 (floating point values), so we need to
divide by the number of floats in a box like we do in the overflow
case below.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>
2014-03-17 14:30:50 -07:00
Eric Anholt
d036d22a95 glamor: Drop duplicated lines for getting pixmap state in GetImage.
No change in generated code size -- apparently the compiler figured it
out.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>
2014-03-17 14:30:49 -07:00
Eric Anholt
e23dd41195 glamor: Return the stride/size for glamor_dri3_name_from_pixmap(), too.
Just like for a caller of glamor_dri3_fd_from_pixmap(), otherwise the
consumer of that named buffer has no idea what GL chose for the
stride.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>
2014-03-17 14:30:49 -07:00
Eric Anholt
4e21b7ee49 glamor: Drop the body of the function for enabling DRI3 extensions.
The flag is already being set at glamor_egl_screen_init() time, so no
need for the driver to separately call this.  That said, leave the
function around to keep the ABI compatibility.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>
2014-03-17 14:30:49 -07:00
Eric Anholt
92e2125c52 sync: Add a header include necessary to use misyncstr.h
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2014-03-17 14:30:45 -07:00
Eric Anholt
12b2adaaeb glamor: Do glyph private init at screeninit time, and other stuff at CSR.
This hasn't actually been a problem, since the server hasn't allocated
any glyphs before our glyph private initialization during
CreateScreenResources.  But it's generally not X Server style to do
things this way.

Now that glamor itself drives both parts of glyphs setup, DDX drivers
no longer need to tell glamor to initialize glyphs.  We do retain the
old public symbol so they can keep running with no changes.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>
2014-03-17 14:30:45 -07:00
Eric Anholt
df1ef90fa0 glamor: Move the EGL image to the normal pixmap private.
There's no reason to hide EGL from the rest of glamor, now that we
have epoxy.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>
2014-03-17 14:30:45 -07:00
Eric Anholt
732faea542 glamor: Use epoxy_has_egl_extension() instead of rolling our own.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>
2014-03-17 14:30:45 -07:00
Eric Anholt
a895f6a165 glamor: Drop the set of the context to NULL at the end of glamor ops.
The theory here was that it (which I copied from EGL) existed to fix
up context switching with indirect GLX.  But indirect GLX won't even
try to set the context again unless its lastContext field is cleared,
so we need to solve this a different way.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2014-03-17 14:30:41 -07:00
Eric Anholt
f31911ff8f xephyr: Don't forget to glViewport() before drawing the screen.
Fixes misrendering with cairogears.  I had noticed the failure while
trying to figure out what was going on with traps.  Cairogears was
apparently putting its results on the screen through putimage, which
is a texture upload, so the last GL drawing was done to the size of
the cairogears window, not the size of the xephyr screen.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2014-03-17 14:30:28 -07:00
Kristian Høgsberg
8b6c79e19c xkb: add KeymapOrDefault
Helper function to return a default map if the keymap compilation failed.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-03-17 15:10:47 +10:00
Kristian Høgsberg
cb9a1d0146 xkb: factor out xkb loading to LoadXkm
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-03-17 15:10:37 +10:00
Peter Hutterer
4391cf27f4 xkb: add a callback to xkbcomp
This provides a callback to write to xkbcomp's buffer once everything is
prepared.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-03-17 15:10:31 +10:00
Peter Hutterer
6ebd838d80 xkb: constify XkbDDXOpenConfigFile
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-03-17 15:10:07 +10:00
Rui Matos
d35a02a767 xkb: Repurpose XkbCopyDeviceKeymap to apply a given keymap to a device
This will also make it useful for cases when we have a new keymap to
apply to a device but don't have a source device.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-03-12 16:43:23 +10:00
Rui Matos
361f405d3c xkb: Factor out a function to copy a keymap's controls onto another
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-03-12 15:45:38 +10:00