Changeset a35b458 in mainline for uspace/srv/hid/rfb/main.c
- Timestamp:
- 2018-03-02T20:10:49Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f1380b7
- Parents:
- 3061bc1
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:38:31)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-02 20:10:49)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/rfb/main.c
r3061bc1 ra35b458 78 78 { 79 79 fibril_mutex_lock(&rfb.lock); 80 80 81 81 if (x0 + width > rfb.width || y0 + height > rfb.height) { 82 82 fibril_mutex_unlock(&rfb.lock); 83 83 return EINVAL; 84 84 } 85 85 86 86 /* TODO update surface_t and use it */ 87 87 if (!rfb.damage_valid) { … … 112 112 } 113 113 } 114 114 115 115 pixelmap_t *map = &vs->cells; 116 116 117 117 for (sysarg_t y = y0; y < height + y0; ++y) { 118 118 for (sysarg_t x = x0; x < width + x0; ++x) { … … 122 122 } 123 123 } 124 124 125 125 fibril_mutex_unlock(&rfb.lock); 126 126 return EOK; … … 161 161 162 162 const char *rfb_name = argv[1]; 163 163 164 164 char *endptr; 165 165 unsigned long width = strtoul(argv[2], &endptr, 0); … … 169 169 return 1; 170 170 } 171 171 172 172 unsigned long height = strtoul(argv[3], &endptr, 0); 173 173 if (*endptr != 0) { … … 176 176 return 1; 177 177 } 178 178 179 179 unsigned long port = 5900; 180 180 if (argc > 4) { … … 186 186 } 187 187 } 188 188 189 189 rfb_init(&rfb, width, height, rfb_name); 190 190 191 191 vis = malloc(sizeof(visualizer_t)); 192 192 if (vis == NULL) { … … 194 194 return 3; 195 195 } 196 196 197 197 graph_init_visualizer(vis); 198 198 199 199 pixel_mode.mode.index = 0; 200 200 pixel_mode.mode.version = 0; … … 207 207 pixel_mode.mode.cell_aspect.height = 1; 208 208 pixel_mode.mode.cell_visual.pixel_visual = VISUAL_RGB_8_8_8; 209 209 210 210 link_initialize(&pixel_mode.link); 211 211 list_append(&pixel_mode.link, &vis->modes); 212 212 213 213 vis->def_mode_idx = 0; 214 214 215 215 vis->ops = rfb_ops; 216 216 vis->dev_ctx = NULL; … … 232 232 233 233 service_id_t service_id; 234 234 235 235 rc = loc_service_register(service_name, &service_id); 236 236 if (rc != EOK) { … … 238 238 return rc; 239 239 } 240 240 241 241 free(service_name); 242 242 … … 247 247 return 1; 248 248 } 249 249 250 250 rc = loc_service_add_to_cat(service_id, visualizer_category); 251 251 if (rc != EOK) { … … 253 253 return 1; 254 254 } 255 255 256 256 rc = rfb_listen(&rfb, port); 257 257 if (rc != EOK) { … … 259 259 return 2; 260 260 } 261 261 262 262 printf("%s: Accepting connections\n", NAME); 263 263 task_retval(0);
Note:
See TracChangeset
for help on using the changeset viewer.