<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size: 12pt; color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;">
I observe that the IDs used to denote some wl_buffer protocol objects created by a server-side factory in the $WAYLAND_DEBUG trace, differ between the moment they're first announced in the callback event and the later use-sites when the objects are passed to
subsequent Wayland protocol method invocations.
<div><br>
</div>
<div>For example, using weston-simple-dmabuf-egl normally uses "non-immediate" allocation of wl_buffers through the zwp_linux_dmabuf_v1 protocol extension. One distinguishing feature of this non-immediate technique is that the ID of the newly-built protocol
object is not known at the time the method to request creation is made. The compositor is expected to supply it later in an asynchronous event.</div>
<div><br>
</div>
<div>This all works fine, but I notice in the log output that the ID of the newly built object is different at point it's first announced to the client:</div>
<div><br>
</div>
<div>
<div><span style="font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;"> </span>[2902569.971] -> zwp_linux_explicit_synchronization_v1@6.get_synchronization(new
id zwp_linux_surface_synchronization_v1@10, wl_surface@3)</div>
<div><span style="font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;"> </span>[2902570.062] -> zwp_linux_dmabuf_v1@5.create_params(new
id zwp_linux_buffer_params_v1@11)</div>
<div><span style="font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;"> </span>[2902570.076] -> zwp_linux_buffer_params_v1@11.add(fd
8, 0, 0, 1024, 16777216, 2)</div>
<div><span style="font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;"> </span>[2902570.095] -> zwp_linux_buffer_params_v1@11.create(256,
256, 875713112, 1)</div>
<div><span style="font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;"> </span>[2902572.072] -> zwp_linux_dmabuf_v1@5.create_params(new
id zwp_linux_buffer_params_v1@12)</div>
<div><span style="font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;"> </span>[2902572.105] -> zwp_linux_buffer_params_v1@12.add(fd
10, 0, 0, 1024, 16777216, 2)</div>
<div><span style="font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;"> </span>[2902572.124] -> zwp_linux_buffer_params_v1@12.create(256,
256, 875713112, 1)</div>
<div><span style="font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;"> </span>[2902572.240] -> zwp_linux_dmabuf_v1@5.create_params(new
id zwp_linux_buffer_params_v1@13)</div>
<div><span style="font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;"> </span>[2902572.249] -> zwp_linux_buffer_params_v1@13.add(fd
12, 0, 0, 1024, 16777216, 2)</div>
<div><span style="font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;"> </span>[2902572.262] -> zwp_linux_buffer_params_v1@13.create(256,
256, 875713112, 1)</div>
<span style="font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;"> </span>...</div>
<div>
<div><span style="font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;"> </span>[2902576.893] zwp_linux_buffer_params_v1@11.created(new
id wl_buffer@2372643520)</div>
<div><span style="font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;"> </span>[2902576.901] -> zwp_linux_buffer_params_v1@11.destroy()</div>
<div><span style="font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;"> </span>[2902576.906] zwp_linux_buffer_params_v1@12.created(new
id wl_buffer@2372643856)</div>
<div><span style="font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;"> </span>[2902576.913] -> zwp_linux_buffer_params_v1@12.destroy()</div>
<div><span style="font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;"> </span>[2902576.918] zwp_linux_buffer_params_v1@13.created(new
id wl_buffer@2372644240)</div>
<div><span style="font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;"> </span>[2902576.924] -> zwp_linux_buffer_params_v1@13.destroy()</div>
<br>
</div>
<div>So, here are the ID's of the buffers built using the non-immediate mode:</div>
<div><br>
</div>
<div>
<ul style="margin-bottom:0px; margin-top:0px">
<li>wl_buffer@2372643520 (0<span>x8d6baac0)</span></li><li>wl_buffer@2372643856 (<span>0x8d6bac10)</span></li><li>wl_buffer@2372644240 (<span>0x8d6bad90)</span></li></ul>
</div>
<div><br>
</div>
<div>These ID's look suspicious to begin with. They do not have ID's in the usual range of server-allocated object ID's (these are supposed to begin at 0xff000000).</div>
<div><br>
</div>
<div>But then later when the application uses these objects as parameter to subsequent requests, the ID's are printed differently:</div>
<div><br>
</div>
<div><span> [2902577.702] -> wl_surface@3.attach(wl_buffer@4278190080, 0, 0)</span><br>
</div>
<div><span> ...</span></div>
<div><span><span> [3183676.812] -> wl_surface@3.attach(wl_buffer@4278190081, 0, 0)</span><br>
</span></div>
<div> ...</div>
<div><br>
</div>
<div>So here, those are:</div>
<div><br>
</div>
<div>
<ul style="margin-bottom:0px; margin-top:0px">
<li>wl_buffer@<span>4278190080 (0xff000000)</span></li><li><span>wl_buffer@<span>4278190081 (0xff000001)</span></span></li></ul>
<div><br>
</div>
<div><br>
</div>
<div>Those ID's <span style="font-size: 12pt;">are in the expected range for server-allocated protocol objects. Despite this discrepancy, the application clearly works fine; the right contents appear on-screen.</span></div>
<div><br>
</div>
<div>Is there some quirk that causes object ID's passed as parameters to events to be mis-printed?</div>
<div><br>
</div>
<div>-Matt</div>
</div>
</div>
</body>
</html>