Skip to content

drm/gem: Rust create_fops omits drm_show_fdinfo, hiding DRM client identity #1266

Open

Description

@mattmireles

Rust DRM's generated file operations leave show_fdinfo unset, so userspace cannot read the standard DRM client identity even though the generic C helper already supplies it.

Source checked at current rust-next 21a7f44:

The DRM fdinfo documentation recommends installing drm_show_fdinfo in file_operations. That helper prints drm-driver/drm-client-id, then calls the optional driver hook.

Minimal observed reproduction

On an Apple M1 downstream Rust-DRM kernel (7.2.12-2-1-ARCH, based on asahi-7.2.12-2), this fresh read requires no Vulkan library, shader, model or GPU submission:

import os
fd = os.open("/dev/dri/renderD128", os.O_RDONLY)
try:
    print(open(f"/proc/self/fdinfo/{fd}").read())
finally:
    os.close(fd)

Observed:

pos:    0
flags:  02400000
mnt_id: 30
ino:    92

No drm-* keys are present. This physical observation is on the downstream kernel; it is not a runtime test of current rust-next.

Small proposed direction

Assign fops.show_fdinfo = Some(bindings::drm_show_fdinfo) in create_fops. This connects the generic identity path without a new Rust printer abstraction or enabling memory counters for every driver.

Driver-specific memory reporting is a separate API question. Generic GEM totals describe handle-visible object sizes, not a complete physical/resident GPU footprint, and should not be enabled globally or relabeled as residency.

A downstream candidate with the fops connection and a separate driver opt-in has completed its kernel build, but has not been boot-tested. Current rust-next has not been built or boot-tested here. No upstream-tested fix is claimed.

This report was prepared with Codex-assisted source analysis. It is a source-bound issue report, not a signed-off patch submission. Searched the project's issues/PRs and public mailing-list search for matching fdinfo work; no matching focused report was found.

Activity

  1. pederbe commented on Nov 19, 2026

    @pederbe

    I have submitted a patch for this.

    Mailing-list thread

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions