[PATCH 0/8] DRM Rust abstractions

Danilo Krummrich dakr at kernel.org
Thu Apr 10 10:23:46 UTC 2025


(Adding Sima and dri-devel back in.)

On Thu, Apr 10, 2025 at 04:12:13PM +0900, Asahi Lina wrote:
> 
> P.S. my analysis based on the pasted code (since everyone here and
> everyone on Reddit is forcing me to do it) is that:

First of all, you keep talking as if I would have been resisting to do any
changes, even though I offered you to change things from the get-go.

Instead of taking the offer, you decided to go with wild accusations, without
even properly looking at things and understanding my intentions.

Given that you stepped back from kernel development, making clear that you don't
want to be bothered with it anymore (as you also repeated in this thread), I had
to take a decision: Do I "keep" your primary authorship for commits that I
(newly) create, commit messages I write and code that I substantially change, or
do I account for this by changing primary authorship while still giving you
credit.

The decision I took is clearly reasonable and *nothing* about it is uncommon.

I also want to point out that for patch "rust: drm: ioctl: Add DRM ioctl
abstraction" I kept your primary authorship, since I took the patch "as is" with
just very minor modifications.

However, I understand that you prefer to have primary authorship, even if the
code has been re-organized in new commits, moved, modified or rewritten.

This really is *totally* fine for me, and I won't argue about it (even though
one could).

> The series adds around 978 lines of code. After merging some code that
> was just moved around in the diff that Danilo posted, only 412 addition
> lines remain in the diff. So more than 50% of the raw remaining code is
> mine. If you exclude comments, Danilo only added 270 lines of actual
> code (and whitespace). And of those, a good portion were just minor
> changes and refactoring, not completely novel code (this also tracks
> with the stat that to get to those 270 lines, 379 were removed, and much
> of those probably pair up as minor refactorings and not outright novel
> code).
> 
> In terms of actual code added an not just lines rearranged or further
> commented, I probably wrote at least 75% of this series. And I'm sure
> Danilo knows this, having done the refactoring/rearranging/modification
> work to get here.

I do not understand what you are trying to proof here and especially why.

I also do *not* agree with the above; to me it looks like it does not account
for the cases where code has been moved *and* modified.

Here's the full list of changes for the diff [1].

  - rewrite of drm::Device
    - full rewrite of the abstraction using the subclassing pattern

  - rework of drm::Registration
    - this may seem like a trivial simplification (or move), but has
      architectural implications to prevent use-after-free bugs
      - some members (vtable) of drm::Registration need to be tied to the
        lifetime of the drm::Device instead, *not* the drm::Registration
    - introduce Devres

  - rework of drm::File
    - switch to the Opaque<T> type
    - fix (mutable) references to struct drm_file (which in this context is UB)
    - restructure and rename functions to align with common kernel schemes

  - rework of the GEM object abstractions
    - switch to the Opaque<T> type
    - fix (mutable) references to struct drm_gem_object (which in this context is UB)
    - drop all custom reference types in favor of AlwaysRefCounted
    - a bunch of minor changes and simplifications (e.g. IntoGEMObject trait)

  - MISC
    - write and fix lots of safety and invariant comments
    - remove necessity for and convert 'as' casts
    - bunch of other minor changes

The sum of the above is clearly *not* minor.

I really don't agree with the fact that you keep accusing me of "stealing" your
code, which I clearly did not. Trust me, I don't need that.

> Danilo: If you do not take me up on the CC-0 offer, I expect you to put
> my name as primary author of patches 3 through 7.

I offered this from the get-go, hence I will do so.

However, are you sure you really want primary authorship for "rust: drm: add
device abstraction", given that drm::Device is a full rewrite?

[1] https://pastebin.com/FT4tNn5d


More information about the dri-devel mailing list