Re: [PATCH 2/2] drm/panthor: Fix the user MMIO offset logic for emulators

2025-04-17 Thread Steven Price
On 17/04/2025 13:10, Boris Brezillon wrote: > On Thu, 17 Apr 2025 11:41:18 +0100 > Steven Price wrote: > >> On 17/04/2025 11:05, Boris Brezillon wrote: >>> Currently, we pick the MMIO offset based on the size of the pgoff_t >>> type seen by the process that manipulates the FD, such that a 32-bit

Re: [PATCH 2/2] drm/panthor: Fix the user MMIO offset logic for emulators

2025-04-17 Thread Boris Brezillon
On Thu, 17 Apr 2025 14:10:31 +0200 Boris Brezillon wrote: > > I can't help feeling we can just simplify this to: > > > > u64 mmio_offset = pfile->user_mmio.offset; > > > > if (offset >= mmio_offset) { > > offset -= mmio_offset; > > offset += DRM_PANTHOR_USER_MMIO

Re: [PATCH 2/2] drm/panthor: Fix the user MMIO offset logic for emulators

2025-04-17 Thread Liviu Dudau
On Thu, Apr 17, 2025 at 02:16:11PM +0200, Boris Brezillon wrote: > On Thu, 17 Apr 2025 12:33:01 +0100 > Liviu Dudau wrote: > > > On Thu, Apr 17, 2025 at 11:41:18AM +0100, Steven Price wrote: > > > On 17/04/2025 11:05, Boris Brezillon wrote: > > > > Currently, we pick the MMIO offset based on th

Re: [PATCH 2/2] drm/panthor: Fix the user MMIO offset logic for emulators

2025-04-17 Thread Boris Brezillon
On Thu, 17 Apr 2025 12:33:01 +0100 Liviu Dudau wrote: > On Thu, Apr 17, 2025 at 11:41:18AM +0100, Steven Price wrote: > > On 17/04/2025 11:05, Boris Brezillon wrote: > > > Currently, we pick the MMIO offset based on the size of the pgoff_t > > > type seen by the process that manipulates the FD,

Re: [PATCH 2/2] drm/panthor: Fix the user MMIO offset logic for emulators

2025-04-17 Thread Boris Brezillon
On Thu, 17 Apr 2025 11:41:18 +0100 Steven Price wrote: > On 17/04/2025 11:05, Boris Brezillon wrote: > > Currently, we pick the MMIO offset based on the size of the pgoff_t > > type seen by the process that manipulates the FD, such that a 32-bit > > process can always map the user MMIO ranges. Bu

Re: [PATCH 2/2] drm/panthor: Fix the user MMIO offset logic for emulators

2025-04-17 Thread Liviu Dudau
On Thu, Apr 17, 2025 at 11:41:18AM +0100, Steven Price wrote: > On 17/04/2025 11:05, Boris Brezillon wrote: > > Currently, we pick the MMIO offset based on the size of the pgoff_t > > type seen by the process that manipulates the FD, such that a 32-bit > > process can always map the user MMIO range

Re: [PATCH 2/2] drm/panthor: Fix the user MMIO offset logic for emulators

2025-04-17 Thread Steven Price
On 17/04/2025 11:05, Boris Brezillon wrote: > Currently, we pick the MMIO offset based on the size of the pgoff_t > type seen by the process that manipulates the FD, such that a 32-bit > process can always map the user MMIO ranges. But this approach doesn't > work well for emulators like FEX, where

[PATCH 2/2] drm/panthor: Fix the user MMIO offset logic for emulators

2025-04-17 Thread Boris Brezillon
Currently, we pick the MMIO offset based on the size of the pgoff_t type seen by the process that manipulates the FD, such that a 32-bit process can always map the user MMIO ranges. But this approach doesn't work well for emulators like FEX, where the emulator is a 64-bit binary which might be exec