Intel08 Nov 2013 09:47 am

Some Months ago I made a promise here: drm/i915: GPU Power Savings. So it is time to move on with this promise and write a little bit about Panel Self Refresh (PSR) power saving feature that landed on latest Linux kernel (3.12) released this week.

Before explaining the feature itself, how it works, how it contributes to power savings, how to get it working and how to test it, there are important things that you must be aware of:

  1. Not all eDP necessarily support PSR. Actually this is so rare yet nowadays. Almost no eDP panel in the market support PSR. Sad but true. If you are a luck guy with a eDP that supports PSR on your Ultrabook you should see this “Detected EDP PSR Panel. on your dmesg with kernel booted with drm.debug=0xe.
  2. Besides the Panel it also have to be supported by the GPU. In our case it is only supported for Haswell yet. I’m currently working to get it working for Baytrail and Ben already submited support for Broadwell.
  3. Don’t try to enable PSR feature if you use KDE or XDM. Some small writes to scanout cannot be detected by GPU if userspace doesn’t send busy_ioctls at least. So, with this components Haswell doesn’t know something was written to scanout and that screen must be updated. So it doesn’t triger PSR Exit and Remote Frame Buffer update and will won’t see what you typed until you move your mouse. (Mouse cursor updates are tracked by GPU and PSR Exits).

With all this sad restrictions/limitations/known issues said, let’s tell more about PSR.

PSR is an eDP feature specified by VESA’s eDP v1.3. If you need a deep spec about PSR this is the one. I’ll try to explain it in a high level and easy way here.

So, if your eDP panel supports PSR it has a Remote Frame Buffer (RFB) on it. When Hardware/GPU (Source) detects some identical idle frames updates it tells the Panel (Sink) that it can use the minimal energy as possible by letting the static screen on RFB and shutdown any other panel component. This is called PSR Entry state or SRD.

Source is also responsible for detect when a screen update is needed and tell Sink to Exit PSR letting everything on, allowing normal screen updates.

When programming Haswell we just configure idle frames, max sleep time and other things like this, but the hardware itself that does the whole magic of detect identical frames and tell Sink it can switch from PSR Exit state to PSR Entry and vice versa.

Power Savings: the feature alone saves some power, but it saves even more  by allowing Package C States to stay more time in deep states.

How to enable it: Add i915.enable_psr=1 to your Linux Kernel cmdline.

How to check current state: cat /sys/kernel/debug/dri/0/i915/i915_edp_psr_status

How to test it: Intel-gpu-tools testcase under pm_psr. Just run pm_psr.

 

3 Responses to “drm/i915: GPU Power Savings – Panel Self Refresh (PSR/SRD)”

  1. on 20 Apr 2014 at 7:01 pm Chaohui Lin

    Hi Vivi,
    As you said, … When Hardware/GPU (Source) detects some identical idle frames updates it tells the Panel (Sink) that it can use the minimal energy as possible by letting the static screen on RFB and shutdown any other panel component….
    Could you tell me how many idential idle frames are used by GPU to determine this state? Is it configured in intel_dp.c?

    Thanks,
    -Chaohui

  2. on 26 Jun 2014 at 6:47 pm Chaohui Lin

    Hi Vivi,

    I found an issue that Intel GPU/driver can’t enter/output PSR SDP after resuming from suspend on Ubuntu Linux.

    Environment:
    Lenovo Thinkpad Ultrabook S1 Yoga;
    1. Processor Intel Core i5-4200U CPU@1.60GHzx4
    2. Graphics Intel Haswell Mobile
    3. 64bit Ubuntu 14.04 LTS;
    4. Linux kernel: 3.13.6;
    5. Kernel cmdline: i915.enable_psr=1

    Steps to reproduce:
    1. Run Iris code(Romcode/Appcode);
    2. Reboot Lenovo S1 Yoga;
    3. Output display panel can lightup;
    4. Login Ubuntu;
    5. Wait a while(around 10s~15s)
    6. SSH connect to Ubuntu from remote client, and check with command “sudo cat /sys/kernel/debug/dri/0/i915_edp_psr_status”, result:
    Sink_support: yes
    Source_OK: yes
    Enabled: yes
    Performance_counter: 6698
    7. Put Ubuntu into Suspend
    8. Move mouse to resume Ubuntu
    9. Output display panel can lightup;
    10.Wait a while(around 10s~15s)
    11.SSH connect to Ubuntu from remote client, and check with command “sudo cat /sys/kernel/debug/dri/0/i915_edp_psr_status”, result:
    Sink_support: yes
    Source_OK: yes
    Enabled: yes
    Performance_counter: 0
    And afterwards, the performance_counter is always 0, PSR state was never achieved.

    Did you ever experience this issue?
    and could you help confirm this is a bug in Intel GPU hardware or driver?

    Best regards,
    -Chaohui Lin

  3. on 01 Sep 2017 at 1:02 am Albert

    Is there any way we can fix this on KDE side? Or at least make it disabled? Is this a problem on KDE side? on X? on driver?

Trackback this Post | Feed on comments to this Post

Leave a Reply