tina 新建图层问题
-
按照文档的资料新建了一个图层
#include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include "sunxi_display2.h" #include <stdio.h> #include <string.h> #include <sys/ioctl.h> #include <sys/mman.h> #include <stdlib.h> int dispfd = 0; unsigned int addr[800*480] = {0xFF}; static void disp_set_add(void){ unsigned long arg[3] = {0}; struct disp_layer_config config; unsigned int width = 480; unsigned int height = 800; unsigned int ret = 0; memset(&config, 0, sizeof(struct disp_layer_config)); /*设置图层参数*/ config.channel = 0; config.layer_id = 0; config.enable = 1; config.info.mode = LAYER_MODE_BUFFER; // config.info.fb.addr[0] = (unsigned long long)0x48400000; config.info.fb.addr[0] = (unsigned long long)addr; config.info.fb.size[0].width = width; config.info.fb.size[0].height = height; config.info.fb.align[0] = 4; config.info.fb.format = DISP_FORMAT_ARGB_8888; /*设置crop 裁剪区域大小*/ config.info.fb.crop.x = 0; config.info.fb.crop.y = 0; config.info.fb.crop.width = (unsigned long long)width << 32; config.info.fb.crop.height = (unsigned long long)height << 32; config.info.fb.flags = DISP_BF_NORMAL; config.info.fb.scan = DISP_SCAN_PROGRESSIVE; config.info.alpha_mode = 2; config.info.alpha_value = 0xFF; config.info.zorder = 20; /*设置窗口大小*/ config.info.screen_win.x = 0; config.info.screen_win.y = 0; config.info.screen_win.width = width; config.info.screen_win.height = height; config.info.id = 0; arg[0] = 0; //显示器0 arg[1] = (unsigned long)&config; //图层配置 arg[2] = 1; //设置一个图层 ret = ioctl(dispfd, DISP_LAYER_SET_CONFIG, (void*)arg); if(ret < 0){ printf("disp_set_add fail to set layer info\n"); } } int main(int argc,char ** argv){ dispfd = open("dev/disp",O_RDWR); if(dispfd < 0){ printf("open display device fail!!!\n"); return -1; } disp_set_add(); while(1){ // memset(addr, 0xFF , 100); } } 62,0-1 64%
编译传到板子里运行发现的确增加了一个图层但是,屏幕却花屏了
-
图层信息
有大佬知道是什么原因吗?
Copyright © 2024 深圳全志在线有限公司 粤ICP备2021084185号 粤公网安备44030502007680号