Created
June 26, 2014 17:43
-
-
Save tiagovignatti/8eb7e1e588fd44d38d9b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/ui/ozone/platform/dri/dri_buffer.cc b/ui/ozone/platform/dri/dri_buffer.cc | |
index e4cde59..5efb772 100644 | |
--- a/ui/ozone/platform/dri/dri_buffer.cc | |
+++ b/ui/ozone/platform/dri/dri_buffer.cc | |
@@ -50,6 +50,7 @@ bool CreateDumbBuffer(int fd, | |
uint32_t* handle, | |
uint32_t* stride) { | |
struct drm_mode_create_dumb request; | |
+ memset(&request, 0, sizeof(request)); | |
request.width = info.width(); | |
request.height = info.height(); | |
request.bpp = info.bytesPerPixel() << 3; | |
@@ -61,7 +62,7 @@ bool CreateDumbBuffer(int fd, | |
return false; | |
} | |
- DCHECK_EQ(info.getSafeSize(request.pitch), request.size); | |
+ DCHECK_LE(info.getSafeSize(request.pitch), request.size); | |
*handle = request.handle; | |
*stride = request.pitch; | |
diff --git a/ui/ozone/platform/dri/dri_util.cc b/ui/ozone/platform/dri/dri_util.cc | |
index b739545..0722108 100644 | |
--- a/ui/ozone/platform/dri/dri_util.cc | |
+++ b/ui/ozone/platform/dri/dri_util.cc | |
@@ -105,6 +105,8 @@ GetAvailableDisplayControllerInfos(int fd) { | |
drmModeCrtc* crtc = drmModeGetCrtc(fd, crtc_id); | |
displays.push_back(new HardwareDisplayControllerInfo(connector, crtc)); | |
+ | |
+ DLOG(INFO) << "mode for connector " << connector->connector_id << " is " << connector->modes[0].hdisplay << "x" << connector->modes[0].vdisplay; | |
} | |
drmModeFreeResources(resources); | |
@@ -133,6 +135,7 @@ bool MapDumbBuffer(int fd, | |
uint32_t size, | |
void** pixels) { | |
struct drm_mode_map_dumb map_request; | |
+ memset(&map_request, 0, sizeof(map_request)); | |
map_request.handle = handle; | |
if (drmIoctl(fd, DRM_IOCTL_MODE_MAP_DUMB, &map_request)) { | |
DLOG(ERROR) << "Cannot prepare dumb buffer for mapping (" << errno << ") " | |
diff --git a/ui/ozone/platform/dri/dri_wrapper.cc b/ui/ozone/platform/dri/dri_wrapper.cc | |
index 5bdf195..db33dd4 100644 | |
--- a/ui/ozone/platform/dri/dri_wrapper.cc | |
+++ b/ui/ozone/platform/dri/dri_wrapper.cc | |
@@ -36,11 +36,13 @@ bool DriWrapper::SetCrtc(uint32_t crtc_id, | |
uint32_t* connectors, | |
drmModeModeInfo* mode) { | |
CHECK(fd_ >= 0); | |
+ LOG(ERROR) << "set_crtc: " << crtc_id << " conn: " << *connectors << "buf: " << framebuffer; | |
return !drmModeSetCrtc(fd_, crtc_id, framebuffer, 0, 0, connectors, 1, mode); | |
} | |
bool DriWrapper::SetCrtc(drmModeCrtc* crtc, uint32_t* connectors) { | |
CHECK(fd_ >= 0); | |
+ LOG(ERROR) << "set_crtc: " << crtc->crtc_id << " conn: " << *connectors << "buf: " << crtc->buffer_id; | |
return !drmModeSetCrtc(fd_, | |
crtc->crtc_id, | |
crtc->buffer_id, | |
@@ -64,7 +66,7 @@ bool DriWrapper::AddFramebuffer(uint32_t width, | |
uint32_t handle, | |
uint32_t* framebuffer) { | |
CHECK(fd_ >= 0); | |
- return !drmModeAddFB(fd_, | |
+ bool ret = drmModeAddFB(fd_, | |
width, | |
height, | |
depth, | |
@@ -72,6 +74,8 @@ bool DriWrapper::AddFramebuffer(uint32_t width, | |
stride, | |
handle, | |
framebuffer); | |
+ LOG(ERROR) << "drm_mode_add_fb ret: " << ret << " fb: " << *framebuffer << " " << handle << " " << stride; | |
+ return !ret; | |
} | |
bool DriWrapper::RemoveFramebuffer(uint32_t framebuffer) { | |
@@ -83,11 +87,14 @@ bool DriWrapper::PageFlip(uint32_t crtc_id, | |
uint32_t framebuffer, | |
void* data) { | |
CHECK(fd_ >= 0); | |
- return !drmModePageFlip(fd_, | |
+ bool ret = drmModePageFlip(fd_, | |
crtc_id, | |
framebuffer, | |
DRM_MODE_PAGE_FLIP_EVENT, | |
data); | |
+ | |
+ LOG(ERROR) << "page flip " << ret << " crtc: " << crtc_id << " " << framebuffer; | |
+ return !ret; | |
} | |
drmModeFB* DriWrapper::GetFramebuffer(uint32_t framebuffer) { | |
diff --git a/ui/ozone/platform/dri/hardware_display_controller.cc b/ui/ozone/platform/dri/hardware_display_controller.cc | |
index 4b00c6e..95599f4 100644 | |
--- a/ui/ozone/platform/dri/hardware_display_controller.cc | |
+++ b/ui/ozone/platform/dri/hardware_display_controller.cc | |
@@ -110,6 +110,8 @@ void HardwareDisplayController::Disable() { | |
bool HardwareDisplayController::SchedulePageFlip() { | |
CHECK(surface_); | |
+ | |
+ LOG(INFO) << "Attempting to PageFlip connector: " << connector_id_; | |
if (!is_disabled_ && !drm_->PageFlip(crtc_id_, | |
surface_->GetFramebufferId(), | |
this)) { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment