Mir

Mir continues to render background application surfaces even when they're not visible

Bug #1227739 reported by Thomi Richards on 2013-09-19
60
This bug affects 10 people
Affects Status Importance Assigned to Milestone
Mir
Fix Released
High
Daniel van Vugt
The Ubuntu Power Consumption Project
Undecided
Unassigned
platform-api
High
Andreas Pokorny
unity-mir
High
Alberto Aguirre
mir (Ubuntu)
High
Daniel van Vugt
unity-mir (Ubuntu)
Undecided
Unassigned

Bug Description

Not sure where to file this.

on the phone, if you open the clock app (which cases redraws every second when the second hand moves), and then open an indicator over the top, unity8 still renders frames every second, despite the fact that nothing on the screen is changing.

Talking to greyback and saviq, it sounds like some changes are required in both unity8 and mir before we can fix this.

Related branches

kevin gunn (kgunn72) wrote :

raising priority, but this is an optimization so it should be post phone v1

Changed in mir:
importance: Medium → High
status: New → Triaged
Changed in unity-mir:
status: New → Triaged
importance: Undecided → High
Daniel van Vugt (vanvugt) wrote :

I would say "not a bug" but an enhancement. However most of the requisite enhancement is done. The logic of optimizing for a single surface on top already exists as part of bypass. We clearly just need to wire up the bypass filter and the renderer differently.

Changed in mir:
assignee: nobody → Daniel van Vugt (vanvugt)
Changed in unity-mir:
status: Triaged → Invalid
Changed in mir:
status: Triaged → In Progress
Daniel van Vugt (vanvugt) wrote :

Also affects platform-api... Because occlusion testing doesn't operate on surfaces that have an alpha channel, we need the platform-api to be smarter about choosing a pixel format so that it doesn't get one with alpha;

static MirPixelFormat
mir_choose_default_pixel_format(MirConnection *connection)
{
    MirDisplayInfo info;
    mir_connection_get_display_info(connection, &info);
    return info.supported_pixel_format[0];
}

Changed in platform-api:
importance: Undecided → High
Daniel van Vugt (vanvugt) wrote :

And unity-mir might be a good place to do it too. Because on touch platforms for example, unity-mir has the knowledge that generally only the focussed app will be visible. So unity-mir could just pause anything not on top.

Alternatively, wait for the required functionality to land in both mir and platform-api.

Changed in unity-mir:
status: Invalid → Confirmed
status: Confirmed → Triaged
Changed in platform-api:
status: New → Triaged
summary: - Mir continues to render application surface even when the indicator
- surface is on top
+ Mir continues to render background application surfaces even when
+ they're not visible
tags: added: performance
Omer Akram (om26er) on 2013-10-14
tags: added: rls-s-incoming
PS Jenkins bot (ps-jenkins) wrote :

Fix committed into lp:~mir-team/mir/development-branch at revision 1135, scheduled for release in mir, milestone Unknown

Changed in mir:
status: In Progress → Fix Committed
Daniel van Vugt (vanvugt) wrote :

Not fixed. Only a related prerequisite enhancement landed.

Changed in mir:
status: Fix Committed → In Progress
Daniel van Vugt (vanvugt) wrote :

As if we weren't already past trying to squeeze this fix into saucy I hit another roadblock. It seems the Nexus 4 only has one pixel format (according to Mir) and that's with an alpha channel. This means the occlusion testing proposed will never be used on N4. At least not without further enhancements to Mir and/or libhybris.

PS Jenkins bot (ps-jenkins) wrote :

Fix committed into lp:~mir-team/mir/development-branch at revision None, scheduled for release in mir, milestone Unknown

Changed in mir:
status: In Progress → Fix Committed
Changed in mir:
status: Fix Committed → In Progress
Changed in mir:
milestone: none → 0.0.17
Changed in mir:
status: In Progress → Fix Committed
Daniel van Vugt (vanvugt) wrote :

Please note; just because the fix for this bug has landed (in trusty), doesn't mean it's turned on yet.

To be functional on Nexus 4 at least, we also need fixes for platform-api and bug 1240833.

Daniel van Vugt (vanvugt) wrote :

See also this branch for significant performance improvements on the way:
https://code.launchpad.net/~vanvugt/mir/fix-r1049-regressions/+merge/191776

Changed in mir (Ubuntu):
assignee: nobody → Daniel van Vugt (vanvugt)
importance: Undecided → High
status: New → Fix Committed
Changed in mir:
status: Fix Committed → Fix Released
Launchpad Janitor (janitor) wrote :
Download full text (5.1 KiB)

This bug was fixed in the package mir - 0.1.0+14.04.20131028-0ubuntu1

---------------
mir (0.1.0+14.04.20131028-0ubuntu1) trusty; urgency=low

  [ Daniel van Vugt ]
  * Bump version 0.1.0
  * Add method for testing if Rectangle::contains(Rectangle), which is
    the basis of any occlusion detection. (LP: #1227739)
  * Add support for traversing the Scene from front surface to back.
    This is required for occlusion detection at least (coming soon). .
    (LP: #1227739)
  * Optimization: Turn off blending for surfaces that are not blendable.
    On some systems this can have a noticeable performance benefit.
  * Avoid rendering surfaces that are fully hidden by other surfaces.
    This is particularly important for mobile device performance. (LP:
    #1227739) . (LP: #1227739)
  * Remove orphaned tags, which appear to have come from the Compiz
    project (!?) Add tags for the most recent releases up to 0.0.16. No
    files changed, only tags.
  * Fix significant performance issues LP: #1241369 / LP: #1241371, and
    probably more(!) Added regression test to catch such regressions and
    revert the offending commit r1049. (LP: #1241369, #1241371)

  [ Brandon Schaefer ]
  * When Scroll events come in we don't keep around the android vscroll
    hscroll data. Store it now. (LP: #1233089)

  [ Albert Astals ]
  * Fix mismatched free() / delete / delete [] reported by valgrind

  [ Alexandros Frantzis ]
  * server: Extend server status (formerly pause/resume) listener to
    report "started" events This change is needed by users of
    libmirserver, so they can properly synchronize external interactions
    with the server. (LP: #1239876)
  * graphics,examples: Don't enable more outputs than supported when
    changing the display configuration. (LP: #1217877)
  * client: Allow clients to call API functions after a connection break
    has been detected When a client tries to call an API function after
    a connection break has been detected in a previous API call, the
    client blocks in the new call. This happens because in
    MirSocketRpcChannel::notify_disconnected() the pending RPC calls are
    not forced to complete, since the channel has already been marked as
    'disconnected' by the failure in the previous call. Note that if the
    break is first detected while calling an API function, then that
    call doesn't block, since this is the first time we call
    MirSocketRpcChannel::notify_disconnected() and the pending RPC calls
    are forced to complete. This commit solves this problem by always
    forcing requests to complete when a communication failure occurs,
    even if a disconnection has already been handled. This is preferred
    over the alternative of manually calling the completion callback in
    a try-catch block when calling an RPC method because of: 1.
    Correctness: In case the communication problem first occurs in that
    call, the callback will be called twice, once by
    notify_disconnected() and once manually. 2. Consistency: The
    callback is called from one place regardless of whether the
    communication problem is first detected during that call or not.
    (LP: #1201436)
  * graphics: Improve si...

Read more...

Changed in mir (Ubuntu):
status: Fix Committed → Fix Released
Ricardo Mendoza (ricmm) on 2013-12-04
Changed in platform-api:
assignee: nobody → Ricardo Mendoza (ricmm)
status: Triaged → In Progress
Omer Akram (om26er) wrote :

So, is the fix in platform-api still needed for this bug to be fixed on Nexus 4 ?

Daniel van Vugt (vanvugt) wrote :

Just checked lp:platform-api. It appears the required fix (comment #3) has not been implemented yet.

Mir's occlusion optimizations won't work until platform-api is fixed.

Changed in platform-api:
status: In Progress → Triaged
Changed in platform-api:
status: Triaged → In Progress
assignee: Ricardo Mendoza (ricmm) → Andreas Pokorny (andreas-pokorny)
Changed in unity-mir:
status: Triaged → In Progress
assignee: nobody → Alberto Aguirre (albaguirre)
kevin gunn (kgunn72) on 2014-02-20
Changed in unity-mir (Ubuntu):
status: New → Fix Released
status: Fix Released → In Progress
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package unity-mir - 0.2+14.04.20140221.1-0ubuntu1

---------------
unity-mir (0.2+14.04.20140221.1-0ubuntu1) trusty; urgency=low

  [ Michael Terry ]
  * When part of a greeter shell, use a transparent background instead
    of an opaque one.

  [ Gerry Boland ]
  * Add visible property to Application, so can show/hide all app
    surfaces

  [ Ubuntu daily release ]
  * New rebuild forced

  [ Alberto Aguirre ]
  * Set the visibility state on the mir surface attached to the
    application during suspend/resume states. By setting the visibility
    state (hide) of the mir surface during an appilcation suspend state,
    mir can avoid compositing the surface even regardless of opaqueness
    and alpha pixel format. fixes: lp: #1227739 (LP: #1227739)
 -- Ubuntu daily release <email address hidden> Fri, 21 Feb 2014 17:07:41 +0000

Changed in unity-mir (Ubuntu):
status: In Progress → Fix Released
Changed in unity-mir:
status: In Progress → Fix Committed
Changed in ubuntu-power-consumption:
status: New → Fix Released
Gerry Boland (gerboland) on 2014-05-07
Changed in unity-mir:
status: Fix Committed → Fix Released

no longer valid for platform api

Changed in platform-api:
status: In Progress → Invalid
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers