mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2025-12-31 02:41:52 +00:00
common-graphics-channel: Move "qxl" property to DisplayChannel
Only DisplayChannel uses this property. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
This commit is contained in:
parent
8e7d5ac580
commit
6db3ee7f83
@ -38,7 +38,6 @@ G_DEFINE_TYPE(CommonGraphicsChannelClient, common_graphics_channel_client, RED_T
|
||||
|
||||
struct CommonGraphicsChannelPrivate
|
||||
{
|
||||
QXLInstance *qxl;
|
||||
int during_target_migrate; /* TRUE when the client that is associated with the channel
|
||||
is during migration. Turned off when the vm is started.
|
||||
The flag is used to avoid sending messages that are artifacts
|
||||
@ -75,48 +74,6 @@ static void common_release_recv_buf(RedChannelClient *rcc, uint16_t type, uint32
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
enum {
|
||||
PROP0,
|
||||
PROP_QXL
|
||||
};
|
||||
|
||||
static void
|
||||
common_graphics_channel_get_property(GObject *object,
|
||||
guint property_id,
|
||||
GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
CommonGraphicsChannel *self = COMMON_GRAPHICS_CHANNEL(object);
|
||||
|
||||
switch (property_id)
|
||||
{
|
||||
case PROP_QXL:
|
||||
g_value_set_pointer(value, self->priv->qxl);
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
common_graphics_channel_set_property(GObject *object,
|
||||
guint property_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
CommonGraphicsChannel *self = COMMON_GRAPHICS_CHANNEL(object);
|
||||
|
||||
switch (property_id)
|
||||
{
|
||||
case PROP_QXL:
|
||||
self->priv->qxl = g_value_get_pointer(value);
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec);
|
||||
}
|
||||
}
|
||||
|
||||
bool common_channel_client_config_socket(RedChannelClient *rcc)
|
||||
{
|
||||
RedClient *client = red_channel_client_get_client(rcc);
|
||||
@ -145,21 +102,7 @@ bool common_channel_client_config_socket(RedChannelClient *rcc)
|
||||
static void
|
||||
common_graphics_channel_class_init(CommonGraphicsChannelClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS(klass);
|
||||
|
||||
g_type_class_add_private(klass, sizeof(CommonGraphicsChannelPrivate));
|
||||
|
||||
object_class->get_property = common_graphics_channel_get_property;
|
||||
object_class->set_property = common_graphics_channel_set_property;
|
||||
|
||||
g_object_class_install_property(object_class,
|
||||
PROP_QXL,
|
||||
g_param_spec_pointer("qxl",
|
||||
"qxl",
|
||||
"QXLInstance for this channel",
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_CONSTRUCT_ONLY |
|
||||
G_PARAM_STATIC_STRINGS));
|
||||
}
|
||||
|
||||
static void
|
||||
@ -178,11 +121,6 @@ gboolean common_graphics_channel_get_during_target_migrate(CommonGraphicsChannel
|
||||
return self->priv->during_target_migrate;
|
||||
}
|
||||
|
||||
QXLInstance* common_graphics_channel_get_qxl(CommonGraphicsChannel *self)
|
||||
{
|
||||
return self->priv->qxl;
|
||||
}
|
||||
|
||||
static void
|
||||
common_graphics_channel_client_init(CommonGraphicsChannelClient *self)
|
||||
{
|
||||
|
||||
@ -62,7 +62,6 @@ GType common_graphics_channel_get_type(void) G_GNUC_CONST;
|
||||
|
||||
void common_graphics_channel_set_during_target_migrate(CommonGraphicsChannel *self, gboolean value);
|
||||
gboolean common_graphics_channel_get_during_target_migrate(CommonGraphicsChannel *self);
|
||||
QXLInstance* common_graphics_channel_get_qxl(CommonGraphicsChannel *self);
|
||||
|
||||
enum {
|
||||
RED_PIPE_ITEM_TYPE_INVAL_ONE = RED_PIPE_ITEM_TYPE_CHANNEL_BASE,
|
||||
|
||||
@ -2324,7 +2324,7 @@ static void marshall_gl_scanout(RedChannelClient *rcc,
|
||||
{
|
||||
DisplayChannelClient *dcc = DISPLAY_CHANNEL_CLIENT(rcc);
|
||||
DisplayChannel *display_channel = DCC_TO_DC(dcc);
|
||||
QXLInstance* qxl = common_graphics_channel_get_qxl(COMMON_GRAPHICS_CHANNEL(display_channel));
|
||||
QXLInstance* qxl = display_channel->priv->qxl;
|
||||
|
||||
SpiceMsgDisplayGlScanoutUnix *scanout = red_qxl_get_gl_scanout(qxl);
|
||||
if (scanout != NULL) {
|
||||
|
||||
@ -519,7 +519,7 @@ DisplayChannelClient *dcc_new(DisplayChannel *display,
|
||||
spice_debug("New display (client %p) dcc %p stream %p", client, dcc, stream);
|
||||
common_graphics_channel_set_during_target_migrate(COMMON_GRAPHICS_CHANNEL(display), mig_target);
|
||||
if (dcc) {
|
||||
dcc->priv->id = common_graphics_channel_get_qxl(COMMON_GRAPHICS_CHANNEL(display))->id;
|
||||
dcc->priv->id = display->priv->qxl->id;
|
||||
}
|
||||
|
||||
return dcc;
|
||||
|
||||
@ -75,6 +75,8 @@ struct DisplayChannelPrivate
|
||||
{
|
||||
DisplayChannel *pub;
|
||||
|
||||
QXLInstance *qxl;
|
||||
|
||||
uint32_t bits_unique;
|
||||
|
||||
MonitorsConfig *monitors_config;
|
||||
|
||||
@ -28,7 +28,8 @@ G_DEFINE_TYPE(DisplayChannel, display_channel, TYPE_COMMON_GRAPHICS_CHANNEL)
|
||||
enum {
|
||||
PROP0,
|
||||
PROP_N_SURFACES,
|
||||
PROP_VIDEO_CODECS
|
||||
PROP_VIDEO_CODECS,
|
||||
PROP_QXL
|
||||
};
|
||||
|
||||
static void
|
||||
@ -47,6 +48,9 @@ display_channel_get_property(GObject *object,
|
||||
case PROP_VIDEO_CODECS:
|
||||
g_value_set_static_boxed(value, self->priv->video_codecs);
|
||||
break;
|
||||
case PROP_QXL:
|
||||
g_value_set_pointer(value, self->priv->qxl);
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec);
|
||||
}
|
||||
@ -68,6 +72,9 @@ display_channel_set_property(GObject *object,
|
||||
case PROP_VIDEO_CODECS:
|
||||
display_channel_set_video_codecs(self, g_value_get_boxed(value));
|
||||
break;
|
||||
case PROP_QXL:
|
||||
self->priv->qxl = g_value_get_pointer(value);
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec);
|
||||
}
|
||||
@ -278,7 +285,7 @@ static void stop_streams(DisplayChannel *display)
|
||||
void display_channel_surface_unref(DisplayChannel *display, uint32_t surface_id)
|
||||
{
|
||||
RedSurface *surface = &display->priv->surfaces[surface_id];
|
||||
QXLInstance *qxl = common_graphics_channel_get_qxl(COMMON_GRAPHICS_CHANNEL(display));
|
||||
QXLInstance *qxl = display->priv->qxl;
|
||||
DisplayChannelClient *dcc;
|
||||
|
||||
if (--surface->refs != 0) {
|
||||
@ -2381,12 +2388,10 @@ void display_channel_gl_scanout(DisplayChannel *display)
|
||||
|
||||
static void set_gl_draw_async_count(DisplayChannel *display, int num)
|
||||
{
|
||||
QXLInstance *qxl = common_graphics_channel_get_qxl(COMMON_GRAPHICS_CHANNEL(display));
|
||||
|
||||
display->priv->gl_draw_async_count = num;
|
||||
|
||||
if (num == 0) {
|
||||
red_qxl_gl_draw_async_complete(qxl);
|
||||
red_qxl_gl_draw_async_complete(display->priv->qxl);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2514,6 +2519,14 @@ display_channel_class_init(DisplayChannelClass *klass)
|
||||
G_PARAM_CONSTRUCT_ONLY |
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_STATIC_STRINGS));
|
||||
g_object_class_install_property(object_class,
|
||||
PROP_QXL,
|
||||
g_param_spec_pointer("qxl",
|
||||
"qxl",
|
||||
"QXLInstance for this channel",
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_CONSTRUCT_ONLY |
|
||||
G_PARAM_STATIC_STRINGS));
|
||||
}
|
||||
|
||||
void display_channel_debug_oom(DisplayChannel *display, const char *msg)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user