Similar to bug #1069694.

I have found out that the bug is somehow related to vgaswitcheroo. Here
is a way to reproduce it (installing lm-sensors is welcome):

1. Let's say you have both integrated and discrete. Then, `cat 
/sys/kernel/debug/vgaswitcheroo/switch` should give you something like
{{{0:DIS: :Pwr:0000:01:00.0
1:IGD:+:Pwr:0000:00:02.0}}}

2. If you `pm-suspend` now and resume, and then repeat step 1, you
should see the same results.

3. If you now try to turn ON the discrete card it should work well,
since it is already on and vgaswitcheroo is aware of this.

4. Now, turn discrete card off: `echo OFF > 
/sys/kernel/debug/vgaswitcheroo/switch`. If you read the status, it shoul render
{{{0:DIS: :Off:0000:01:00.0
1:IGD:+:Pwr:0000:00:02.0}}}

5. If you `pm-suspend` now and resume, you might get frozen screen.

6. If not, you can check vgaswitcheroo status, you'll see that discrete card is 
switched off:
{{{0:DIS: :Off:0000:01:00.0
1:IGD:+:Pwr:0000:00:02.0}}}

However, if you do `sensors` you'll see that discrete card reports it's
temperature - that is, it is on.

7. Now, if you try to turn it on by `echo ON >
/sys/kernel/debug/vgaswitcheroo/switch` you'll probably get freeze.

And since we know all this, we can create a workaround. Just make our discrete 
card turn on before suspend, and turn off in a few seconds after resume. In 
order to achieve this, just create file `/etc/pm/sleep.d/77_amd_toggle` with 
the following content:
{{{#!/bin/bash
# Script to disable and enable the discrete graphics card before suspend and 
after resume

case "${1}" in
suspend)
  # We turn it on before resume to prevent bugs
  echo ON > /sys/kernel/debug/vgaswitcheroo/switch
  ;;

resume)
  # Your GFX would freeze if you turn off discrete card immediately, that's why 
this delay:
  sleep 3
  # We turn it off after resume to save energy
  echo OFF > /sys/kernel/debug/vgaswitcheroo/switch
  ;;
esac}}}

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to xorg in Ubuntu.
https://bugs.launchpad.net/bugs/1155501

Title:
  system hangs when switching between TTY and X (12.10)

Status in “xorg” package in Ubuntu:
  Confirmed

Bug description:
  So, I have this problem on lenovo ideapad y460, with hybrid graphics
  (AMD 5650 and intel) on ubuntu 12.10 with preinstalled open-source
  video drivers.

  To reproduce bug on my system:

  1) switch off discrette videocard using vgaswitcheroo:

  kirill@lenovo:~$ sudo -s
  [sudo] password for kirill: 
  root@lenovo:~# echo OFF > /sys/kernel/debug/vgaswitcheroo/switch 
  root@lenovo:~# cat /sys/kernel/debug/vgaswitcheroo/switch 
  0:DIS: :Off:0000:01:00.0
  1:IGD:+:Pwr:0000:00:02.0
  2:DIS-Audio:+:Off:0000:01:00.1
  root@lenovo:~# 

  2) switch to any TTY using ctrl+alt+F1..F6
  3) switch back to X-server using ctrl+alt+F7

  After that I see the scree in state I leave it, but in frost state
  (for example, I can open gif animation, switch to TTY and back, and
  after I have static image on screen). Also I can't use keyboard and
  mouse.

  If I try to go to the TTY and back with discrette videocard switched
  on, it works fine.

  I have that bug on 12.10 and 13.04. But 10.10, 11.04, 11.10 and 12.04
  work great.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/xorg/+bug/1155501/+subscriptions

-- 
Mailing list: https://launchpad.net/~desktop-packages
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~desktop-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to