Bug 65396

Summary: [IVB] FBC increases power for libva video workload
Product: DRI Reporter: Liu Tienan <tienan.liu>
Component: DRM/IntelAssignee: Ville Syrjala <ville.syrjala>
Status: CLOSED INVALID QA Contact: Intel GFX Bugs mailing list <intel-gfx-bugs>
Severity: normal    
Priority: medium CC: christophe.prigent, focus.luo, gordon.jin, haihao.xiang, lianyuex.yang, ouping.zhang, przanoni, rodrigo.vivi, shengyanx.zhao, shuang.he, tienan.liu, zhenxiang.li, zhixinx.liu
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: IVB i915 features: display/FBC
Bug Depends on:    
Bug Blocks: 87704    

Description Liu Tienan 2013-06-05 07:53:27 UTC
System Environment:
----------------------------------------
Platform: HSW-ult\IVB

Libdrm:                       (master)libdrm-2.4.45-3-

g3586337f3703ce4833a375f66b08df064a1cec28
Mesa:                          (master)f6beb4c6b647b0d5077c7abd6c99cdaba6e0c112
Xserver:                      (master)xorg-server-1.14.99.1-82-

g7e97166c4fc38076b6224e4dbdd632b43444149f
Xf86_video_intel:         (master)2.21.6-47-gd6c30d1d4df6bcdfa075bd29da7c8aabee20774c
Cairo:                         (master)631bf299256e11a17511977f357e0353fb5615f7
Libva:                          (staging)880c916092c6d68096c95e49405714d8a21f9322
Libva_intel_driver:        (staging)0a5cfdab47c788569feb0a3e4293906687523f88      
Kernel:                        (drm-intel-nightly) 675fa342aa3a54af0a81f23809fff9590dfb6fc1


Test result:
----------------------------------------      
HSW-ult      FBC disable Average_watt       FBC enable Average_watt          
idle         14.8                           14.7 
browser      17.9                           17.8
video        18.7                           18.6
game         21                             21

IVB          FBC disable Average_watt       FBC enable Average_watt
idle         28                             27.8      
browser      32.5                           32.1
video        31.6                           32
game         34.8                           34.7     


Findings:
----------------------------------------
on HSW, FBC saved 0.1w running idle/browser/video workloads, but did not save any power when running game workload.
on IVB, FBC saved 0.2w on idle, 0.4w on browser, 0.1w on game, but FBC cost more 0.4w power when running video workload.
Comment 1 Daniel Vetter 2013-06-05 08:16:24 UTC
We need sprites support to be able to fix this ...
Comment 2 Liu Tienan 2013-06-05 08:32:31 UTC
This is our wiki "http://otcqa.sh.intel.com/qawiki/Graphics/Power-workloads", you can get more detailed information.

(In reply to comment #1)
> We need sprites support to be able to fix this ...
Comment 3 Chris Wilson 2013-06-07 22:02:12 UTC
What display path is being used here for video? vaapi, gl or xv?
Comment 4 Chris Wilson 2013-06-07 22:02:55 UTC
And what is the margin of error in the measurements?
Comment 5 Liu Tienan 2013-06-08 02:34:45 UTC
We used vaapi. And normally, the enable result should save 0.1 to 0.2 watts than disable. 
(In reply to comment #4)
> And what is the margin of error in the measurements?
Comment 6 Ouping Zhang 2013-06-09 07:50:52 UTC
For video, FBC saved 0.1w on HSW ULT, but consume more 0.4w on IVB, compared with disabling FBC.

For game, FBC saved 0.1w on IVB, but didn’t saved power on HSW.

FBC pass/fail criteria is 0.1-0.2w.
Comment 7 Rodrigo Vivi 2013-11-20 22:47:01 UTC
Hi Li,

could you please verify if Ville's fbc work fix the issue?

branch fbc_fixes on git://gitorious.org/vsyrjala/linux.git

Thanks,
Rodrigo.
Comment 8 Jocelyn Li 2013-11-21 01:59:47 UTC
Hi Shuang,

Could you help verify the patch from Ville?

Thanks,
Jocelyn
Comment 9 Shuang He 2013-11-22 02:47:47 UTC
Shengyan, could you help to verify if this bug still exist
Comment 10 ZhaoShengyan 2013-11-27 03:40:07 UTC
We followed Rodrigo Vivi's comment and tried kernel branch fbc_fixes with newest commit 68ba047bf19fbdcc22743069da259dc60f56a659, and the detail is as follows:

Env:
Arch:           x86_64
Libdrm:         (master)libdrm-2.4.49
Mesa:           (master)ddc77c5092b6f782327a7014b320f31f5f4e8e93
Xf86_video_intel:               (master)2.99.906-47-g5580df729f4d3b2498a6dae19dac938f06bf602d
Libva:          (staging)9aa8530ce272dc844428b7273afe7d4f0aaf391d
Libva_intel_driver:             (staging)34627c96f331f7a344270c3d51b634f5f166073e
Gstreamer10:            (1.0)4e880d4d1e151ea64f83c28b5c3e1bbc06c57903
Gst_plugins_base10:             (1.0)2dd3f028c1e6dea799d7496639f53220818b20b1
Gst_plugins_good10:             (1.0)643d425f51f81b56deec16c01162637546708ee5
Gst_plugins_bad10:              (1.0)0587ab41b4f9979e9cfc11011ed5c970569ee3d3
Gst_plugins_ugly10:             (1.0)c7c911b8320576429e4a4234a1e29ec7436e6814
Gst_plugins_vaapi10:            (master)0e9fc92819352b708b55b77e360a0b1ee7e7b555



Test result:
----------------------------------------      
HSW-ult      FBC disable Average_watt       FBC enable Average_watt          
idle         10.7                           10.8 
browser      16.7                           16.8
video        17.3                           18.6
game         25.5                           25.1

IVB          FBC disable Average_watt       FBC enable Average_watt
idle         28.8                           28.7      
browser      34.7                           34.4
video        36.5                           36.3
game         39.4                           39.1     


We found the feature that we mentioned saved power, such as IVB all tests got good data. HSW game also got great save result, however, HSW idle, browser, video, all got regression.
Comment 11 Ville Syrjala 2013-12-04 15:29:30 UTC
Here's my latest FBC work:
git://gitorious.org/vsyrjala/linux.git fbc_stolen_fixes

Would be nice to know if that helps more/less than the previous attempt.
Comment 12 Daniel Vetter 2013-12-04 16:04:21 UTC
Is this with the render or with the sprite based Xv port? Imo power consumption figures wrt fbc and video are only relevant with the later ...
Comment 13 Chris Wilson 2013-12-04 16:18:32 UTC
(In reply to comment #12)
> Is this with the render or with the sprite based Xv port? Imo power
> consumption figures wrt fbc and video are only relevant with the later ...

otoh, the default port is the render since that works best with compositing managers, wobbly windows and spinning cube workspace transitions.
Comment 14 Daniel Vetter 2013-12-04 16:20:43 UTC
Yeah, in the end the compositor needs to decide whether to use a sprite or not. So I'm not terribly offended if the current X model suffers a bit ;-)
Comment 15 Ville Syrjala 2013-12-04 16:34:42 UTC
Well, video frame rate is often significantly lower than the screen refresh rate, so FBC could actually do something useful for the render based Xv.

For the sprite based Xv, we might even turn off the primary plane if the sprite happens to be fullscreen, in which case FBC does nothing.
Comment 16 ZhaoShengyan 2013-12-11 07:54:26 UTC
(In reply to comment #11)
> Here's my latest FBC work:
git://gitorious.org/vsyrjala/linux.git
> fbc_stolen_fixes

Would be nice to know if that helps more/less than the
> previous attempt.

Ville Syrjala, we attempt the kernel that your provided and got the following details:

Testing Env:
------------------------------
Arch:           x86_64
Platform:       HSW/IVB
OSD:            Fedora release 16 (Verne)
Kernel_version:         53eb94ae76ca4a19d09fad378a8453cfa8430bb5
Libdrm:         (master)libdrm-2.4.50
Mesa:           (master)0b16042377a6981ff9bba92387889524a3547b3f
Xf86_video_intel:               (master)2.99.906-86-gade25f4f95994b565a8ed8eb3811ff7453a8b0e5
Cairo:          (master)8e11a42e3e9b679dce97ac45cd8b47322536a253
Libva:          (staging)a3097a5b045f4d624ae50949c891351e08588d66
Libva_intel_driver:             (staging)2a61b0d17072bdc5b58608e3dfa2c4f9f80dcec4
Ffmpeg:         (master)8e5a2989a387e809d7367167114d2f2a45649ffa
Mplayer:                (hwaccel-vaapi)1923fa10ed77bbf8408f2ce312d85a97dab1f0f3
Glib:           (master)a22f77739dd4ec911d7bdc0f0fc61314e5f9f1cf

Test result:
----------------------------------------      
HSW-ult      FBC disable Average_watt       FBC enable Average_watt          
idle         10.7                           10.7 
browser      16.2                           16.2
video        16.9                           16.8
game         25.1                           24.9

IVB          FBC disable Average_watt       FBC enable Average_watt
idle         29.2                           29.0      
browser      30.0                           29.7
video        36.7                           36.6
game         39.3                           39.3     

Findings:
----------------------------------------
1. Got much better result than the former testing via this new commit. At least, enable fbc feature were not cost more power.
2. It is still not save power, at least not obvious, when fbc enabling in testcase idle/browser at HSW, and game at IVB.
Comment 17 Gordon Jin 2013-12-13 01:52:05 UTC
the latest result looks good enough for this reported issue.
Comment 18 ZhaoShengyan 2013-12-13 02:21:21 UTC
(In reply to comment #17)
> the latest result looks good enough for this reported issue.
Okay, Gordon. So marked this as verified and fixed directly.
Comment 19 Gordon Jin 2013-12-13 08:01:33 UTC
Shengyan, we should keep it open until the fix goes into Daniel's tree.
Comment 20 ZhaoShengyan 2013-12-13 08:07:17 UTC
(In reply to comment #19)
> Shengyan, we should keep it open until the fix goes into Daniel's tree.

Okay, got it, thanks for your comments.
Comment 21 Jani Nikula 2014-08-14 13:16:58 UTC
Please retest with current nightly.
Comment 22 zhixinx.liu 2014-10-08 01:57:05 UTC
(In reply to Jani Nikula from comment #21)
> Please retest with current nightly.

FBC disabled on current nightly.

TEST Command:
[root@x-ivb16 ~]# cat /proc/cmdline
BOOT_IMAGE=kernels//nightly_parents/2014_10_01/drm-intel-nightly/913f5c269acd0010427cd7fee6b4812bdacd1cab/bzImage_x86_64 root=/dev/sda1 i915.i915_enable_fbc=1 modules_path=kernels//nightly_parents/2014_10_01/drm-intel-nightly/913f5c269acd0010427cd7fee6b4812bdacd1cab/modules_x86_64/lib/modules/3.17.0-rc7_drm-intel-nightly_913f5c_20141001+ kexec_jump_back_entry=0xca492c56
Add  i915.i915_enable_fbc=1  into x-ivb16
Start   X
[root@x-ivb16 ~]# cat /sys/kernel/debug/dri/0/i915_fbc_status
FBC disabled: disabled per chip default
Comment 23 zhixinx.liu 2014-10-15 02:51:20 UTC
(In reply to Jani Nikula from comment #21)
> Please retest with current nightly.

ignore my last commit.

virify FBC function with kernel3.17.0_drm-intel-nightly_ead7d7_20141013. and we found that:
For HSW=>
    Save power when running idle/browser/video workload after enable FBC. 
    Not save power when running game workload after enable FBC. 
For IVB=>
    Cannot enable FBC with IVB.
    When set i915.enable_fbc=1 or i915.enable_fbc=0, after reboot and start X, 
    check the FBS status that it's always disable. log:
        [root@x-ivb16 opt]# cat /sys/kernel/debug/dri/0/i915_fbc_status
        FBC disabled: multiple pipes are enabled
    It's new design or issue?

Test result:
----------------------------------------      
HSW-ult      FBC disable Average_watt       FBC enable Average_watt          
idle         11.0                           10.9 
browser      14.1                           14.0
video        13.2                           12.8
game         20.6                           20.6

Test Env:
Arch:              x86_64
Libdrm:            (master)libdrm-2.4.56
Mesa:              (10.3)9f67c26d1b424b8f3d86b5435c8f74d0a81eb86d
Xserver:           (server-1.16-branch)xorg-server-1.16.0
Xf86_video_intel:  (master)2.99.914
Libva:             (master)e0d25ece01e7aba819c910e98c4fb4706cdab055
Libva_intel_driver:(master)e02449a1d65b44a82b5f2fcdf8a5b0ba51c2bb6a
Ffmpeg:            (master)1b5ccae0f2045ac86bc9e1257cec1b3fba81315f
Mplayer:           (hwaccel-vaapi)1923fa10ed77bbf8408f2ce312d85a97dab1f0f3
Glib:              (master)3b8bc8bacf1fe31cda44fb5293711e87989388ea
Gstreamer10:       (1.2)861ca3d6787d84c9bea7110cb46821e9b8f63aff
Gst_plugins_base10:(1.2)df7e7daa29ba14447b4d8dd43c35d8a3ad9e4984
Gst_plugins_good10:(1.2)e0417c28d56ac64a2e8d149bbaf812d2ce227153
Gst_plugins_bad10: (1.2)277b8c34e7214177764833b73f17e43ced496f8f
Gst_plugins_ugly10:(1.2)2233d97e6ad1a3988d9a9ca0fc0cf00ec4031a8f
Gst_plugins_vaapi10:(master)406aa37373e2b9917714eccd2834a45d18b61fd1
Comment 24 Paulo Zanoni 2015-02-24 17:20:53 UTC
Downgrading priority since FBC is disabled by default.
Comment 25 Elio 2015-08-12 19:07:34 UTC
Currently working on FBC until today, performance test is needed.
Comment 26 Paulo Zanoni 2016-10-28 11:48:01 UTC
Let's just close this bug:

- No plans to enable FBC on IVB for now
- Latest measurement is 2 years old, a lot has changed since then
- Many FBC bugs fixed in the last 2 years
- No evidence that the machine was properly configured for power testing (e.g.: some other driver preventing FBC from actually saving power by forcing the machine to stay on a bad package C state)

If you feel this bug is still relevant, please feel free to reopen it.

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.