Changeset aeb3037 in mainline for uspace/lib/display/src
- Timestamp:
- 2020-03-18T17:27:18Z (5 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0680854
- Parents:
- 1a1271d
- git-author:
- Jiri Svoboda <jiri@…> (2020-03-18 16:57:15)
- git-committer:
- Jiri Svoboda <jiri@…> (2020-03-18 17:27:18)
- Location:
- uspace/lib/display/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/display/src/disp_srv.c
r1a1271d raeb3037 37 37 #include <disp_srv.h> 38 38 #include <display/event.h> 39 #include <display/info.h> 39 40 #include <display/wndresize.h> 40 41 #include <errno.h> … … 268 269 } 269 270 271 static void display_get_info_srv(display_srv_t *srv, ipc_call_t *icall) 272 { 273 display_info_t info; 274 ipc_call_t call; 275 size_t size; 276 errno_t rc; 277 278 if (srv->ops->get_info == NULL) { 279 async_answer_0(icall, ENOTSUP); 280 return; 281 } 282 283 /* Transfer information */ 284 if (!async_data_read_receive(&call, &size)) { 285 async_answer_0(icall, EREFUSED); 286 return; 287 } 288 289 if (size != sizeof(info)) { 290 async_answer_0(icall, EREFUSED); 291 async_answer_0(&call, EREFUSED); 292 return; 293 } 294 295 rc = srv->ops->get_info(srv->arg, &info); 296 if (rc != EOK) { 297 async_answer_0(icall, rc); 298 async_answer_0(&call, rc); 299 return; 300 } 301 302 rc = async_data_read_finalize(&call, &info, sizeof(info)); 303 if (rc != EOK) { 304 async_answer_0(icall, rc); 305 async_answer_0(&call, rc); 306 return; 307 } 308 309 async_answer_0(icall, EOK); 310 } 311 270 312 void display_conn(ipc_call_t *icall, display_srv_t *srv) 271 313 { … … 306 348 case DISPLAY_GET_EVENT: 307 349 display_get_event_srv(srv, &call); 350 break; 351 case DISPLAY_GET_INFO: 352 display_get_info_srv(srv, &call); 308 353 break; 309 354 default: -
uspace/lib/display/src/display.c
r1a1271d raeb3037 385 385 * 386 386 * @param display Display 387 * @param rwindow Place to store pointe to window that received event387 * @param rwindow Place to store pointer to window that received event 388 388 * @param event Place to store event 389 389 * @return EOK on success or an error code … … 418 418 419 419 *rwindow = window; 420 return EOK; 421 } 422 423 /** Get display information. 424 * 425 * @param display Display 426 * @param info Place to store display information 427 * @return EOK on success or an error code 428 */ 429 errno_t display_get_info(display_t *display, display_info_t *info) 430 { 431 async_exch_t *exch; 432 ipc_call_t answer; 433 aid_t req; 434 errno_t rc; 435 436 exch = async_exchange_begin(display->sess); 437 req = async_send_0(exch, DISPLAY_GET_INFO, &answer); 438 rc = async_data_read_start(exch, info, sizeof(*info)); 439 async_exchange_end(exch); 440 if (rc != EOK) { 441 async_forget(req); 442 return rc; 443 } 444 445 async_wait_for(req, &rc); 446 if (rc != EOK) 447 return rc; 448 420 449 return EOK; 421 450 }
Note:
See TracChangeset
for help on using the changeset viewer.