• Zhao Yakui's avatar
    drm/i915: Update LVDS connector status when receiving ACPI LID event · a2565377
    Zhao Yakui authored
    Dirk reports that nothing is displayed on LVDS when using ubuntu 9.1 after
    close/reopen the LID. And I also reproduce this issue on another laptop.
    After some tests and debug, it seems that it is related with that the
    LVDS status is not updated in time in course of suspend/resume.
    
    Now the LID state is used to check whether the LVDS is connected or
    disconnected. And when the LID is closed, it means that the LVDS is
    disconnected. When it is reopened, it means that the LVDS is connected.
    At the same time on some distributions the LID event is also used to put
    the system into suspend state. When the LID is closed, the system will enter
    the suspend state. When the LID is reopened, the system will be resumed.
    
    In such case when the LID is closed, user-space script will receive the LID
    notification event and  detect the LVDS as disconnected. Then the system will
    enter the suspended state. When the LID is reopened, the system will be
    resumed. As the LVDS status is not updated in course of resume, it will cause
    that the LVDS connector is marked as unused and disabled. After the resume is
    finished,user-space script will try to configure the display mode for LVDS.
    But unfortunately as the LVDS status is not updated in time and it is still
    marked as disconnected, the LVDS and its corresponding CRTC will be disabled
    again in the function of drm_helper_disable_unused_functions after changing
    mode for LVDS.
    
    So we had better check and update the status of LVDS connector after receiving
    the LID notication event. Then after the system is resumed from suspended
    state, we can set the display mode for LVDS correctly.
    Signed-off-by: default avatarZhao Yakui <yakui.zhao@intel.com>
    Reported-by: default avatarDirk Hohndel <hohndel@infradead.org>
    Reviewed-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
    CC: stable@kernel.org
    Signed-off-by: default avatarEric Anholt <eric@anholt.net>
    a2565377
intel_lvds.c 33.2 KB