Changeset d8503fd in mainline for uspace/srv/hid/display/main.c
- Timestamp:
- 2023-01-09T21:14:04Z (2 years ago)
- Branches:
- master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 46b02cb
- Parents:
- e04b72d6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/display/main.c
re04b72d6 rd8503fd 1 1 /* 2 * Copyright (c) 202 2Jiri Svoboda2 * Copyright (c) 2023 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 36 36 #include <async.h> 37 37 #include <disp_srv.h> 38 #include <dispcfg_srv.h> 38 39 #include <errno.h> 39 40 #include <gfx/context.h> … … 48 49 #include <task.h> 49 50 #include <wndmgt_srv.h> 51 #include "cfgclient.h" 52 #include "cfgops.h" 50 53 #include "client.h" 51 54 #include "display.h" … … 62 65 static void display_client_ev_pending(void *); 63 66 static void display_wmclient_ev_pending(void *); 67 static void display_cfgclient_ev_pending(void *); 64 68 static void display_gc_conn(ipc_call_t *, void *); 65 69 static void display_wndmgt_conn(ipc_call_t *, void *); 70 static void display_dispcfg_conn(ipc_call_t *, void *); 66 71 67 72 #ifdef CONFIG_DISP_DOUBLE_BUF … … 86 91 }; 87 92 93 static ds_cfgclient_cb_t display_cfgclient_cb = { 94 .ev_pending = display_cfgclient_ev_pending 95 }; 96 88 97 static void display_client_ev_pending(void *arg) 89 98 { … … 98 107 99 108 wndmgt_srv_ev_pending(srv); 109 } 110 111 static void display_cfgclient_ev_pending(void *arg) 112 { 113 dispcfg_srv_t *srv = (dispcfg_srv_t *) arg; 114 115 dispcfg_srv_ev_pending(srv); 100 116 } 101 117 … … 110 126 port_id_t gc_port; 111 127 port_id_t wm_port; 128 port_id_t dc_port; 112 129 errno_t rc; 113 130 … … 118 135 goto error; 119 136 120 rc = ds_seat_create(disp, &seat);137 rc = ds_seat_create(disp, "Alice", &seat); 121 138 if (rc != EOK) 122 139 goto error; … … 146 163 rc = async_create_port(INTERFACE_WNDMGT, display_wndmgt_conn, disp, 147 164 &wm_port); 165 if (rc != EOK) 166 goto error; 167 168 rc = async_create_port(INTERFACE_DISPCFG, display_dispcfg_conn, disp, 169 &dc_port); 148 170 if (rc != EOK) 149 171 goto error; … … 170 192 // XXX destroy gc_port 171 193 // XXX destroy wm_port 194 // XXX destroy dc_port 172 195 #if 0 173 196 if (disp->input != NULL) … … 284 307 } 285 308 309 /** Handle configuration connection to display server */ 310 static void display_dispcfg_conn(ipc_call_t *icall, void *arg) 311 { 312 ds_display_t *disp = (ds_display_t *) arg; 313 errno_t rc; 314 dispcfg_srv_t srv; 315 ds_cfgclient_t *cfgclient = NULL; 316 317 /* Create CFG client object */ 318 ds_display_lock(disp); 319 rc = ds_cfgclient_create(disp, &display_cfgclient_cb, &srv, &cfgclient); 320 ds_display_unlock(disp); 321 if (rc != EOK) { 322 async_answer_0(icall, ENOMEM); 323 return; 324 } 325 326 /* Set up protocol structure */ 327 dispcfg_srv_initialize(&srv); 328 srv.ops = &dispcfg_srv_ops; 329 srv.arg = cfgclient; 330 331 /* Handle connection */ 332 dispcfg_conn(icall, &srv); 333 334 ds_display_lock(disp); 335 ds_cfgclient_destroy(cfgclient); 336 ds_display_unlock(disp); 337 } 338 286 339 int main(int argc, char *argv[]) 287 340 {
Note:
See TracChangeset
for help on using the changeset viewer.