diff options
Diffstat (limited to 'ui/ozone/platform/drm')
-rw-r--r-- | ui/ozone/platform/drm/gpu/crtc_controller.cc | 20 | ||||
-rw-r--r-- | ui/ozone/platform/drm/gpu/drm_buffer.cc | 2 | ||||
-rw-r--r-- | ui/ozone/platform/drm/gpu/drm_device.cc | 3 | ||||
-rw-r--r-- | ui/ozone/platform/drm/gpu/drm_util.cc | 6 | ||||
-rw-r--r-- | ui/ozone/platform/drm/gpu/hardware_display_controller.cc | 1 | ||||
-rw-r--r-- | ui/ozone/platform/drm/gpu/hardware_display_plane.cc | 1 | ||||
-rw-r--r-- | ui/ozone/platform/drm/gpu/hardware_display_plane_manager.cc | 1 | ||||
-rw-r--r-- | ui/ozone/platform/drm/gpu/hardware_display_plane_manager_legacy.cc | 18 | ||||
-rw-r--r-- | ui/ozone/platform/drm/gpu/screen_manager.cc | 14 |
9 files changed, 30 insertions, 36 deletions
diff --git a/ui/ozone/platform/drm/gpu/crtc_controller.cc b/ui/ozone/platform/drm/gpu/crtc_controller.cc index 00006db..e76db6d 100644 --- a/ui/ozone/platform/drm/gpu/crtc_controller.cc +++ b/ui/ozone/platform/drm/gpu/crtc_controller.cc @@ -34,11 +34,11 @@ CrtcController::~CrtcController() { bool CrtcController::Modeset(const OverlayPlane& plane, drmModeModeInfo mode) { if (!drm_->SetCrtc(crtc_, plane.buffer->GetFramebufferId(), std::vector<uint32_t>(1, connector_), &mode)) { - LOG(ERROR) << "Failed to modeset: error='" << strerror(errno) - << "' crtc=" << crtc_ << " connector=" << connector_ - << " framebuffer_id=" << plane.buffer->GetFramebufferId() - << " mode=" << mode.hdisplay << "x" << mode.vdisplay << "@" - << mode.vrefresh; + PLOG(ERROR) << "Failed to modeset: crtc=" << crtc_ + << " connector=" << connector_ + << " framebuffer_id=" << plane.buffer->GetFramebufferId() + << " mode=" << mode.hdisplay << "x" << mode.vdisplay << "@" + << mode.vrefresh; return false; } @@ -78,17 +78,17 @@ bool CrtcController::SchedulePageFlip(HardwareDisplayPlaneList* plane_list, DCHECK(primary->buffer.get()); if (primary->buffer->GetSize() != gfx::Size(mode_.hdisplay, mode_.vdisplay)) { - LOG(WARNING) << "Trying to pageflip a buffer with the wrong size. Expected " - << mode_.hdisplay << "x" << mode_.vdisplay << " got " - << primary->buffer->GetSize().ToString() << " for" - << " crtc=" << crtc_ << " connector=" << connector_; + VLOG(2) << "Trying to pageflip a buffer with the wrong size. Expected " + << mode_.hdisplay << "x" << mode_.vdisplay << " got " + << primary->buffer->GetSize().ToString() << " for" + << " crtc=" << crtc_ << " connector=" << connector_; FOR_EACH_OBSERVER(PageFlipObserver, observers_, OnPageFlipEvent()); return true; } if (!drm_->plane_manager()->AssignOverlayPlanes(plane_list, overlays, crtc_, this)) { - LOG(ERROR) << "Failed to assign overlay planes for crtc " << crtc_; + PLOG(ERROR) << "Failed to assign overlay planes for crtc " << crtc_; return false; } diff --git a/ui/ozone/platform/drm/gpu/drm_buffer.cc b/ui/ozone/platform/drm/gpu/drm_buffer.cc index 12e0a8e..bdf5727 100644 --- a/ui/ozone/platform/drm/gpu/drm_buffer.cc +++ b/ui/ozone/platform/drm/gpu/drm_buffer.cc @@ -65,7 +65,7 @@ bool DrmBuffer::Initialize(const SkImageInfo& info, !drm_->AddFramebuffer( info.width(), info.height(), GetColorDepth(info.colorType()), info.bytesPerPixel() << 3, stride_, handle_, &framebuffer_)) { - VLOG(2) << "Failed to register framebuffer: " << strerror(errno); + VPLOG(2) << "Failed to register framebuffer"; return false; } diff --git a/ui/ozone/platform/drm/gpu/drm_device.cc b/ui/ozone/platform/drm/gpu/drm_device.cc index 0a4952f..5f87095 100644 --- a/ui/ozone/platform/drm/gpu/drm_device.cc +++ b/ui/ozone/platform/drm/gpu/drm_device.cc @@ -48,8 +48,7 @@ bool DrmCreateDumbBuffer(int fd, request.flags = 0; if (drmIoctl(fd, DRM_IOCTL_MODE_CREATE_DUMB, &request) < 0) { - VLOG(2) << "Cannot create dumb buffer (" << errno << ") " - << strerror(errno); + VPLOG(2) << "Cannot create dumb buffer"; return false; } diff --git a/ui/ozone/platform/drm/gpu/drm_util.cc b/ui/ozone/platform/drm/gpu/drm_util.cc index 6c96d11..e0db47d 100644 --- a/ui/ozone/platform/drm/gpu/drm_util.cc +++ b/ui/ozone/platform/drm/gpu/drm_util.cc @@ -4,7 +4,6 @@ #include "ui/ozone/platform/drm/gpu/drm_util.h" -#include <errno.h> #include <fcntl.h> #include <stdint.h> #include <stdlib.h> @@ -114,15 +113,14 @@ bool MapDumbBuffer(int fd, uint32_t handle, uint32_t size, void** pixels) { memset(&map_request, 0, sizeof(map_request)); map_request.handle = handle; if (drmIoctl(fd, DRM_IOCTL_MODE_MAP_DUMB, &map_request)) { - VLOG(2) << "Cannot prepare dumb buffer for mapping (" << errno << ") " - << strerror(errno); + VPLOG(2) << "Cannot prepare dumb buffer for mapping"; return false; } *pixels = mmap(0, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, map_request.offset); if (*pixels == MAP_FAILED) { - VLOG(2) << "Cannot mmap dumb buffer (" << errno << ") " << strerror(errno); + VPLOG(2) << "Cannot mmap dumb buffer"; return false; } diff --git a/ui/ozone/platform/drm/gpu/hardware_display_controller.cc b/ui/ozone/platform/drm/gpu/hardware_display_controller.cc index fd5edb4..3f31b6e 100644 --- a/ui/ozone/platform/drm/gpu/hardware_display_controller.cc +++ b/ui/ozone/platform/drm/gpu/hardware_display_controller.cc @@ -5,7 +5,6 @@ #include "ui/ozone/platform/drm/gpu/hardware_display_controller.h" #include <drm.h> -#include <errno.h> #include <string.h> #include <xf86drm.h> diff --git a/ui/ozone/platform/drm/gpu/hardware_display_plane.cc b/ui/ozone/platform/drm/gpu/hardware_display_plane.cc index defca91..37bb23f 100644 --- a/ui/ozone/platform/drm/gpu/hardware_display_plane.cc +++ b/ui/ozone/platform/drm/gpu/hardware_display_plane.cc @@ -5,7 +5,6 @@ #include "ui/ozone/platform/drm/gpu/hardware_display_plane.h" #include <drm.h> -#include <errno.h> #include <xf86drm.h> #include "base/logging.h" diff --git a/ui/ozone/platform/drm/gpu/hardware_display_plane_manager.cc b/ui/ozone/platform/drm/gpu/hardware_display_plane_manager.cc index b0fbfa6..f825c7f 100644 --- a/ui/ozone/platform/drm/gpu/hardware_display_plane_manager.cc +++ b/ui/ozone/platform/drm/gpu/hardware_display_plane_manager.cc @@ -5,7 +5,6 @@ #include "ui/ozone/platform/drm/gpu/hardware_display_plane_manager.h" #include <drm.h> -#include <errno.h> #include <xf86drm.h> #include <set> diff --git a/ui/ozone/platform/drm/gpu/hardware_display_plane_manager_legacy.cc b/ui/ozone/platform/drm/gpu/hardware_display_plane_manager_legacy.cc index 6dacd32..b204508 100644 --- a/ui/ozone/platform/drm/gpu/hardware_display_plane_manager_legacy.cc +++ b/ui/ozone/platform/drm/gpu/hardware_display_plane_manager_legacy.cc @@ -36,9 +36,8 @@ bool HardwareDisplayPlaneManagerLegacy::Commit( for (const auto& plane : flip.planes) { if (!drm_->PageFlipOverlay(flip.crtc_id, plane.framebuffer, plane.bounds, plane.src_rect, plane.plane)) { - LOG(ERROR) << "Cannot display plane on overlay: error=" - << strerror(errno) << "crtc=" << flip.crtc - << " plane=" << plane.plane; + PLOG(ERROR) << "Cannot display plane on overlay: crtc=" << flip.crtc + << " plane=" << plane.plane; ret = false; flip.crtc->PageFlipFailed(); break; @@ -48,11 +47,9 @@ bool HardwareDisplayPlaneManagerLegacy::Commit( base::Bind(&CrtcController::OnPageFlipEvent, flip.crtc->AsWeakPtr()))) { if (errno != EACCES) { - LOG(ERROR) << "Cannot page flip: error='" << strerror(errno) << "'" - << " crtc=" << flip.crtc_id - << " framebuffer=" << flip.framebuffer - << " is_sync=" << is_sync; - LOG(ERROR) << "Failed to commit planes"; + PLOG(ERROR) << "Cannot page flip: crtc=" << flip.crtc_id + << " framebuffer=" << flip.framebuffer + << " is_sync=" << is_sync; ret = false; } flip.crtc->PageFlipFailed(); @@ -65,9 +62,8 @@ bool HardwareDisplayPlaneManagerLegacy::Commit( // This plane is being released, so we need to zero it. if (!drm_->PageFlipOverlay(plane->owning_crtc(), 0, gfx::Rect(), gfx::Rect(), plane->plane_id())) { - LOG(ERROR) << "Cannot free overlay: error=" << strerror(errno) - << "crtc=" << plane->owning_crtc() - << " plane=" << plane->plane_id(); + PLOG(ERROR) << "Cannot free overlay: crtc=" << plane->owning_crtc() + << " plane=" << plane->plane_id(); ret = false; break; } diff --git a/ui/ozone/platform/drm/gpu/screen_manager.cc b/ui/ozone/platform/drm/gpu/screen_manager.cc index 3b3dd57..8f0c70b 100644 --- a/ui/ozone/platform/drm/gpu/screen_manager.cc +++ b/ui/ozone/platform/drm/gpu/screen_manager.cc @@ -28,30 +28,34 @@ void FillModesetBuffer(const scoped_refptr<DrmDevice>& drm, ScanoutBuffer* buffer) { DrmConsoleBuffer modeset_buffer(drm, buffer->GetFramebufferId()); if (!modeset_buffer.Initialize()) { - LOG(ERROR) << "Failed to grab framebuffer " << buffer->GetFramebufferId(); + VLOG(2) << "Failed to grab framebuffer " << buffer->GetFramebufferId(); return; } auto crtcs = controller->crtc_controllers(); DCHECK(!crtcs.empty()); - if (!crtcs[0]->saved_crtc() || !crtcs[0]->saved_crtc()->buffer_id) + if (!crtcs[0]->saved_crtc() || !crtcs[0]->saved_crtc()->buffer_id) { + VLOG(2) << "Crtc has no saved state or wasn't modeset"; return; + } // If the display controller is in mirror mode, the CRTCs should be sharing // the same framebuffer. DrmConsoleBuffer saved_buffer(drm, crtcs[0]->saved_crtc()->buffer_id); if (!saved_buffer.Initialize()) { - LOG(ERROR) << "Failed to grab saved framebuffer " - << crtcs[0]->saved_crtc()->buffer_id; + VLOG(2) << "Failed to grab saved framebuffer " + << crtcs[0]->saved_crtc()->buffer_id; return; } // Don't copy anything if the sizes mismatch. This can happen when the user // changes modes. if (saved_buffer.canvas()->getBaseLayerSize() != - modeset_buffer.canvas()->getBaseLayerSize()) + modeset_buffer.canvas()->getBaseLayerSize()) { + VLOG(2) << "Previous buffer has a different size than modeset buffer"; return; + } skia::RefPtr<SkImage> image = saved_buffer.image(); SkPaint paint; |