This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to make sure the low-level operations of Vdis_setResolution() are done?

Hi all,

I am working on a project using DVRRDK_3.0.1.3 on our customized TI8168 board.

In our use case, user can choose to change different display resolution at runtime.

In this case, first we shutdown Qt application, call Vdis_setResolution() to change display resolution, and then restart Qt application.

However, we found that if we restart Qt application right after calling Vdis_setResolution(), we got the error message from Qt:

QScreenLinuxFb::connect: Operation not permitted Error opening framebuffer device /dev/fb0 [m3vpss ] 280790: DISPLAY: Start in progress !!! QScreenLinuxFb::connect: Connection timed out Error opening framebuffer device /dev/fb0

Then we tried to delay 10 seconds before restarting Qt application, and it works normally.

It seems that there are some low-level operations to be done after Vdis_setResolution() is called, the low-level hardware is still busy

and we failed to open /dev/fb0 for Qt application since the Vdis_setResolution() call is not blocked until the low-level operations are done.

Is it correct?

Is there some way to make sure all things Vdis_setResolution() need to do are done then we can open /dev/fb0 to start Qt application?

Thanks.

Phil Chen

  • Do you have different threads restarting QT application and calling Vdis_setResolution ? On resolution change , display needs to be stopped and restarted.Log indicates display start is still in progress when you try to open fbdev device. Pls refer /dvr_rdk/demos/mcfw_api_demos/mcfw_demo/demo_display.c

    int Demo_displaySetResolution(UInt32 displayId, UInt32 resolution) for reference of how to do display resolution change

    int Demo_displaySetResolution(UInt32 displayId, UInt32 resolution)
    {
        VDIS_MOSAIC_S vdisMosaicParams;
        VSYS_PARAMS_S sysContextInfo;
    #if USE_FBDEV
        UInt32 outWidth, outHeight;
    #endif

        if (Vdis_isSupportedDisplay(displayId))
        {
                Vsys_getContext(&sysContextInfo);

            #if USE_FBDEV
            #if defined(TI_814X_BUILD)
                /* Disable graphics through sysfs entries */
                if (displayId == VDIS_DEV_HDMI || displayId == VDIS_DEV_DVO2 ) {
                    Vdis_sysfsCmd(3, VDIS_SYSFSCMD_SET_GRPX, VDIS_SYSFS_GRPX0, VDIS_OFF);
                }
            #endif

            #if defined(TI_8107_BUILD)
                /* Disable graphics through sysfs entries */
                if (displayId == VDIS_DEV_HDMI || displayId == VDIS_DEV_HDCOMP ) {
                    Vdis_sysfsCmd(3, VDIS_SYSFSCMD_SET_GRPX, VDIS_SYSFS_GRPX0, VDIS_OFF);
                }
            #endif

            #ifdef TI_816X_BUILD
                /* Disable graphics through sysfs entries */
                Vdis_sysfsCmd(3, VDIS_SYSFSCMD_SET_GRPX, VDIS_SYSFS_GRPX0, VDIS_OFF);
                Vdis_sysfsCmd(3, VDIS_SYSFSCMD_SET_GRPX, VDIS_SYSFS_GRPX1, VDIS_OFF);
            #endif

                if (displayId == VDIS_DEV_SD ) {
                    Vdis_sysfsCmd(3, VDIS_SYSFSCMD_SET_GRPX, VDIS_SYSFS_GRPX2, VDIS_OFF);
                }
            #endif

            #if defined(TI_8107_BUILD)
                if (((sysContextInfo.systemUseCase == VSYS_USECASE_MULTICHN_PROGRESSIVE_VCAP_VDIS_VENC_VDEC) ||
                     (sysContextInfo.systemUseCase == VSYS_USECASE_MULTICHN_PROGRESSIVE_VCAP_VDIS_VENC_VDEC_D1_AND_CIF_8CH)) &&
                    ((VDIS_DEV_HDMI == displayId) || (VDIS_DEV_SD == displayId) || (VDIS_DEV_HDCOMP == displayId)))
                {
                    Vcap_stopWrbkCapt();
                }
            #endif

                Vdis_stopDrv(displayId);
                memset(&vdisMosaicParams, 0, sizeof(VDIS_MOSAIC_S));
                /* Update the resolution that we are changing into */
                Vdis_setResolution(displayId, resolution);

                /* Start with default layout */
                Demo_swMsGenerateLayout(displayId, 0, gDemo_info.maxVdisChannels,
                        layoutId,
                        &vdisMosaicParams, FALSE,
                        gDemo_info.Type,
                        Vdis_getSwMsLayoutResolution(displayId));
                Demo_displayResetFps(&vdisMosaicParams,layoutId);
            #ifdef TI_816X_BUILD
                Demo_displayChangeFpsForLayout(&vdisMosaicParams,layoutId);
            #endif

            #if defined(TI_8107_BUILD)
                if (!((sysContextInfo.systemUseCase == VSYS_USECASE_MULTICHN_PROGRESSIVE_VCAP_VDIS_VENC_VDEC)
                       &&
                    ((VDIS_DEV_HDMI == displayId) || (VDIS_DEV_HDCOMP == displayId))))
                {
                    Vdis_setMosaicParams(displayId, &vdisMosaicParams);
                }
            #else
                Vdis_setMosaicParams(displayId, &vdisMosaicParams);
            #endif
                Vdis_startDrv(displayId);

            #if USE_FBDEV
                Demo_swMsGetOutSize(resolution, &outWidth, &outHeight);
            #if defined(TI_814X_BUILD)
                if((displayId == VDIS_DEV_HDMI) || (displayId == VDIS_DEV_DVO2))
                    grpx_scale(VDIS_DEV_HDMI, 0, 0, outWidth, outHeight);
                if((displayId == VDIS_DEV_SD))
                    grpx_scale(VDIS_DEV_SD, 0, 0, outWidth, outHeight);
                /* Enable graphics through sysfs entries */
                if (displayId == VDIS_DEV_HDMI || displayId == VDIS_DEV_DVO2 ) {
                    Vdis_sysfsCmd(3, VDIS_SYSFSCMD_SET_GRPX, VDIS_SYSFS_GRPX0, VDIS_ON);
                }
            #endif
            #if defined(TI_8107_BUILD)
                if((displayId == VDIS_DEV_HDMI) || (displayId == VDIS_DEV_HDCOMP))
                    grpx_scale(VDIS_DEV_HDMI, 0, 0, outWidth, outHeight);
                if((displayId == VDIS_DEV_SD))
                    grpx_scale(VDIS_DEV_SD, 0, 0, outWidth, outHeight);
                /* Enable graphics through sysfs entries */
                if (displayId == VDIS_DEV_HDMI || displayId == VDIS_DEV_HDCOMP) {
                    Vdis_sysfsCmd(3, VDIS_SYSFSCMD_SET_GRPX, VDIS_SYSFS_GRPX0, VDIS_ON);
                }

            #endif
            #ifdef TI_816X_BUILD
                if(displayId==VDIS_DEV_HDMI)
                    grpx_scale(VDIS_DEV_HDMI, 0, 0, outWidth, outHeight);

                /* Enable graphics through sysfs entries */
                Vdis_sysfsCmd(3, VDIS_SYSFSCMD_SET_GRPX, VDIS_SYSFS_GRPX0, VDIS_ON);
                Vdis_sysfsCmd(3, VDIS_SYSFSCMD_SET_GRPX, VDIS_SYSFS_GRPX1, VDIS_ON);
            #endif
                if (displayId == VDIS_DEV_SD ) {
                    Vdis_sysfsCmd(3, VDIS_SYSFSCMD_SET_GRPX, VDIS_SYSFS_GRPX2, VDIS_ON);
                }

            #endif

            #if defined(TI_8107_BUILD)
                if (((sysContextInfo.systemUseCase == VSYS_USECASE_MULTICHN_PROGRESSIVE_VCAP_VDIS_VENC_VDEC) ||
                     (sysContextInfo.systemUseCase == VSYS_USECASE_MULTICHN_PROGRESSIVE_VCAP_VDIS_VENC_VDEC_D1_AND_CIF_8CH)) &&
                    ((VDIS_DEV_HDMI == displayId) || (VDIS_DEV_SD == displayId) || (VDIS_DEV_HDCOMP == displayId)))
                {
                    UInt32 inW, inH, outW, outH;

                    Demo_swMsGetOutSize(Vdis_getResolution(displayId), &inW, &inH);
                    Demo_swMsGetOutSize(Vdis_getResolution(VDIS_DEV_SD), &outW, &outH);

                    Vcap_setWrbkCaptScParams(inW, inH, outW, outH);

                    Vcap_startWrbkCapt();
                }
                /* Get the Demo Id */
                /* Set the Scalar Parameters as per resolution */
                /* Start Write back Driver */
            #endif
        }
        return 0;
    }

  • Hi,

    Thanks for your reply.

    I think I lack some mechanisms to synchronize the Qt application and the call Vdis_setResolution(), while they are in different processes.

    Thank you very much.

    Phil