Details
-
Bug
-
Resolution: Out of scope
-
Not Evaluated
-
None
-
5.15.2
-
None
Description
"Using Qt 5.15.2 to develop a QML interface, the original display screen resolution was 1920x1080, and the control screen resolution was 1024x768. Now, when changing the display screen resolution to 3840x2160, the error 'Failed to commit atomic request (code=-22)' is encountered."
"I only changed the DRM allocation size in the kernel and the control sizes in the UI QML. When the display resolution is 1920x1080, it works normally. I suspect there might be an issue with the screen refresh rate."
This translation conveys your specific changes and the suspicion about the screen refresh rate being the potential cause of the problem. If you need further assistance or more detailed troubleshooting steps, feel free to let me know!
void DrmMng::run()
{
void * g2dHandle;
g2d_open(&g2dHandle);
int m_iDrmFd = ProcessHelp::GetFdByFileNameInProcess("/dev/dri/card");
if(m_iDrmFd > 0)
{
int iRet1 = drmSetClientCap(m_iDrmFd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1);
int iRet2 = drmSetClientCap(m_iDrmFd, DRM_CLIENT_CAP_ATOMIC, 1);
int iRet3 = drmSetClientCap(m_iDrmFd, DRM_CLIENT_CAP_ASPECT_RATIO, 1);
int iRet4 = drmSetClientCap(m_iDrmFd, DRM_CLIENT_CAP_WRITEBACK_CONNECTORS, 1);
LOG(INFO)<<"drmset result:"<<iRet1<<" "<<iRet2<<" "
<<iRet3<<" "<<iRet4<<" "<<strerror(errno);
drmModeRes *ptrRes = drmModeGetResources(m_iDrmFd);
LOG(INFO)<<"drm count fbs:"<<ptrRes->count_fbs<<", crtcs:"<<ptrRes->count_crtcs<<
", encoders: "<<ptrRes->count_encoders<<", connectors:"<<ptrRes->count_connectors;
LOG(INFO)<<"drm min width:"<<ptrRes->min_width<<", max width:"<<ptrRes->max_width;
LOG(INFO)<<"drm min height:"<<ptrRes->min_height<<", max height:"<<ptrRes->max_height;
for(int index = 0; index < ptrRes->count_fbs; index++)
{
drmModeFB *ptrFB = drmModeGetFB(m_iDrmFd, ptrRes->fbs[index]);
LOG(INFO)<<"FB width:"<<ptrFB->width<<", height:"<<ptrFB->height;
if((ptrFB->width != 3840) || (ptrFB->height != 2160))
continue;
// if((ptrFB->width != 1920) || (ptrFB->height != 1080))
// continue;
int primaryfd = -1;
if(nullptr != ptrFB)
{
int ret = drmPrimeHandleToFD(m_iDrmFd, ptrFB->handle, 0, &primaryfd);
if(0 != ret)
else
}
struct g2d_buf * ptrG2dBuf = g2d_buf_from_fd(primaryfd);
m_iUiFramePhyAddr = ptrG2dBuf->buf_paddr;
LOG(INFO)<<"the fbid for upper screen UI is "<<ptrFB->fb_id
<<", the addr is "<<std::hex<<(unsigned)m_iUiFramePhyAddr;
}
SndUIFramePhyAddrOut();
}
g2d_close(g2dHandle);
}
运行后输出
I20201114 05:37:06.858477 2839 drmmng.cpp:48] drmset result:0 0 0 0 Success
I20201114 05:37:06.858640 2839 drmmng.cpp:51] drm count fbs:3, crtcs:4, encoders: 2, connectors:2
I20201114 05:37:06.858665 2839 drmmng.cpp:53] drm min width:1, max width:5120
I20201114 05:37:06.858683 2839 drmmng.cpp:54] drm min height:1, max height:4096
I20201114 05:37:06.858712 2839 drmmng.cpp:59] FB width:3840, height:2160
I20201114 05:37:06.858741 2839 drmmng.cpp:74] the primaryfd for ui FB is:57
I20201114 05:37:06.872819 2839 drmmng.cpp:79] the fbid for upper screen UI is 157, the addr is ee000000
I20201114 05:37:06.872864 2839 drmmng.cpp:59] FB width:1024, height:768
I20201114 05:37:06.872890 2839 drmmng.cpp:59] FB width:1024, height:768