summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2020-05-23Avoid possible format security errors.HEADmasterJeremy White1-1/+1
Prevents rpm build failures when -Werror=format-security is used.
2020-05-13Fix a bug introduced by the full-screen scan.Jeremy White1-3/+12
You will get occasional screen glitches; you could observe this doing an 'ls; clear' pattern again and again. This was caused by the full screen optimization made in 97517317bdc3 which can cause some scan reports to be incorrectly discarded. Full disclosure: I modified Brendan's original patch to introduce this bug, so the blame is mine alone. Acked-by: Frediano Ziglio <fziglio@redhat.com>
2020-05-06Make grow_changed_tiles loop a bit more readableFrediano Ziglio1-8/+7
It was not clear that a lot of tests were here just to handle borders. Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2020-05-06Reduce indentation in grow_changed_tilesFrediano Ziglio1-20/+22
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2020-05-06Simplify computation of num_vertical_tilesFrediano Ziglio1-6/+4
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2020-05-06Use bool type for tile changedFrediano Ziglio3-13/+14
These arrays are just used to store if the tile is changed. This produces a bit more optimised code, is more readable and it's clear it's a boolean value. Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2020-05-06Fix typo in commentFrediano Ziglio1-1/+1
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2020-05-06Tell spice to always stream when we are in full screen mode.Jeremy White1-0/+3
This saves time waiting for spin up. Acked-by: Frediano Ziglio <fziglio@redhat.com>
2020-05-06Provide a way to specify the video codecs.Jeremy White4-0/+19
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2020-05-06Screen for negative inputs for full_screen_fps.Jeremy White1-2/+2
This makes the treatment of the logic condition in display.c match that of scan.c. Acked-by: Frediano Ziglio <fziglio@redhat.com>
2020-05-06Add a full-screen-fps option.Jeremy White5-20/+61
This option will bypass XDamage and periodic scanning and simply transmit the whole screen to the spice server at the specified rate. This will allow the streaming logic to kick in and hopefully for video codecs to optimize the transmission. This is particularly useful for applications that often change the whole screen. Acked-by: Frediano Ziglio <fziglio@redhat.com>
2020-04-28Initialize the output variables in the called function.Jeremy White2-2/+2
It was previously inconsistent, with partial initialization outside and partial initialization inside. Noted by Frediano Ziglio. Acked-by: Frediano Ziglio <fziglio@redhat.com>
2020-04-28Prevent a buffer overflow if the cached screen does not match current screen.Jeremy White1-0/+6
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2020-04-28Simplify the code in an inner loop to avoid a few skips.Jeremy White1-4/+1
Credit to Frediano Ziglio. Acked-by: Frediano Ziglio <fziglio@redhat.com>
2020-04-28Add full-screen scan triggered by constant, untrusted damage reportsBrendan Shanks4-4/+94
This goes further than commit cb122392 by forcing a whole screen scan, looking for changes. This improves the feel of using a session with mutter, which is quite noticeable in a terminal window. Acked-by: Frediano Ziglio <fziglio@redhat.com>
2020-04-28Don't update the fps calculation for internal messages.Jeremy White1-1/+2
There is no need to increase our CPU usage if we're going to be largely responding to full screen painting requests from a window manager such as mutter. Acked-by: Frediano Ziglio <fziglio@redhat.com>
2020-04-28Perform region checking only for region related scan reports.Jeremy White1-33/+43
This bug became noticable after cb122392, in that we routinely send a new scan report type, which should not affect region tracking. Investigating this revealed that this code was also buggy in that the region code could cause non region related scan reports to be discarded. The code was refactored to avoid that case. Acked-by: Frediano Ziglio <fziglio@redhat.com>
2020-04-21Make all multiline comments within the main x11spice tree consistent.Jeremy White8-41/+29
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2020-04-21Apply style to the main source tree.Jeremy White11-208/+197
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2020-04-21Have tests code follow style guide.Jeremy White6-39/+30
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2020-04-21Tweak style in the spicedummy_driver.Jeremy White1-1/+1
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2020-04-21Add make style targets.Jeremy White4-10/+18
These use a refined version of the doc/spice_indent tool to make sure that all controlled sources follow the spice style guide. Acked-by: Frediano Ziglio <fziglio@redhat.com>
2020-04-20Give x11spice a little time to draw.Jeremy White1-1/+5
There are times when the spice screen is not updated insantaneously; this is particularly true when we are not using damage. Let's add a little delay to allow images to settle. This makes testing more consistent and robust.
2020-04-20Bug fix: support more than 1024 vertical scanlines.Brendan Shanks1-22/+25
The previous logic assumes that the vertical height divided by NUM_SCANLINES is less or equal to NUM_SCANLINES. For large displays, this is clearly wrong. The new logic scales with vertical height. Signed-off-by: Jeremy White <jwhite@codeweavers.com>
2020-04-20Add a new test for tall screens; draw outside of scanline range.Jeremy White4-0/+55
This exposes a bug in the current code base. That is, we do not scan beyond the 32 scan lines currently given. That means if we have a screen taller than 1024 pixels, we will not scan every block fully, and so we can miss changes. This test exposes that issue, and currently fails.
2020-04-20Rename xcb.c to xcbtest.c to avoid name confusion.Jeremy White4-10/+10
Our functions should really not be named xcb_xxx.
2020-04-20Bug fix - send the last few lines of a scanned box when rounding badly.Jeremy White1-6/+15
If the number of vertical lines results in an odd dividend, we were truncating the computation and not sending the last few lines. This fixes that by first avoiding early division which would truncate values, and by then rounding up our width and height calculations. This fixes the bug in the tests introduced in the previous patch.
2020-04-20Add a new test for a 4k screen, which currently fails.Jeremy White6-5/+49
2020-04-20Change the damage trust option to include a 'never' option.Jeremy White4-8/+29
This is not expected to be useful in production, but it will be useful in developing tests.
2020-03-17Provide an attempted optimization when damage reports appear wrong.Jeremy White7-11/+55
With compositing window managers like mutter, when used with the spice-video-dummy, you can get damage reports that are the whole screen. Essentially, you just get an indication that the screen has changed, but no sense of what has changed. This change detects that behavior and stops trusting those damage reports, and instead increases the scan frequency to compensate. Acked-by: Frediano Ziglio <fziglio@redhat.com>
2020-03-15Add a very basic test for our OpenGL enabled driver.Jeremy White2-0/+35
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2020-03-15Use the Spice video dummy driver for our tests if enabled.Jeremy White3-1/+69
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2020-03-15Allow the tests to run from an out of tree build.Jeremy White2-6/+12
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2020-03-13Specify evdev as the default for Xkb.Jeremy White1-0/+10
Spice uses evdev codes, and this provides a better default on RHEL 7.3, which defaults to the base rules. Without evdev, the 'grey' extended keys (e.g. up/down/home/end) do not function properly. Acked-by: Frediano Ziglio <fziglio@redhat.com>
2020-03-11Fix compliation on gcc 4.X.Jeremy White4-4/+4
gcc 4.x warns if you use a { 0 } initialization construct for a structure with an initial member that is also a struct. The { } construct is simpler and appears to work on a wider range of gcc versions. This is a correction to fdfdf1107be100b983de1bff4beee8e6360f670b
2020-02-20Do not provide a stub client_monitors_config in the QXLInterface.Jeremy White1-24/+3
Using NULL causes the server to relay the message on to the agent, which does a superior job to anything we currently want to do. Signed-off-by: Jeremy White <jwhite@codeweavers.com> Acked-by: Henri Verbeet <hverbeet@codeweavers.com>
2020-02-20Call xf86DPMSInit() in DUMMYScreenInit().Henri Verbeet1-0/+2
This is probably not strictly needed, but it's easy and gets rid of the "Xlib: extension "DPMS" missing on display ":2"." message. Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
2020-02-20Implement page flips.Henri Verbeet1-2/+7
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
2020-02-20Provide support for outputs and crtcs.Jeremy White7-145/+599
This allow us to size and dynamically resize the dummy driver. Signed-off-by: Jeremy White <jwhite@codeweavers.com> Acked-by: Henri Verbeet <hverbeet@codeweavers.com>
2020-02-20Enable warnings for spice-video-dummy.Henri Verbeet1-1/+1
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
2020-02-20Use a proper prototype for CreateWindow() in struct dummyRec.Henri Verbeet1-1/+1
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
2020-02-20Add .dirstamp to .gitignore.Henri Verbeet1-0/+1
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
2020-02-20Style: tweak a few spaces to match Spice style.Jeremy White2-2/+2
Signed-off-by: Jeremy White <jwhite@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
2019-08-20Add cache for SHM segmentsBrendan Shanks2-16/+168
Add a cache to allow the reuse of SHM segments. Shared memory segments are added to the cache instead of being deallocated, and the cache is searched instead of/before allocating a new segment. Both the SHM segments and their attachment with the X server are cached. The cache currently has a fixed number of 10 entries, this provided a good cache hit rate while keeping memory usage under control. Building with DEBUG_SHM_CACHE defined and running with G_MESSAGES_DEBUG=all will periodically print out the SHM cache hit rate. On my Ubuntu 18.04 system running XFCE4 with a 2560x1440 screen, the cache hit rate starts around 72%. On-screen windows that update often and have consistently-sized damage rectangles are the best case. With several of those (scrolling terminal windows, web browser showing a WebGL demo), the hit rate slowly rises to around 92%. Operations that generate rapid damage reports (like resizing or moving windows) will lower the hit rate. Signed-off-by: Brendan Shanks <bshanks@codeweavers.com> Acked-by: Jeremy White <jwhite@codeweavers.com>
2019-08-20Create separate shm_segment_t struct for SHM segmentsBrendan Shanks6-20/+25
Signed-off-by: Brendan Shanks <bshanks@codeweavers.com> Acked-by: Jeremy White <jwhite@codeweavers.com>
2019-08-20Use unsigned int/size_t for display width/height/buffer sizeBrendan Shanks2-11/+11
Signed-off-by: Brendan Shanks <bshanks@codeweavers.com> Acked-by: Jeremy White <jwhite@codeweavers.com>
2019-08-07Use separate buffer for primary surface to fix graphical corruptionBrendan Shanks6-7/+26
The 'display->fullscreen' SHM segment was previously being used for both x11spice's internal change scanning and as the spice primary surface. I don't think spice wants anything else writing to the primary surface, and this caused sporadic test failures and graphical corruption. Create a separate SHM segment 'display->primary' and use it only for the primary surface. Signed-off-by: Brendan Shanks <bshanks@codeweavers.com> Acked-by: Jeremy White <jwhite@codeweavers.com>
2019-08-05Fix running tests on Debian/UbuntuBrendan Shanks1-0/+2
Check the Debian/Ubuntu path for the non-wrapper Xorg binary Signed-off-by: Brendan Shanks <bshanks@codeweavers.com> Acked-by: Jeremy White <jwhite@codeweavers.com>
2019-08-01Including missing header for inlined clock functions.Jeremy White1-0/+1
Fixes compilation on RHEL 7.3. Signed-off-by: Jeremy White <jwhite@codeweavers.com> Acked-by: Frediano Ziglio <fziglio@redhat.com>
2019-08-01Provide compatibility for Glamor in Xorg 1.17.Jeremy White2-3/+16
In Xorg 1.18, X changed so that GLAMOR_USE_EGL_SCREEN was the only flag required and it implies the behavior previously requested with the GLAMOR_USE_SCREEN and GLAMORE_USE_PICTURE_SCREEN flags. Thus, if we are building against an older Xorg, we need to specify those now deprecated flags. Additionally, the compat-api header conflicts with the older glamor header file, so it needs to be moved to be included after glamor.h. Signed-off-by: Jeremy White <jwhite@codeweavers.com> Acked-by: Frediano Ziglio <fziglio@redhat.com>