Re: [PATCH RFC 1/3] rust: add useful ops for u64

2025-02-18 Thread John Hubbard
On 2/18/25 5:21 PM, Alexandre Courbot wrote: On Wed Feb 19, 2025 at 5:51 AM JST, Timur Tabi wrote: On Tue, 2025-02-18 at 22:16 +0900, Alexandre Courbot wrote: ... More likely this would be something like: let SplitU64 { high: some_u32, .. } = some_u64; Which is still a bit verbose, but a

Re: [PATCH RFC 1/3] rust: add useful ops for u64

2025-02-18 Thread Alexandre Courbot
On Wed Feb 19, 2025 at 5:51 AM JST, Timur Tabi wrote: > On Tue, 2025-02-18 at 22:16 +0900, Alexandre Courbot wrote: >> > A proper struct with `high` and `low` might be more verbose, but >> > it rules out this issue. >> >> Mmm indeed, so we would have client code looking like: >> >>   let SplitU64

Re: [PATCH] drm/nouveau: select FW caching

2025-02-18 Thread Dave Airlie
On Wed, 19 Feb 2025 at 07:39, Luis Chamberlain wrote: > > On Tue, Feb 18, 2025 at 06:24:43PM +0100, Danilo Krummrich wrote: > > On Tue, Feb 18, 2025 at 06:28:53AM -0800, Luis Chamberlain wrote: > > > > > > What I recommend is to look into why we disable it by default, I think > > > > I think FW_CA

Re: [PATCH] drm/nouveau: select FW caching

2025-02-18 Thread Danilo Krummrich
On Tue, Feb 18, 2025 at 06:28:53AM -0800, Luis Chamberlain wrote: > > What I recommend is to look into why we disable it by default, I think I think FW_CACHE is enabled by default, no? > its sold old obscure reasoning but now suspect it was udev being dumb, > in line with why we also try to defe

Re: [PATCH] drm/nouveau: select FW caching

2025-02-18 Thread Luis Chamberlain
On Fri, Feb 14, 2025 at 02:10:27PM +0100, Danilo Krummrich wrote: > On Fri, Feb 14, 2025 at 02:05:36PM +0100, Danilo Krummrich wrote: > > only force FW_CACHE if DRM_NOUVEAU_GSP_DEFAULT? > > Please scratch that, it was a horrible idea. What I recommend is to look into why we disable it by default,

Re: [PATCH RFC 1/3] rust: add useful ops for u64

2025-02-18 Thread Alexandre Courbot
Hi Daniel! On Tue Feb 18, 2025 at 6:10 AM JST, Daniel Almeida wrote: > Hi Alex, > >> On 17 Feb 2025, at 11:04, Alexandre Courbot wrote: >> >> It is common to build a u64 from its high and low parts obtained from >> two 32-bit registers. Conversely, it is also common to split a u64 into >> two u

Re: [RFC PATCH 0/3] gpu: nova-core: add basic timer subdevice implementation

2025-02-18 Thread Alexandre Courbot
On Tue Feb 18, 2025 at 5:07 PM JST, Greg KH wrote: > On Mon, Feb 17, 2025 at 04:48:13PM +0100, Simona Vetter wrote: >> On Mon, Feb 17, 2025 at 11:04:45PM +0900, Alexandre Courbot wrote: >> > Hi everyone, >> > >> > This short RFC is based on top of Danilo's initial driver stub series >> > [1] and h

Re: [RFC PATCH 0/3] gpu: nova-core: add basic timer subdevice implementation

2025-02-18 Thread Alexandre Courbot
Hi Danilo, On Tue Feb 18, 2025 at 6:33 AM JST, Danilo Krummrich wrote: > Hi Alex, > > On Mon, Feb 17, 2025 at 11:04:45PM +0900, Alexandre Courbot wrote: >> Hi everyone, >> >> This short RFC is based on top of Danilo's initial driver stub series >> [1] and has for goal to initiate discussions and

Re: [PATCH RFC 1/3] rust: add useful ops for u64

2025-02-18 Thread Alexandre Courbot
On Tue Feb 18, 2025 at 7:07 PM JST, Dirk Behme wrote: > On 17/02/2025 15:04, Alexandre Courbot wrote: >> It is common to build a u64 from its high and low parts obtained from >> two 32-bit registers. Conversely, it is also common to split a u64 into >> two u32s to write them into registers. Add an

Re: [PATCH RFC 1/3] rust: add useful ops for u64

2025-02-18 Thread Timur Tabi
On Tue, 2025-02-18 at 22:16 +0900, Alexandre Courbot wrote: > > A proper struct with `high` and `low` might be more verbose, but > > it rules out this issue. > > Mmm indeed, so we would have client code looking like: > >   let SplitU64 { high, low } = some_u64.into_u32(); > > instead of > >  

Re: [PATCH] drm/nouveau: select FW caching

2025-02-18 Thread Luis Chamberlain
On Tue, Feb 18, 2025 at 06:24:43PM +0100, Danilo Krummrich wrote: > On Tue, Feb 18, 2025 at 06:28:53AM -0800, Luis Chamberlain wrote: > > > > What I recommend is to look into why we disable it by default, I think > > I think FW_CACHE is enabled by default, no? > > > its sold old obscure reasonin

Re: [PATCH v3 06/25] drm/armada: Compute dumb-buffer sizes with drm_mode_size_dumb()

2025-02-18 Thread Russell King (Oracle)
On Tue, Feb 18, 2025 at 03:23:29PM +0100, Thomas Zimmermann wrote: > Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and > buffer size. No alignment required. > > Signed-off-by: Thomas Zimmermann > Cc: Russell King armada_pitch() does have some special alignment (it aligns the p

Re: [PATCH v3 02/25] drm/dumb-buffers: Provide helper to set pitch and size

2025-02-18 Thread Geert Uytterhoeven
Hi Thomas, On Tue, 18 Feb 2025 at 15:26, Thomas Zimmermann wrote: > Add drm_modes_size_dumb(), a helper to calculate the dumb-buffer > scanline pitch and allocation size. Implementations of struct > drm_driver.dumb_create can call the new helper for their size > computations. > > There is current

[PATCH v3 05/25] drm/gem-vram: Compute dumb-buffer sizes with drm_mode_size_dumb()

2025-02-18 Thread Thomas Zimmermann
Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and buffer size. Inline code from drm_gem_vram_fill_create_dumb() without the existing size computation. Align the pitch to a multiple of 8. Only hibmc and vboxvideo use gem-vram. Hibmc invokes the call to drm_gem_vram_fill_create_dum

[PATCH v3 04/25] drm/gem-shmem: Compute dumb-buffer sizes with drm_mode_size_dumb()

2025-02-18 Thread Thomas Zimmermann
Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and buffer size. Align the pitch to a multiple of 8. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/drm_gem_shmem_helper.c | 16 +--- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/d

[PATCH v3 07/25] drm/exynos: Compute dumb-buffer sizes with drm_mode_size_dumb()

2025-02-18 Thread Thomas Zimmermann
Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and buffer size. No alignment required. Signed-off-by: Thomas Zimmermann Cc: Inki Dae Cc: Seung-Woo Kim Cc: Kyungmin Park Cc: Krzysztof Kozlowski Cc: Alim Akhtar --- drivers/gpu/drm/exynos/exynos_drm_gem.c | 8 +--- 1 file

[PATCH v3 09/25] drm/hibmc: Compute dumb-buffer sizes with drm_mode_size_dumb()

2025-02-18 Thread Thomas Zimmermann
Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and buffer size. Align the pitch to a multiple of 128. The hibmc driver's new hibmc_dumb_create() is similar to the one in GEM VRAM helpers. The driver was the only caller of drm_gem_vram_fill_create_dumb(). Remove the now unused help

[PATCH v3 06/25] drm/armada: Compute dumb-buffer sizes with drm_mode_size_dumb()

2025-02-18 Thread Thomas Zimmermann
Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and buffer size. No alignment required. Signed-off-by: Thomas Zimmermann Cc: Russell King --- drivers/gpu/drm/armada/armada_gem.c | 16 +++- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/

[PATCH v3 00/25] drm/dumb-buffers: Fix and improve buffer-size calculation

2025-02-18 Thread Thomas Zimmermann
Dumb-buffer pitch and size is specified by width, height, bits-per-pixel plus various hardware-specific alignments. The calculation of these values is inconsistent and duplicated among drivers. The results for formats with bpp < 8 are incorrect. This series fixes this for most drivers. Default sca

[PATCH v3 02/25] drm/dumb-buffers: Provide helper to set pitch and size

2025-02-18 Thread Thomas Zimmermann
Add drm_modes_size_dumb(), a helper to calculate the dumb-buffer scanline pitch and allocation size. Implementations of struct drm_driver.dumb_create can call the new helper for their size computations. There is currently quite a bit of code duplication among DRM's memory managers. Each calculates

[PATCH v3 03/25] drm/gem-dma: Compute dumb-buffer sizes with drm_mode_size_dumb()

2025-02-18 Thread Thomas Zimmermann
Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and buffer size. Align the pitch to a multiple of 8. Push the current calculation into the only direct caller imx. Imx's hardware requires the framebuffer width to be aligned to 8. The driver's current approach is actually incorrect,

[PATCH v3 14/25] drm/nouveau: Compute dumb-buffer sizes with drm_mode_size_dumb()

2025-02-18 Thread Thomas Zimmermann
Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and buffer size. Align the pitch to a multiple of 256. Signed-off-by: Thomas Zimmermann Cc: Karol Herbst Cc: Lyude Paul Cc: Danilo Krummrich --- drivers/gpu/drm/nouveau/nouveau_display.c | 7 --- 1 file changed, 4 insertions(

[PATCH v3 15/25] drm/omapdrm: Compute dumb-buffer sizes with drm_mode_size_dumb()

2025-02-18 Thread Thomas Zimmermann
Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and buffer size. Align the pitch to a multiple of 8. Signed-off-by: Thomas Zimmermann Reviewed-by: Tomi Valkeinen Cc: Tomi Valkeinen --- drivers/gpu/drm/omapdrm/omap_gem.c | 15 +++ 1 file changed, 7 insertions(+), 8 d

[PATCH v3 10/25] drm/imx/ipuv3: Compute dumb-buffer sizes with drm_mode_size_dumb()

2025-02-18 Thread Thomas Zimmermann
Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and buffer size. The hardware requires the framebuffer width to be a multiple of 8. The scanline pitch has be large enough to support this. Therefore compute the byte size of 8 pixels in the given color mode and align the pitch accordi

[PATCH v3 11/25] drm/loongson: Compute dumb-buffer sizes with drm_mode_size_dumb()

2025-02-18 Thread Thomas Zimmermann
Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and buffer size. Align the pitch according to hardware requirements. Signed-off-by: Thomas Zimmermann Reviewed-by: Sui Jingfeng Cc: Sui Jingfeng --- drivers/gpu/drm/loongson/lsdc_gem.c | 29 - 1 file ch

[PATCH v3 16/25] drm/qxl: Compute dumb-buffer sizes with drm_mode_size_dumb()

2025-02-18 Thread Thomas Zimmermann
Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and buffer size. No alignment required. Signed-off-by: Thomas Zimmermann Cc: Dave Airlie Cc: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_dumb.c | 17 - 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/dr

[PATCH v3 12/25] drm/mediatek: Compute dumb-buffer sizes with drm_mode_size_dumb()

2025-02-18 Thread Thomas Zimmermann
Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and buffer size. Align the pitch to a multiple of 8. Signed-off-by: Thomas Zimmermann Cc: Chun-Kuang Hu Cc: Philipp Zabel Cc: Matthias Brugger Cc: AngeloGioacchino Del Regno --- drivers/gpu/drm/mediatek/mtk_gem.c | 13 --

[PATCH v3 01/25] drm/dumb-buffers: Sanitize output on errors

2025-02-18 Thread Thomas Zimmermann
The ioctls MODE_CREATE_DUMB and MODE_MAP_DUMB return results into a memory buffer supplied by user space. On errors, it is possible that intermediate values are being returned. The exact semantics depends on the DRM driver's implementation of these ioctls. Although this is most-likely not a securit

[PATCH v3 21/25] drm/virtio: Compute dumb-buffer sizes with drm_mode_size_dumb()

2025-02-18 Thread Thomas Zimmermann
Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and buffer size. Align the pitch to a multiple of 4. Signed-off-by: Thomas Zimmermann Cc: David Airlie Cc: Gerd Hoffmann Cc: Gurchetan Singh Cc: Chia-I Wu --- drivers/gpu/drm/virtio/virtgpu_gem.c | 11 +-- 1 file changed

[PATCH v3 08/25] drm/gma500: Compute dumb-buffer sizes with drm_mode_size_dumb()

2025-02-18 Thread Thomas Zimmermann
Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and buffer size. Align the pitch to a multiple of 64. Signed-off-by: Thomas Zimmermann Cc: Patrik Jakobsson --- drivers/gpu/drm/gma500/gem.c | 21 ++--- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a

[PATCH v3 19/25] drm/rockchip: Compute dumb-buffer sizes with drm_mode_size_dumb()

2025-02-18 Thread Thomas Zimmermann
Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and buffer size. Align the pitch to a multiple of 64. Signed-off-by: Thomas Zimmermann Acked-by: Heiko Stuebner Cc: Sandy Huang Cc: "Heiko Stübner" Cc: Andy Yan --- drivers/gpu/drm/rockchip/rockchip_drm_gem.c | 12 ++--

[PATCH v3 13/25] drm/msm: Compute dumb-buffer sizes with drm_mode_size_dumb()

2025-02-18 Thread Thomas Zimmermann
Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and buffer size. Alignment is specified in bytes, but the hardware requires the scanline pitch to be a multiple of 32 pixels. Therefore compute the byte size of 32 pixels in the given color mode and align the pitch accordingly. This re

[PATCH v3 18/25] drm/renesas/rz-du: Compute dumb-buffer sizes with drm_mode_size_dumb()

2025-02-18 Thread Thomas Zimmermann
Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and buffer size. Align the pitch according to hardware requirements. Signed-off-by: Thomas Zimmermann Cc: Biju Das --- drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff

[PATCH v3 20/25] drm/tegra: Compute dumb-buffer sizes with drm_mode_size_dumb()

2025-02-18 Thread Thomas Zimmermann
Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and buffer size. Align the pitch according to hardware requirements. Signed-off-by: Thomas Zimmermann Cc: Thierry Reding Cc: Mikko Perttunen --- drivers/gpu/drm/tegra/gem.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletion

[PATCH v3 23/25] drm/xe: Compute dumb-buffer sizes with drm_mode_size_dumb()

2025-02-18 Thread Thomas Zimmermann
Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and buffer size. Align the pitch to a multiple of 8. Align the buffer size according to hardware requirements. Xe's internal calculation allowed for 64-bit wide buffer sizes, but the ioctl's internal checks always verified against 32-

[PATCH v3 17/25] drm/renesas/rcar-du: Compute dumb-buffer sizes with drm_mode_size_dumb()

2025-02-18 Thread Thomas Zimmermann
Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and buffer size. Align the pitch according to hardware requirements. Signed-off-by: Thomas Zimmermann Cc: Laurent Pinchart Cc: Kieran Bingham --- drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c | 7 +-- 1 file changed, 5 inserti

[PATCH v3 22/25] drm/vmwgfx: Compute dumb-buffer sizes with drm_mode_size_dumb()

2025-02-18 Thread Thomas Zimmermann
Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and buffer size. No alignment required. Signed-off-by: Thomas Zimmermann Reviewed-by: Zack Rusin Cc: Zack Rusin Cc: Broadcom internal kernel review list --- drivers/gpu/drm/vmwgfx/vmwgfx_surface.c | 21 - 1 fi

[PATCH v3 25/25] drm/xlnx: Compute dumb-buffer sizes with drm_mode_size_dumb()

2025-02-18 Thread Thomas Zimmermann
Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and buffer size. Align the pitch according to hardware requirements. Signed-off-by: Thomas Zimmermann Cc: Laurent Pinchart Cc: Tomi Valkeinen --- drivers/gpu/drm/xlnx/zynqmp_kms.c | 7 +-- 1 file changed, 5 insertions(+), 2 de

[PATCH v3 24/25] drm/xen: Compute dumb-buffer sizes with drm_mode_size_dumb()

2025-02-18 Thread Thomas Zimmermann
Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and buffer size. Align the pitch to a multiple of 8. Signed-off-by: Thomas Zimmermann Cc: Oleksandr Andrushchenko --- drivers/gpu/drm/xen/xen_drm_front.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dr

Re: [RFC PATCH 0/3] gpu: nova-core: add basic timer subdevice implementation

2025-02-18 Thread Danilo Krummrich
On Tue, Feb 18, 2025 at 11:46:26AM +1000, Dave Airlie wrote: > > 1. How to avoid unnecessary calls to try_access(). > > > > This is why I made Boot0.read() take a &RevocableGuard<'_, Bar0> as > > argument. I > > think we can just call try_access() once and then propage the guard through > > the >

Re: [RFC PATCH 0/3] gpu: nova-core: add basic timer subdevice implementation

2025-02-18 Thread Alexandre Courbot
Hi Dave, On Tue Feb 18, 2025 at 10:42 AM JST, Dave Airlie wrote: > On Tue, 18 Feb 2025 at 00:04, Alexandre Courbot wrote: >> >> Hi everyone, >> >> This short RFC is based on top of Danilo's initial driver stub series >> [1] and has for goal to initiate discussions and hopefully some design >> dec

Re: [PATCH 1/1] MAINTAINERS: Remove myself

2025-02-18 Thread Google
On Mon, 17 Feb 2025 13:27:25 +0100 Danilo Krummrich wrote: > On Sat, Feb 15, 2025 at 08:37:53AM +0100, Karol Herbst wrote: > > I was pondering with myself for a while if I should just make it official > > that I'm not really involved in the kernel community anymore, neither as a > > reviewer, nor

[PATCH v2] drm/nouveau/pmu: Fix gp10b firmware guard

2025-02-18 Thread Aaron Kling via B4 Relay
From: Aaron Kling Most kernel configs enable multiple Tegra SoC generations, causing this typo to go unnoticed. But in the case where a kernel config is strictly for Tegra186, this is a problem. Fixes: 989863d7cbe5 ("drm/nouveau/pmu: select implementation based on available firmware") Signed-of

Re: [PATCH] drm/nouveau/pmu: Fix gp10b firmware guard

2025-02-18 Thread Zhi Wang
On Mon, 17 Feb 2025 17:46:41 -0600 Aaron Kling wrote: > On Mon, Feb 17, 2025 at 5:43 PM Aaron Kling via B4 Relay > wrote: > > > > From: Aaron Kling > > > > Fixes: 989863d7cbe5 ("drm/nouveau/pmu: select implementation based on > > available firmware") > > Signed-off-by: Aaron Kling > > --- > >

Re: [RFC PATCH 0/3] gpu: nova-core: add basic timer subdevice implementation

2025-02-18 Thread Greg KH
On Mon, Feb 17, 2025 at 04:48:13PM +0100, Simona Vetter wrote: > On Mon, Feb 17, 2025 at 11:04:45PM +0900, Alexandre Courbot wrote: > > Hi everyone, > > > > This short RFC is based on top of Danilo's initial driver stub series > > [1] and has for goal to initiate discussions and hopefully some des