diff --git a/src/i830_lvds.c b/src/i830_lvds.c index 027bb5d..3e1546f 100644 --- a/src/i830_lvds.c +++ b/src/i830_lvds.c @@ -407,21 +407,26 @@ i830_lvds_acpi_lid_open(xf86OutputPtr output) button_dir = opendir(ACPI_BUTTON); /* If acpi button driver is not loaded, bypass ACPI check method */ - if (button_dir == NULL) + if (button_dir == NULL) { + xf86DrvMsg(output->scrn->scrnIndex, X_INFO, "debugpatch: ACPI button_dir == NULL\n"); goto out; + } closedir(button_dir); lid_dir = opendir(ACPI_LID); /* no acpi lid object found */ - if (lid_dir == NULL) + if (lid_dir == NULL) { + xf86DrvMsg(output->scrn->scrnIndex, X_INFO, "debugpatch: ACPI lid_dir == NULL\n"); goto out; + } while (1) { lid_dent = readdir(lid_dir); if (lid_dent == NULL) { /* no LID object */ closedir(lid_dir); + xf86DrvMsg(output->scrn->scrnIndex, X_INFO, "debugpatch: ACPI lid_dent == NULL\n"); goto out; } if (strcmp(lid_dent->d_name, ".") && @@ -439,20 +444,26 @@ i830_lvds_acpi_lid_open(xf86OutputPtr output) if ((fd = open(state_name, O_RDONLY)) == -1) { free(state_name); + xf86DrvMsg(output->scrn->scrnIndex, X_INFO, "debugpatch: ACPI (fd = open(state_name, O_RDONLY)) == -1\n"); goto out; } free(state_name); if (read(fd, state, 64) == -1) { close(fd); + xf86DrvMsg(output->scrn->scrnIndex, X_INFO, "debugpatch: ACPI read(fd, state, 64) == -1\n"); goto out; } close(fd); if (strstr(state, "open")) ret = LID_OPEN; - else if (strstr(state, "closed")) + else if (strstr(state, "closed")) { ret = LID_CLOSE; - else /* "unsupported" */ + xf86DrvMsg(output->scrn->scrnIndex, X_INFO, "debugpatch: ACPI LID_CLOSE\n"); + } + else {/* "unsupported" */ ret = LID_UNKNOWN; + xf86DrvMsg(output->scrn->scrnIndex, X_INFO, "debugpatch: ACPI LID_UNKNOWN\n"); + } out: if (pI830->debug_modes && (ret != LID_UNKNOWN)) @@ -476,8 +487,10 @@ i830_lvds_swf_lid_close(xf86OutputPtr output) if (swf14 & SWF14_LID_SWITCH_EN) ret = TRUE; - else + else { ret = FALSE; + xf86DrvMsg(output->scrn->scrnIndex, X_INFO, "debugpatch:SWF swf14 & SWF14_LID_SWITCH_EN == FALSE\n"); + } if (pI830->debug_modes) xf86DrvMsg(pScrn->scrnIndex, X_INFO, @@ -886,11 +899,13 @@ i830_lvds_detect(xf86OutputPtr output) lid = i830_lvds_acpi_lid_open(output); if (lid == LID_OPEN) return XF86OutputStatusConnected; - else if (lid == LID_CLOSE) - return XF86OutputStatusDisconnected; - - if (i830_lvds_swf_lid_close(output)) - return XF86OutputStatusDisconnected; + else if (lid == LID_CLOSE) { + xf86DrvMsg(output->scrn->scrnIndex, X_INFO, "debugpatch: ACPI LID CLOSE\n"); + } + xf86DrvMsg(output->scrn->scrnIndex, X_INFO, "debugpatch: ACPI LID UNKNOWN\n"); + if (i830_lvds_swf_lid_close(output)) { + xf86DrvMsg(output->scrn->scrnIndex, X_INFO, "debugpatch: SWF LID CLOSE\n"); + } return XF86OutputStatusConnected; }