Bug 35402

Summary: self-refresh disabled in drm-intel-next
Product: DRI Reporter: Gordon Jin <gordon.jin>
Component: DRM/IntelAssignee: Yuanhan Liu <yuanhan.liu>
Status: CLOSED FIXED QA Contact: fangxun <xunx.fang>
Severity: normal    
Priority: medium CC: chris, jbarnes
Version: XOrg gitKeywords: regression
Hardware: All   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
The patch to fix this issue none

Description Gordon Jin 2011-03-17 19:54:21 UTC
memory self refresh is disabled in drm-intel-next. It's enabled in -fixes or 2.6.38.

Tested on Huron River:
[root@x-hnr3 ~]# cat /sys/kernel/debug/dri/0/i915_sr_status
self-refresh: disabled

Yuanhan is working on it.
Comment 1 Yuanhan Liu 2011-03-17 20:20:49 UTC
Created attachment 44567 [details] [review]
The patch to fix this issue

The patch to fix this issue
Comment 2 Chris Wilson 2011-03-18 00:36:10 UTC
The patch is incorrect.

You want just:

return mask && (mask & -mask) == mask;

Bad me, forgetting is_pot().
Comment 3 Yuanhan Liu 2011-03-18 00:47:32 UTC
I guess 

mask && (mask & (mask - 1) == 0 and
mask && (mask & -mask) == mask 

is equal. Right?
Comment 4 Yuanhan Liu 2011-03-18 01:24:54 UTC
Oh, right, I did something extra. No need to change ffs to fls as we have only one bit set.

Thanks.
Comment 5 fangxun 2011-03-18 01:47:48 UTC
The patch works on huronriver.
Comment 6 Chris Wilson 2011-03-18 02:12:42 UTC
I've queued:

commit 84ec542510602575073259e10f52b6e8f1ca94b7
Author: Yuanhan Liu <yuanhan.liu@intel.com>
Date:   Fri Mar 18 07:37:35 2011 +0000

    drm/i915: Re-enable self-refresh
    
    A broken implementation of is_pot() prevented the detection of when a
    singular pipe was enabled.
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=35402
    Signed-off-by: Yuanhan Liu <yuanhan.liu@intel.com>
    Tested-by: xunx.fang@intel.com
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Comment 7 Chris Wilson 2011-03-22 23:54:42 UTC
commit 7ccb4a53eb03c9196646ca0c2a97558313e886f1
Author: Yuanhan Liu <yuanhan.liu@intel.com>
Date:   Fri Mar 18 07:37:35 2011 +0000

    drm/i915: Re-enable self-refresh
    
    A broken implementation of is_pot() prevented the detection of when a
    singular pipe was enabled. Eric Anholt pointed out the existence of
    is_power_of_2() so use that instead of our broken code!
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=35402
    Signed-off-by: Yuanhan Liu <yuanhan.liu@intel.com>
    Tested-by: xunx.fang@intel.com
    Reviewed-by: Keith Packard <keithp@keithp.com>
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Comment 8 fangxun 2011-06-02 02:39:52 UTC
Verified with Kernel: (drm-intel-next)caee6066332b83e7f8bdd6f2f40ce46d4836d69c and Kernel: (drm-intel-fixes)2fb4e61d9471867677c97bf11dba8f1e9dfa7f7c.
Comment 9 Jari Tahvanainen 2016-11-03 11:56:03 UTC
Closing verified+fixed.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.