From 8a796c4379021c11e20079ea79419fe09ec80306 Mon Sep 17 00:00:00 2001 From: Rayllll Date: Fri, 11 Oct 2024 17:27:01 +0800 Subject: [PATCH 1/3] Signed-off-by: Rayllll add log --- services/ui/driver/drm_driver.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/services/ui/driver/drm_driver.cpp b/services/ui/driver/drm_driver.cpp index 681ec535..ea6564ba 100644 --- a/services/ui/driver/drm_driver.cpp +++ b/services/ui/driver/drm_driver.cpp @@ -80,6 +80,7 @@ int DrmDriver::ModesetCreateFb(struct BufferObject *bo) map.handle = create.handle; drmIoctl(fd_, DRM_IOCTL_MODE_MAP_DUMB, &map); bo->vaddr = static_cast(mmap(0, create.size, PROT_READ | PROT_WRITE, MAP_SHARED, fd_, map.offset)); + LOG(INFO) << "create.size = " << create.size << "; fd = " << fd_ << "; map.offset = " << map.offset; if (bo->vaddr == MAP_FAILED) { LOG(ERROR) << "failed to mmap framebuffer"; return -1; -- Gitee From 83829bfa645fb207642cc585d02b72e1d4d00190 Mon Sep 17 00:00:00 2001 From: Rayllll Date: Sat, 12 Oct 2024 09:48:25 +0000 Subject: [PATCH 2/3] update services/ui/driver/drm_driver.cpp. Signed-off-by: Rayllll --- services/ui/driver/drm_driver.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/services/ui/driver/drm_driver.cpp b/services/ui/driver/drm_driver.cpp index ea6564ba..fa24222b 100644 --- a/services/ui/driver/drm_driver.cpp +++ b/services/ui/driver/drm_driver.cpp @@ -81,6 +81,7 @@ int DrmDriver::ModesetCreateFb(struct BufferObject *bo) drmIoctl(fd_, DRM_IOCTL_MODE_MAP_DUMB, &map); bo->vaddr = static_cast(mmap(0, create.size, PROT_READ | PROT_WRITE, MAP_SHARED, fd_, map.offset)); LOG(INFO) << "create.size = " << create.size << "; fd = " << fd_ << "; map.offset = " << map.offset; + LOG(ERROR) << "mmap fail, errno = " << errno << "; strerrno = " << strerror(errno); if (bo->vaddr == MAP_FAILED) { LOG(ERROR) << "failed to mmap framebuffer"; return -1; -- Gitee From d5e50bcad0489b70ad45cc6b6e961a8ea81beb03 Mon Sep 17 00:00:00 2001 From: Rayllll Date: Mon, 14 Oct 2024 08:16:54 +0000 Subject: [PATCH 3/3] update services/ui/driver/drm_driver.cpp. Signed-off-by: Rayllll --- services/ui/driver/drm_driver.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/ui/driver/drm_driver.cpp b/services/ui/driver/drm_driver.cpp index fa24222b..1542227a 100644 --- a/services/ui/driver/drm_driver.cpp +++ b/services/ui/driver/drm_driver.cpp @@ -79,8 +79,8 @@ int DrmDriver::ModesetCreateFb(struct BufferObject *bo) /* map the dumb-buffer to userspace */ map.handle = create.handle; drmIoctl(fd_, DRM_IOCTL_MODE_MAP_DUMB, &map); - bo->vaddr = static_cast(mmap(0, create.size, PROT_READ | PROT_WRITE, MAP_SHARED, fd_, map.offset)); LOG(INFO) << "create.size = " << create.size << "; fd = " << fd_ << "; map.offset = " << map.offset; + bo->vaddr = static_cast(mmap(0, create.size, PROT_READ | PROT_WRITE, MAP_SHARED, fd_, map.offset)); LOG(ERROR) << "mmap fail, errno = " << errno << "; strerrno = " << strerror(errno); if (bo->vaddr == MAP_FAILED) { LOG(ERROR) << "failed to mmap framebuffer"; -- Gitee