Changeset 6af4b4f in mainline for uspace/srv/hid/display/main.c
- Timestamp:
- 2019-10-05T08:45:25Z (5 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- bef51cf
- Parents:
- c8cf261
- git-author:
- Jiri Svoboda <jiri@…> (2019-10-04 17:52:54)
- git-committer:
- Jiri Svoboda <jiri@…> (2019-10-05 08:45:25)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/display/main.c
rc8cf261 r6af4b4f 46 46 #include <task.h> 47 47 #include "display.h" 48 #include "win gc.h"48 #include "window.h" 49 49 50 50 #define NAME "display" … … 55 55 static errno_t display_srv_init(void) 56 56 { 57 ds_display_t *disp = NULL; 57 58 errno_t rc; 59 60 rc = ds_display_create(&disp); 61 if (rc != EOK) 62 goto error; 58 63 59 64 log_msg(LOG_DEFAULT, LVL_DEBUG, "display_srv_init()"); 60 65 61 async_set_fallback_port_handler(display_client_conn, NULL/*parts*/);66 async_set_fallback_port_handler(display_client_conn, disp); 62 67 63 68 rc = loc_server_register(NAME); … … 77 82 return EOK; 78 83 error: 84 if (disp != NULL) 85 ds_display_destroy(disp); 79 86 return rc; 80 87 } … … 86 93 sysarg_t wnd_id; 87 94 sysarg_t svc_id; 88 win_gc_t *wgc = NULL; 95 ds_window_t *wnd; 96 ds_display_t *disp = (ds_display_t *) arg; 89 97 gfx_context_t *gc; 90 errno_t rc;91 98 92 99 log_msg(LOG_DEFAULT, LVL_NOTE, "display_client_conn arg1=%zu arg2=%zu arg3=%zu arg4=%zu.", … … 103 110 /* Display management */ 104 111 srv.ops = &display_srv_ops; 105 srv.arg = NULL;112 srv.arg = disp; 106 113 107 114 display_conn(icall, &srv); 108 115 } else { 109 (void) wnd_id;110 116 /* Window GC */ 111 rc = win_gc_create(&wgc);112 if ( rc != EOK) {113 async_answer_0(icall, ENO MEM);117 wnd = ds_display_find_window(disp, wnd_id); 118 if (wnd == NULL) { 119 async_answer_0(icall, ENOENT); 114 120 return; 115 121 } 116 122 117 gc = win_gc_get_ctx(wgc);123 gc = ds_window_get_ctx(wnd); 118 124 gc_conn(icall, gc); 119 120 win_gc_delete(wgc);121 125 } 122 126 }
Note:
See TracChangeset
for help on using the changeset viewer.