On Thu, 9 Sep 2021 17:29:21 +0000
David Deyo <dd...@tireprofiles.com> wrote:

> Hello all,
> 
> I am trying to track down a  bug I’ve either created or revealed.
> 
> I’ve implemented a patch to Weston-9 to allow me to rotate my display.
> 
> It mostly works.  Occasionally it fails and crashes because the new
> screen size (1315) requested is too large.
> 
> Does anyone know where would I find the functions below, like
> wl_shm_pool@21.create_buffer<mailto:wl_shm_pool@21.create_buffer>?

Hi,

that particular one is implemented in
https://gitlab.freedesktop.org/wayland/wayland/-/blob/bf98c1a8f2872d3da2be895d9a7f56ada65d43d5/src/wayland-shm.c#L174

That function is plugged into struct wl_shm_pool_interface in
shm_create_pool(). That one in turn is plugged into struct
wl_shm_interface in bind_shm(), which gets called for wl_registry.bind
request when the wl_shm global is the argument.

Weston installs this machinery by calling wl_display_init_shm().

> 
> I’ve searched through the git folder of weston.  I’ve been able to
> find weston_desktop_xdg_surface_protocol_set_window_geometry, but
> when I try a simple printf, I never get it in stdout. But, I can put
> a wl_resource_post_error in the same place and it definitely crashes.
>  How would I add a log statement and actually get it?

I don't see why the printf would not come through, but in Weston it's
often better to use weston_log() instead.

stdout is buffered - maybe it's not flushed on crash? Hence preferring
strerr for ad hoc printf instead.

> 
> I’ve set WAYLAND_DEBUG to 1 and I believe below is the protocol log.
> 
> [2077634.996] wl_callb...@21.done(156952735)
> [2077645.484]  -> wl_shm@9.create_pool(new id wl_shm_pool@21, fd 10, 10099200)
> [2077645.654]  -> wl_shm_pool@21.create_buffer(new id wl_buffer@15, 0, 1920, 
> 1315, 7680, 0)
> [2077673.186]  -> wl_surface@27.attach(wl_buffer@15, 0, 0)
> [2077673.303]  -> wl_surface@27.set_buffer_scale(1)
> [2077673.320]  -> wl_surface@27.damage(0, 0, 1920, 1315)
> [2077673.350]  -> xdg_toplevel@31.set_min_size(686, 1315)
> [2077673.369]  -> xdg_toplevel@31.set_max_size(0, 0)
> [2077673.388]  -> xdg_surface@29.set_window_geometry(0, 0, 1920, 1315)
> [2077673.419]  -> wl_compositor@4.create_region(new id wl_region@23)
> [2077673.437]  -> wl_reg...@23.add(0, 0, 1920, 1315)
> [2077673.465]  -> wl_surface@27.set_opaque_region(wl_region@23)
> [2077673.479]  -> wl_region@23.destroy()
> [2077673.492]  -> wl_compositor@4.create_region(new id wl_region@20)
> [2077673.509]  -> wl_reg...@20.add(-10, -10, 1940, 1335)
> [2077673.537]  -> wl_surface@27.set_input_region(wl_region@20)
> [2077673.551]  -> wl_region@20.destroy()
> [2077673.611]  -> wl_surface@27.frame(new id wl_callback@30)
> [2077673.659]  -> wl_surface@27.commit()
> [2077678.019] wl_display@1.delete_id(26)
> [2077678.091] wl_display@1.delete_id(3)
> [2077678.107] wl_display@1.delete_id(23)
> [2077678.121] wl_display@1.delete_id(20)
> [2077678.134] wl_display@1.error(xdg_wm_base@18, 4, "xdg_surface buffer (1920 
> x 1315) is larger than the configured fullscreen state (1920 x 1088)")

You should be getting a configure event with 1920x1088 in the client.
Then you need to use that size when you ack the configuration.

However, this is a protocol error sent to the client. It doesn't crash
the compositor per se.


Thanks,
pq

Attachment: pgpKnOhMpOaXN.pgp
Description: OpenPGP digital signature

Reply via email to