Mir

Merge lp:~albaguirre/mir/fix-1475571 into lp:mir

Proposed by Alberto Aguirre
Status: Superseded
Proposed branch: lp:~albaguirre/mir/fix-1475571
Merge into: lp:mir
Diff against target: 16 lines (+0/-6)
1 file modified
src/platforms/mesa/server/common/buffer_allocator.cpp (+0/-6)
To merge this branch: bzr merge lp:~albaguirre/mir/fix-1475571
Reviewer Review Type Date Requested Status
Chris Halse Rogers Needs Information
Daniel van Vugt Approve
PS Jenkins bot (community) continuous-integration Needs Fixing
Review via email: mp+265186@code.launchpad.net

This proposal has been superseded by a proposal from 2015-07-20.

Commit message

Don't throw when gbm_device_is_format_supported returns false.

gbm_device_is_format_supported reports false on formats that work just fine with gbm_bo_create.

Description of the change

Don't throw when gbm_device_is_format_supported returns false.

gbm_device_is_format_supported reports false on formats that work just fine with gbm_bo_create.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

That check is correct and should probably not be deleted.

I suspect the issue is now we're more careful with pixel format semantics, an invalid format used screencast is being detected. This could be a simple matter of accidentally requesting RGBA for an RGBX framebuffer or mixed up byte ordering. I'm somewhat confident the bug lies in mirscreencast but have not looked yet. Will do so today...

review: Needs Fixing
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Oh I see. It's probably the bo_flags getting GBM_BO_USE_SCANOUT due to the size of the surface (which is a very ugly heuristic). With the SCANOUT flag, gbm will refuse RGBA and only allow RGBX. That's spurious because we actually have no desire for scan-out support in screencasting and there might be a real alpha channel that we want.

I think if gbm_bo_create throws adequate errors still then this change is fine. Providing it passes CI.

review: Approve
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

An alternate fix could be to change:
  gbm_device_is_format_supported(device, gbm_format, bo_flags)
to:
  gbm_device_is_format_supported(device, gbm_format, 0)

Revision history for this message
Chris Halse Rogers (raof) wrote :

If it really is the GBM_BO_USE_SCANOUT flag making the difference, then wouldn't it be a better idea to fix the allocator to not try to allocate a scanout buffer for screencasts (which doesn't make sense anyway).

I'd be concerned that just dropping the check will instead bite us later when we try and scanout from a BO that's not scanout-capable.

review: Needs Information

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/platforms/mesa/server/common/buffer_allocator.cpp'
2--- src/platforms/mesa/server/common/buffer_allocator.cpp 2015-07-16 07:03:19 +0000
3+++ src/platforms/mesa/server/common/buffer_allocator.cpp 2015-07-17 22:53:13 +0000
4@@ -157,12 +157,6 @@
5 bo_flags |= GBM_BO_USE_SCANOUT;
6 }
7
8- if (!gbm_device_is_format_supported(device, gbm_format, bo_flags))
9- {
10- BOOST_THROW_EXCEPTION(
11- std::runtime_error("Trying to create GBM buffer with unsupported pixel format"));
12- }
13-
14 gbm_bo *bo_raw = gbm_bo_create(
15 device,
16 buffer_properties.size.width.as_uint32_t(),

Subscribers

People subscribed via source and target branches