display-channel: Limit number of surfaces to 1024

Qemu never used more than this number and today surfaces are not
much used so there's no reason to keep this limit so high.
This reduces quite a lot some internal structure
(DisplayChannelPrivate and DisplayChannelClientPrivate).

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
This commit is contained in:
Frediano Ziglio 2017-12-15 13:40:40 +00:00
parent 7362882993
commit 4458cc372b
2 changed files with 2 additions and 2 deletions

View File

@ -68,7 +68,7 @@ display_channel_set_property(GObject *object,
switch (property_id)
{
case PROP_N_SURFACES:
self->priv->n_surfaces = g_value_get_uint(value);
self->priv->n_surfaces = MIN(g_value_get_uint(value), NUM_SURFACES);
break;
case PROP_VIDEO_CODECS:
display_channel_set_video_codecs(self, g_value_get_boxed(value));

View File

@ -20,7 +20,7 @@
#define DISPLAY_LIMITS_H_
/** Maximum number of surfaces a guest can create */
#define NUM_SURFACES 10000
#define NUM_SURFACES 1024
/** Maximum number of streams created by spice-server */
#define NUM_STREAMS 50