Changeset 1766326 in mainline for uspace/srv/hid/display/main.c
- Timestamp:
- 2022-10-18T09:06:07Z (3 years ago)
- Branches:
- master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7a05d924
- Parents:
- 0761448
- git-author:
- Jiri Svoboda <jiri@…> (2022-10-17 17:05:56)
- git-committer:
- Jiri Svoboda <jiri@…> (2022-10-18 09:06:07)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/display/main.c
r0761448 r1766326 1 1 /* 2 * Copyright (c) 20 19Jiri Svoboda2 * Copyright (c) 2022 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 47 47 #include <stdio.h> 48 48 #include <task.h> 49 #include <wndmgt_srv.h> 49 50 #include "client.h" 50 51 #include "display.h" … … 55 56 #include "seat.h" 56 57 #include "window.h" 58 #include "wmops.h" 57 59 58 60 static void display_client_conn(ipc_call_t *, void *); 59 61 static void display_client_ev_pending(void *); 62 static void display_gc_conn(ipc_call_t *, void *); 63 static void display_wndmgt_conn(ipc_call_t *, void *); 60 64 61 65 #ifdef CONFIG_DISP_DOUBLE_BUF … … 90 94 ds_output_t *output = NULL; 91 95 gfx_context_t *gc = NULL; 96 port_id_t disp_port; 97 port_id_t gc_port; 98 port_id_t wm_port; 92 99 errno_t rc; 93 100 … … 115 122 goto error; 116 123 117 async_set_fallback_port_handler(display_client_conn, disp); 124 rc = async_create_port(INTERFACE_DISPLAY, display_client_conn, disp, 125 &disp_port); 126 if (rc != EOK) 127 goto error; 128 129 rc = async_create_port(INTERFACE_GC, display_gc_conn, disp, &gc_port); 130 if (rc != EOK) 131 goto error; 132 133 rc = async_create_port(INTERFACE_WNDMGT, display_wndmgt_conn, disp, 134 &wm_port); 135 if (rc != EOK) 136 goto error; 118 137 119 138 rc = loc_server_register(NAME); … … 135 154 return EOK; 136 155 error: 156 // XXX destroy disp_port 157 // XXX destroy gc_port 158 // XXX destroy wm_port 137 159 #if 0 138 160 if (disp->input != NULL) … … 154 176 { 155 177 display_srv_t srv; 156 sysarg_t wnd_id;157 178 sysarg_t svc_id; 158 179 ds_client_t *client = NULL; 159 ds_window_t *wnd;160 180 ds_display_t *disp = (ds_display_t *) arg; 161 gfx_context_t *gc;162 181 errno_t rc; 163 182 … … 166 185 ipc_get_arg4(icall)); 167 186 168 (void) icall;169 (void) arg;170 171 187 svc_id = ipc_get_arg2(icall); 172 wnd_id = ipc_get_arg3(icall);173 188 174 189 if (svc_id != 0) { … … 191 206 ds_client_destroy(client); 192 207 ds_display_unlock(disp); 193 } else { 194 /* Window GC connection */ 195 196 wnd = ds_display_find_window(disp, wnd_id); 197 if (wnd == NULL) { 198 async_answer_0(icall, ENOENT); 199 return; 200 } 201 202 /* 203 * XXX We need a way to make sure that the connection does 204 * not stay active after the window had been destroyed 205 */ 206 gc = ds_window_get_ctx(wnd); 207 gc_conn(icall, gc); 208 } 208 } 209 } 210 211 /** Handle GC connection to display server */ 212 static void display_gc_conn(ipc_call_t *icall, void *arg) 213 { 214 sysarg_t wnd_id; 215 ds_window_t *wnd; 216 ds_display_t *disp = (ds_display_t *) arg; 217 gfx_context_t *gc; 218 219 log_msg(LOG_DEFAULT, LVL_DEBUG, "display_gc_conn arg1=%zu arg2=%zu arg3=%zu arg4=%zu.", 220 ipc_get_arg1(icall), ipc_get_arg2(icall), ipc_get_arg3(icall), 221 ipc_get_arg4(icall)); 222 223 wnd_id = ipc_get_arg3(icall); 224 225 /* Window GC connection */ 226 227 wnd = ds_display_find_window(disp, wnd_id); 228 if (wnd == NULL) { 229 async_answer_0(icall, ENOENT); 230 return; 231 } 232 233 /* 234 * XXX We need a way to make sure that the connection does 235 * not stay active after the window had been destroyed 236 */ 237 gc = ds_window_get_ctx(wnd); 238 gc_conn(icall, gc); 239 } 240 241 /** Handle window management connection to display server */ 242 static void display_wndmgt_conn(ipc_call_t *icall, void *arg) 243 { 244 wndmgt_srv_t srv; 245 246 /* Set up protocol structure */ 247 wndmgt_srv_initialize(&srv); 248 srv.ops = &wndmgt_srv_ops; 249 srv.arg = NULL; // XXX 250 251 /* Handle connection */ 252 wndmgt_conn(icall, &srv); 209 253 } 210 254
Note:
See TracChangeset
for help on using the changeset viewer.