Changeset 674 for trunk/kernel/devices/dev_fbf.h
- Timestamp:
- Nov 20, 2020, 12:04:01 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/devices/dev_fbf.h
r657 r674 39 39 * This device provide access to an external graphic display, that is seen 40 40 * as a fixed size frame buffer, mapped in the kernel address space. 41 * The only pixel encoding type in the current implementation is one byte per pixel42 * (256 levels of gray).41 * The only pixel encoding type in the current ALMOS-MKH implementation (oct 2020) 42 * is one byte per pixel (256 levels of gray). 43 43 * 44 44 * It supports a first API, for the user syscalls, implementing a simple windows manager. … … 78 78 * - FBF_DIRECT_WRITE : move synchronously pixels from an user buffer to the FBF. 79 79 * - FBF_DIRECT_READ : move synchronously pixels from the FBF to an user buffer. 80 *81 80 * For these deprecated operations, the client thread calls 82 81 * directly the driver to move data between the user buffer and the FBF. … … 105 104 bitmap_t windows_bitmap[CONFIG_FBF_WINDOWS_MAX_NR >> 5]; /*! wid allocator */ 106 105 107 uint32_t width; /*! number of pixels per line.*/108 uint32_t height; /*! total number of lines.*/109 uint32_t subsampling; /*! pixel encoding type.*/106 uint32_t width; /*! Frame Buffer number of pixels per line. */ 107 uint32_t height; /*! Frame Buffer total number of lines. */ 108 uint32_t subsampling; /*! Frame Buffer pixel encoding type. */ 110 109 } 111 110 fbf_extend_t; … … 169 168 fbf_window_t; 170 169 170 171 171 /****************************************************************************************** 172 172 * This function returns a printable string for a given FBF user command <cmd_type>. … … 177 177 *****************************************************************************************/ 178 178 char * dev_fbf_cmd_str( uint32_t cmd_type ); 179 180 /****************************************************************************************** 181 * This function checks that the calling process is the owner of the window identified 182 * by the <wid> argument, and returns an extended pointer on the window descriptor. 183 * It can be called by a thread running in any cluster. 184 ****************************************************************************************** 185 * @ wid : FBF window kernel identifier. 186 * @ returns XPTR on the window if success / return XPT_NULL if not owner or undefined. 187 *****************************************************************************************/ 188 xptr_t dev_fbf_get_xptr_from_wid( uint32_t wid ); 179 189 180 190 /****************************************************************************************** … … 208 218 * The window index <wid> is dynamically allocated. The owner is the calling process. 209 219 * The FBF window is defined by the <nlines>, <npixels>, <l_min>, <p_min> arguments. 210 * It can be called by any thread running in any cluster. As th isvseg is not directly220 * It can be called by any thread running in any cluster. As the vseg is not directly 211 221 * mapped to the frame buffer, the owner process can access this private buffer without 212 222 * syscall. As for any vseg, the physical memory is allocated on demand at each page fault. 213 * The created vseg base address in user space is returned in the <user_base> argument. 214 * 215 * Implementation note: 216 * 1. it allocates memory in the local cluster for the window, 223 * The created vseg base address in user space is returned in the <user_base> argument. 224 * The created window is set in "hidden" mode. 225 ****************************************************************************************** 226 * Implementation note: 227 * 1. it allocates memory in the local cluster for the window descriptor, 217 228 * 2. it creates in the associated vseg, 218 229 * 3. it initializes the window descriptor, … … 220 231 * 5. it allocates a new <wid>, 221 232 * 6. it registers the window in the window_tbl[] array, 222 * 7. it registers the window in the windows list,233 * 7. it registers the window in the FBF rooted windows list, 223 234 * 8. it releases the lock protecting windows. 224 * It does not call the FBF driver.225 235 ****************************************************************************************** 226 236 * @ nlines : [in] number of lines in window. 227 237 * @ npixels : [in] number of pixels per line in window. 228 * @ l_min : [in] first pixel index in FBF .229 * @ p_min : [in] first line index in FBF .238 * @ l_min : [in] first pixel index in FBF reference. 239 * @ p_min : [in] first line index in FBF reference. 230 240 * @ user_base : [out] pointer on allocated buffer base in user space. 231 241 * @ return the <wid> index if success / returns -1 if failure … … 237 247 intptr_t * user_base ); 238 248 249 250 /****************************************************************************************** 251 * This function implements the fbf_active_wiindow syscall. It set or reset the "hidden" 252 * flag for the window identified by the <wid> argument as specified by <active> argument. 253 ****************************************************************************************** 254 * @ wid : [in] window index in window_tbl[]. 255 * @ active : [in] set hidden flag if zero / rest hidden flag if non zero. 256 * @ returns 0 if success / returns -1 if wid not registered. 257 *****************************************************************************************/ 258 error_t dev_fbf_active_window( uint32_t wid, 259 uint32_t active ); 260 239 261 /****************************************************************************************** 240 262 * This function implements the fbf_delete_window() syscall to delete a FBF window, … … 242 264 * releases the memory allocated for the window buffer and for the window descriptor. 243 265 * It can be called by any thread running in any cluster. 244 * 245 * Implementation note: 246 * 1. it takes the lock protecting windows in write mode,247 * 2. it set the hidden flag in deleted window descriptor,248 * 3. it refresh the FBF window,266 ****************************************************************************************** 267 * Implementation note: 268 * 1. it set the "hidden" flag in the window descriptor, 269 * 2. it refresh the window in FBF, 270 * 3. it takes the lock protecting windows in write mode, 249 271 * 4. it removes the window from windows_tbl[] array, 250 272 * 5. it removes the window from xlist, 251 273 * 6. it releases the wid to bitmap, 252 * 7. it releases the lock protecting windows ,274 * 7. it releases the lock protecting windows from write mode, 253 275 * 8. it releases the memory allocated for window descriptor, 254 276 * 9. it deletes the associated vseg in all clusters 255 * It does not call directly the FBF driver.256 277 ****************************************************************************************** 257 278 * @ wid : [in] window index in window_tbl[]. … … 265 286 * defined by the <l_min> and <p_min> arguments. 266 287 * It can be called by any thread running in any cluster. 267 * 268 * Implementation note: 269 * 1. it takes the lock protecting windows in write mode,270 * 2. it gives the modified window the lowest priority,271 * 3. it set the "hidden" flag in window descriptor,272 * 4. it refresh the FBF for the current window position,273 * 5. it set the new coordinates in the window descriptor,274 * 6. it gives the modified window the highest priority,288 ****************************************************************************************** 289 * Implementation note: 290 * 1. it set the "hidden" flag in window descriptor, 291 * 2. it refresh the FBF for the current window position, 292 * 3. it takes the lock protecting windows in write mode, 293 * 4. it set the new coordinates in the window descriptor, 294 * 5. it gives the modified window the highest priority, 295 * 6. it releases the lock protecting windows, 275 296 * 7. it reset the "hidden" flag in window descriptor, 276 297 * 8. it refresh the FBF for the new window position, 277 * 9. it releases the lock protecting windows,278 * It does not call directly the FBF driver.279 298 ****************************************************************************************** 280 299 * @ wid : [in] window index in window_tbl[]. 281 * @ l_min : [in] new first pixel index in FBF .282 * @ p_min : [in] new first line index in FBF .300 * @ l_min : [in] new first pixel index in FBF reference. 301 * @ p_min : [in] new first line index in FBF reference. 283 302 * @ returns 0 if success / returns -1 if illegal arguments. 284 303 *****************************************************************************************/ … … 293 312 * When the new window buffer is larger than the existing one, it is 0 filled. 294 313 * It can be called by any thread running in any cluster. 295 * 296 * Implementation note: 297 * 1. it takes the lock protecting windows in write mode,298 * 2. it gives the modified window the lowest priority,299 * 3. it set the "hidden" flag in window descriptor,300 * 4. it refresh the FBF for the current window,301 * 5. it set the new size in the window descriptor,302 * 6. it resizes the associated vsegif required,303 * 7. i f fill the window buffer extension with 0 if required,304 * 8. it gives the modified window the highest priority,314 ****************************************************************************************** 315 * Implementation note: 316 * 1. it set the "hidden" flag in window descriptor, 317 * 2. it refresh the FBF for the current window, 318 * 3. it takes the lock protecting windows in write mode, 319 * 4. it set the new size in the window descriptor, 320 * 5. it resizes the associated vseg if required, 321 * 6. it fill the user buffer with zero if required, 322 * 7. it gives the modified window the highest priority, 323 * 8. it releases the lock protecting windows, 305 324 * 9. it reset the "hidden" flag in window descriptor, 306 325 * 10. it refresh the FBF for the new window, 307 * 11. it releases the lock protecting windows,308 * It does not call directly the FBF driver.309 326 ****************************************************************************************** 310 327 * @ wid : [in] window index in window_tbl[]. … … 321 338 * It allows an owner process to signal the windows manager that some lines of a window 322 339 * identified by the <wid>, <line_min>, and <line_max> argument have been modified, and 323 * must be refreshed in the FBF. It scans all the registered FBF windows to respect the 324 * overlap order defined by the windows xlist. 325 * It can be called by any thread running in any cluster. 326 * 327 * Implementation note: 328 * 1. it takes the lock protecting windows in read mode, 329 * 2. it refresh the FBF, 330 * 3. it releases the lock protecting windows, 331 * It does not call directly the FBF driver. 340 * must be refreshed in the FBF. 341 * It can be called by any thread running in any cluster. 342 ****************************************************************************************** 343 * Implementation note: 344 * it simply checks the arguments, and calls the fbf_update() function. 332 345 ****************************************************************************************** 333 346 * @ wid : [in] window index in window_tbl[] 334 * @ line_ first : [in] first line index in window.335 * @ line_ last : [in] last line index(excluded).347 * @ line_min : [in] first line index in window in window referencd. 348 * @ line_max : [in] last line index in window in window reference (excluded). 336 349 * @ returns 0 if success / returns -1 if wid not registered. 337 350 *****************************************************************************************/ 338 351 error_t dev_fbf_refresh_window( uint32_t wid, 339 uint32_t line_first, 340 uint32_t line_last ); 341 342 /****************************************************************************************** 343 * WARNING : This function is deprecated ( january 2020 [AG] ). It was defined 352 uint32_t line_min, 353 uint32_t line_max ); 354 355 /****************************************************************************************** 356 * This function implements the fbf_front_window() syscall. 357 * It gives the highest priority to the window identified by the <wid> argument, 358 * and refresh the FBF accordingly. 359 * It can be called by any thread running in any cluster. 360 ****************************************************************************************** 361 * Implementation note: 362 * 1. it takes the lock protecting windows in write mode, 363 * 2. it modify the xlist of windows rooted in FBF, 364 * 3. it releases the lock from write mode, 365 * 4. it refresh the window in FBF, 366 ****************************************************************************************** 367 * @ wid : [in] window index in window_tbl[] 368 * @ returns 0 if success / returns -1 if wid not registered. 369 *****************************************************************************************/ 370 error_t dev_fbf_front_window( uint32_t wid ); 371 372 /****************************************************************************************** 373 * This function displays on the TXT0 kernel terminal the list of registered FBF windows 374 * rooted in the FBF device - in decreasing priority order - owned by the process 375 * identified by the <pid> argument. It displays all windows when pid value is 0. 376 * It can be called by any thread running in any cluster. 377 ****************************************************************************************** 378 * @ pid : [in] target process identifier / all processes when pid == 0 379 *****************************************************************************************/ 380 void dev_fbf_display_windows( pid_t pid ); 381 382 /****************************************************************************************** 383 * This function deletes all FBF windows owned by the process identified by 384 * the <pid> argument. It can be called by any thread running in any cluster. 385 ****************************************************************************************** 386 * @ pid : [in] target process identifier. 387 *****************************************************************************************/ 388 void dev_fbf_cleanup( pid_t pid ); 389 390 391 392 393 394 395 396 /****************************************************************************************** 397 * TODO : This function is deprecated ( january 2020 [AG] ). It was defined 344 398 * to implement the fbf_read() and fbf_write() deprecated syscalls. 345 * 399 ****************************************************************************************** 346 400 * It moves <length> bytes between the frame buffer, starting from pixel defined 347 401 * by the <offset> argument, and an user buffer defined by the <user_buffer> argument.
Note: See TracChangeset
for help on using the changeset viewer.