mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2026-01-08 04:11:52 +00:00
Store reference to RedsState in QXLState
Remove use of global 'reds' variable from QXLState functions. Instead store the owning RedsState variable inside the QXLState struct and use that when necessary. Acked-by: Fabiano Fidêncio <fidencio@redhat.com> Acked-by: Frediano Ziglio <fziglio@redhat.com>
This commit is contained in:
parent
95fa8bfb13
commit
c3d43fdea7
@ -56,6 +56,7 @@ struct QXLState {
|
||||
int use_hardware_cursor;
|
||||
QXLDevSurfaceCreate surface_create;
|
||||
unsigned int max_monitors;
|
||||
RedsState *reds;
|
||||
|
||||
pthread_mutex_t scanout_mutex;
|
||||
SpiceMsgDisplayGlScanoutUnix scanout;
|
||||
@ -331,7 +332,7 @@ static void red_qxl_destroy_primary_surface_complete(QXLState *qxl_state)
|
||||
qxl_state->use_hardware_cursor = FALSE;
|
||||
qxl_state->primary_active = FALSE;
|
||||
|
||||
reds_update_client_mouse_allowed(reds);
|
||||
reds_update_client_mouse_allowed(qxl_state->reds);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -383,7 +384,7 @@ static void red_qxl_create_primary_surface_complete(QXLState *qxl_state)
|
||||
qxl_state->use_hardware_cursor = surface->mouse_mode;
|
||||
qxl_state->primary_active = TRUE;
|
||||
|
||||
reds_update_client_mouse_allowed(reds);
|
||||
reds_update_client_mouse_allowed(qxl_state->reds);
|
||||
memset(&qxl_state->surface_create, 0, sizeof(QXLDevSurfaceCreate));
|
||||
}
|
||||
|
||||
@ -933,7 +934,7 @@ void red_qxl_gl_draw_async_complete(QXLState *qxl_state)
|
||||
red_qxl_async_complete(qxl_state, async);
|
||||
}
|
||||
|
||||
void red_qxl_init(QXLInstance *qxl)
|
||||
void red_qxl_init(RedsState *reds, QXLInstance *qxl)
|
||||
{
|
||||
QXLState *qxl_state;
|
||||
RedChannel *channel;
|
||||
@ -950,6 +951,7 @@ void red_qxl_init(QXLInstance *qxl)
|
||||
}
|
||||
|
||||
qxl_state = spice_new0(QXLState, 1);
|
||||
qxl_state->reds = reds;
|
||||
qxl_state->qxl = qxl;
|
||||
pthread_mutex_init(&qxl_state->scanout_mutex, NULL);
|
||||
qxl_state->scanout.drm_dma_buf_fd = -1;
|
||||
|
||||
@ -24,7 +24,7 @@ typedef struct QXLState QXLState;
|
||||
|
||||
typedef struct AsyncCommand AsyncCommand;
|
||||
|
||||
void red_qxl_init(QXLInstance *qxl);
|
||||
void red_qxl_init(SpiceServer *reds, QXLInstance *qxl);
|
||||
|
||||
void red_qxl_set_mm_time(QXLState *qxl_state, uint32_t);
|
||||
void red_qxl_on_ic_change(QXLState *qxl_state, SpiceImageCompression ic);
|
||||
|
||||
@ -3209,7 +3209,7 @@ SPICE_GNUC_VISIBLE int spice_server_add_interface(SpiceServer *s,
|
||||
}
|
||||
|
||||
qxl = SPICE_CONTAINEROF(sin, QXLInstance, base);
|
||||
red_qxl_init(qxl);
|
||||
red_qxl_init(reds, qxl);
|
||||
qxl_state = qxl->st;
|
||||
reds->qxl_states = g_list_prepend(reds->qxl_states, qxl_state);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user