[v3] protocol: warn clients about some wl_output properties

Submitted by Simon Ser on Oct. 26, 2018, 9:13 a.m.

Details

Message ID fewGJOCzr4J_7PkCPBaU1xc_TNtJC66j2RfdD4vzphjMDnp9QOJMJHLMmw2OsYRGBTFkgRzgbH-uBSlXzQwkAXKwgMMR5pV_NEeyOowNy1U=@emersion.fr
State Accepted
Commit 8c121e10178070f23a06c438a292703fe76d5c06
Headers show
Series "protocol: warn clients about some wl_output properties" ( rev: 3 ) in Wayland

Not browsing as part of any series.

Commit Message

Simon Ser Oct. 26, 2018, 9:13 a.m.
All wl_output properties don't always make sense for all
compositors.

Some compositors might not implement a "global compositor space",
(e.g. 3D compositors) in which case properties like x and y don't
make sense.

Some compositors might expose virtual outputs, in which case modes,
make and model are not relevant.

In a lot of these situations, information from xdg_output is better
suited.

Compositors also expose output refresh rate, which shouldn't be used
for synchronization purposes.

Signed-off-by: Simon Ser <contact@emersion.fr>
---

Thoughts?

Changes from v2 to v3: forgot to mention wl_surface.frame.

 protocol/wayland.xml | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/protocol/wayland.xml b/protocol/wayland.xml
index 141038b..9a841f8 100644
--- a/protocol/wayland.xml
+++ b/protocol/wayland.xml
@@ -2402,6 +2402,13 @@ 
 
 	The physical size can be set to zero if it doesn't make sense for this
 	output (e.g. for projectors or virtual outputs).
+
+	Note: wl_output only advertises partial information about the output
+	position and identification. Some compositors, for instance those not
+	implementing a desktop-style output layout or those exposing virtual
+	outputs, might fake this information. Instead of using x and y, clients
+	should use xdg_output.logical_position. Instead of using make and model,
+	clients should use xdg_output.name and xdg_output.description.
       </description>
       <arg name="x" type="int"
 	   summary="x position within the global compositor space"/>
@@ -2446,7 +2453,17 @@ 
 	the output device. This is not necessarily the same as
 	the output size in the global compositor space. For instance,
 	the output may be scaled, as described in wl_output.scale,
-	or transformed, as described in wl_output.transform.
+	or transformed, as described in wl_output.transform. Clients
+	willing to retrieve the output size in the global compositor
+	space should use xdg_output.logical_size instead.
+
+	Clients should not use the refresh rate to schedule frames. Instead,
+	they should use the wl_surface.frame event or the presentation-time
+	protocol.
+
+	Note: this information is not always meaningful for all outputs. Some
+	compositors, such as those exposing virtual outputs, might fake the
+	refresh rate or the size.
       </description>
       <arg name="flags" type="uint" enum="mode" summary="bitfield of mode flags"/>
       <arg name="width" type="int" summary="width of the mode in hardware units"/>

Comments

On Friday, October 26, 2018 11:13 AM, Simon Ser <contact@emersion.fr> wrote:
> Compositors also expose output refresh rate, which shouldn't be used
> for synchronization purposes.

I'd like to bump this patch, because people apparently do use wl_output's
refresh rate for synchronization purposes in Firefox [1]. I think it
would be a good thing to make sure people are aware they should be using
frame callbacks instead.

[1]: https://bugzilla.mozilla.org/show_bug.cgi?id=1515448#c13
Hi Simon,

On Mon, 18 Feb 2019 at 16:22, Simon Ser <contact@emersion.fr> wrote:
> On Friday, October 26, 2018 11:13 AM, Simon Ser <contact@emersion.fr> wrote:
> > Compositors also expose output refresh rate, which shouldn't be used
> > for synchronization purposes.
>
> I'd like to bump this patch, because people apparently do use wl_output's
> refresh rate for synchronization purposes in Firefox [1]. I think it
> would be a good thing to make sure people are aware they should be using
> frame callbacks instead.

Thanks a lot for bumping this. Patch is:
Reviewed-by: Daniel Stone <daniels@collabora.com>

Cheers,
Daniel
On Mon, Feb 18, 2019 at 04:28:18PM +0000, Daniel Stone wrote:
> Hi Simon,
> 
> On Mon, 18 Feb 2019 at 16:22, Simon Ser <contact@emersion.fr> wrote:
> > On Friday, October 26, 2018 11:13 AM, Simon Ser <contact@emersion.fr> wrote:
> > > Compositors also expose output refresh rate, which shouldn't be used
> > > for synchronization purposes.
> >
> > I'd like to bump this patch, because people apparently do use wl_output's
> > refresh rate for synchronization purposes in Firefox [1]. I think it
> > would be a good thing to make sure people are aware they should be using
> > frame callbacks instead.
> 
> Thanks a lot for bumping this. Patch is:
> Reviewed-by: Daniel Stone <daniels@collabora.com>

This is

Reviewed-by: Jonas Ådahl <jadahl@gmail.com>

too.


Jonas

> 
> Cheers,
> Daniel
> _______________________________________________
> wayland-devel mailing list
> wayland-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/wayland-devel