[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <cv4we57zxltpys6qf43nxldwwogjwxyglp2hj3ld6talvlteqp@dsen5g3v24t7>
Date: Mon, 15 Dec 2025 22:48:30 +0200
From: Dmitry Baryshkov <dmitry.baryshkov@....qualcomm.com>
To: Swaraj Gaikwad <swarajgaikwad1925@...il.com>
Cc: Rob Clark <robin.clark@....qualcomm.com>,
Dmitry Baryshkov <lumag@...nel.org>,
Abhinav Kumar <abhinav.kumar@...ux.dev>,
Jessica Zhang <jesszhan0024@...il.com>, Sean Paul <sean@...rly.run>,
Marijn Suijten <marijn.suijten@...ainline.org>,
David Airlie <airlied@...il.com>, Simona Vetter <simona@...ll.ch>,
"open list:DRM DRIVER for Qualcomm display hardware" <linux-arm-msm@...r.kernel.org>,
"open list:DRM DRIVER for Qualcomm display hardware" <dri-devel@...ts.freedesktop.org>,
"open list:DRM DRIVER for Qualcomm display hardware" <freedreno@...ts.freedesktop.org>,
open list <linux-kernel@...r.kernel.org>, skhan@...uxfoundation.org,
david.hunter.linux@...il.com
Subject: Re: [PATCH] drm/msm: Replace custom dumb_map_offset with generic
helper
On Mon, Dec 15, 2025 at 02:28:50AM +0000, Swaraj Gaikwad wrote:
> 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).
Other pieces are using msm_gem_lock() / msm_gem_unlock(), which
translates to dma_resv_lock() / dma_resv_unlock(), so you need to
describe, why it's still safe wrt. that code.
>
> 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@...il.com>
> ---
>
> Compile-tested only.
>
--
With best wishes
Dmitry
Powered by blists - more mailing lists