Discussion:
[Spice-devel] need help explaining the algorithm
Zihao Miao
2018-11-09 09:08:21 UTC
Permalink
Hi, list:
This is my first post to a mail list.. so..
I am a college student and I am very interested in the algorithm that
maintains the current ring of drawables to reduce the display data
transfer. I currently read the code through the trace of
disolay_channel_process_draw->display_channel_add_drawable->current_add->exclude_region->__exclude_region,
and gained some understanding of the code.
However, I still don't quite get the concept of the difference between a
draw item and a container? And there are questions like why
current_add_with_shadow is much more complicated than the current_add; what
did the pip actually send? a drawable or the whole surface? where do
compression come in?...
Do you guys have any resources besides the newbee and spice protocol
document to learn about this algorithm?
Best wishes!
Zihao Miao
Victor Toso
2018-11-16 08:55:15 UTC
Permalink
Hi,
Post by Zihao Miao
This is my first post to a mail list.. so..
Welcome.
Post by Zihao Miao
I am a college student and I am very interested in the
algorithm that maintains the current ring of drawables to
reduce the display data transfer.
I currently read the code through the trace of
disolay_channel_process_draw->display_channel_add_drawable->current_add->exclude_region->__exclude_region,
heh, "TODO: What is the intended use of this function?"
https://gitlab.freedesktop.org/spice/spice/blob/master/server/display-channel.c#L764
Post by Zihao Miao
and gained some understanding of the code.
However, I still don't quite get the concept of the difference
between a draw item and a container?
And there are questions like why current_add_with_shadow is
much more complicated than the current_add; what
https://gitlab.freedesktop.org/spice/spice/blob/master/server/display-channel.c#L1424
Post by Zihao Miao
did the pip actually send? a drawable or the whole surface?
where do compression come in?...
So many questions. I'm not really familiar with this code tbh so
I'd have to study myself to reply.
Post by Zihao Miao
Do you guys have any resources besides the newbee and spice
protocol document to learn about this algorithm?
Not really, I trust more the comments and git history.
Post by Zihao Miao
Best wishes!
Zihao Miao
Sorry that I could not help much right now but I hate to see this
kind of email going on not replied for so long. We welcome better
documentation, please do feel free to send patches with your
understanding as documentation. It might trigger the discussions
that you want.

Cheers,
Victor
Frediano Ziglio
2018-12-05 09:32:55 UTC
Permalink
Post by Victor Toso
Hi,
Post by Zihao Miao
This is my first post to a mail list.. so..
Welcome.
Post by Zihao Miao
I am a college student and I am very interested in the
algorithm that maintains the current ring of drawables to
reduce the display data transfer.
I currently read the code through the trace of
disolay_channel_process_draw->display_channel_add_drawable->current_add->exclude_region->__exclude_region,
heh, "TODO: What is the intended use of this function?"
https://gitlab.freedesktop.org/spice/spice/blob/master/server/display-channel.c#L764
Post by Zihao Miao
and gained some understanding of the code.
However, I still don't quite get the concept of the difference
between a draw item and a container?
Not really sure about it but a draw item should just contain a single
draw command, a container bound more commands.
Post by Victor Toso
Post by Zihao Miao
And there are questions like why current_add_with_shadow is
much more complicated than the current_add; what
https://gitlab.freedesktop.org/spice/spice/blob/master/server/display-channel.c#L1424
Shadow terminology always puzzled me. But is related to copy screen to
screen. Is more complicated as you cannot simply delete covered drawing
as part could be used.
More or less the optimization at that level try to remove old drawing
covered by new one. As an example if you paint the entire screen with a
single color all old drawing will be covered so you can remove them
(current_add). But if you scroll part of the screen part of the old
drawing will not be needed but other will be moved (current_add_with_shadow)
so is more complicated.
Post by Victor Toso
Post by Zihao Miao
did the pip actually send? a drawable or the whole surface?
where do compression come in?...
So many questions. I'm not really familiar with this code tbh so
I'd have to study myself to reply.
The compression is done before sending to be client.
Post by Victor Toso
Post by Zihao Miao
Do you guys have any resources besides the newbee and spice
protocol document to learn about this algorithm?
Not really, I trust more the comments and git history.
No :-(
Yes, that part of the code is pretty complicated and old.
Post by Victor Toso
Post by Zihao Miao
Best wishes!
Zihao Miao
Sorry that I could not help much right now but I hate to see this
kind of email going on not replied for so long. We welcome better
documentation, please do feel free to send patches with your
understanding as documentation. It might trigger the discussions
that you want.
Cheers,
Victor
Frediano

Loading...