Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(80)

Issue 1841683003: ui/ozone: Flush CPU caches when mapping/unmapping prime pixmap (Closed)

Created:
4 years, 8 months ago by vignatti (out of this project)
Modified:
4 years, 8 months ago
CC:
chromium-reviews, darin-cc_chromium.org, jam, jln+watch_chromium.org, kalyank, ozone-reviews_chromium.org, rickyz+watch_chromium.org, Robert Sesek
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

ui/ozone: Flush CPU caches when mapping/unmapping prime pixmap The dma-buf API requires that the mapped buffer gets always flushed before and after accessing it. This CL fixes this API usage therefore. As a consequence this CL gives the needed support for non-coherent hardware when using prime native pixmap. It forwards cache coherency management to the driver which will execute accordingly the hardware needs. It requires kernel changes to implement the ioctl, so for now only Chrome OS is enabled. cache coherent hw, Core "IvyBridge" i5: - noop * Map/Unmap accounts for 2.13% of PlaybackToMemory. Calculation is based on "CPU Self Time". * PlaybackToMemory time takes on average 0.1840 ms to be executed. Calculation based on "Wall Duration" against "Occurrences". - sync (with this patch applied) * Map/Unmap accounts for 6.70% of PlaybackToMemory. Calculation based on "CPU Self Time". * PlaybackToMemory time takes on average 0.1786 ms to be executed. Calculation based on "Wall Duration" against "Occurrences". cache incoherent hw, Celeron "Bay Trail-M" N2830: - noop * Map/Unmap accounts for 10.31% of PlaybackToMemory. Calculation is based on CPU Self Time". * PlaybackToMemory time takes on average 0.3955 ms to be executed. Calculation based on "Wall Duration" against "Occurrences". - sync (with this patch applied) * Map/Unmap accounts for 24.17% of PlaybackToMemory. Calculation based on "CPU Self Time". * PlaybackToMemory time takes on average 0.6593 ms to be executed. Calculation based on "Wall Duration" against "Occurrences". Conclusion: Wall Duration average for PlaybackToMemory is better when the ioctls are in place in coherent hardware. i.e. even though Map/Unmap brings an in-place overhead, for the overall graphics system there's a speed-up when syncing the caches. For non-coherent hardware, there's a considerable performance regression. TEST=chrome on Core platform, using the following options: --enable-native-gpu-memory-buffers --enable-zero-copy \ --trace-startup=drm,cc --trace-startup-file=mapunmap-sync.json \ --trace-startup-duration=5 ../../tools/perf/page_sets/tough_texture_upload_cases/background_color_animation.html BUG=581151 Committed: https://crrev.com/5e5cf24e3825a63996779ff0e817b79a2faa1dc9 Cr-Commit-Position: refs/heads/master@{#385737}

Patch Set 1 #

Total comments: 7

Patch Set 2 : build fix pointed by dshwang #

Patch Set 3 : use base::ScopedFD #

Total comments: 10

Patch Set 4 : fix spang comments and use local definition for ioctl #

Total comments: 9

Patch Set 5 : #

Patch Set 6 : fix missing semicolon #

Total comments: 1

Patch Set 7 : ran git cl format #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+76 lines, -4 lines) Patch
M content/common/sandbox_linux/bpf_renderer_policy_linux.cc View 1 2 3 4 5 6 2 chunks +17 lines, -0 lines 2 comments Download
M ui/ozone/platform/drm/client_native_pixmap_factory_gbm.cc View 1 2 3 4 5 6 2 chunks +11 lines, -2 lines 0 comments Download
M ui/ozone/platform/drm/common/client_native_pixmap_dmabuf.h View 1 2 2 chunks +2 lines, -0 lines 0 comments Download
M ui/ozone/platform/drm/common/client_native_pixmap_dmabuf.cc View 1 2 3 4 5 6 3 chunks +46 lines, -2 lines 2 comments Download

Messages

Total messages: 38 (13 generated)
dshwang
Great. few nits. https://codereview.chromium.org/1841683003/diff/1/content/common/sandbox_linux/bpf_renderer_policy_linux.cc File content/common/sandbox_linux/bpf_renderer_policy_linux.cc (right): https://codereview.chromium.org/1841683003/diff/1/content/common/sandbox_linux/bpf_renderer_policy_linux.cc#newcode35 content/common/sandbox_linux/bpf_renderer_policy_linux.cc:35: Allow()) is it ok to build ...
4 years, 8 months ago (2016-03-29 13:23:40 UTC) #2
dshwang
https://codereview.chromium.org/1841683003/diff/1/content/common/sandbox_linux/bpf_renderer_policy_linux.cc File content/common/sandbox_linux/bpf_renderer_policy_linux.cc (right): https://codereview.chromium.org/1841683003/diff/1/content/common/sandbox_linux/bpf_renderer_policy_linux.cc#newcode35 content/common/sandbox_linux/bpf_renderer_policy_linux.cc:35: Allow()) On 2016/03/29 13:23:40, dshwang wrote: > is it ...
4 years, 8 months ago (2016-03-29 13:53:10 UTC) #3
vignatti (out of this project)
PTAL. I'm abandoning 1609383003 in favour of this CL now.
4 years, 8 months ago (2016-03-29 20:30:32 UTC) #7
vignatti (out of this project)
I've fixed now dshwang's commentaries but one about the Linux support. A simple #ifdef to ...
4 years, 8 months ago (2016-03-29 21:08:31 UTC) #9
spang
https://codereview.chromium.org/1841683003/diff/40001/content/common/sandbox_linux/bpf_renderer_policy_linux.cc File content/common/sandbox_linux/bpf_renderer_policy_linux.cc (right): https://codereview.chromium.org/1841683003/diff/40001/content/common/sandbox_linux/bpf_renderer_policy_linux.cc#newcode35 content/common/sandbox_linux/bpf_renderer_policy_linux.cc:35: Allow()) I'm fairly certain this is going to cause ...
4 years, 8 months ago (2016-03-30 00:19:00 UTC) #10
vignatti (out of this project)
https://codereview.chromium.org/1841683003/diff/40001/content/common/sandbox_linux/bpf_renderer_policy_linux.cc File content/common/sandbox_linux/bpf_renderer_policy_linux.cc (right): https://codereview.chromium.org/1841683003/diff/40001/content/common/sandbox_linux/bpf_renderer_policy_linux.cc#newcode35 content/common/sandbox_linux/bpf_renderer_policy_linux.cc:35: Allow()) On 2016/03/30 00:19:00, spang wrote: > I'm fairly ...
4 years, 8 months ago (2016-03-30 14:58:37 UTC) #11
spang
On 2016/03/30 14:58:37, vignatti wrote: > https://codereview.chromium.org/1841683003/diff/40001/content/common/sandbox_linux/bpf_renderer_policy_linux.cc > File content/common/sandbox_linux/bpf_renderer_policy_linux.cc (right): > > https://codereview.chromium.org/1841683003/diff/40001/content/common/sandbox_linux/bpf_renderer_policy_linux.cc#newcode35 > ...
4 years, 8 months ago (2016-03-30 15:10:11 UTC) #12
vignatti (out of this project)
spang@ check the latest patch please. I've used the local definitions now and that works ...
4 years, 8 months ago (2016-03-30 20:04:23 UTC) #13
spang
https://codereview.chromium.org/1841683003/diff/60001/content/common/sandbox_linux/bpf_renderer_policy_linux.cc File content/common/sandbox_linux/bpf_renderer_policy_linux.cc (right): https://codereview.chromium.org/1841683003/diff/60001/content/common/sandbox_linux/bpf_renderer_policy_linux.cc#newcode11 content/common/sandbox_linux/bpf_renderer_policy_linux.cc:11: * <linux/dma-buf.h> once kernel version 4.6 becomes widely used. ...
4 years, 8 months ago (2016-03-30 21:03:25 UTC) #15
spang
On 2016/03/30 20:04:23, vignatti wrote: > spang@ check the latest patch please. I've used the ...
4 years, 8 months ago (2016-03-30 21:09:48 UTC) #16
vignatti (out of this project)
PTAL now, spang. https://codereview.chromium.org/1841683003/diff/60001/content/common/sandbox_linux/bpf_renderer_policy_linux.cc File content/common/sandbox_linux/bpf_renderer_policy_linux.cc (right): https://codereview.chromium.org/1841683003/diff/60001/content/common/sandbox_linux/bpf_renderer_policy_linux.cc#newcode11 content/common/sandbox_linux/bpf_renderer_policy_linux.cc:11: * <linux/dma-buf.h> once kernel version 4.6 ...
4 years, 8 months ago (2016-03-30 21:13:56 UTC) #17
spang
lgtm
4 years, 8 months ago (2016-03-30 21:17:29 UTC) #19
vignatti (out of this project)
mdempsky@ PTAL the changes in content/common/sandbox_linux/
4 years, 8 months ago (2016-03-30 21:17:54 UTC) #20
spang
https://codereview.chromium.org/1841683003/diff/60001/ui/ozone/platform/drm/client_native_pixmap_factory_gbm.cc File ui/ozone/platform/drm/client_native_pixmap_factory_gbm.cc (right): https://codereview.chromium.org/1841683003/diff/60001/ui/ozone/platform/drm/client_native_pixmap_factory_gbm.cc#newcode73 ui/ozone/platform/drm/client_native_pixmap_factory_gbm.cc:73: return nullptr; On 2016/03/30 21:13:56, vignatti wrote: > On ...
4 years, 8 months ago (2016-03-30 21:20:01 UTC) #21
vignatti (out of this project)
On 2016/03/30 21:20:01, spang wrote: > https://codereview.chromium.org/1841683003/diff/60001/ui/ozone/platform/drm/client_native_pixmap_factory_gbm.cc > File ui/ozone/platform/drm/client_native_pixmap_factory_gbm.cc (right): > > https://codereview.chromium.org/1841683003/diff/60001/ui/ozone/platform/drm/client_native_pixmap_factory_gbm.cc#newcode73 > ...
4 years, 8 months ago (2016-03-30 21:28:59 UTC) #22
vignatti (out of this project)
I posted now the tracing of non-coherent hw. PTAL.
4 years, 8 months ago (2016-04-01 15:50:37 UTC) #24
vignatti (out of this project)
rsesek@ PTAL the changes in content/common/sandbox_linux/
4 years, 8 months ago (2016-04-04 17:59:33 UTC) #25
Robert Sesek
On 2016/04/04 17:59:33, vignatti wrote: > rsesek@ PTAL the changes in content/common/sandbox_linux/ rickyz@ would be ...
4 years, 8 months ago (2016-04-04 18:12:17 UTC) #27
vignatti (out of this project)
On 2016/04/04 18:12:17, Robert Sesek wrote: > On 2016/04/04 17:59:33, vignatti wrote: > > rsesek@ ...
4 years, 8 months ago (2016-04-04 18:46:59 UTC) #28
rickyz (no longer on Chrome)
https://codereview.chromium.org/1841683003/diff/120001/content/common/sandbox_linux/bpf_renderer_policy_linux.cc File content/common/sandbox_linux/bpf_renderer_policy_linux.cc (right): https://codereview.chromium.org/1841683003/diff/120001/content/common/sandbox_linux/bpf_renderer_policy_linux.cc#newcode26 content/common/sandbox_linux/bpf_renderer_policy_linux.cc:26: #define LOCAL_DMA_BUF_BASE 'b' Not sure how problematic this is ...
4 years, 8 months ago (2016-04-06 02:04:48 UTC) #29
vignatti (out of this project)
https://codereview.chromium.org/1841683003/diff/120001/content/common/sandbox_linux/bpf_renderer_policy_linux.cc File content/common/sandbox_linux/bpf_renderer_policy_linux.cc (right): https://codereview.chromium.org/1841683003/diff/120001/content/common/sandbox_linux/bpf_renderer_policy_linux.cc#newcode26 content/common/sandbox_linux/bpf_renderer_policy_linux.cc:26: #define LOCAL_DMA_BUF_BASE 'b' On 2016/04/06 02:04:48, rickyz wrote: > ...
4 years, 8 months ago (2016-04-06 13:52:47 UTC) #30
rickyz (no longer on Chrome)
Cool, thanks for the details - lgtm.
4 years, 8 months ago (2016-04-07 01:56:48 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1841683003/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1841683003/120001
4 years, 8 months ago (2016-04-07 12:17:19 UTC) #34
commit-bot: I haz the power
Committed patchset #7 (id:120001)
4 years, 8 months ago (2016-04-07 13:25:16 UTC) #36
commit-bot: I haz the power
4 years, 8 months ago (2016-04-07 13:27:01 UTC) #38
Message was sent while issue was closed.
Patchset 7 (id:??) landed as
https://crrev.com/5e5cf24e3825a63996779ff0e817b79a2faa1dc9
Cr-Commit-Position: refs/heads/master@{#385737}

Powered by Google App Engine
This is Rietveld 408576698