<p dir="ltr"><br>
On Mar 7, 2014 1:14 PM, "Bryce W. Harrington" <<a href="mailto:b.harrington@samsung.com">b.harrington@samsung.com</a>> wrote:<br>
><br>
> On Fri, Mar 07, 2014 at 11:31:16AM -0600, Jason Ekstrand wrote:<br>
> > > > + If the size of the presented surface changes, the resulting output<br>
> > > > + is undefined. The compositor may attempt to change the output<br>
> > mode<br>
> > > > + to compensate. However, there is no guarantee that a suitable<br>
> > mode<br>
> > > > + will be found and the client has no way to be notified of success<br>
> > > > + or failure.<br>
> > ><br>
> > > Probably a stupid question but could the presented surface be locked to<br>
> > > prevent it from changing size?<br>
> ><br>
> > Not really. The client simply attaches buffers of some size or another and<br>
> > the server has to take what the client gives it. That patagraph is<br>
> > intended expressly to address this by telling the client "Don't do that!"<br>
> > under threat of undefined results.<br>
><br>
> Guess I'm thinking more from the user perspective of having downloaded<br>
> some random client app off the internet that ignores this advice.<br>
><br>
> Presumably at least the damage is limited to the client's window. I<br>
> guess that's my main concern - that some random app doesn't leave the<br>
> user's system borked up.<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>
> > > This doesn't actually define what the framerate parameter does. Does it<br>
> > > do something if the framerate drops too low? Or does it cap it to not<br>
> > > go above a certain level?<br>
> ><br>
> > The output mode is given by three parameters: width, height, and<br>
> > framerate. The framerate should be given in mHz (same as in<br>
> > wl_output.mode) but maybe I should specify that. If the compositor states<br>
> > that the given output supports, for instance 1024x768@60Hz and 1024x768@50Hz,<br>
> > this lets the client specify which it would like. In most cases, the<br>
> > client won't care which is why I have the 0 option. However, providing a<br>
> > framerate option allows the client more-or-less full control over the<br>
> > output mode.<br>
><br>
> Ah, that's clearer. Think I was confused by the word target; 'desired<br>
> framerate' would maybe be clearer.<br>
><br>
> So for your examples, if 50Hz was desired, then you'd pass<br>
> framerate="50000"?<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>
> > ><br>
> > > This paragraph is a bit confusing. Is buffer_scale a scaling factor?<br>
> ><br>
> > Wayland provides an integer scale parameter for each output that tells the<br>
> > client that the given output is actually scaled down. This is for HiDPI<br>
> > displays where you may want 2 or 3 physical pixels per logical pixel. If<br>
> > the output has a scale factor of 3, that means that every surface on that<br>
> > output will be scaled up by a factor of 3. The buffer_scale option allows<br>
> > the client to compensate in the same way as the buffer_transform option<br>
> > allows it to compensate for a rotated output. If a surface has a<br>
> > buffer_scale of 3 and a 600x900 buffer, then the size of the surface is<br>
> > only 200x300 but it will be pixel-for-pixel exact on the output that's<br>
> > scaled by 3.<br>
> ><br>
> > The problem here is what to do with the buffer_scale factor. In the<br>
> > example above, the client is providing a 600x900 buffer but the surface is<br>
> > only 200x300. Which size should the compositor make the output? This gets<br>
> > even stickier because the output modes provided by wl_output are given in<br>
> > physical pixels without any transform or scale. As given, I chose to<br>
> > explicitly not solve this problem and let the compositor choose. In<br>
> > practice, I expect that most compositors won't provide any scale factor on<br>
> > the output and the client just provides the surface size it wants.<br>
> ><br>
> > Perhaps this isn't the best option. Would it be better defined if we just<br>
> > stated that the compositor will try to match the output size to the surface<br>
> > size? Then warn clients that the wl_output.scale factor may still get<br>
> > applied. This may be a better option since the client will have to handle<br>
> > the tramsform in a similar way.<br>
> ><br>
> > Ultimately, if the client wants to control modesetting it should be either<br>
> > a) using the same size and transform as the output or b) providing a<br>
> > surface in output-space (after having transformed the mode from the<br>
> > compositor) and letting the compositor transform/scale it. I'm not really<br>
> > sure what's best to do here honestly. Suggestions are appreciated. I'll<br>
> > think on it more.<br>
><br>
> Are the use cases here just HiDPI and fullscreen games? If there are<br>
> other use cases they might shed light on the scope of the problem.<br>
> Would video players use it?<br>
><br>
> In particular is there any use case for having 1 physical pixel per N<br>
> logical pixels? If there is, then perhaps let buffer_scale just be the<br>
> scaling factor, and have a separate parameter for toggling scaling on or<br>
> off? Documentation-wise, having two parameters is going to be easier to<br>
> explain I think.</p>
<p dir="ltr">I think there's some confusion as to the target clientel here. I don't intend for games of other "normal" apps to be running on this protocol. The modesetting part in particular is inteded mainly for running a compositor embedded inside another one. Take another look at the 0'th patch in the series. I cover the use-cases in detail there.</p>
<p dir="ltr">Really, the question here isn't about turning scaling on/off, it's about what to do with the wl_surface.buffer_scale that we already have. If wl_surface.buffer_scale == wl_output.scale then it's obvious. If this is not the case, it's not 100% clear what the right thing to do is here.</p>
<p dir="ltr">><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"<br>
> > 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<br>
> > requests<br>
> > > > + </description><br>
> > > > + <entry name="invalid_method" value="0" summary="present_method<br>
> > 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>
> > > receiving<br>
> > ><br>
> > > > + wl_fullscreen_shell_mode_feedback object.<br>
> > > > + </description><br>
> > > > + </event><br>
> > > > + <event name="mode_failed"><br>
> > > > + <description summary="mode switch failed"><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>
> > > Would it be worth returning these two failure modes as distinct events?<br>
> > > Might help client developers in debugging if nothing else.<br>
> > ><br>
> > > If lets say a game client wanted to do a mode change, would it make<br>
> > > sense for them to do a series of present_surface_for_mode calls and<br>
> > > keep trying different modes while they receive mode_failed events?<br>
> > > Or is there a way for them to query for allowed modes that they can<br>
> > > select from?<br>
> ><br>
> > Ok, first off games aren't really the intended clientel. I don't think<br>
> > this is really an issue. Allow me to elaborate. I expect that the<br>
> > compositor will have one of two basic modes of operation. First, is to<br>
> > allow you to set any mode at all. This is likely to be the case for<br>
> > streaming/recording compositors where there is no physical output. Second<br>
> > is that it has some list of modes and allows you to select one. In the<br>
> > first case, it should always succeed unless the compositor has some rule<br>
> > such as "you can only set this once".<br>
><br>
> Right, or invalid modes... -1x-1, 1000000x1000000, etc.<br>
><br>
> > In the second case, you can go ahead<br>
> > and try to set whatever you want, but it might not work. However, if it's<br>
> > an advertised mode and the transform and scale match (see above) you should<br>
> > expect it to work.<br>
><br>
> Gotcha, yeah so long as there's a list available then we can expect the<br>
> client to constrain itself to those. How does the client request this<br>
> list?<br>
><br>
> > If a client wants to run at some exotic resolution, I expect it to try that<br>
> > and, if it fails, pick the best resolution from the advertised modes and<br>
> > then try that.<br>
> ><br>
> > I still want to leave the compositor a bit of a way out if there's a<br>
> > problem. Perhaps "does not allow mode switches at this time" is a bad way<br>
> > to put it.<br>
><br>
> It suggests the client could sleep(N) and try again. If that is an<br>
> appropriate way to handle it then the wording's fine. If it's not going<br>
> to be allowed for the given client, window, or surface at all, then<br>
> perhaps a more definitive wording would help the client.</p>
<p dir="ltr">Yeah, I need to reword this. I'll get it patched up.</p>
<p dir="ltr">><br>
> Bryce<br>
><br>
</p>