drm/i915: set LVDS connector status to unknown if the lid is closed
Subsystems (2)
PATCH 1/1 drm/i915: set LVDS connector status to unknown if the lid is closed
Currently, the LVDS connector on i915-equipped laptops is always reported as connected, regardless of the lid state and presence of external monitors. This was done because of too many BIOSes reporting lid status in an unreliable way. However, in a quite usual setup of a laptop attached to an external monitor, the only way to obtain the monitor's resolution on boot is to disable the LVDS via the boot command line, which is unfortunate as one have to reboot to get the internal screen back.
The following patch implements the same scheme as in the Nouveau driver: if the lid is reported as closed, the LVDS connector status is set to unknown, and the internal screen will be turned on only if there are no other connected monitors. The ACPI lid status is not checked if the "i915.ignorelid" parameter is set to zero (to account for the buggy BIOSes), which is the default value, so that the current behavior does not change.
The patch applies to the 2.6.35 kernel.
Best regards,
Andrei
drivers/gpu/drm/i915/i915_drv.c +3 -0
@@ -45,6 +45,9 @@ module_param_named(fbpercrtc, i915_fbpercrtc, int, 0400);unsigned int i915_powersave =1 ;module_param_named (powersave, i915_powersave, int,0400 ); +unsigned int i915_ignorelid =1 ; +module_param_named (ignorelid, i915_ignorelid, int,0400 ); +unsigned int i915_lvds_downclock =0 ;module_param_named (lvds_downclock, i915_lvds_downclock, int,0400 );
drivers/gpu/drm/i915/i915_drv.h +1 -0
@@ -815,6 +815,7 @@ extern struct drm_ioctl_desc i915_ioctls[];extern int i915_max_ioctl;extern unsigned int i915_fbpercrtc;extern unsigned int i915_powersave; +extern unsigned int i915_ignorelid;extern unsigned int i915_lvds_downclock;extern int i915_suspend (struct drm_device *dev,pm_message_t state);
drivers/gpu/drm/i915/intel_lvds.c +2 -5
@@ -551,11 +551,8 @@ static enum drm_connector_status intel_lvds_detect(struct drm_connector *connectstruct drm_device *dev = connector->dev;enum drm_connector_status status = connector_status_connected; -/* ACPI lid methods were generally unreliable in this generation, so -* don't even bother. -*/ -if (IS_GEN2 (dev) ||IS_GEN3 (dev)) -return connector_status_connected; +if (!i915_ignorelid && !acpi_lid_open ()) + status = connector_status_unknown;return status; }
Quoted 10 lines · Andrei Paskevich
Currently, the LVDS connector on i915-equipped laptops is always reported as connected, regardless of the lid state and presence of external monitors. This was done because of too many BIOSes reporting lid status in an unreliable way. However, in a quite usual setup of a laptop attached to an external monitor, the only way to obtain the monitor's resolution on boot is to disable the LVDS via the boot command line, which is unfortunate as one have to reboot to get the internal screen back.
This sounds like policy that should be handled in userspace. One could argue that the LVDS panel is always connected so it should always report as connected. Your desktop manager or whatever can decide what to light up based on what's connected and the current lid status.
Alex
Quoted 64 lines
The following patch implements the same scheme as in the Nouveau driver: if the lid is reported as closed, the LVDS connector status is set to unknown, and the internal screen will be turned on only if there are no other connected monitors. The ACPI lid status is not checked if the "i915.ignorelid" parameter is set to zero (to account for the buggy BIOSes), which is the default value, so that the current behavior does not change.
The patch applies to the 2.6.35 kernel.
Best regards,
Andreidrivers/gpu/drm/i915/i915_drv.c +3
-0@@ -45,6 +45,9 @@ module_param_named(fbpercrtc, i915_fbpercrtc, int, 0400); unsigned int i915_powersave = 1; module_param_named(powersave, i915_powersave, int, 0400); +unsigned int i915_ignorelid =1 ; +module_param_named (ignorelid, i915_ignorelid, int,0400 ); + unsigned int i915_lvds_downclock = 0; module_param_named(lvds_downclock, i915_lvds_downclock, int, 0400);drivers/gpu/drm/i915/i915_drv.h +1
-0@@ -815,6 +815,7 @@ extern struct drm_ioctl_desc i915_ioctls[]; extern int i915_max_ioctl; extern unsigned int i915_fbpercrtc; extern unsigned int i915_powersave; +extern unsigned int i915_ignorelid; extern unsigned int i915_lvds_downclock; extern int i915_suspend(struct drm_device *dev, pm_message_t state);drivers/gpu/drm/i915/intel_lvds.c +2
-5@@ -551,11 +551,8 @@ static enum drm_connector_status intel_lvds_detect(struct drm_connector *connect struct drm_device *dev = connector->dev; enum drm_connector_status status = connector_status_connected; - /* ACPI lid methods were generally unreliable in this generation, so - * don't even bother. - */ - if (IS_GEN2(dev) || IS_GEN3(dev)) - return connector_status_connected; + if (!i915_ignorelid && !acpi_lid_open()) + status = connector_status_unknown; return status; }_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 12 lines · Alex Deucher
Quoted 10 lines · Andrei Paskevich
Currently, the LVDS connector on i915-equipped laptops is always reported as connected, regardless of the lid state and presence of external monitors. This was done because of too many BIOSes reporting lid status in an unreliable way. However, in a quite usual setup of a laptop attached to an external monitor, the only way to obtain the monitor's resolution on boot is to disable the LVDS via the boot command line, which is unfortunate as one have to reboot to get the internal screen back.
Quoted 5 lines
This sounds like policy that should be handled in userspace. One could argue that the LVDS panel is always connected so it should always report as connected. Your desktop manager or whatever can decide what to light up based on what's connected and the current lid status.
This can certainly be handled in a desktop manager, as you propose. The problem is that KMS code will choose the undesired resolution for the console, well before a desktop manager is started.
I also agree that the LVDS panel is always connected in the proper sense of the word. What I don't agree with is that every connected output must be always turned on and configured for some common resolution, which is almost never what I want (*). Yet the current DRM implementation does exactly this, and Nouveau provides at least a good workaround.
Andrei
(*) Except maybe for the case of laptop+beamer, but it is this case that can and should be treated by one's desktop environment.
Quoted 68 lines
Alex
Quoted 64 lines
The following patch implements the same scheme as in the Nouveau driver: if the lid is reported as closed, the LVDS connector status is set to unknown, and the internal screen will be turned on only if there are no other connected monitors. The ACPI lid status is not checked if the "i915.ignorelid" parameter is set to zero (to account for the buggy BIOSes), which is the default value, so that the current behavior does not change.
The patch applies to the 2.6.35 kernel.
Best regards,
Andreidrivers/gpu/drm/i915/i915_drv.c +3
-0@@ -45,6 +45,9 @@ module_param_named(fbpercrtc, i915_fbpercrtc, int, 0400); unsigned int i915_powersave = 1; module_param_named(powersave, i915_powersave, int, 0400); +unsigned int i915_ignorelid =1 ; +module_param_named (ignorelid, i915_ignorelid, int,0400 ); + unsigned int i915_lvds_downclock = 0; module_param_named(lvds_downclock, i915_lvds_downclock, int, 0400);drivers/gpu/drm/i915/i915_drv.h +1
-0@@ -815,6 +815,7 @@ extern struct drm_ioctl_desc i915_ioctls[]; extern int i915_max_ioctl; extern unsigned int i915_fbpercrtc; extern unsigned int i915_powersave; +extern unsigned int i915_ignorelid; extern unsigned int i915_lvds_downclock; extern int i915_suspend(struct drm_device *dev, pm_message_t state);drivers/gpu/drm/i915/intel_lvds.c +2
-5@@ -551,11 +551,8 @@ static enum drm_connector_status intel_lvds_detect(struct drm_connector *connect struct drm_device *dev = connector->dev; enum drm_connector_status status = connector_status_connected; - /* ACPI lid methods were generally unreliable in this generation, so - * don't even bother. - */ - if (IS_GEN2(dev) || IS_GEN3(dev)) - return connector_status_connected; + if (!i915_ignorelid && !acpi_lid_open()) + status = connector_status_unknown; return status; }_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 9 lines · Andrei Paskevich
Currently, the LVDS connector on i915-equipped laptops is always reported as connected, regardless of the lid state and presence of external monitors. This was done because of too many BIOSes reporting lid status in an unreliable way. However, in a quite usual setup of a laptop attached to an external monitor, the only way to obtain the monitor's resolution on boot is to disable the LVDS via the boot command line, which is unfortunate as one have to reboot to get the internal screen back.
If ACPI lid status were even remotely reliable for Intel machines, this might be a good idea.
- ajax
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 11 lines · Adam Jackson
Quoted 9 lines · Andrei Paskevich
Currently, the LVDS connector on i915-equipped laptops is always reported as connected, regardless of the lid state and presence of external monitors. This was done because of too many BIOSes reporting lid status in an unreliable way. However, in a quite usual setup of a laptop attached to an external monitor, the only way to obtain the monitor's resolution on boot is to disable the LVDS via the boot command line, which is unfortunate as one have to reboot to get the internal screen back.
Quoted 2 lines
If ACPI lid status were even remotely reliable for Intel machines, this might be a good idea.
I don't agree: if lid status were reliable, there would be no need for this, as we could just report a lid-closed LVDS disconnected (as it was done in intel_lvds.c before). The trick with the "unknown" status is really useful when ACPI erroneously reports the lid as closed and there are no other connected monitors.
The purpose of the proposed patch is to provide a correct screen mode on boot for those Intel laptops which have correct ACPI lid status handling (and such laptops do exist) without changing the existing behaviour in the default case.
Andrei