Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • W wayland-protocols
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 122
    • Issues 122
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 76
    • Merge requests 76
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
    • Model experiments
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar

Admin message

Due to an influx of spam, we have had to impose restrictions on new accounts. Please see this wiki page for instructions on how to get full permissions. Sorry for the inconvenience.

  • waylandwayland
  • wayland-protocols
  • Issues
  • #135

Specifying buffer usage at creation time

This applies to both shm buffers and dma-bufs but dma-bufs are more interesting.

When creating a buffer via linux-dmabuf, the compositor cannot know how the client intends to use the buffer. The client could want to use the buffer

  • as a framebuffer and/or
  • for sampling.

Therefore, when the client calls

  • create or
  • create_immed,

the compositor cannot actually fully import the buffer. Even if those requests signal success, using the buffers might later fail if the compositor has to create additional data structures.


Therefore, I believe that it would be useful to add a new request to linux-dmabuf:

  <interface name="zwp_linux_buffer_params_v1" version="5">
    <enum name="error">
      <entry name="no_usage" value="8"
             summary="tried to create a buffer without a usage"/>
    </enum>

    <enum name="usage" bitfield="true">
      <entry name="rendering" value="1" summary="the buffer will be rendered-to"/>
      <entry name="sampling" value="2" summary="the buffer will be sampled-from"/>
    </enum>

    <request name="add_usage" since="5">
      <description summary="add a usage to this buffer">
        This request specifies in which ways the created buffer will be used. It is a
        protocol error to attempt to use the buffer in a way not specified via this
        request.

        The client must request at least one usage before attempting to create the buffer.
        Otherwise, the no_usage error is raised.

        This request allows the compositor to determine at create time if the dma-buf
        can be used for the intended purpose.
      </description>
      <arg name="usage" type="uint" enum="usage" summary="see enum usage"/>
    </request>
  </interface>
Edited Mar 05, 2023 by Julian Orth
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking