海思屏幕MIPI显示颜色异常

现象是使用 mipi 显示时,视频颜色是正常的,但是 QT 程序和 hifb 测试程序颜色均不正常,但是 hifb 的背景颜色是正常的。
主要的问题是 sample hifb 的颜色也都不对,怎么调都不出来,后续还是问了技术支持,技术支持知道这个问题,在使用 mipi 显示时,图形层需要用 HI_MPI_VO_SetGraphicLayerCSC 设置,参照文档:
海思屏幕MIPI显示颜色异常_第1张图片
详细说明了这个,但是在修改时还需要注意,需要在 open fb 之后再设置才有效,参照:

   strncpy(file, "/dev/fb0", 12);
   pstInfo->fd = open(file, O_RDWR, 0);
   if (pstInfo->fd < 0) {
      SAMPLE_PRT("open %s failed!\n", file);
      return HI_FAILURE;
   }
   VO_CSC_S stVideoCSC;
   memset(&stVideoCSC,0,sizeof(VO_CSC_S));
   s32Ret = HI_MPI_VO_GetGraphicLayerCSC(GRAPHICS_LAYER_G0,&stVideoCSC);
   if (HI_SUCCESS != s32Ret) {
      SAMPLE_PRT("HI_MPI_VO_GetGraphicLayerCSC failed with %#x!\n", s32Ret);
   }
   printf("xxxxxxxxxxx HI_MPI_VO_GetGraphicLayerCSC xxxxxxxxxxxxxxx\n");
   printf("enCscMatrix:%d\n",(int)stVideoCSC.enCscMatrix);
   printf("u32Luma:%d\n",(int)stVideoCSC.u32Luma);
   printf("u32Contrast:%d\n",(int)stVideoCSC.u32Contrast);
   printf("u32Hue:%d\n",(int)stVideoCSC.u32Hue);
   printf("u32Satuature:%d\n",(int)stVideoCSC.u32Satuature);
   stVideoCSC.enCscMatrix = VO_CSC_MATRIX_IDENTITY;
   s32Ret = HI_MPI_VO_SetGraphicLayerCSC(GRAPHICS_LAYER_G0, &stVideoCSC);
   if (HI_SUCCESS != s32Ret) {
      SAMPLE_PRT("HI_MPI_VO_SetGraphicLayerCSC failed with %#x!\n", s32Ret);
   }
   memset(&stVideoCSC,0,sizeof(VO_CSC_S));
   s32Ret = HI_MPI_VO_GetGraphicLayerCSC(GRAPHICS_LAYER_G0,&stVideoCSC);
   if (HI_SUCCESS != s32Ret) {
      SAMPLE_PRT("HI_MPI_VO_GetGraphicLayerCSC failed with %#x!\n", s32Ret);
   }
   printf("xxxxxxxx HI_MPI_VO_GetGraphicLayerCSC AFTERSET xxxxxxxxx\n");
   printf("enCscMatrix:%d\n",(int)stVideoCSC.enCscMatrix);
   printf("u32Luma:%d\n",(int)stVideoCSC.u32Luma);
   printf("u32Contrast:%d\n",(int)stVideoCSC.u32Contrast);
   printf("u32Hue:%d\n",(int)stVideoCSC.u32Hue);
   printf("u32Satuature:%d\n",(int)stVideoCSC.u32Satuature);
   printf("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n");

如果多图层都有图像显示,则都需要设置。

你可能感兴趣的:(linux驱动及海思,linux)