| 348 | } |
| 349 | |
| 350 | static rt_err_t fb_control(rt_device_t dev, int cmd, void *args) |
| 351 | { |
| 352 | switch(cmd) |
| 353 | { |
| 354 | case FBIOPAN_DISPLAY: |
| 355 | { |
| 356 | rt_hw_cpu_dcache_clean(_graphic_info.framebuffer, _graphic_info.smem_len); |
| 357 | rt_device_control(_gpu_dev, RTGRAPHIC_CTRL_RECT_UPDATE, &_rect_info); |
| 358 | break; |
| 359 | } |
| 360 | case FBIOGET_FSCREENINFO: |
| 361 | { |
| 362 | struct fb_fix_screeninfo *info = (struct fb_fix_screeninfo *)args; |
| 363 | strncpy(info->id, "lcd", sizeof(info->id)); |
| 364 | info->smem_len = _graphic_info.smem_len; |
| 365 | break; |
| 366 | } |
| 367 | case FBIOGET_VSCREENINFO: |
| 368 | { |
| 369 | struct fb_var_screeninfo *info = (struct fb_var_screeninfo *)args; |
| 370 | info->bits_per_pixel = _graphic_info.bits_per_pixel; |
| 371 | info->xres = _graphic_info.width; |
| 372 | info->yres = _graphic_info.height; |
| 373 | info->yres_virtual = _graphic_info.height; |
| 374 | info->xres_virtual = _graphic_info.width; |
| 375 | info->transp.offset = 24; |
| 376 | info->transp.length = 8; |
| 377 | info->red.offset = 0; |
| 378 | info->red.length = 8; |
| 379 | info->green.offset = 8; |
| 380 | info->green.length = 8; |
| 381 | info->blue.offset = 16; |
| 382 | info->blue.length = 8; |
| 383 | break; |
| 384 | } |
| 385 | case RT_FIOMMAP2: |
| 386 | { |
| 387 | struct dfs_mmap2_args *mmap2 = (struct dfs_mmap2_args *)args; |
| 388 | |
| 389 | if(mmap2) |
| 390 | { |
| 391 | mmap2->ret = lwp_map_user_phy(lwp_self(), RT_NULL, rt_kmem_v2p(_graphic_info.framebuffer), mmap2->length, 1); |
| 392 | } |
| 393 | else |
| 394 | { |
| 395 | return -EIO; |
| 396 | } |
| 397 | |
| 398 | break; |
| 399 | } |
| 400 | default: |
| 401 | break; |
| 402 | } |
| 403 | |
| 404 | return RT_EOK; |
| 405 | } |
| 406 | |
| 407 | #ifdef RT_USING_DEVICE_OPS |
nothing calls this directly
no test coverage detected