From f7705c1c8c1c4797b6f55f7aaa648e77a0db4311 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Thu, 2 Apr 2009 14:46:54 +0000 Subject: [PATCH] Improve logging in setScreenLayout(). git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@3739 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- unix/xserver/hw/vnc/XserverDesktop.cc | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/unix/xserver/hw/vnc/XserverDesktop.cc b/unix/xserver/hw/vnc/XserverDesktop.cc index f192b8a7..d18ea270 100644 --- a/unix/xserver/hw/vnc/XserverDesktop.cc +++ b/unix/xserver/hw/vnc/XserverDesktop.cc @@ -853,11 +853,15 @@ unsigned int XserverDesktop::setScreenLayout(int fb_width, int fb_height, // Register a new size, or get a reference to the existing one pSize = RRRegisterSize(pScreen, fb_width, fb_height, pScreen->mmWidth, pScreen->mmHeight); - if (!pSize) + if (!pSize) { + vlog.error("setScreenLayout: Could not get register new resolution"); return resultNoResources; + } ret = RRRegisterRate(pScreen, pSize, 60); - if (!ret) + if (!ret) { + vlog.error("setScreenLayout: Could not register a rate for the resolution"); return resultNoResources; + } // Go via RandR to set the resolution in order for X11 notifications // to be sent out properly. We currently only do RandR 1.0, but Xorg @@ -883,19 +887,25 @@ unsigned int XserverDesktop::setScreenLayout(int fb_width, int fb_height, break; } } - if (!mode) + if (!mode) { + vlog.error("setScreenLayout: Could not find a matching mode"); return resultNoResources; + } // Adjust screen size ret = RRScreenSizeSet(pScreen, fb_width, fb_height, pScreen->mmWidth, pScreen->mmHeight); - if (!ret) + if (!ret) { + vlog.error("setScreenLayout: Could not adjust screen size"); return resultNoResources; + } // And then the CRTC ret = RRCrtcSet(output->crtc, mode, 0, 0, RR_Rotate_0, 1, &output); - if (!ret) + if (!ret) { + vlog.error("setScreenLayout: Could not adjust CRTC"); return resultNoResources; + } // RandR 1.0 doesn't carry any screen layout information, so we need // to update that manually. This results in another unnecessary -- 2.39.5