[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [Spice-devel] [PATCH 3/5] Process outstanding commands
From: |
Alon Levy |
Subject: |
Re: [Qemu-devel] [Spice-devel] [PATCH 3/5] Process outstanding commands in the ring after changing capability bits |
Date: |
Mon, 3 Sep 2012 14:31:44 -0400 (EDT) |
> From: Søren Sandmann Pedersen <address@hidden>
>
> When a new client connects, there may be commands in the ring that it
> can't understand, so we need to process these before forwarding new
> commands to the client. By doing this after changing the capability
> bits we ensure that the new client will never see a command that it
> doesn't understand (under the assumption that the guest will read and
> obey the capability bits).
ACK.
We really should have some sort of fence mechanism for this. This patch will
still work, since the command ring is 32 items long, so it should be relatively
cheap to flush it (each item is a single comamnd. worse case can be
32*video_mem). There is still a race - the guest has to handle the interrupt
before sending any new commands.
In the future we could introduce a new command called QXLFence and have the
interrupt handler call a new io to return it just before pushing it to the
ring. The fence would be used only in the server right now, but when the driver
releases it it can use it to know all commands before it have been processed
(note that it doesn't mean all those commands have been released).
> ---
> server/red_worker.c | 5 +++++
> 1 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/server/red_worker.c b/server/red_worker.c
> index 60b5471..f87967c 100644
> --- a/server/red_worker.c
> +++ b/server/red_worker.c
> @@ -9493,6 +9493,11 @@ static void
> on_new_display_channel_client(DisplayChannelClient *dcc)
> }
> red_channel_client_ack_zero_messages_window(&dcc->common.base);
> if (worker->surfaces[0].context.canvas) {
> + int ring_is_empty;
> +
> + while (red_process_commands(worker, MAX_PIPE_SIZE,
> &ring_is_empty)) {
> + }
> +
> red_current_flush(worker, 0);
> push_new_primary_surface(dcc);
> red_push_surface_image(dcc, 0);
> --
> 1.7.4
>
> _______________________________________________
> Spice-devel mailing list
> address@hidden
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
>
- [Qemu-devel] [PATCH-v2 spice-protocol 1/2] Add A8 surface capability, (continued)
- [Qemu-devel] [PATCH-v2 spice-protocol 1/2] Add A8 surface capability, Søren Sandmann Pedersen, 2012/09/03
- [Qemu-devel] [PATCH-v2 spice-gtk] Advertise SPICE_DISPLAY_CAP_A8_SURFACE, Søren Sandmann Pedersen, 2012/09/03
- [Qemu-devel] [PATCH-v2 spice 1/2] Set a8 capability in the QXL device if supported by the client, Søren Sandmann Pedersen, 2012/09/03
- Re: [Qemu-devel] [PATCH-v2 spice 1/2] Set a8 capability in the QXL device if supported by the client, Alon Levy, 2012/09/03
- Re: [Qemu-devel] [PATCH-v2 spice 1/2] Set a8 capability in the QXL device if supported by the client, Søren Sandmann, 2012/09/03
- Re: [Qemu-devel] [PATCH-v2 spice 1/2] Set a8 capability in the QXL device if supported by the client, Søren Sandmann, 2012/09/03
- [Qemu-devel] [PATCH 1/5] client: Advertise A8_SURFACE capability, Søren Sandmann, 2012/09/03
- [Qemu-devel] [PATCH 2/5] Add new set_client_capabilities() interface to QXLInstance, Søren Sandmann, 2012/09/03
- [Qemu-devel] [PATCH 5/5] Bump spice.h version number to 0.11.4, Søren Sandmann, 2012/09/03
- [Qemu-devel] [PATCH 3/5] Process outstanding commands in the ring after changing capability bits, Søren Sandmann, 2012/09/03
- Re: [Qemu-devel] [Spice-devel] [PATCH 3/5] Process outstanding commands in the ring after changing capability bits,
Alon Levy <=
- [Qemu-devel] [PATCH 4/5] Set a8 capability in the QXL device if supported by the client, Søren Sandmann, 2012/09/03
[Qemu-devel] [PATCH-v2 spice 2/2] Bump spice.h version number to 0.11.4, Søren Sandmann Pedersen, 2012/09/03
[Qemu-devel] [PATCH-v2 qemu] qxl: Add set_client_capabilities() interface to QXLInterface, Søren Sandmann Pedersen, 2012/09/03
Re: [Qemu-devel] [PATCH-v2 qemu] qxl: Add set_client_capabilities() interface to QXLInterface, Gerd Hoffmann, 2012/09/04