Bug 88658 - (bisected) Slow video playback on Kabini
Summary: (bisected) Slow video playback on Kabini
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/Gallium/radeonsi (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Default DRI bug account
QA Contact: Default DRI bug account
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-21 10:10 UTC by jtossenb
Modified: 2015-02-06 02:24 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
st/mesa: Don't use PIPE_USAGE_STREAM for unpack PBOs (879 bytes, patch)
2015-02-04 00:43 UTC, Michel Dänzer
Details | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description jtossenb 2015-01-21 10:10:20 UTC
I am using a 64-bit Kabini based system (AMD Athlon 5350) with Kodi 14.0 on an up-to-date Arch linux.
Kodi plays this 
https://dl-web.dropbox.com/get/hi10p_sample.mp4?w=AAC8qnXfS0xxWbd5Fc2bkvWxMxeqlUiSkL-Dxe5C5BDVyw&dl=1&_subject_uid=6760021
small sample file fine with kernel 3.16.x, but with kernel >= 3.17 the playback is only 1 fps (like a slideshow). It is a hi10p video, so Kodi uses pure software decoding.

I've done a git bisect between 3.16 and 3.17-rc1 and found that 02376d8282b88f07d0716da6155094c8760b1a13 is the first bad commit.

commit 02376d8282b88f07d0716da6155094c8760b1a13
Author: Michel Dänzer <michel.daenzer@amd.com>
Date:   Thu Jul 17 19:01:08 2014 +0900

    drm/radeon: Allow write-combined CPU mappings of BOs in GTT (v2)
    
    v2: fix rebase onto drm-fixes
    
    Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
    Reviewed-by: Christian König <christian.koenig@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

Then I applied the patch found in comment 30 of bug 84627 attachment 11024 [details] (as I use 64-bit system).

This patch worked around the problem on 3.17 and on the latest 3.19-rc5 kernel as well and now Kodi plays the above video 24 fps.
Comment 1 jtossenb 2015-01-21 10:20:40 UTC
Sorry, attachment 110024 [details] [review]
Comment 3 Michel Dänzer 2015-01-22 04:02:02 UTC
What version of Mesa are you using? Does the problem already happen with Mesa commit 07c65b85eada8dd34019763b6e82ed4257a9b4a6, or if not, can you bisect Mesa?
Comment 4 jtossenb 2015-01-22 09:02:03 UTC
My Arch Linux is up-to-date, I use Mesa 10.4.2 and so commit 07c65b85eada8dd34019763b6e82ed4257a9b4a6 is included. I am ready to do bisecting Mesa if you wish, but at the moment I don't know where to start, what kernel version to use during bisecting Mesa.
Comment 5 Michel Dänzer 2015-01-22 09:23:10 UTC
(In reply to jtossenb from comment #4)
> My Arch Linux is up-to-date, I use Mesa 10.4.2 and so commit
> 07c65b85eada8dd34019763b6e82ed4257a9b4a6 is included.

If it wasn't included, you wouldn't have the problem. :)

My question was: If you build Mesa *at* commit 07c65b85eada8dd34019763b6e82ed4257a9b4a6, does the problem occur with that? If not, please bisect Mesa between that commit and the 10.4.2 release. If yes, there's nothing to bisect.

> I am ready to do bisecting Mesa if you wish, but at the moment I don't know
> where to start, what kernel version to use during bisecting Mesa.

Any kernel which exposes the problem in your testing so far should do.
Comment 6 smoki 2015-01-22 10:58:32 UTC
 Well he can just try to revert this one again, Kodi seems to does not like that:

 http://cgit.freedesktop.org/mesa/mesa/commit/src/gallium/drivers/radeon/r600_buffer_common.c?id=7b4276d7acf2e0f77044cb50caa6ad936fa78786

 @Michel

 I guess this should be reverted again as Valley does not stutter with 3.19 kernel.
Comment 7 jtossenb 2015-01-22 17:40:17 UTC
(In reply to smoki from comment #6)
>  Well he can just try to revert this one again, Kodi seems to does not like
> that:
> 
>  http://cgit.freedesktop.org/mesa/mesa/commit/src/gallium/drivers/radeon/
> r600_buffer_common.c?id=7b4276d7acf2e0f77044cb50caa6ad936fa78786

Thanks, it was a good idea!
I've built Mesa 10.4.2 with the reverted commit and the problem solved, Kodi works fine now.
I used the original 3.18.2-2-ARCH kernel during the test.
Comment 8 Michel Dänzer 2015-02-03 06:56:51 UTC
(In reply to jtossenb from comment #2)
> And the right video URL is: 
> https://dl-web.dropbox.com/get/hi10p_sample.mp4?w=AAC8qnXfS0xxWbd5Fc2bkvWxMxeqlUiSkL-Dxe5C5BDVyw&dl=1&_subject_uid=67600211

I get error 403 for that.
Comment 9 jtossenb 2015-02-03 08:10:55 UTC
Sorry. I hope it works.
https://www.dropbox.com/s/3ronrw57r3n8hsn/hi10p_sample.mp4?dl=1
Comment 10 Michel Dänzer 2015-02-04 00:43:26 UTC
Created attachment 113144 [details] [review]
st/mesa: Don't use PIPE_USAGE_STREAM for unpack PBOs

Does this Mesa patch help?
Comment 11 jtossenb 2015-02-04 16:08:55 UTC
(In reply to Michel Dänzer from comment #10)
> Does this Mesa patch help?

Yes, it does!
mesa-10.4.3 + this patch works fine.
Thank you very much!
Comment 12 Michel Dänzer 2015-02-06 02:24:17 UTC
Module: Mesa
Branch: master
Commit: a338dc01866ce50bf7555ee8dc08491c7f63b585
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=a338dc01866ce50bf7555ee8dc08491c7f63b585

Author: Michel Dänzer <michel.daenzer@amd.com>
Date:   Thu Feb  5 12:46:04 2015 +0900

st/mesa: Don't use PIPE_USAGE_STREAM for GL_PIXEL_UNPACK_BUFFER_ARB


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct.