Mir

frontend::SessionMediator should not bypass the shell::Shell to create buffer streams for surfaces

Bug #1580555 reported by Alan Griffiths
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mir
Won't Fix
Medium
Unassigned

Bug Description

Mir is designed for the shell to control placement and sizing of surfaces and buffer streams within the model. With Mir-0.22 this control is partially bypassed in SessionMediator::create_surface() by creating a buffer stream before the shell gets to place the surface.

One place where this causes problems is with the miral-kiosk "splash" internal client. This arbitrarily sets a size of 0x0 as it "knows" that a fullscreen surface will be appropriately sized by the window manager.

Because the buffer stream is created from the request parameters, rather than from the placed parameters this leads to an attempt to mmap() a zero sized buffer, which fails.

Revision history for this message
Kevin DuBois (kdub) wrote :

BufferStreams are client-controlled, so the shell gets to say how big a surface is, but it doesn't get to specify the size of any particular MirBuffer or MirBufferStream.

The problem here is that the client can create a stream with size X, then create a surface with size X, and then the shell can say that the surface is actually size Y. The client would then have to resize its MirBufferStream (or MirBuffers) to be size Y so that no scaling is needed. Needs some thought on how to resolve.

Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

Looking closer at SessionMediator::create_surface() there is at least one issue here:

The path with "request->stream_size() > 0" doesn't set buffer_stream_id to a meaningful value - although it is later used. Unfortunately this path is not exercised by our tests and examples so this has gone unnoticed.

Changed in mir:
status: New → In Progress
milestone: none → 0.24.0
assignee: nobody → Alan Griffiths (alan-griffiths)
importance: Undecided → Medium
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

Leaving this for now - there are ongoing changes in this area, I have higher priorities and there's an easy workaround.

Changed in mir:
assignee: Alan Griffiths (alan-griffiths) → nobody
status: In Progress → Confirmed
milestone: 0.24.0 → none
status: Confirmed → Triaged
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

This is largely to become moot, and the rest of the problem is dealt with by bug 1667690

Changed in mir:
status: Triaged → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.