已合并
6.1display整改 #432
wanghongen创建于 2月25日
6.1display整改 #432
已合并
共 1 个文件变更+13-3
| @@ -293,8 +293,12 @@ bool DrmConnector::HandleHotplug(IdMapPtr<DrmEncoder> &encoders, | |||
| 293 | DISPLAY_LOGE("drm atomic alloc failed errno %{public}d", errno)); | 293 | DISPLAY_LOGE("drm atomic alloc failed errno %{public}d", errno)); |
| 294 | 294 | ||
| 295 | drmModeConnectorPtr c = drmModeGetConnector(drmFd, mId); | 295 | drmModeConnectorPtr c = drmModeGetConnector(drmFd, mId); |
| 296 | - DISPLAY_CHK_RETURN((c == nullptr), false, DISPLAY_LOGE("can not get connector")); | 296 | + DISPLAY_CHK_RETURN((c == nullptr), false, |
| 297 | + DISPLAY_LOGE("can not get connector"); | ||
| 298 | + drmModeAtomicFree(pset); | ||
| 299 | + ); | ||
| 297 | if (mConnectState == c->connection) { | 300 | if (mConnectState == c->connection) { |
| 301 | + drmModeAtomicFree(pset); | ||
| 298 | drmModeFreeConnector(c); | 302 | drmModeFreeConnector(c); |
| 299 | return false; | 303 | return false; |
| 300 | } else { | 304 | } else { |
| @@ -311,11 +315,17 @@ bool DrmConnector::HandleHotplug(IdMapPtr<DrmEncoder> &encoders, | |||
| 311 | ret |= drmModeAtomicAddProperty(pset, crtc->GetId(), crtc->GetModePropId(), blob_id); | 315 | ret |= drmModeAtomicAddProperty(pset, crtc->GetId(), crtc->GetModePropId(), blob_id); |
| 312 | ret |= drmModeAtomicAddProperty(pset, GetId(), GetPropCrtcId(), crtc_id); | 316 | ret |= drmModeAtomicAddProperty(pset, GetId(), GetPropCrtcId(), crtc_id); |
| 313 | DISPLAY_CHK_RETURN((ret < 0), DISPLAY_FAILURE, | 317 | DISPLAY_CHK_RETURN((ret < 0), DISPLAY_FAILURE, |
| 314 | - DISPLAY_LOGE("can not add the crtc id prop %{public}d", errno)); | 318 | + DISPLAY_LOGE("can not add the crtc id prop %{public}d", errno); |
| 319 | + drmModeAtomicFree(pset); | ||
| 320 | + drmModeFreeConnector(c); | ||
| 321 | + ); | ||
| 315 | 322 | ||
| 316 | ret = drmModeAtomicCommit(drmFd, pset, DRM_MODE_ATOMIC_ALLOW_MODESET, nullptr); | 323 | ret = drmModeAtomicCommit(drmFd, pset, DRM_MODE_ATOMIC_ALLOW_MODESET, nullptr); |
| 317 | DISPLAY_CHK_RETURN((ret < 0), DISPLAY_FAILURE, | 324 | DISPLAY_CHK_RETURN((ret < 0), DISPLAY_FAILURE, |
| 318 | - DISPLAY_LOGE("can not add the crtc id prop %{public}d", errno)); | 325 | + DISPLAY_LOGE("can not add the crtc id prop %{public}d", errno); |
| 326 | + drmModeAtomicFree(pset); | ||
| 327 | + drmModeFreeConnector(c); | ||
| 328 | + ); | ||
| 319 | drmModeAtomicFree(pset); | 329 | drmModeAtomicFree(pset); |
| 320 | 330 | ||
| 321 | mConnectState = c->connection; | 331 | mConnectState = c->connection; |