Changes in uspace/srv/hid/display/main.c [4c6fd56:ca48672] in mainline
- File:
-
- 1 edited
-
uspace/srv/hid/display/main.c (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/display/main.c
r4c6fd56 rca48672 1 1 /* 2 * Copyright (c) 202 3Jiri Svoboda2 * Copyright (c) 2025 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 54 54 #include "display.h" 55 55 #include "dsops.h" 56 #include "ievent.h" 56 57 #include "input.h" 57 58 #include "main.h" … … 62 63 #include "wmops.h" 63 64 65 const char *cfg_file_path = "/w/cfg/display.sif"; 66 64 67 static void display_client_conn(ipc_call_t *, void *); 65 68 static void display_client_ev_pending(void *); … … 123 126 ds_output_t *output = NULL; 124 127 gfx_context_t *gc = NULL; 125 port_id_t disp_port; 126 port_id_t gc_port; 127 port_id_t wm_port; 128 port_id_t dc_port; 128 port_id_t port = 0; 129 129 loc_srv_t *srv = NULL; 130 130 service_id_t sid = 0; … … 137 137 goto error; 138 138 139 rc = ds_seat_create(disp, "Alice", &seat); 140 if (rc != EOK) 141 goto error; 139 rc = ds_display_load_cfg(disp, cfg_file_path); 140 if (rc != EOK) { 141 log_msg(LOG_DEFAULT, LVL_NOTE, 142 "Starting with fresh configuration."); 143 144 /* Create first seat */ 145 rc = ds_seat_create(disp, "Alice", &seat); 146 if (rc != EOK) 147 goto error; 148 } 142 149 143 150 rc = ds_output_create(&output); … … 150 157 goto error; 151 158 159 rc = ds_ievent_init(disp); 160 if (rc != EOK) 161 goto error; 162 152 163 rc = ds_input_open(disp); 153 164 if (rc != EOK) … … 155 166 156 167 rc = async_create_port(INTERFACE_DISPLAY, display_client_conn, disp, 157 &disp_port); 158 if (rc != EOK) 159 goto error; 160 161 rc = async_create_port(INTERFACE_GC, display_gc_conn, disp, &gc_port); 162 if (rc != EOK) 163 goto error; 164 165 rc = async_create_port(INTERFACE_WNDMGT, display_wndmgt_conn, disp, 166 &wm_port); 167 if (rc != EOK) 168 goto error; 169 170 rc = async_create_port(INTERFACE_DISPCFG, display_dispcfg_conn, disp, 171 &dc_port); 168 &port); 169 if (rc != EOK) 170 goto error; 171 172 rc = async_port_create_interface(port, INTERFACE_GC, display_gc_conn, 173 disp); 174 if (rc != EOK) 175 goto error; 176 177 rc = async_port_create_interface(port, INTERFACE_WNDMGT, 178 display_wndmgt_conn, disp); 179 if (rc != EOK) 180 goto error; 181 182 rc = async_port_create_interface(port, INTERFACE_DISPCFG, 183 display_dispcfg_conn, disp); 172 184 if (rc != EOK) 173 185 goto error; … … 180 192 } 181 193 182 rc = loc_service_register(srv, SERVICE_NAME_DISPLAY, &sid);194 rc = loc_service_register(srv, SERVICE_NAME_DISPLAY, port, &sid); 183 195 if (rc != EOK) { 184 196 log_msg(LOG_DEFAULT, LVL_ERROR, "Failed registering service: %s.", str_error(rc)); … … 194 206 if (srv != NULL) 195 207 loc_server_unregister(srv); 196 // XXX destroy disp_port 197 // XXX destroy gc_port 198 // XXX destroy wm_port 199 // XXX destroy dc_port 208 if (port != 0) 209 async_port_destroy(port); 200 210 #if 0 201 211 if (disp->input != NULL) 202 212 ds_input_close(disp); 203 213 #endif 214 ds_ievent_fini(disp); 204 215 if (output != NULL) 205 216 ds_output_destroy(output);
Note:
See TracChangeset
for help on using the changeset viewer.
