]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/msm: Replace custom dumb_map_offset with generic helper
authorSwaraj Gaikwad <swarajgaikwad1925@gmail.com>
Mon, 15 Dec 2025 02:28:50 +0000 (02:28 +0000)
committerRob Clark <robin.clark@oss.qualcomm.com>
Sun, 18 Jan 2026 15:35:55 +0000 (07:35 -0800)
commit3f6cf0653f8a2117ec135b2ca322ec68abc1b26c
treec9239969a79ae5fb37135ff3f038624611074a5d
parent5b6f6a76e0b8908d7071cd7d83bd8fb12f38990e
drm/msm: Replace custom dumb_map_offset with generic helper

The msm driver implements a custom dumb_map_offset callback. This
implementation acquires the msm_gem_lock, but the underlying
drm_gem_create_mmap_offset() function is already thread-safe regarding
the VMA offset manager (it acquires the mgr->vm_lock internally).

Switching to the generic drm_gem_dumb_map_offset() helper provides
several benefits:
1. Removes the unnecessary locking overhead (locking leftovers).
2. Adds a missing check to reject mapping of imported objects, which is
   invalid for dumb buffers.
3. Allows for the removal of the msm_gem_dumb_map_offset() wrapper and
   the msm_gem_mmap_offset() helper function.

The logic from msm_gem_mmap_offset() has been inlined into
msm_ioctl_gem_info() to maintain functionality without the separate
helper.

This addresses the TODO:
"Documentation/gpu/todo.rst: Remove custom dumb_map_offset implementations"

Signed-off-by: Swaraj Gaikwad <swarajgaikwad1925@gmail.com>
Patchwork: https://patchwork.freedesktop.org/patch/694727/
Message-ID: <20251215022850.12358-1-swarajgaikwad1925@gmail.com>
Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com>
drivers/gpu/drm/msm/msm_drv.c
drivers/gpu/drm/msm/msm_gem.c
drivers/gpu/drm/msm/msm_gem.h