Re: [Spice-devel] [PATCH spice-server v2 12/12] display-channel: Inline red_migrate_display function

2019-03-28 Thread Jonathon Jongsma
Acked-by: Jonathon Jongsma On Tue, 2019-03-26 at 19:10 +, Frediano Ziglio wrote: > The only caller only called that function. > > Signed-off-by: Frediano Ziglio > --- > server/display-channel.c | 10 +++--- > 1 file changed, 3 insertions(+), 7 deletions(-) >

Re: [Spice-devel] [PATCH spice-server v2 11/12] Move image_compression field from RedWorker to DisplayChannel

2019-03-28 Thread Jonathon Jongsma
Acked-by: Jonathon Jongsma On Tue, 2019-03-26 at 19:10 +, Frediano Ziglio wrote: > Signed-off-by: Frediano Ziglio > --- > server/display-channel-private.h | 1 + > server/display-channel.c | 10 -- > server/display-channel.h | 2 ++ > s

Re: [Spice-devel] [PATCH spice-server v2 10/12] Check image compression value earlier

2019-03-28 Thread Jonathon Jongsma
Acked-by: Jonathon Jongsma On Tue, 2019-03-26 at 19:10 +, Frediano Ziglio wrote: > Do not check it after assigning to reds->config->image_compression, > check the value as soon as possible. > This prevent potential invalid settings. > > Signed-off-by: Frediano Ziglio

Re: [Spice-devel] [PATCH spice-server v2 09/12] red-worker: Remove only assigned fields

2019-03-28 Thread Jonathon Jongsma
Acked-by: Jonathon Jongsma On Tue, 2019-03-26 at 19:10 +, Frediano Ziglio wrote: > DisplayChannelClient get them directly from reds (they are changed > only during initialisation so they can be read freely from any > thread). > > Signed-off-by: Frediano Ziglio >

Re: [Spice-devel] [PATCH spice-server v2 08/12] cursor-channel: Update some declarations and documentation

2019-03-28 Thread Jonathon Jongsma
This also looks like a patch that should get squashed (maybe parts should be squashed into two different previous commits, see below), but I agree with all of the changes. Acked-by: Jonathon Jongsma On Tue, 2019-03-26 at 19:10 +, Frediano Ziglio wrote: > Signed-off-by: Frediano Zig

Re: [Spice-devel] [PATCH spice-server v2 07/12] Make some function static

2019-03-28 Thread Jonathon Jongsma
Personally, I would squash this patch with the previous one Acked-by: Jonathon Jongsma On Tue, 2019-03-26 at 19:10 +, Frediano Ziglio wrote: > Now that stuff are a bit more on their correct place some > function can be static. > > Signed-off-by: Frediano Ziglio > --- &

Re: [Spice-devel] [PATCH spice-server v2 05/12] Check running state in red_qxl_set_client_capabilities

2019-03-28 Thread Jonathon Jongsma
Acked-by: Jonathon Jongsma On Tue, 2019-03-26 at 19:10 +, Frediano Ziglio wrote: > No reasons to expose red_qxl_is_running, this was used to not > send capability is the state was not running. > > Signed-off-by: Frediano Ziglio > --- > server/display-channel.c | 3 --- &

Re: [Spice-devel] [PATCH spice-server v2 04/12] Move DisplayChannel callbacks from RedWorker to DisplayChannel

2019-03-28 Thread Jonathon Jongsma
Acked-by: Jonathon Jongsma On Tue, 2019-03-26 at 19:10 +, Frediano Ziglio wrote: > Signed-off-by: Frediano Ziglio > --- > server/display-channel.c | 108 + > server/display-channel.h | 7 +++ > server/red-work

Re: [Spice-devel] [PATCH spice-server v2 02/12] Move thread/dispatching handling to RedChannel

2019-03-28 Thread Jonathon Jongsma
Acked-by: Jonathon Jongsma On Tue, 2019-03-26 at 19:10 +, Frediano Ziglio wrote: > Currently channel threading/handling is spread between RedQxl, > RedWorker and RedChannel. > Move more to RedChannel simplify RedQxl and RedWorker. > > Signed-off-by: Frediano Ziglio > --

Re: [Spice-devel] [PATCH spice-server v2 01/12] dispatcher: Allows to manage messages without registering them

2019-03-28 Thread Jonathon Jongsma
r.h > @@ -99,6 +99,21 @@ typedef void (*dispatcher_handle_any_message)(void > *opaque, > void dispatcher_send_message(Dispatcher *dispatcher, uint32_t > message_type, > void *payload); > > +/* dispatcher_send_message_cus

[Spice-devel] [PATCH spice-server] Save running property in QXLState

2019-03-21 Thread Jonathon Jongsma
From: Frediano Ziglio This is a preparatory patch that states the running property in QXLState and provides accessor functions that allows us to check whether the QXL device is running from different threads. Signed-off-by: Jonathon Jongsma --- Alternate proposal for patch 7/10. I also rebased

Re: [Spice-devel] [PATCH spice-server 07/10] Propagate running property from RedWorker to DisplayChannel

2019-03-20 Thread Jonathon Jongsma
Somehow this information doesn't really seem to belong to DisplayChannel, but I can't put my finger on exactly why it feels out of place... On Wed, 2019-03-20 at 09:59 +, Frediano Ziglio wrote: > This is a preparatory patch to allows DisplayChannel to check > if device is running. > >

Re: [Spice-devel] [PATCH spice-server 06/10] Move thread/dispatching handling to RedChannel

2019-03-20 Thread Jonathon Jongsma
nnel, >stat, > "display_channel"); > -red_channel_register_client_cbs(channel, client_display_cbs); > -g_object_set_data(G_OBJECT(channel), "dispatcher", dispatcher); > +g_object_set_data(G_OBJECT(channel), "worker", worker); > + >

Re: [Spice-devel] [PATCH spice-server 05/10] main-dispatcher: Use dispatcher_send_message_generic

2019-03-20 Thread Jonathon Jongsma
There should be some justification in the commit log about why this is an improvement. Jonathon On Wed, 2019-03-20 at 09:59 +, Frediano Ziglio wrote: > Signed-off-by: Frediano Ziglio > --- > server/main-dispatcher.c | 38 -- > 1 file changed, 8

Re: [Spice-devel] [PATCH spice-server 04/10] main-dispatcher: Use reds as opaque for dispatcher

2019-03-20 Thread Jonathon Jongsma
Acked-by: Jonathon Jongsma On Wed, 2019-03-20 at 09:59 +, Frediano Ziglio wrote: > No reason to pass through MainDispatcher, the purpose of > MainDispatcher is to call reds functions from the right thread. > > Signed-off-by: Frediano Ziglio > --- > server/main

Re: [Spice-devel] [PATCH spice-server 03/10] main-dispatcher: Remove main_dispatcher_self_handle_channel_event

2019-03-20 Thread Jonathon Jongsma
That's a weird function, but seems rather unrelated to the current series. Acked-by: Jonathon Jongsma On Wed, 2019-03-20 at 09:59 +, Frediano Ziglio wrote: > Signed-off-by: Frediano Ziglio > --- > server/main-dispatcher.c | 13 ++--- > 1 file changed, 2 inser

Re: [Spice-devel] [PATCH spice-server 02/10] dispatcher: Allows to manage message without registering them

2019-03-20 Thread Jonathon Jongsma
t;priv- > >payload, msg->size); > diff --git a/server/dispatcher.h b/server/dispatcher.h > index bb968e56..b8339c06 100644 > --- a/server/dispatcher.h > +++ b/server/dispatcher.h > @@ -99,6 +99,21 @@ typedef void (*dispatcher_handle_any_message)(void > *opaque, > void dispa

Re: [Spice-devel] [PATCH spice-server 01/10] dispatcher: Use NULL for pointer check

2019-03-20 Thread Jonathon Jongsma
Acked-by: Jonathon Jongsma On Wed, 2019-03-20 at 09:59 +, Frediano Ziglio wrote: > handler is a pointer, check for NULL, not 0. > > Signed-off-by: Frediano Ziglio > --- > server/dispatcher.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git

[Spice-devel] [PATCH spice-server 1/2] Move CursorChannel definition to header

2019-03-19 Thread Jonathon Jongsma
This way, the cursor channel can be subclassed. This will be used in future commits as I refactor the client callbacks. --- server/cursor-channel.c | 62 +++-- server/cursor-channel.h | 12 2 files changed, 40 insertions(+), 34 deletions(-) diff --git

[Spice-devel] [PATCH spice-server 2/2] Make channel client callbacks virtual functions

2019-03-19 Thread Jonathon Jongsma
Rather than having an API to register client callbacks for each channel type, make them vfuncs. Since the client callbacks are registered identically for each channel of the same type, it doesn't make sense for to require these to be registered separately for each object. It's cleaner to have

Re: [Spice-devel] [PATCH spice-common v3 0/5] Generate C declarations automatically

2019-03-18 Thread Jonathon Jongsma
On Mon, 2019-03-18 at 09:53 -0400, Frediano Ziglio wrote: > > On Mon, Mar 11, 2019 at 12:42:10PM -0400, Frediano Ziglio wrote: > > > > > > > > Series looks good to me, > > > > > > > > Reviewed-by: Christophe Fergeau > > > > > > > > > > Why not ack? Not good enough? Not tested? Missing

Re: [Spice-devel] [PATCH spice-server v2] Move channel registration to constructed vfunc

2019-03-15 Thread Jonathon Jongsma
On Fri, 2019-03-15 at 05:05 -0400, Frediano Ziglio wrote: > > > > For the Display Channel and the Cursor channel, move the call to > > reds_register_channel() to the _constructed() vfunc rather than > > calling > > it explicitly from RedWorker. This matches what other channels do. > > --- > >

[Spice-devel] [PATCH spice-server v2] Move channel registration to constructed vfunc

2019-03-14 Thread Jonathon Jongsma
For the Display Channel and the Cursor channel, move the call to reds_register_channel() to the _constructed() vfunc rather than calling it explicitly from RedWorker. This matches what other channels do. --- Changes in v2: - remove cursor channel registration in stream device Note that I didn't

[Spice-devel] [PATCH win-vdagent v2] Don't exit when receiving unknown messages

2019-03-04 Thread Jonathon Jongsma
message was received and ignore it. Signed-off-by: Jonathon Jongsma --- changes in v2: - change rationale in commit log vdagent/vdagent.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/vdagent/vdagent.cpp b/vdagent/vdagent.cpp index 89019bb..177e663 100644 --- a/vdagent

[Spice-devel] [PATCH spice-server v2 3/3] Switch some boolean fields to 'bool' type

2019-03-04 Thread Jonathon Jongsma
For coding style consistency, use 'bool' when we want to represent a boolean value. Signed-off-by: Jonathon Jongsma --- Changes in v2: - new patch server/reds.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/server/reds.c b/server/reds.c index 07562b555

[Spice-devel] [PATCH spice-server v2 1/3] Refactor agent_adjust_capabilities() function

2019-03-04 Thread Jonathon Jongsma
sending graphics device info to agents that do not support it. Signed-off-by: Jonathon Jongsma --- server/reds.c | 17 +++-- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/server/reds.c b/server/reds.c index 2e5c69e60..63bfadb22 100644 --- a/server/reds.c +++ b/server/reds.c

[Spice-devel] [PATCH spice-server v2 2/3] Only send device display info to supported agents

2019-03-04 Thread Jonathon Jongsma
Only send the graphics device display info to agents that advertise the VD_AGENT_CAP_GRAPHICS_DEVICE_INFO capability Signed-off-by: Jonathon Jongsma --- Changes in v2: - renamed member variable - moved variable to RedCharDeviceVDIPortPrivate - reset variable when agent disconnects - make

[Spice-devel] [PATCH spice-server 1/2] Refactor agent_adjust_capabilities() function

2019-02-28 Thread Jonathon Jongsma
sending graphics device info to agents that do not support it. Signed-off-by: Jonathon Jongsma --- server/reds.c | 17 +++-- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/server/reds.c b/server/reds.c index 2e5c69e60..63bfadb22 100644 --- a/server/reds.c +++ b/server/reds.c

[Spice-devel] [PATCH spice-server 2/2] Only send device display info to supported agents

2019-02-28 Thread Jonathon Jongsma
Only send the graphics device display info to agents that advertise the VD_AGENT_CAP_GRAPHICS_DEVICE_INFO capability Signed-off-by: Jonathon Jongsma --- server/reds-private.h | 1 + server/reds.c | 9 + 2 files changed, 10 insertions(+) diff --git a/server/reds-private.h b

[Spice-devel] [PATCH linux vdagent] Advertise VD_AGENT_CAP_GRAPHICS_DEVICE_INFO

2019-02-28 Thread Jonathon Jongsma
Since we now support the graphics device info message, advertise this fact when sending capabilities to the server. Signed-off-by: Jonathon Jongsma --- src/vdagentd/vdagentd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/vdagentd/vdagentd.c b/src/vdagentd/vdagentd.c index f80f48b

Re: [Spice-devel] [PATCH win-vdagent] Don't exit when receiving unknown messages

2019-02-28 Thread Jonathon Jongsma
eans that it's not correct, > this is another indication that it's wrong. > > > Signed-off-by: Jonathon Jongsma > > --- > > vdagent/vdagent.cpp | 3 +-- > > 1 file changed, 1 insertion(+), 2 deletions(-) > > > > diff --git a/vdagent/vdagent.cpp b/vdage

[Spice-devel] [PATCH win-vdagent] Don't exit when receiving unknown messages

2019-02-27 Thread Jonathon Jongsma
and ignore it. Signed-off-by: Jonathon Jongsma --- vdagent/vdagent.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/vdagent/vdagent.cpp b/vdagent/vdagent.cpp index 89019bb..177e663 100644 --- a/vdagent/vdagent.cpp +++ b/vdagent/vdagent.cpp @@ -1288,8 +1288,7 @@ void VDAgent

Re: [Spice-devel] [PATCH spice-server] red-pipe-item: Removed some not necessary headers inclusions

2019-02-22 Thread Jonathon Jongsma
Acked-by: Jonathon Jongsma On Fri, 2019-02-22 at 16:12 +, Frediano Ziglio wrote: > RedPipeItem is not using the Ring structures anymore. > Also is not using GLib functionality. > Just include base headers. > > Signed-off-by: Frediano Ziglio > --- > server/red-pipe

Re: [Spice-devel] [PATCH spice-common 6/6] Generate automatically most C message declarations

2019-02-22 Thread Jonathon Jongsma
So, I applied these patches, and generated the messages with the new code and compared it to the old hand-coded message.h file. I had to re- arrange a bunch of the newly-generated code to get a readable diff, but I end up with the attached output. A few notable changes: - Quite a few fields have

Re: [Spice-devel] [PATCH spice-common 1/6] messages: Remove fields not used by the protocol

2019-02-22 Thread Jonathon Jongsma
DstInfo; Hmm, slightly tricky, this one. It's technically an ABI change, but since we only use spice-common as a submodule, I suppose it's OK to remove. I'd like to see the commit log mention that this is leftover from v1 of the protocol, which we removed support for already. Acked-by: Jo

Re: [Spice-devel] [PATCH spice-server] Removed some not necessary headers inclusions

2019-02-21 Thread Jonathon Jongsma
uot; > -#include "image-encoders.h" > #include "common-graphics-channel.h" Seems that display-channel.h uses a GlzImageRetention type which is defined in image-encoders.h. And BitmapGradualType which is defined in spice-bitmap-utils.h. Presumably these headers are i

Re: [Spice-devel] [PATCH spice-gtk v2] build-sys: Use always --buildtype=release

2019-02-21 Thread Jonathon Jongsma
ise, Acked-by: Jonathon Jongsma On Thu, 2019-02-21 at 15:59 +, Frediano Ziglio wrote: > Allows the compiler to catch some errors which are only triggered > when > building with optimizations enabled. > > Signed-off-by: Frediano Ziglio > --- > .gitlab-ci.yml | 10 +- >

Re: [Spice-devel] [PATCH spice-gtk] build-sys: Use always --buildtype=release

2019-02-21 Thread Jonathon Jongsma
e, but what kind of errors are you talking about? > > Reviewed-by: Jonathon Jongsma > > > > Like "this variable is not used" or "this variable is not > initialized" > for instance. > Not sure if people prefers "release" or "debugo

Re: [Spice-devel] [PATCH spice-server] Move channel registration to constructed vfunc

2019-02-20 Thread Jonathon Jongsma
On Wed, 2019-02-20 at 07:08 -0500, Frediano Ziglio wrote: > > > > For the Display Channel and the Cursor channel, move the call to > > reds_register_channel() to the _constructed() vfunc rather than > > calling > > it explicitly from RedWorker. This matches what other channels do. > > I think

Re: [Spice-devel] [PATCH spice-gtk] build-sys: Use always --buildtype=release

2019-02-20 Thread Jonathon Jongsma
On Thu, 2019-02-14 at 12:56 +, Frediano Ziglio wrote: > Allows to catch some errors which the compiler is not able to > detect in debug mode (the default). Seems fine, but what kind of errors are you talking about? Reviewed-by: Jonathon Jongsma > > Signed-off-by: Fre

Re: [Spice-devel] [PATCH spice-server] Move channel registration to constructed vfunc

2019-02-20 Thread Jonathon Jongsma
On Wed, 2019-02-20 at 07:08 -0500, Frediano Ziglio wrote: > > > > For the Display Channel and the Cursor channel, move the call to > > reds_register_channel() to the _constructed() vfunc rather than > > calling > > it explicitly from RedWorker. This matches what other channels do. > > I think

[Spice-devel] [PATCH spice-server] Move channel registration to constructed vfunc

2019-02-19 Thread Jonathon Jongsma
For the Display Channel and the Cursor channel, move the call to reds_register_channel() to the _constructed() vfunc rather than calling it explicitly from RedWorker. This matches what other channels do. --- server/cursor-channel.c | 12 server/display-channel.c | 2 ++

Re: [Spice-devel] [PATCH spice-server 2/2] QXL devices must be registered before Stream Devices

2019-02-13 Thread Jonathon Jongsma
On Wed, 2019-02-13 at 09:19 -0500, Frediano Ziglio wrote: > > > > Stream devices assume that all QXL devices are registered with the > > server before we receive any communications from the stream device. > > This > > is due to the fact that QXL display channel IDs are assigned > > directly > >

Re: [Spice-devel] [PATCH spice-server v2 3/3] Remove core parameter from main_dispatcher_new

2019-02-12 Thread Jonathon Jongsma
Acked-by: Jonathon Jongsma On Tue, 2019-02-12 at 21:24 +, Frediano Ziglio wrote: > This was added in bd8771adbcf3ff34d14333cf874191e8d105f612. > There's no reason to not use reds function instead. > MainDispatcher needs to listen in the main thread that is the > one provided b

Re: [Spice-devel] [PATCH spice-server v2 2/3] test-stream-device: Check monitor ID messages

2019-02-12 Thread Jonathon Jongsma
Looks fine to me. Insofar as I can ACK a patch that's partially my own code: Acked-by: Jonathon Jongsma :) On Tue, 2019-02-12 at 21:24 +, Frediano Ziglio wrote: > Signed-off-by: Frediano Ziglio > Signed-off-by: Jonathon Jongsma > Reviewed-by: Jonathon Jongsma > --- >

Re: [Spice-devel] [PATCH spice-server 6/8] agent-msg-filter: Simplify code

2019-02-12 Thread Jonathon Jongsma
why not Acked-by: Jonathon Jongsma On Mon, 2019-02-11 at 11:54 +, Frediano Ziglio wrote: > Most of the time result is set to AGENT_MSG_FILTER_OK, set at > the beginning and change if necessary. > > Signed-off-by: Frediano Ziglio > --- > server/agent-msg-filter.c | 14 +

Re: [Spice-devel] [PATCH spice-server 3/8] test-stream-device: Check monitor ID messages

2019-02-12 Thread Jonathon Jongsma
Looks mostly good, but I found an issue and had a couple suggested improvments. So I sent a couple follow-up patches that you can squash with this patch if you think they're valid. Reviewed-by: Jonathon Jongsma On Mon, 2019-02-11 at 11:54 +, Frediano Ziglio wrote: > Signed-off-by: Fredi

[Spice-devel] [PATCH spice-server 1/2] Fixup display info test

2019-02-12 Thread Jonathon Jongsma
Rather than showing the expected data in raw format (ascii codes, etc), which is hard to verify, show the characters themselves, and group them by structure. Also add a few more comments. --- server/tests/test-stream-device.c | 35 +++ 1 file changed, 26

[Spice-devel] [PATCH spice-server 2/2] QXL devices must be registered before Stream Devices

2019-02-12 Thread Jonathon Jongsma
Stream devices assume that all QXL devices are registered with the server before we receive any communications from the stream device. This is due to the fact that QXL display channel IDs are assigned directly from the QXL device ID, whereas Stream display channels are assigned channel IDs based

Re: [Spice-devel] [PATCH spice-server 2/8] reds: Factor out a function to marshall VDAgentGraphicsDeviceInfo message

2019-02-12 Thread Jonathon Jongsma
On Tue, 2019-02-12 at 12:24 -0500, Frediano Ziglio wrote: > > On Tue, 2019-02-12 at 04:05 -0500, Frediano Ziglio wrote: > > > > > > > Untested, but looks fine. > > > > > > > > Acked-by: Jonathon Jongsma > > > > > > &g

Re: [Spice-devel] [PATCH spice-server 2/8] reds: Factor out a function to marshall VDAgentGraphicsDeviceInfo message

2019-02-11 Thread Jonathon Jongsma
Untested, but looks fine. Acked-by: Jonathon Jongsma On Mon, 2019-02-11 at 11:54 +, Frediano Ziglio wrote: > Instead of scanning the monitor twice (one to compute the size > and another to build the message) use a single function to > marshall the message. > This also fixe

Re: [Spice-devel] [PATCH v2 spice-gtk] Update the codeflow description comment

2019-02-11 Thread Jonathon Jongsma
ome gstreamer sink plugin which implements the > GstVideoOverlay interface > + * 3) Decompressed frames will be rendered to widget directly from > GStreamer's pipeline "to *the* widget" sounds more correct. Otherwise I'd say the rest of this patch looks fine. I only reviewed it

[Spice-devel] [PATCH linux vdagent] Fix coding style

2019-01-29 Thread Jonathon Jongsma
Use brackets everywhere. --- src/vdagent/device-info.c | 28 +++- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/src/vdagent/device-info.c b/src/vdagent/device-info.c index 7c0f615..4983543 100644 --- a/src/vdagent/device-info.c +++

Re: [Spice-devel] [PATCH linux vdagent v5 1/7] Add lookup_xrand_output_for_device_info()

2019-01-29 Thread Jonathon Jongsma
ith_session_info" = "auto" || test "$with_session_info" > > = > > "systemd"; then > > PKG_CHECK_MODULES([LIBSYSTEMD_LOGIN], > > diff --git a/src/vdagent/device-info.c b/src/vdagent/device-info.c > > new file mode 100644 > >

Re: [Spice-devel] [PATCH] QXL interface: improve the spice_qxl_set_device_info documentation

2019-01-28 Thread Jonathon Jongsma
Acked-by: Jonathon Jongsma On Mon, 2019-01-28 at 11:14 +0100, Lukáš Hrázký wrote: > Instead of one unsupported example, present two real world examples. > > Signed-off-by: Lukáš Hrázký > --- > server/spice-qxl.h | 32 ++-- > 1 file changed, 22

Re: [Spice-devel] [PATCH spice v4 2/6] Receive the GraphicsDeviceInfo message from the streaming agent

2019-01-28 Thread Jonathon Jongsma
Acked-by: Jonathon Jongsma On Mon, 2019-01-28 at 15:09 +0100, Lukáš Hrázký wrote: > Receives the GraphicsDeviceInfo message from the streaming agent and > stores the data in a list on the streaming device. > > Signed-off-by: Lukáš Hrázký > --- > server/display-limits.h

[Spice-devel] [PATCH linux vdagent v5 1/7] Add lookup_xrand_output_for_device_info()

2019-01-23 Thread Jonathon Jongsma
nd display id + * + * Copyright 2018 Red Hat, Inc. + * + * Red Hat Authors: + * Jonathon Jongsma + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the L

[Spice-devel] [PATCH linux vdagent v5 7/7] Send display_id down to the vdagentd daemon

2019-01-23 Thread Jonathon Jongsma
Add a display_id field to the structure that we use to send down the list of guest display resolutions to the vdagentd daemon. This allows us to map the spice display id to the proper X display for determining mouse locations, etc. In the case where we have an mjpeg plugin running in the

[Spice-devel] [PATCH linux vdagent v5 5/7] Factor a function out of get_current_mon_config()

2019-01-23 Thread Jonathon Jongsma
When sending the guest xorg resolution to the vdagentd daemon, we get the current resolution with this function, which returns a VDAgentMonitorsConfig structure that must then be converted to the structure that we send to the daemon. Rather than re-using this function that returns the wrong type,

[Spice-devel] [PATCH linux vdagent v5 2/7] Look up and store xrandr output in display map

2019-01-23 Thread Jonathon Jongsma
Instead of storing each device address and device display ID in the hash table, simply use the lookup_xrandr_output_for_device_info() function to look up the ID of the xrandr output and store that in the hash table. --- src/vdagent/x11-priv.h | 2 +- src/vdagent/x11-randr.c | 58

[Spice-devel] [PATCH linux vdagent v5 4/7] Use guest output map to determine xrandr output

2019-01-23 Thread Jonathon Jongsma
instead of using the spice display id directly as the xrandr output, look it up using our new guest output map --- src/vdagent/x11-randr.c | 81 - 1 file changed, 72 insertions(+), 9 deletions(-) diff --git a/src/vdagent/x11-randr.c

[Spice-devel] [PATCH linux vdagent v5 3/7] Make clearer distinctions between output ids

2019-01-23 Thread Jonathon Jongsma
There are basically three ways to refer to an output within vdagent: - The index of the array of MonitorConfig message. This is essentially a "spice display id" - the index of the array of xrandr outputs. This is the "output index" - the xrandr output id. This is the "output ID"

[Spice-devel] [PATCH linux vdagent v5 6/7] Use new function in vdagent_x11_send_daemon_guest_xorg_res()

2019-01-23 Thread Jonathon Jongsma
Rather than getting the current guest resolution in a VDAgentMonitorsConfig struct and then translating it to a new struct type for sending down to the daemon, simply use the new function that was factored out in a previous commit and populate the message struct directly. ---

[Spice-devel] [PATCH linux vdagent v5 0/7] Use the PCI addr and display ID

2019-01-23 Thread Jonathon Jongsma
moved goto - improved logging - etc. Jonathon Jongsma (7): Add lookup_xrand_output_for_device_info() Look up and store xrandr output in display map Make clearer distinctions between output ids Use guest output map to determine xrandr output Factor a function out of get_current_

Re: [Spice-devel] [PATCH spice-gtk 04/12] Drop autotools

2019-01-22 Thread Jonathon Jongsma
On Fri, 2019-01-18 at 15:56 +0400, Marc-André Lureau wrote: > Hi > > On Fri, Jan 18, 2019 at 3:47 PM Frediano Ziglio > wrote: > > > > > > > > From: Marc-André Lureau > > > > > > Maintaining 1 build system is hard. Maintaining 2 is even harder. > > > > > > It seems the meson build system is

[Spice-devel] [PATCH linux vdagent v4 1/9] Add lookup_xrand_output_for_device_info()

2019-01-17 Thread Jonathon Jongsma
nd display id + * + * Copyright 2018 Red Hat, Inc. + * + * Red Hat Authors: + * Jonathon Jongsma + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the L

[Spice-devel] [PATCH linux vdagent v4 6/9] Use new function in vdagent_x11_send_daemon_guest_xorg_res()

2019-01-17 Thread Jonathon Jongsma
Rather than getting the current guest resolution in a VDAgentMonitorsConfig struct and then translating it to a new struct type for sending down to the daemon, simply use the new function that was factored out in a previous commit and populate the message struct directly. ---

[Spice-devel] [PATCH linux vdagent v4 3/9] Make clearer distinctions between output ids

2019-01-17 Thread Jonathon Jongsma
There are basically three ways to refer to an output within vdagent: - The index of the array of MonitorConfig message. This is essentially a "spice display id" - the index of the array of xrandr outputs. This is the "output index" - the xrandr output id. This is the "output ID"

[Spice-devel] [PATCH linux vdagent v4 5/9] Factor a function out of get_current_mon_config()

2019-01-17 Thread Jonathon Jongsma
When sending the guest xorg resolution to the vdagentd daemon, we get the current resolution with this function, which returns a VDAgentMonitorsConfig structure that must then be converted to the structure that we send to the daemon. Rather than re-using this function that returns the wrong type,

[Spice-devel] [PATCH linux vdagent v4 7/9] Send display_id down to the vdagentd daemon

2019-01-17 Thread Jonathon Jongsma
Add a display_id field to the structure that we use to send down the list of guest display resolutions to the vdagentd daemon. This allows us to map the spice display id to the proper X display for determining mouse locations, etc. --- src/vdagent/x11-randr.c | 35

[Spice-devel] [PATCH linux vdagent v4 8/9] Send display IDs to daemon when device info changes

2019-01-17 Thread Jonathon Jongsma
When the agent gets a new device info message (from the daemon), we need to re-calculate the guest output map and send that information back down to the daemon so that it can handle mouse input events correctly. --- src/vdagent/x11-randr.c | 3 +++ 1 file changed, 3 insertions(+) diff --git

[Spice-devel] [PATCH linux vdagent v4 0/9] Use the PCI addr and display ID

2019-01-17 Thread Jonathon Jongsma
tput index and crtc index - added a patch to send new display IDs when device info changes - multiple changes from review - factored out function find_device_at_pci_address() - No more initializing X/XRandr - removed goto - improved logging - etc. Jonathon Jongsma

[Spice-devel] [PATCH linux vdagent v4 2/9] Look up and store xrandr output in display map

2019-01-17 Thread Jonathon Jongsma
Instead of storing each device address and device display ID in the hash table, simply use the lookup_xrandr_output_for_device_info() function to look up the ID of the xrandr output and store that in the hash table. --- src/vdagent/x11-priv.h | 2 +- src/vdagent/x11-randr.c | 53

[Spice-devel] [PATCH linux vdagent v4 4/9] Use guest output map to determine xrandr output

2019-01-17 Thread Jonathon Jongsma
instead of using the spice display id directly as the xrandr output, look it up using our new guest output map --- src/vdagent/x11-randr.c | 78 - 1 file changed, 69 insertions(+), 9 deletions(-) diff --git a/src/vdagent/x11-randr.c

[Spice-devel] [PATCH linux vdagent v4 9/9] Make cursor work with mjpeg streaming

2019-01-17 Thread Jonathon Jongsma
In the case where we have an mjpeg plugin running in the streaming agent, we have two spice displays representing the same guest display. In that scenario, the session agent may maintain the following guest output mapping: spice channel 0 (QXL) => X output 0 spice channel 1 (streaming-agent) =>

Re: [Spice-devel] [PATCH vd_agent 8/8 v3] Receive the graphics_device_info message

2019-01-17 Thread Jonathon Jongsma
Acked-by: Jonathon Jongsma On Wed, 2019-01-16 at 13:52 +0100, Lukáš Hrázký wrote: > The graphics_device_info message contains the device display ID > information (device address and device display ID). Stores the data > in a > hash table in vdagent. > > Signed-of

Re: [Spice-devel] [PATCH spice-streaming-agent 6/8 v3] Interface + implementation of getting device display info

2019-01-17 Thread Jonathon Jongsma
e, may not be necessary (the list should > be sorted out of glob) > +std::sort(outputs.begin(), outputs.end(), [](const OutputInfo > , const OutputInfo ) { > +return oi1.output_name > oi2.output_name; > +} > +); > + > +// Check if the output names of QXL cards start at Virtual-1 and > if so, > +// subtract one from each of them > +for (auto : outputs) { > +// if we find a QXL card > +if (output.card_vendor_id == pci_vendor_id_redhat && > +output.card_device_id == pci_device_id_qxl) > +{ > +// if the first name is Virtual-0, we know we are good, > quit the loop > +if (output.output_name == "Virtual-0") { > +break; > +} > + > +// if the name starts with "Virtual-" > +if (!output.output_name.compare(0, 8, "Virtual-")) { I strongly prefer "foo.compare() == 0" over "!foo.compare()" > +// decrement the last digit by one > +// fails if the number at the end is more than one > digit, > +// which would imply multiple QXL devices, an > unsupported case > +output.output_name[output.output_name.length() - 1]- > -; > +} > +} > +} > + > +std::map output_map; > +for (const auto : outputs) { > +output_map[output.output_name] = output; > +} > + > +auto xrandr_outputs = get_xrandr_outputs(display, > RootWindow(display, XDefaultScreen(display))); > + > +std::vector result; > + > +for (uint32_t i = 0; i < xrandr_outputs.size(); ++i) { > +const auto = xrandr_outputs[i]; Since you have variables named 'outputs' and 'xrandr_outputs' in this function, I'd personally prefer to name this variable something like 'xoutput' instead of simply 'output' for clarity. > +const auto it = output_map.find(output); > +if (it == output_map.end()) { > +throw Error("Could not find card for output " + output); > +} > + > +std::string device_address = get_device_address(it- > >second.card_path); > + > +result.push_back({i, device_address, it- > >second.device_display_id}); > +} > + > +return result; > +} > + > +std::vector > get_device_display_info_no_drm(Display *display) > +{ > +// look for the first card that doesn't list its outputs (and > therefore > +// doesn't support DRM), that's the best we can do... > +const auto globs = utils::glob("/sys/class/drm/card*"); > + > +std::string found_card_path; > +for (const auto : globs) { > +std::string card_output = path.substr(path.rfind("/") + 1, > path.npos); > +auto dash_it = card_output.find("-"); > +// if this file is a card (and not an output) > +if (dash_it == card_output.npos) { > +// if we already have a found card, this means it > doesn't have any outputs, > +// we have found our card > +if (!found_card_path.empty()) { > +break; > +} > +found_card_path = card_output; > +} else { > +found_card_path = ""; > +} > +} > + > +std::string device_address = > get_device_address(found_card_path); > + > +auto xrandr_outputs = get_xrandr_outputs(display, > RootWindow(display, XDefaultScreen(display))); > + > +std::vector result; > + > +for (uint32_t i = 0; i < xrandr_outputs.size(); ++i) { > +result.push_back({i, device_address, i}); > +} > + > +return result; > +} > + > +}} // namespace spice::streaming_agent Acked-by: Jonathon Jongsma ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/spice-devel

Re: [Spice-devel] [PATCH spice 5/8 v3] Send the graphics device info from streaming agent to the vd_agent

2019-01-17 Thread Jonathon Jongsma
I know that the stream device currently (and probably always) only has a single display per channel, but part of me wishes the interfaces had some consistency. Not a big issue, just curious. Acked-by: Jonathon Jongsma > static StreamDevice * > stream_device_new(SpiceCharDeviceInstan

Re: [Spice-devel] [PATCH spice 3/8 v3] Send the graphics device info to the vd_agent

2019-01-17 Thread Jonathon Jongsma
re-sending on the correct patch series. Acked-by: Jonathon Jongsma On Wed, 2019-01-16 at 13:52 +0100, Lukáš Hrázký wrote: > Sends the device address and device display IDs to the vdagent. The > message is sent either in reaction to the SPICE_MSGC_MAIN_AGENT_START > message or when the

Re: [Spice-devel] [PATCH spice-protocol 2/8 v3] Add the StreamMsgGraphicsDeviceInfo message

2019-01-17 Thread Jonathon Jongsma
Accidentally sent this on the v2 series, but I'll repeat it here: Commit subject mentions the wrong type name? StreamMsgGraphicsDeviceInfo != StreamMsgDeviceDisplayInfo On Wed, 2019-01-16 at 13:52 +0100, Lukáš Hrázký wrote: > The message contains information about the graphics device and >

Re: [Spice-devel] [PATCH spice-protocol 2/8 v2] Add the StreamMsgGraphicsDeviceInfo message

2019-01-17 Thread Jonathon Jongsma
Commit subject mentions the wrong type name? StreamMsgGraphicsDeviceInfo != StreamMsgDeviceDisplayInfo On Mon, 2019-01-14 at 17:38 +0100, Lukáš Hrázký wrote: > The message contains information about the graphics device and > monitor > belonging to a particular video stream (which maps to a

Re: [Spice-devel] [PATCH spice 3/8 v2] Send the graphics device info to the vd_agent

2019-01-17 Thread Jonathon Jongsma
Acked-by: Jonathon Jongmsa On Mon, 2019-01-14 at 17:38 +0100, Lukáš Hrázký wrote: > Sends the device address and device display IDs to the vdagent. The > message is sent either in reaction to the SPICE_MSGC_MAIN_AGENT_START > message or when the graphics device info changes. > > Signed-off-by:

Re: [Spice-devel] [PATCH spice 4/8 v2] Receive the GraphicsDeviceInfo message from the streaming agent

2019-01-17 Thread Jonathon Jongsma
On Wed, 2019-01-16 at 13:34 +0100, Lukáš Hrázký wrote: > > > +StreamMsgDeviceDisplayInfo *display_info_msg = > > > >msg->device_display_info; > > > + > > > +size_t device_address_len = > > > GUINT32_FROM_LE(display_info_msg->device_address_len); > > > +if (device_address_len >

Re: [Spice-devel] [PATCH spice-server] Reuse SPICE_UPCAST instead of SPICE_CONTAINEROF where possible

2019-01-17 Thread Jonathon Jongsma
Acked-by: Jonathon Jongsma On Wed, 2019-01-02 at 11:21 +, Frediano Ziglio wrote: > Signed-off-by: Frediano Ziglio > --- > server/inputs-channel.c | 8 > server/reds.c | 36 +++- > server/reds.h | 2 +- > 3

Re: [Spice-devel] [PATCH spice 4/8] Receive the GraphicsDeviceInfo message from the streaming agent

2019-01-14 Thread Jonathon Jongsma
On Fri, 2019-01-11 at 10:07 +0100, Lukáš Hrázký wrote: > Hi, > > On Thu, 2019-01-10 at 15:27 -0600, Jonathon Jongsma wrote: > > On Tue, 2019-01-08 at 16:28 +0100, Lukáš Hrázký wrote: > > > Receives the GraphicsDeviceInfo message from the streaming agent > > > an

Re: [Spice-devel] [PATCH spice 1/3] QXL interface: add a function to identify monitors in the guest

2019-01-14 Thread Jonathon Jongsma
On Fri, 2019-01-11 at 11:15 +0100, Lukáš Hrázký wrote: > On Wed, 2019-01-09 at 11:36 -0600, Jonathon Jongsma wrote: > > On Tue, 2019-01-08 at 16:26 +0100, Lukáš Hrázký wrote: > > > Adds a function to let QEMU provide information to identify > > > graphics >

Re: [Spice-devel] [PATCH spice 4/8] Receive the GraphicsDeviceInfo message from the streaming agent

2019-01-10 Thread Jonathon Jongsma
On Tue, 2019-01-08 at 16:28 +0100, Lukáš Hrázký wrote: > Receives the GraphicsDeviceInfo message from the streaming agent and > stores the data in a list on the streaming device. > > Signed-off-by: Lukáš Hrázký > --- > server/red-qxl.c | 1 - > server/red-stream-device.c | 66 >

Re: [Spice-devel] [PATCH spice 3/8] Send the graphics device info to the vd_agent

2019-01-10 Thread Jonathon Jongsma
On Tue, 2019-01-08 at 16:28 +0100, Lukáš Hrázký wrote: > Sends the device address and device display IDs to the vdagent. The > message is sent either in reaction to the SPICE_MSGC_MAIN_AGENT_START > message or when the graphics device info changes. > > TODO: doesn't resend the message on agent

Re: [Spice-devel] [PATCH spice-protocol 2/8] Add the StreamMsgGraphicsDeviceInfo message

2019-01-10 Thread Jonathon Jongsma
On Wed, 2019-01-09 at 12:43 +0100, Lukáš Hrázký wrote: > On Wed, 2019-01-09 at 02:38 -0500, Frediano Ziglio wrote: > > > > > > The message contains information about the graphics device and > > > monitor > > > belonging to a particular video stream (which maps to a channel) > > > from > > > the

Re: [Spice-devel] [PATCH spice-protocol 1/8] Add the VDAgentGraphicsDeviceInfo message

2019-01-10 Thread Jonathon Jongsma
On Tue, 2019-01-08 at 16:28 +0100, Lukáš Hrázký wrote: > The message serves for passing the device address and device display > ID > information for all display channels from SPICE server to the > vd_agent. > > Signed-off-by: Lukáš Hrázký > --- > spice/vd_agent.h | 15 +++ > 1 file

Re: [Spice-devel] [spice-gtk] gtk-session: prefer early check to agent connectivity

2019-01-10 Thread Jonathon Jongsma
This patch looks reasonable to me, but I wonder if you could expand the commit log to indicate the steps required to trigger the warning? In what situation is this function (clipboard_get()) being called when the agent is not connected? Jonathon On Thu, 2019-01-10 at 16:39 +0100, Victor

Re: [Spice-devel] [PATCH spice 2/3] QXL interface: deprecate spice_qxl_set_max_monitors

2019-01-09 Thread Jonathon Jongsma
Acked-by: Jonathon Jongsma On Tue, 2019-01-08 at 16:26 +0100, Lukáš Hrázký wrote: > Replace it by spice_qxl_set_device_info. Note we can't use > monitors_count for what's stored in max_monitors, because > monitors_count > denotes the length of the device_display_ids

Re: [Spice-devel] [PATCH spice 1/3] QXL interface: add a function to identify monitors in the guest

2019-01-09 Thread Jonathon Jongsma
On Tue, 2019-01-08 at 16:26 +0100, Lukáš Hrázký wrote: > Adds a function to let QEMU provide information to identify graphics > devices and their monitors in the guest. The function > (spice_qxl_set_device_info) sets the device address (e.g. a PCI path) > and monitor ID -> device display ID

[Spice-devel] [PATCH linux vdagent v3 9/9] Send display IDs to daemon when device info changes

2019-01-07 Thread Jonathon Jongsma
When the agent gets a new device info message (from the daemon), we need to re-calculate the guest output map and send that information back down to the daemon so that it can handle mouse input events correctly. --- src/vdagent/x11-randr.c | 3 +++ 1 file changed, 3 insertions(+) diff --git

[Spice-devel] [PATCH linux vdagent v3 7/9] Use new function in vdagent_x11_send_daemon_guest_xorg_res()

2019-01-07 Thread Jonathon Jongsma
Rather than getting the current guest resolution in a VDAgentMonitorsConfig struct and then translating it to a new struct type for sending down to the daemon, simply use the new function that was factored out in a previous commit and populate the message struct directly. ---

[Spice-devel] [PATCH linux vdagent v3 6/9] Factor a function out of get_current_mon_config()

2019-01-07 Thread Jonathon Jongsma
When sending the guest xorg resolution to the vdagentd daemon, we get the current resolution with this function, which returns a VDAgentMonitorsConfig structure that must then be converted to the structure that we send to the daemon. Rather than re-using this function that returns the wrong type,

[Spice-devel] [PATCH linux vdagent v3 8/9] Send display_id down to the vdagentd daemon

2019-01-07 Thread Jonathon Jongsma
Add a display_id field to the structure that we use to send down the list of guest display resolutions to the vdagentd daemon. This allows us to map the spice display id to the proper X display for determining mouse locations, etc. --- src/vdagent/x11-randr.c | 35

[Spice-devel] [PATCH linux vdagent v3 3/9] Look up and store xrandr output in display map

2019-01-07 Thread Jonathon Jongsma
Instead of storing each device address and device display ID in the hash table, simply use the lookup_xrandr_output_for_device_info() function to look up the ID of the xrandr output and store that in the hash table. --- src/vdagent/x11-priv.h | 2 +- src/vdagent/x11-randr.c | 47

[Spice-devel] [PATCH linux vdagent v3 0/9] Use the PCI addr and display ID

2019-01-07 Thread Jonathon Jongsma
on between output index and crtc index - added a patch to send new display IDs when device info changes - multiple changes from review - factored out function find_device_at_pci_address() - No more initializing X/XRandr - removed goto - improved logging - etc. Jonathon Jongsma

[Spice-devel] [PATCH linux vdagent v3 2/9] Move handling of DeviceInfo to vdagent_x11

2019-01-07 Thread Jonathon Jongsma
--- src/vdagent/vdagent.c | 68 + src/vdagent/x11-priv.h | 1 + src/vdagent/x11-randr.c | 58 +++ src/vdagent/x11.c | 13 src/vdagent/x11.h | 1 + 5 files changed, 74 insertions(+), 67 deletions(-)

  1   2   3   4   5   6   7   8   9   10   >