Changeset 7c3fb9b in mainline for uspace/lib/graph/graph.h
- Timestamp:
- 2018-05-17T08:29:01Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6ff23ff
- Parents:
- fac0ac7
- git-author:
- Jiri Svoboda <jiri@…> (2018-05-16 17:28:17)
- git-committer:
- Jiri Svoboda <jiri@…> (2018-05-17 08:29:01)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/graph/graph.h
rfac0ac7 r7c3fb9b 53 53 /** 54 54 * Device driver shall allocate any necessary internal structures 55 * specific for a claimed visualizer. */ 55 * specific for a claimed visualizer. 56 */ 56 57 errno_t (*claim)(struct visualizer *vs); 57 58 … … 60 61 * specific for a claimed visualizer. Driver shall also check whether 61 62 * the mode is set and if so it shall change its internal state 62 * accordingly (e.g. deallocate frame buffers). */ 63 * accordingly (e.g. deallocate frame buffers). 64 */ 63 65 errno_t (*yield)(struct visualizer *vs); 64 66 … … 71 73 * reason). If it is convenient for the device driver (e.g. for better 72 74 * optimization), the pointer to the handle_damage operation can be 73 * changed at this point. */ 75 * changed at this point. 76 */ 74 77 errno_t (*change_mode)(struct visualizer *vs, vslmode_t new_mode); 75 78 … … 81 84 * the shared backbuffer (i.e. when reading from backbuffer, the offsets 82 85 * shall be added to the coordinates and if necessary the result shall be 83 * wrapped around the edge of the backbuffer). */ 86 * wrapped around the edge of the backbuffer). 87 */ 84 88 errno_t (*handle_damage)(struct visualizer *vs, 85 89 sysarg_t x, sysarg_t y, sysarg_t width, sysarg_t height, … … 89 93 * Upper layers of the graphic stack might report inactivity. In such 90 94 * case, device driver might enable power saving mode on the device 91 * corresponding to the visualizer. */ 95 * corresponding to the visualizer. 96 */ 92 97 errno_t (*suspend)(struct visualizer *vs); 93 98 94 99 /** 95 100 * When upper layers detect activity on suspended visualizer, device 96 * driver shall disable power saving mode on the corresponding device. */ 101 * driver shall disable power saving mode on the corresponding device. 102 */ 97 103 errno_t (*wakeup)(struct visualizer *vs); 98 104 } visualizer_ops_t; … … 105 111 /** 106 112 * Link to the list of all visualizers belonging to the graphic device. 107 * Field is fully managed by libgraph. */ 113 * Field is fully managed by libgraph. 114 */ 108 115 link_t link; 109 116 … … 112 119 * when equals 0, visualizer is not claimed. At the time, visualizer 113 120 * can be claimed only by a single client. 114 * Field is fully managed by libgraph. */ 121 * Field is fully managed by libgraph. 122 */ 115 123 atomic_t ref_cnt; 116 124 … … 121 129 * If the visualizer is registered through libgraph functions, then the 122 130 * field is fully managed by libgraph. Otherwise, it is a driver 123 * responsibility to set and update this field. */ 131 * responsibility to set and update this field. 132 */ 124 133 sysarg_t reg_svc_handle; 125 134 … … 130 139 * in the compositor). 131 140 * Field is fully managed by libgraph. It is assigned when the visualizer 132 * gets claimed and is valid until it is yielded. */ 141 * gets claimed and is valid until it is yielded. 142 */ 133 143 sysarg_t client_side_handle; 134 144 … … 141 151 * degrees, virtual monitor is resized by the user). 142 152 * Field is fully managed by libgraph. Device driver can use it indirectly 143 * through notification functions. */ 153 * through notification functions. 154 */ 144 155 async_sess_t *notif_sess; 145 156 … … 150 161 * dimensions when virtual monitor is resized). 151 162 * Both device driver and libgraph must lock on this mutex when accessing 152 * modes list or default mode index. */ 163 * modes list or default mode index. 164 */ 153 165 fibril_mutex_t mode_mtx; 154 166 … … 162 174 * and final output device (e.g. monitor). 163 175 * Field is fully managed by device driver, libgraph reads it with locked 164 * mutex. */ 176 * mutex. 177 */ 165 178 list_t modes; 166 179 … … 173 186 * mode list. 174 187 * Field is fully managed by device driver, libgraph reads it with locked 175 * mutex. */ 188 * mutex. 189 */ 176 190 sysarg_t def_mode_idx; 177 191 … … 181 195 * driver can also read it to properly interpret the cell type and its 182 196 * internal structures when handling the damage. 183 * Field is fully managed by libgraph, can be read by device driver. */ 197 * Field is fully managed by libgraph, can be read by device driver. 198 */ 184 199 vslmode_t cur_mode; 185 200 … … 187 202 * Determines whether the visualizer is currently set to some mode or not, 188 203 * that is whether cur_mode field contains up-to-date data. 189 * Field is fully managed by libgraph, can be read by device driver. */ 204 * Field is fully managed by libgraph, can be read by device driver. 205 */ 190 206 bool mode_set; 191 207 … … 193 209 * Device driver function pointers. 194 210 * Field is fully managed by device driver, libgraph invokes driver's 195 * functions through it. */ 211 * functions through it. 212 */ 196 213 visualizer_ops_t ops; 197 214 … … 200 217 * Device driver reads the cells when handling damage. Cells shall be 201 218 * interpreted according to the currently set mode. 202 * Field is fully managed by libgraph, can be read by device driver. */ 219 * Field is fully managed by libgraph, can be read by device driver. 220 */ 203 221 pixelmap_t cells; 204 222 … … 207 225 * contain pointers to frontbuffers or information representing the 208 226 * final output device (e.g. hardware port for physical monitor). 209 * Field is fully managed by device driver. */ 227 * Field is fully managed by device driver. 228 */ 210 229 void *dev_ctx; 211 230 } visualizer_t; … … 265 284 * Fill in the basic visualizer structure. The device driver shall take the 266 285 * created torso and to complete it by adding its specific structures 267 * (device context, modes). */ 286 * (device context, modes). 287 */ 268 288 extern void graph_init_visualizer(visualizer_t *); 269 289 … … 281 301 282 302 /** 283 * Allocate the visualizer so it can be initialized. */ 303 * Allocate the visualizer so it can be initialized. 304 */ 284 305 extern visualizer_t *graph_alloc_visualizer(void); 285 306 … … 289 310 * is considered ready to handle client connection. Since visualizer 290 311 * list is guarded by the mutex, visualizers might be added even after the 291 * initialialization of the device driver. */ 312 * initialialization of the device driver. 313 */ 292 314 extern errno_t graph_register_visualizer(visualizer_t *); 293 315 294 316 /** 295 317 * Retrieve the visualizer from the visualizer list according to its 296 * service ID. */ 318 * service ID. 319 */ 297 320 extern visualizer_t *graph_get_visualizer(sysarg_t); 298 321 … … 300 323 * Unregister the visualizer from the location service and remove it 301 324 * from the driver visualizer list. Function shall be called by device driver 302 * before deallocating the resources for the visualizer. */ 325 * before deallocating the resources for the visualizer. 326 */ 303 327 extern errno_t graph_unregister_visualizer(visualizer_t *); 304 328 … … 306 330 * Destroy the rest of the visualizer. Device driver shall call this function 307 331 * only after it has unregistered the visualizer and deallocated all the 308 * resources for which the driver is responsible. */ 332 * resources for which the driver is responsible. 333 */ 309 334 extern void graph_destroy_visualizer(visualizer_t *); 310 335 … … 320 345 * Device driver can call this function to notify the client through the 321 346 * callback connection that the visualizer with a specified service ID should 322 * be switched to the mode with the given index. */ 347 * be switched to the mode with the given index. 348 */ 323 349 extern errno_t graph_notify_mode_change(async_sess_t *, sysarg_t, sysarg_t); 324 350 … … 326 352 * Device driver can call this function to notify the client through the 327 353 * callback connection that the visualizer with a specified service ID has 328 * lost its output device (e.g. virtual monitor was closed by a user). */ 354 * lost its output device (e.g. virtual monitor was closed by a user). 355 */ 329 356 extern errno_t graph_notify_disconnect(async_sess_t *, sysarg_t); 330 357
Note:
See TracChangeset
for help on using the changeset viewer.