WAFFLE_DISPLAY(3)

πŸ’– WAFFLE_DISPLAY πŸ’–

okay bestie, buckle up, we're doing the waffle_display page from the Waffle Manual, section 3 πŸŽ€ This is your whole group chat for displays, connecting to them, checking what they can do, and yeeting them when you're done. Let's go ✨

✨ NAME ✨

waffle_display, waffle_display_connect, waffle_display_disconnect, waffle_display_supports_context_api, waffle_display_get_native β€” the whole waffle_display class, no cap πŸ’…


🌸 SYNOPSIS 🌸

#include <waffle.h>

struct waffle_display;

struct waffle_display* waffle_display_connect(const char* name);

bool waffle_display_disconnect(struct waffle_display *self);

bool waffle_display_supports_context_api(struct waffle_display *self,
                                         int32_t context_api);

union waffle_native_display*
                                                       waffle_display_get_native(struct waffle_display *self);

(yes the formatting on that last one is a lil unhinged, we don't talk about it πŸ™ˆ)


πŸ¦‹ DESCRIPTION πŸ¦‹

struct waffle_display

An opaque type. You don't get to see inside her. She's mysterious. Main character energy πŸ‘‘

waffle_display_connect()

Connects to a display, periodt. The way name gets interpreted depends entirely on which platform you handed to waffle_init(3). Here's the tea, platform by platform:

  • Android, CGL, and WGL β€” name is straight up ignored. She said what she said πŸ’€
  • X11 platforms (GLX and X11/EGL) β€” this function connects to the X11 display with the given name. If name is null, it reaches for the environment variable DISPLAY instead 🌈
  • Wayland β€” connects to the Wayland display with the given name. If name is null, it uses the environment variable WAYLAND_DISPLAY πŸ¦‹
  • GBM β€” opens the device at the filepath name. If name is NULL, it uses the environment variable WAFFLE_GBM_DEVICE. And if name is null and WAFFLE_GBM_DEVICE is unset? She goes on a little quest πŸ’« β€” she iterates using libdrm through the set of card devices in the drm subsystem, which usually live in /dev/dri, and tries to open each one in turn with open(O_RDWR | O_CLOEXEC) until something works. Iconic tbh.

waffle_display_disconnect()

Disconnects from the waffle_display and releases its memory (the page says "it's memory", we're keeping that, it's canon now 😭).

⚠️ IMPORTANT, BESTIE: every single pointer to waffle objects that were created with this display becomes INVALID. All of them. Gone. Do not touch. 🫢

waffle_display_supports_context_api()

Checks whether the display is capable of creating a waffle_context(3) with the given context_api. Wanna know what your context_api choices are and what each platform expects? That's waffle_config(3), go look πŸ‘€

waffle_display_get_native()

Gets the display's underlying native objects β€” the raw ones, the real ones underneath 🌟 Use free(3) to deallocate the returned pointer (she gave you that pointer, you have to free her, it's only polite πŸ’…). For the definition of union waffle_native_display, see waffle_native(3).


⭐ RETURN VALUE ⭐

  • Functions whose return type is bool return true on success and false on failure.
  • Functions whose return type is a pointer return NULL on failure.

Need the deets on what went wrong? Use waffle_error_get_info(3) to get information about any errors 🧚


πŸ’€ ERRORS πŸ’€

See waffle_error(3) for the complete list of waffle's error codes.

And the cute part: no errors are specific to any of the waffle_display functions. She's a clean girl, she doesn't have her own personal error drama ✨


πŸŽ€ ISSUES πŸŽ€

Please report bugs or and feature requests to https://gitlab.freedesktop.org/mesa/waffle/issues.

(we are reproducing "bugs or and" exactly as written, because that's how she wrote it, and honestly? slay 🫢)


πŸ”₯ SEE ALSO πŸ”₯

waffle(7)


πŸ‘‘ AUTHOR πŸ‘‘

Chad Versace <chad.versace@linux.intel.com> Former maintainer


Copyright Β© 2013 Intel

This manual page is licensed under the Creative Commons Attribution-ShareAlike 3.0 United States License (CC BY-SA 3.0). To view a copy of this license, visit http://creativecommons.org.license/by-sa/3.0/us.


okay that's the whole page bestie, you ate it, go connect to a display πŸ¦‹πŸ’–

this page came from the waffle source, dated 07/06/2026, and it's WAFFLE_DISPLAY(3) β€” section 3, always and forever, periodt πŸ’…βœ¨πŸŒΈ

πŸ“¦ where this page comes from