Commit 98598e7e authored by dnicoara's avatar dnicoara Committed by Commit bot

[Ozone-Drm] More LOG cleanup

Make all the LOGs that follow DRM calls PLOGs since we're interested in
the error message.

Also add a few more LOGs during device probing just in case we end up in
odd states where the DRM device is controlled by another process and
we're trying to take ownership.

BUG=none

Review URL: https://codereview.chromium.org/991963002

Cr-Commit-Position: refs/heads/master@{#319716}
parent 83109ac5
...@@ -336,14 +336,14 @@ bool DrmGpuDisplayManager::GetHDCPState(const DrmDisplaySnapshot& output, ...@@ -336,14 +336,14 @@ bool DrmGpuDisplayManager::GetHDCPState(const DrmDisplaySnapshot& output,
ScopedDrmConnectorPtr connector( ScopedDrmConnectorPtr connector(
output.drm()->GetConnector(output.connector())); output.drm()->GetConnector(output.connector()));
if (!connector) { if (!connector) {
LOG(ERROR) << "Failed to get connector " << output.connector(); PLOG(ERROR) << "Failed to get connector " << output.connector();
return false; return false;
} }
ScopedDrmPropertyPtr hdcp_property( ScopedDrmPropertyPtr hdcp_property(
output.drm()->GetProperty(connector.get(), kContentProtection)); output.drm()->GetProperty(connector.get(), kContentProtection));
if (!hdcp_property) { if (!hdcp_property) {
LOG(ERROR) << "'" << kContentProtection << "' property doesn't exist."; PLOG(ERROR) << "'" << kContentProtection << "' property doesn't exist.";
return false; return false;
} }
...@@ -369,14 +369,14 @@ bool DrmGpuDisplayManager::SetHDCPState(const DrmDisplaySnapshot& output, ...@@ -369,14 +369,14 @@ bool DrmGpuDisplayManager::SetHDCPState(const DrmDisplaySnapshot& output,
ScopedDrmConnectorPtr connector( ScopedDrmConnectorPtr connector(
output.drm()->GetConnector(output.connector())); output.drm()->GetConnector(output.connector()));
if (!connector) { if (!connector) {
LOG(ERROR) << "Failed to get connector " << output.connector(); PLOG(ERROR) << "Failed to get connector " << output.connector();
return false; return false;
} }
ScopedDrmPropertyPtr hdcp_property( ScopedDrmPropertyPtr hdcp_property(
output.drm()->GetProperty(connector.get(), kContentProtection)); output.drm()->GetProperty(connector.get(), kContentProtection));
if (!hdcp_property) { if (!hdcp_property) {
LOG(ERROR) << "'" << kContentProtection << "' property doesn't exist."; PLOG(ERROR) << "'" << kContentProtection << "' property doesn't exist.";
return false; return false;
} }
......
...@@ -129,7 +129,7 @@ bool MapDumbBuffer(int fd, uint32_t handle, uint32_t size, void** pixels) { ...@@ -129,7 +129,7 @@ bool MapDumbBuffer(int fd, uint32_t handle, uint32_t size, void** pixels) {
void ForceInitializationOfPrimaryDisplay(const scoped_refptr<DrmDevice>& drm, void ForceInitializationOfPrimaryDisplay(const scoped_refptr<DrmDevice>& drm,
ScreenManager* screen_manager) { ScreenManager* screen_manager) {
LOG(WARNING) << "Forcing initialization of primary display."; VLOG(2) << "Forcing initialization of primary display.";
ScopedVector<HardwareDisplayControllerInfo> displays = ScopedVector<HardwareDisplayControllerInfo> displays =
GetAvailableDisplayControllerInfos(drm->get_fd()); GetAvailableDisplayControllerInfos(drm->get_fd());
...@@ -159,8 +159,10 @@ base::FilePath GetPrimaryDisplayCardPath() { ...@@ -159,8 +159,10 @@ base::FilePath GetPrimaryDisplayCardPath() {
break; break;
int fd = open(card_path.c_str(), O_RDWR | O_CLOEXEC); int fd = open(card_path.c_str(), O_RDWR | O_CLOEXEC);
if (fd < 0) if (fd < 0) {
VPLOG(1) << "Failed to open '" << card_path << "'";
continue; continue;
}
memset(&res, 0, sizeof(struct drm_mode_card_res)); memset(&res, 0, sizeof(struct drm_mode_card_res));
int ret = drmIoctl(fd, DRM_IOCTL_MODE_GETRESOURCES, &res); int ret = drmIoctl(fd, DRM_IOCTL_MODE_GETRESOURCES, &res);
...@@ -168,6 +170,8 @@ base::FilePath GetPrimaryDisplayCardPath() { ...@@ -168,6 +170,8 @@ base::FilePath GetPrimaryDisplayCardPath() {
if (ret == 0 && res.count_crtcs > 0) { if (ret == 0 && res.count_crtcs > 0) {
return base::FilePath(card_path); return base::FilePath(card_path);
} }
VPLOG_IF(1, ret) << "Failed to get DRM resources for '" << card_path << "'";
} }
return base::FilePath(); return base::FilePath();
......
...@@ -75,7 +75,7 @@ bool GbmPixmap::Initialize() { ...@@ -75,7 +75,7 @@ bool GbmPixmap::Initialize() {
// especially when sharing buffers via DMABUF. // especially when sharing buffers via DMABUF.
dma_buf_ = gbm_bo_get_fd(buffer_->bo()); dma_buf_ = gbm_bo_get_fd(buffer_->bo());
if (dma_buf_ < 0) { if (dma_buf_ < 0) {
LOG(ERROR) << "Failed to export buffer to dma_buf"; PLOG(ERROR) << "Failed to export buffer to dma_buf";
return false; return false;
} }
return true; return true;
......
...@@ -29,7 +29,7 @@ GbmBufferBase::GbmBufferBase(const scoped_refptr<DrmDevice>& drm, ...@@ -29,7 +29,7 @@ GbmBufferBase::GbmBufferBase(const scoped_refptr<DrmDevice>& drm,
!drm_->AddFramebuffer(gbm_bo_get_width(bo), gbm_bo_get_height(bo), !drm_->AddFramebuffer(gbm_bo_get_width(bo), gbm_bo_get_height(bo),
kColorDepth, kPixelDepth, gbm_bo_get_stride(bo), kColorDepth, kPixelDepth, gbm_bo_get_stride(bo),
gbm_bo_get_handle(bo).u32, &framebuffer_)) gbm_bo_get_handle(bo).u32, &framebuffer_))
LOG(ERROR) << "Failed to register buffer"; PLOG(ERROR) << "Failed to register buffer";
} }
GbmBufferBase::~GbmBufferBase() { GbmBufferBase::~GbmBufferBase() {
......
...@@ -27,7 +27,7 @@ bool GbmDevice::Initialize() { ...@@ -27,7 +27,7 @@ bool GbmDevice::Initialize() {
device_ = gbm_create_device(get_fd()); device_ = gbm_create_device(get_fd());
if (!device_) { if (!device_) {
LOG(ERROR) << "Unable to initialize GBM"; PLOG(ERROR) << "Unable to initialize GBM";
return false; return false;
} }
......
...@@ -75,7 +75,7 @@ bool HardwareDisplayPlaneManager::Initialize(DrmDevice* drm) { ...@@ -75,7 +75,7 @@ bool HardwareDisplayPlaneManager::Initialize(DrmDevice* drm) {
ScopedDrmPlaneResPtr plane_resources(drmModeGetPlaneResources(drm->get_fd())); ScopedDrmPlaneResPtr plane_resources(drmModeGetPlaneResources(drm->get_fd()));
if (!plane_resources) { if (!plane_resources) {
LOG(ERROR) << "Failed to get plane resources."; PLOG(ERROR) << "Failed to get plane resources";
return false; return false;
} }
...@@ -90,7 +90,7 @@ bool HardwareDisplayPlaneManager::Initialize(DrmDevice* drm) { ...@@ -90,7 +90,7 @@ bool HardwareDisplayPlaneManager::Initialize(DrmDevice* drm) {
ScopedDrmPlanePtr drm_plane( ScopedDrmPlanePtr drm_plane(
drmModeGetPlane(drm->get_fd(), plane_resources->planes[i])); drmModeGetPlane(drm->get_fd(), plane_resources->planes[i]));
if (!drm_plane) { if (!drm_plane) {
LOG(ERROR) << "Failed to get plane " << i << "."; PLOG(ERROR) << "Failed to get plane " << i;
return false; return false;
} }
plane_ids.insert(drm_plane->plane_id); plane_ids.insert(drm_plane->plane_id);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment