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

Issue 2533163002: ozone: Create GbmBuffers from fourcc formats and gbm flags. (Closed)

Created:
4 years ago by Daniele Castagna
Modified:
4 years ago
CC:
chromium-reviews, kalyank, ozone-reviews_chromium.org, piman+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

ozone: Create GbmBuffers from fourcc formats and gbm flags. This CL changes the interface of GbmBuffer to use fourcc formats and gbm flags instead of gfx::Buffer{Format,Usage}. In this way we can create modeset buffers that can be mapped and can be scanned out without the need to add a new gfx::BufferUsage. BUG=chrome-os-partner:56407 Committed: https://crrev.com/2be041a887dffe27d886225be13d69160115dd12 Cr-Commit-Position: refs/heads/master@{#435368}

Patch Set 1 #

Patch Set 2 : Make ozone_unittests compile. #

Total comments: 5

Patch Set 3 : Address dnicoara's comments. #

Total comments: 7
Unified diffs Side-by-side diffs Delta from patch set Stats (+86 lines, -81 lines) Patch
M ui/ozone/platform/drm/gpu/drm_overlay_validator.cc View 1 chunk +1 line, -2 lines 0 comments Download
M ui/ozone/platform/drm/gpu/drm_overlay_validator_unittest.cc View 1 2 chunks +4 lines, -5 lines 0 comments Download
M ui/ozone/platform/drm/gpu/drm_thread.cc View 1 2 5 chunks +23 lines, -5 lines 5 comments Download
M ui/ozone/platform/drm/gpu/drm_window_unittest.cc View 1 2 chunks +2 lines, -1 line 0 comments Download
M ui/ozone/platform/drm/gpu/gbm_buffer.h View 2 chunks +9 lines, -9 lines 0 comments Download
M ui/ozone/platform/drm/gpu/gbm_buffer.cc View 1 2 11 chunks +29 lines, -44 lines 0 comments Download
M ui/ozone/platform/drm/gpu/gbm_buffer_base.h View 1 chunk +2 lines, -2 lines 0 comments Download
M ui/ozone/platform/drm/gpu/gbm_buffer_base.cc View 1 chunk +6 lines, -4 lines 0 comments Download
M ui/ozone/platform/drm/gpu/mock_dumb_buffer_generator.h View 1 1 chunk +1 line, -1 line 0 comments Download
M ui/ozone/platform/drm/gpu/mock_dumb_buffer_generator.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M ui/ozone/platform/drm/gpu/mock_scanout_buffer_generator.h View 1 chunk +1 line, -1 line 0 comments Download
M ui/ozone/platform/drm/gpu/mock_scanout_buffer_generator.cc View 1 chunk +2 lines, -3 lines 0 comments Download
M ui/ozone/platform/drm/gpu/scanout_buffer.h View 1 chunk +1 line, -1 line 0 comments Download
M ui/ozone/platform/drm/gpu/screen_manager.cc View 1 chunk +2 lines, -1 line 0 comments Download
M ui/ozone/platform/drm/gpu/screen_manager_unittest.cc View 1 2 chunks +2 lines, -1 line 2 comments Download

Messages

Total messages: 39 (19 generated)
Daniele Castagna
4 years ago (2016-11-29 00:22:38 UTC) #5
hoegsberg1
This looks good.
4 years ago (2016-11-30 01:06:18 UTC) #11
Daniele Castagna
Thank you for taking a look Kristian. +dnicoara for review. crrev.com/2535613002 has some context on ...
4 years ago (2016-11-30 01:33:45 UTC) #13
dnicoara
https://codereview.chromium.org/2533163002/diff/20001/ui/ozone/platform/drm/gpu/drm_thread.cc File ui/ozone/platform/drm/gpu/drm_thread.cc (right): https://codereview.chromium.org/2533163002/diff/20001/ui/ozone/platform/drm/gpu/drm_thread.cc#newcode114 ui/ozone/platform/drm/gpu/drm_thread.cc:114: unsigned flags = 0; nit: Make this a uint32_t. ...
4 years ago (2016-11-30 15:12:02 UTC) #14
Daniele Castagna
https://codereview.chromium.org/2533163002/diff/20001/ui/ozone/platform/drm/gpu/drm_thread.cc File ui/ozone/platform/drm/gpu/drm_thread.cc (right): https://codereview.chromium.org/2533163002/diff/20001/ui/ozone/platform/drm/gpu/drm_thread.cc#newcode114 ui/ozone/platform/drm/gpu/drm_thread.cc:114: unsigned flags = 0; On 2016/11/30 at 15:12:01, dnicoara ...
4 years ago (2016-11-30 18:41:38 UTC) #16
dnicoara
lgtm https://codereview.chromium.org/2533163002/diff/20001/ui/ozone/platform/drm/gpu/gbm_buffer.cc File ui/ozone/platform/drm/gpu/gbm_buffer.cc (right): https://codereview.chromium.org/2533163002/diff/20001/ui/ozone/platform/drm/gpu/gbm_buffer.cc#newcode204 ui/ozone/platform/drm/gpu/gbm_buffer.cc:204: for (size_t i = 0; i < gfx::NumberOfPlanesForBufferFormat(format); ...
4 years ago (2016-11-30 18:44:15 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2533163002/40001
4 years ago (2016-11-30 19:07:44 UTC) #22
commit-bot: I haz the power
Committed patchset #3 (id:40001)
4 years ago (2016-11-30 19:16:10 UTC) #24
commit-bot: I haz the power
Patchset 3 (id:??) landed as https://crrev.com/2be041a887dffe27d886225be13d69160115dd12 Cr-Commit-Position: refs/heads/master@{#435368}
4 years ago (2016-11-30 19:21:29 UTC) #26
tfiga
https://codereview.chromium.org/2533163002/diff/40001/ui/ozone/platform/drm/gpu/drm_thread.cc File ui/ozone/platform/drm/gpu/drm_thread.cc (right): https://codereview.chromium.org/2533163002/diff/40001/ui/ozone/platform/drm/gpu/drm_thread.cc#newcode44 ui/ozone/platform/drm/gpu/drm_thread.cc:44: GBM_BO_USE_SCANOUT | GBM_BO_USE_LINEAR); Why GBM_BO_USE_SCANOUT | GBM_BO_USE_LINEAR? First of ...
4 years ago (2016-12-06 06:16:32 UTC) #28
Daniele Castagna
https://codereview.chromium.org/2533163002/diff/40001/ui/ozone/platform/drm/gpu/drm_thread.cc File ui/ozone/platform/drm/gpu/drm_thread.cc (right): https://codereview.chromium.org/2533163002/diff/40001/ui/ozone/platform/drm/gpu/drm_thread.cc#newcode44 ui/ozone/platform/drm/gpu/drm_thread.cc:44: GBM_BO_USE_SCANOUT | GBM_BO_USE_LINEAR); On 2016/12/06 at 06:16:32, tfiga wrote: ...
4 years ago (2016-12-06 06:31:01 UTC) #29
tfiga
https://codereview.chromium.org/2533163002/diff/40001/ui/ozone/platform/drm/gpu/drm_thread.cc File ui/ozone/platform/drm/gpu/drm_thread.cc (right): https://codereview.chromium.org/2533163002/diff/40001/ui/ozone/platform/drm/gpu/drm_thread.cc#newcode44 ui/ozone/platform/drm/gpu/drm_thread.cc:44: GBM_BO_USE_SCANOUT | GBM_BO_USE_LINEAR); On 2016/12/06 06:31:01, Daniele Castagna wrote: ...
4 years ago (2016-12-06 06:50:57 UTC) #30
tfiga
https://codereview.chromium.org/2533163002/diff/40001/ui/ozone/platform/drm/gpu/screen_manager_unittest.cc File ui/ozone/platform/drm/gpu/screen_manager_unittest.cc (right): https://codereview.chromium.org/2533163002/diff/40001/ui/ozone/platform/drm/gpu/screen_manager_unittest.cc#newcode503 ui/ozone/platform/drm/gpu/screen_manager_unittest.cc:503: drm_, DRM_FORMAT_XRGB8888, GetPrimaryBounds().size()); Shouldn't the new format be DRM_FORMAT_ARGB8888?
4 years ago (2016-12-06 07:20:37 UTC) #31
Daniele Castagna
https://codereview.chromium.org/2533163002/diff/40001/ui/ozone/platform/drm/gpu/screen_manager_unittest.cc File ui/ozone/platform/drm/gpu/screen_manager_unittest.cc (right): https://codereview.chromium.org/2533163002/diff/40001/ui/ozone/platform/drm/gpu/screen_manager_unittest.cc#newcode503 ui/ozone/platform/drm/gpu/screen_manager_unittest.cc:503: drm_, DRM_FORMAT_XRGB8888, GetPrimaryBounds().size()); On 2016/12/06 at 07:20:37, tfiga wrote: ...
4 years ago (2016-12-06 18:31:10 UTC) #32
marcheu1
https://codereview.chromium.org/2533163002/diff/40001/ui/ozone/platform/drm/gpu/drm_thread.cc File ui/ozone/platform/drm/gpu/drm_thread.cc (right): https://codereview.chromium.org/2533163002/diff/40001/ui/ozone/platform/drm/gpu/drm_thread.cc#newcode44 ui/ozone/platform/drm/gpu/drm_thread.cc:44: GBM_BO_USE_SCANOUT | GBM_BO_USE_LINEAR); On 2016/12/06 06:50:57, tfiga wrote: > ...
4 years ago (2016-12-13 00:07:06 UTC) #34
marcheu1
On 2016/12/13 00:07:06, marcheu1 wrote: > https://codereview.chromium.org/2533163002/diff/40001/ui/ozone/platform/drm/gpu/drm_thread.cc > File ui/ozone/platform/drm/gpu/drm_thread.cc (right): > > https://codereview.chromium.org/2533163002/diff/40001/ui/ozone/platform/drm/gpu/drm_thread.cc#newcode44 > ...
4 years ago (2016-12-13 00:09:42 UTC) #35
hoegsberg1
On 2016/12/13 00:07:06, marcheu1 wrote: > https://codereview.chromium.org/2533163002/diff/40001/ui/ozone/platform/drm/gpu/drm_thread.cc > File ui/ozone/platform/drm/gpu/drm_thread.cc (right): > > https://codereview.chromium.org/2533163002/diff/40001/ui/ozone/platform/drm/gpu/drm_thread.cc#newcode44 > ...
4 years ago (2016-12-13 00:11:42 UTC) #36
marcheu1
On 2016/12/13 00:11:42, hoegsberg1 wrote: > On 2016/12/13 00:07:06, marcheu1 wrote: > > > https://codereview.chromium.org/2533163002/diff/40001/ui/ozone/platform/drm/gpu/drm_thread.cc ...
4 years ago (2016-12-13 00:15:47 UTC) #37
hoegsberg1
On 2016/12/13 00:15:47, marcheu1 wrote: > On 2016/12/13 00:11:42, hoegsberg1 wrote: > > On 2016/12/13 ...
4 years ago (2016-12-13 00:22:36 UTC) #38
Daniele Castagna
4 years ago (2016-12-13 02:28:59 UTC) #39
Message was sent while issue was closed.
https://codereview.chromium.org/2533163002/diff/40001/ui/ozone/platform/drm/g...
File ui/ozone/platform/drm/gpu/drm_thread.cc (right):

https://codereview.chromium.org/2533163002/diff/40001/ui/ozone/platform/drm/g...
ui/ozone/platform/drm/gpu/drm_thread.cc:44: GBM_BO_USE_SCANOUT |
GBM_BO_USE_LINEAR);
On 2016/12/13 at 00:07:06, marcheu1 wrote:
> On 2016/12/06 06:50:57, tfiga wrote:
> > On 2016/12/06 06:31:01, Daniele Castagna wrote:
> > > On 2016/12/06 at 06:16:32, tfiga wrote:
> > > > Why GBM_BO_USE_SCANOUT | GBM_BO_USE_LINEAR? First of all,
> > GBM_BO_USE_RENDERING
> > > should be necessary for the GPU to actually write anything to this buffer.
> > Then
> > > some platforms (e.g. Intel) can actually scan out of tiled buffers, which
is a
> > > significant performance optimization, so forcing linear doesn't make much
> > sense.
> > > 
> > > The GPU is not writing to this buffer. We're mapping it and writing to it
via
> > SW
> > > skia.
> > > 
> > > I don't think we care about performance in this case, this allocation is
for
> > > buffers that are used only for modesetting after we change the display
mode.
> > 
> > Acknowledged.
> 
> This is still wrong. You can't allocate a gem BO and expect to be able to map
it like a dumb buffer since these are two different things. There are two
possible ways to make this consistent:
> 
> 1. allocate an actual dumb buffer with DRM_IOCTL_MODE_CREATE_DUMB (not through
gbm), then map it like a dumb buffer (which is what the code currently does).
> 
> 2. allocate a GBM buffer with the LINEAR flag. In theory the LINEAR flag is
not needed because gbm_bo_map() gives you a linear view, except on Tegra where
that's not working because nvidia didn't implement it, and on Kevin where that
might not work because we don't know how to decompress AFBC. You need to then
change the code which maps the buffer to use gbm_bo_map() instead of
DRM_IOCTL_MODE_MAP_DUMB.

As discussed offline, let's start landing crrev.com/2568243004 as a temporary
fix for the regression described in crbug.com/673026

Powered by Google App Engine
This is Rietveld 408576698