[Openchrome-devel] xf86-video-openchrome: src/via_driver.c src/via_lvds.c

James Simmons jsimmons at kemper.freedesktop.org
Mon May 20 15:15:13 PDT 2013


 src/via_driver.c |    7 +++++++
 src/via_lvds.c   |    3 ++-
 2 files changed, 9 insertions(+), 1 deletion(-)

New commits:
commit a013a7deabc63dd76d3ae635e05c9da4a5fc321b
Author: James Simmons <jsimmons at infradead.org>
Date:   Mon May 20 18:13:24 2013 -0400

    Patch from Krummenacher <max.krummenacher at toradex.com>
    to fix via_lvds.c warning, char* compared to string literal
    
    gcc 4.7.2 issues a warning which make 'open suse build system' fail.
    via_lvds.c: In function 'via_lvds_detect':
    via_lvds.c:1305:26: warning: comparison with string literal results in unspecified behavior [-Waddress]

diff --git a/src/via_driver.c b/src/via_driver.c
index 1d3b78e..139a0c3 100644
--- a/src/via_driver.c
+++ b/src/via_driver.c
@@ -874,18 +874,25 @@ via_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height)
         ret = xf86CrtcSetMode(crtc, &crtc->mode, crtc->rotation,
 	                          crtc->x, crtc->y);
         if (!ret) {
+            xf86DrvMsg(scrn->scrnIndex, X_INFO,
+                "SetMode !ret so we reset front_bo\n");
             drmmode->front_bo = old_front;
             drmmode->fb_id = old_fb_id;
             break;
 #ifdef HAVE_DRI
         } else {
+            xf86DrvMsg(scrn->scrnIndex, X_INFO,
+                "SetMode ret so we cleanup old front_bo\n");
             if (pVia->KMS && old_fb_id)
                 drmModeRmFB(drmmode->fd, old_fb_id);
 #endif
         }
     }
 
+
     if (ret) {
+        xf86DrvMsg(scrn->scrnIndex, X_INFO,
+                   "More cleanup old front_bo\n");
         drm_bo_unmap(scrn, old_front);
         drm_bo_free(scrn, old_front);
         return ret;
diff --git a/src/via_lvds.c b/src/via_lvds.c
index e4e5cdf..0dcc64a 100644
--- a/src/via_lvds.c
+++ b/src/via_lvds.c
@@ -1295,6 +1295,7 @@ ViaPanelLookUpModeIndex(int width, int height)
 static xf86OutputStatus
 via_lvds_detect(xf86OutputPtr output)
 {
+    static const char xoId[] = "OLPC XO 1.5";
     xf86OutputStatus status = XF86OutputStatusDisconnected;
     ViaPanelInfoPtr panel = output->driver_private;
     ScrnInfoPtr pScrn = output->scrn;
@@ -1302,7 +1303,7 @@ via_lvds_detect(xf86OutputPtr output)
     vgaHWPtr hwp = VGAHWPTR(pScrn);
 
     /* Hardcode panel size for the XO */
-    if (pVia->Id->String == "OLPC XO 1.5") {
+    if(strcmp(pVia->Id->String, xoId) == 0) {
         panel->NativeWidth = 1200;
         panel->NativeHeight = 900;
         status = XF86OutputStatusConnected;


More information about the Openchrome-devel mailing list