<div dir="ltr"><p dir="ltr">Jonas, thanks for reviewing.<br>
On Feb 24, 2014 4:03 PM, "Jonas Ådahl" <<a href="mailto:jadahl@gmail.com" target="_blank">jadahl@gmail.com</a>> wrote:<br>
><br>
> On Thu, Feb 13, 2014 at 10:37:53PM -0600, Jason Ekstrand wrote:<br>
> > The following is yet another take on the fullscreen shell protocol.<br>
> > Previous versions more-or-less followed the approach taken in wl_shell.<br>
> > This version completely reworks the concept. In particular, the protocol<br>
> > is split into two use-cases. The first is that of a simple client that<br>
> > wants to present a surface or set of surfaces possibly with some scaling.<br>
> > This happens through the present_surface request which looks similar to<br>
> > that of wl_shell only without the modesetting.<br>
> ><br>
> > The second use-case is of a client that wants more control over the<br>
> > outputs. In this case, the client uses the present_surface_for_mode<br>
> > request to present the surface at a particular output mode. This request<br>
> > provides a more-or-less atomic modeset operation. If the compositor can<br>
> > satisfy the requested mode, then the mode is changed and the new surface is<br>
> > presented. Otherwise, the compositor harmlessly falls back to the<br>
> > previously presented surface and the client is informed that the switch<br>
> > failed. This way, the surface is either displayed correctly or not at all.<br>
> > Of course, a client is free to call present_surface_for_mode with the<br>
> > currently presented surface and hope for the best. However, this may<br>
> > result in strange behavior and there is no reliable fallback if the mode<br>
> > switch fails.<br>
> ><br>
> > In particular, I would like feedback on the modesetting portion of this<br>
> > protocol. This is particularly targetted at compositors that want to run<br>
> > inside weston or some other fullscreen compositor. In the next week or so,<br>
> > I will attempt to implement all this in weston and see how well it works.<br>
> > However, I would also like to know how well this will work for other<br>
> > compositors such as KWin or Hawaii.<br>
><br>
> Hi Jason,<br>
><br>
> Some follow up comments from last round inline.<br>
><br>
> ><br>
> > Thanks for your feedback,<br>
> > --Jason Ekstrand<br>
> ><br>
> > ===== Protocol follows: =====<br>
> ><br>
> > <protocol name="fullscreen_shell"><br>
> > <interface name="wl_fullscreen_shell" version="1"><br>
> > <description summary="Displays a single surface per output"><br>
> > Displays a single surface per output.<br>
> ><br>
> > This interface provides a mechanism for a single client to display<br>
> > simple full-screen surfaces. While there technically may be multiple<br>
> > clients bound to this interface, only one of those clients should be<br>
> > shown at a time.<br>
> ><br>
> > To present a surface, the client uses either the present_surface or<br>
> > present_surface_for_mode requests. Presenting a surface takes effect<br>
> > on the next wl_surface.commit. See the individual requests for<br>
> > details about scaling and mode switches.<br>
> ><br>
> > The client can have at most one surface per output at any time.<br>
> > Requesting a surface be presented on an output that already has a<br>
> > surface replaces the previously presented surface. Presenting a null<br>
> > surface removes its content and effectively disables the output.<br>
> > Exactly what happens when an output is "disabled" is<br>
> > compositor-specific. The same surface may be presented multiple<br>
> > outputs simultaneously.<br>
> > </description><br>
> ><br>
> > <enum name="present_method"><br>
> > <description summary="different method to set the surface fullscreen"><br>
> > Hints to indicate to the compositor how to deal with a conflict<br>
> > between the dimensions of the surface and the dimensions of the<br>
> > output. The compositor is free to ignore this parameter.<br>
> > </description><br>
> > <entry name="default" value="0" summary="no preference, apply default policy"/><br>
> > <entry name="center" value="1" summary="center the surface on the output"/><br>
> > <entry name="zoom" value="2" summary="scale the surface, preserving aspect ratio, to the largest size that will fit on the output" /><br>
> > <entry name="zoom_crop" value="3" summary="scale the surface, preserving aspect ratio, to fully fill the output cropping if needed" /><br>
> > <entry name="stretch" value="4" summary="scale the surface to the size of the output ignoring aspect ratio" /><br>
> > </enum><br>
> ><br>
> > <request name="present_surface"><br>
> > <description summary="present surface for display"><br>
> > Present a surface on the given output.<br>
> ><br>
> > If the output is null, the compositor will present the surface on<br>
> > whatever display (or displays) it thinks best. In particular, this<br>
> > may replace any or all surfaces currently presented so it should<br>
> > not be used in combination with placing surfaces on specific<br>
> > outputs.<br>
> ><br>
> > The method parameter is a hit to the compositor for how the surface<br>
> > is to be presented. In particular, it tells the compostior how to<br>
> > handle a size mismatch between the presented surface and the<br>
> > output. The compositor is free to ignore this parameter.<br>
> ><br>
> > The "zoom", "zoom_crop", and "stretch" methods imply a scaling<br>
> > operation on the surface. This will override any kind of output<br>
> > scaling, so the buffer_scale property of the surface is effectively<br>
> > ignored.<br>
> > </description><br>
> > <arg name="surface" type="object" interface="wl_surface"/><br>
><br>
> I think you might be missing an 'allow-null="true"' parameter here, as<br>
> you above specify that presenting a null-surface on non-null output<br>
> would "disable" that output.</p>
<p dir="ltr">Yes, it does. I have it fixed locally.</p>
<p dir="ltr">><br>
> It might also be a good idea to add a note that presenting a<br>
> null-surface on a null-output should raise a protocol error as I assume<br>
> it should.</p>
<p dir="ltr">Nope, that's fine. It should clear whatever default stuff you've presented. In my implementation, it clears everything.</p>
<p dir="ltr">><br>
> Regarding present_surface_for_mode, it is unclear if it is expected<br>
> that it will handle null-surface (if you'd add allow-null="true") as one<br>
> need to provide a frame rate, while the description doesn't say anything<br>
> of what method of presenting has the described effect.</p>
<p dir="ltr">Yeah. You could make null here the same as the other or not accept null. From a client perspective it shouldn't make much difference whether they call one or the other. I think we can make allow-null=false for present_surface_for_mode for now. If we ever have reason to change that we can later.<br>
</p>
<p dir="ltr">><br>
><br>
> Jonas<br>
><br>
> > <arg name="method" type="uint"/><br>
> > <arg name="output" type="object" interface="wl_output" allow-null="true"/><br>
> > </request><br>
> ><br>
> > <request name="present_surface_for_mode"><br>
> > <description summary="present surface for display at a particular mode"><br>
> > Presents a surface on the given output for a particular mode.<br>
> ><br>
> > If the current size of the output differs from that of the surface,<br>
> > the compositor will attempt to change the size of the output to<br>
> > match the surface. The result of the mode-swith operation will be<br>
> > returned via the provided wl_fullscreen_shell_mode_feedback object.<br>
> ><br>
> > If the current output mode matches the one requested or if the<br>
> > compositor successfully switches the mode to match the surface,<br>
> > then the mode_successfull event will be sent and the output will<br>
> > contain the contents of the given surface. If the compositor<br>
> > cannot match the output size to the surface size, the mode_failed<br>
> > will be sent and the output will contain the contents of the<br>
> > previously presented surface (if any). If another surface is<br>
> > presented on the given output before either of these has a chance<br>
> > to happen, the present_canceled event will be sent.<br>
> ><br>
> > If the size of the presented surface changes, the resulting output<br>
> > is undefined. The compositor may attempt to change the output mode<br>
> > to compensate. However, there is no guarantee that a suitable mode<br>
> > will be found and the client has no way to be notified of success<br>
> > or failure.<br>
> ><br>
> > The framerate parameter specifies the target framerate for the<br>
> > output. The compositor is free to ignore this parameter. A value<br>
> > of 0 indicates that the client has no preference.<br>
> ><br>
> > If the surface has a buffer_scale greater than 1, the compositor<br>
> > may choose a mode that matches either the buffer size or the<br>
> > surface size. In either case, the surface will fill the output.<br>
> > </description><br>
> > <arg name="surface" type="object" interface="wl_surface"/><br>
> > <arg name="output" type="object" interface="wl_output"/><br>
> > <arg name="framerate" type="int"/><br>
> > <arg name="feedback" type="new_id" interface="wl_fullscreen_shell_mode_feedback"/><br>
> > </request><br>
> ><br>
> > <enum name="error"><br>
> > <description summary="wl_fullscreen_shell error values"><br>
> > These errors can be emitted in response to wl_fullscreen_shell requests<br>
> > </description><br>
> > <entry name="invalid_method" value="0" summary="present_method is not known"/><br>
> > </enum><br>
> > </interface><br>
> ><br>
> > <interface name="wl_fullscreen_shell_mode_feedback" version="1"><br>
> > <event name="mode_successful"><br>
> > <description summary="mode switch succeeded"><br>
> > This event indicates that the attempted mode switch operation was<br>
> > successful. A surface of the size requested in the mode switch<br>
> > will fill the output without scaling.<br>
> ><br>
> > Upon recieving this event, the client should destroy the<br>
> > wl_fullscreen_shell_mode_feedback object.<br>
> > </description><br>
> > </event><br>
> > <event name="mode_failed"><br>
> > <description summary="mode switch succeeded"><br>
> > This event indicates that the attempted mode switch operation<br>
> > failed. This may be because the requested output mode is not<br>
> > possible or it may mean that the compositor does not want to allow<br>
> > mode switches at this time.<br>
> ><br>
> > Upon recieving this event, the client should destroy the<br>
> > wl_fullscreen_shell_mode_feedback object.<br>
> > </description><br>
> > </event><br>
> > <event name="present_canceled"><br>
> > <description summary="mode switch succeeded"><br>
> > This event indicates that the attempted mode switch operation was<br>
> > canceled. Most likely this is because the client requested a<br>
> > second mode switch before the first one completed.<br>
> ><br>
> > Upon recieving this event, the client should destroy the<br>
> > wl_fullscreen_shell_mode_feedback object.<br>
> > </description><br>
> > </event><br>
> > </interface><br>
> > </protocol><br>
> > _______________________________________________<br>
> > wayland-devel mailing list<br>
> > <a href="mailto:wayland-devel@lists.freedesktop.org" target="_blank">wayland-devel@lists.freedesktop.org</a><br>
> > <a href="http://lists.freedesktop.org/mailman/listinfo/wayland-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/wayland-devel</a><br>
</p>
</div>