Changeset b7fd2a0 in mainline for uspace/lib/graph
- Timestamp:
- 2018-01-13T03:10:29Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a53ed3a
- Parents:
- 36f0738
- Location:
- uspace/lib/graph
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/graph/graph.c
r36f0738 rb7fd2a0 86 86 } 87 87 88 int graph_register_visualizer(visualizer_t *vs)88 errno_t graph_register_visualizer(visualizer_t *vs) 89 89 { 90 90 char node[LOC_NAME_MAXLEN + 1]; … … 93 93 94 94 category_id_t cat; 95 int rc = loc_category_get_id("visualizer", &cat, 0);95 errno_t rc = loc_category_get_id("visualizer", &cat, 0); 96 96 if (rc != EOK) 97 97 return rc; … … 114 114 } 115 115 116 int graph_register_renderer(renderer_t *rnd)116 errno_t graph_register_renderer(renderer_t *rnd) 117 117 { 118 118 char node[LOC_NAME_MAXLEN + 1]; … … 121 121 122 122 category_id_t cat; 123 int rc = loc_category_get_id("renderer", &cat, 0);123 errno_t rc = loc_category_get_id("renderer", &cat, 0); 124 124 if (rc != EOK) 125 125 return rc; … … 178 178 } 179 179 180 int graph_unregister_visualizer(visualizer_t *vs)180 errno_t graph_unregister_visualizer(visualizer_t *vs) 181 181 { 182 182 fibril_mutex_lock(&visualizer_list_mtx); 183 int rc = loc_service_unregister(vs->reg_svc_handle);183 errno_t rc = loc_service_unregister(vs->reg_svc_handle); 184 184 list_remove(&vs->link); 185 185 fibril_mutex_unlock(&visualizer_list_mtx); … … 188 188 } 189 189 190 int graph_unregister_renderer(renderer_t *rnd)190 errno_t graph_unregister_renderer(renderer_t *rnd) 191 191 { 192 192 fibril_mutex_lock(&renderer_list_mtx); 193 int rc = loc_service_unregister(rnd->reg_svc_handle);193 errno_t rc = loc_service_unregister(rnd->reg_svc_handle); 194 194 list_remove(&rnd->link); 195 195 fibril_mutex_unlock(&renderer_list_mtx); … … 219 219 } 220 220 221 int graph_notify_mode_change(async_sess_t *sess, sysarg_t handle, sysarg_t mode_idx)221 errno_t graph_notify_mode_change(async_sess_t *sess, sysarg_t handle, sysarg_t mode_idx) 222 222 { 223 223 async_exch_t *exch = async_exchange_begin(sess); 224 int ret = async_req_2_0(exch, VISUALIZER_MODE_CHANGE, handle, mode_idx);224 errno_t ret = async_req_2_0(exch, VISUALIZER_MODE_CHANGE, handle, mode_idx); 225 225 async_exchange_end(exch); 226 226 … … 228 228 } 229 229 230 int graph_notify_disconnect(async_sess_t *sess, sysarg_t handle)230 errno_t graph_notify_disconnect(async_sess_t *sess, sysarg_t handle) 231 231 { 232 232 async_exch_t *exch = async_exchange_begin(sess); 233 int ret = async_req_1_0(exch, VISUALIZER_DISCONNECT, handle);233 errno_t ret = async_req_1_0(exch, VISUALIZER_DISCONNECT, handle); 234 234 async_exchange_end(exch); 235 235 … … 242 242 { 243 243 vs->client_side_handle = IPC_GET_ARG1(*icall); 244 int rc = vs->ops.claim(vs);244 errno_t rc = vs->ops.claim(vs); 245 245 async_answer_0(iid, rc); 246 246 } … … 257 257 258 258 /* Driver might also deallocate resources for the current mode. */ 259 int rc = vs->ops.yield(vs);259 errno_t rc = vs->ops.yield(vs); 260 260 261 261 /* Now that the driver was given a chance to deallocate resources, … … 285 285 list_get_instance(link, vslmode_list_element_t, link); 286 286 287 int rc = async_data_read_finalize(callid, &mode_elem->mode, len);287 errno_t rc = async_data_read_finalize(callid, &mode_elem->mode, len); 288 288 async_answer_0(iid, rc); 289 289 } else { … … 317 317 318 318 if (mode_elem != NULL) { 319 int rc = async_data_read_finalize(callid, &mode_elem->mode, len);319 errno_t rc = async_data_read_finalize(callid, &mode_elem->mode, len); 320 320 async_answer_0(iid, rc); 321 321 } else { … … 340 340 341 341 if (vs->mode_set) { 342 int rc = async_data_read_finalize(callid, &vs->cur_mode, len);342 errno_t rc = async_data_read_finalize(callid, &vs->cur_mode, len); 343 343 async_answer_0(iid, rc); 344 344 } else { … … 372 372 373 373 if (mode_elem != NULL) { 374 int rc = async_data_read_finalize(callid, &mode_elem->mode, len);374 errno_t rc = async_data_read_finalize(callid, &mode_elem->mode, len); 375 375 async_answer_0(iid, rc); 376 376 } else { … … 429 429 430 430 void *new_cell_storage; 431 int rc = async_share_out_finalize(callid, &new_cell_storage);431 errno_t rc = async_share_out_finalize(callid, &new_cell_storage); 432 432 if ((rc != EOK) || (new_cell_storage == AS_MAP_FAILED)) { 433 433 async_answer_0(iid, ENOMEM); … … 472 472 sysarg_t y_offset = (IPC_GET_ARG5(*icall) & 0x0000ffff); 473 473 474 int rc = vs->ops.handle_damage(vs,474 errno_t rc = vs->ops.handle_damage(vs, 475 475 IPC_GET_ARG1(*icall), IPC_GET_ARG2(*icall), 476 476 IPC_GET_ARG3(*icall), IPC_GET_ARG4(*icall), … … 481 481 static void vs_suspend(visualizer_t *vs, ipc_callid_t iid, ipc_call_t *icall) 482 482 { 483 int rc = vs->ops.suspend(vs);483 errno_t rc = vs->ops.suspend(vs); 484 484 async_answer_0(iid, rc); 485 485 } … … 487 487 static void vs_wakeup(visualizer_t *vs, ipc_callid_t iid, ipc_call_t *icall) 488 488 { 489 int rc = vs->ops.wakeup(vs);489 errno_t rc = vs->ops.wakeup(vs); 490 490 async_answer_0(iid, rc); 491 491 } -
uspace/lib/graph/graph.h
r36f0738 rb7fd2a0 54 54 * Device driver shall allocate any necessary internal structures 55 55 * specific for a claimed visualizer. */ 56 int (* claim)(struct visualizer *vs);56 errno_t (* claim)(struct visualizer *vs); 57 57 58 58 /** … … 61 61 * the mode is set and if so it shall change its internal state 62 62 * accordingly (e.g. deallocate frame buffers). */ 63 int (* yield)(struct visualizer *vs);63 errno_t (* yield)(struct visualizer *vs); 64 64 65 65 /** … … 72 72 * optimization), the pointer to the handle_damage operation can be 73 73 * changed at this point. */ 74 int (* change_mode)(struct visualizer *vs, vslmode_t new_mode);74 errno_t (* change_mode)(struct visualizer *vs, vslmode_t new_mode); 75 75 76 76 /** … … 82 82 * shall be added to the coordinates and if necessary the result shall be 83 83 * wrapped around the edge of the backbuffer). */ 84 int (* handle_damage)(struct visualizer *vs,84 errno_t (* handle_damage)(struct visualizer *vs, 85 85 sysarg_t x, sysarg_t y, sysarg_t width, sysarg_t height, 86 86 sysarg_t x_offset, sysarg_t y_offset); … … 90 90 * case, device driver might enable power saving mode on the device 91 91 * corresponding to the visualizer. */ 92 int (* suspend)(struct visualizer *vs);92 errno_t (* suspend)(struct visualizer *vs); 93 93 94 94 /** 95 95 * When upper layers detect activity on suspended visualizer, device 96 96 * driver shall disable power saving mode on the corresponding device. */ 97 int (* wakeup)(struct visualizer *vs);97 errno_t (* wakeup)(struct visualizer *vs); 98 98 } visualizer_ops_t; 99 99 … … 290 290 * list is guarded by the mutex, visualizers might be added even after the 291 291 * initialialization of the device driver. */ 292 extern int graph_register_visualizer(visualizer_t *);292 extern errno_t graph_register_visualizer(visualizer_t *); 293 293 294 294 /** … … 301 301 * from the driver visualizer list. Function shall be called by device driver 302 302 * before deallocating the resources for the visualizer. */ 303 extern int graph_unregister_visualizer(visualizer_t *);303 extern errno_t graph_unregister_visualizer(visualizer_t *); 304 304 305 305 /** … … 310 310 311 311 extern renderer_t *graph_alloc_renderer(void); 312 extern int graph_register_renderer(renderer_t *);312 extern errno_t graph_register_renderer(renderer_t *); 313 313 extern renderer_t *graph_get_renderer(sysarg_t); 314 extern int graph_unregister_renderer(renderer_t *);314 extern errno_t graph_unregister_renderer(renderer_t *); 315 315 extern void graph_destroy_renderer(renderer_t *); 316 316 … … 321 321 * callback connection that the visualizer with a specified service ID should 322 322 * be switched to the mode with the given index. */ 323 extern int graph_notify_mode_change(async_sess_t *, sysarg_t, sysarg_t);323 extern errno_t graph_notify_mode_change(async_sess_t *, sysarg_t, sysarg_t); 324 324 325 325 /** … … 327 327 * callback connection that the visualizer with a specified service ID has 328 328 * lost its output device (e.g. virtual monitor was closed by a user). */ 329 extern int graph_notify_disconnect(async_sess_t *, sysarg_t);329 extern errno_t graph_notify_disconnect(async_sess_t *, sysarg_t); 330 330 331 331 /*----------------------------------------------------------------------------*/
Note:
See TracChangeset
for help on using the changeset viewer.