[PATCH] video: fbdev: arkfb: fix possible object reference leak

2023-10-05 Thread Zhang Shurong
Add missing pci_disable_device() in error path in ark_pci_probe(). Signed-off-by: Zhang Shurong --- drivers/video/fbdev/arkfb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/video/fbdev/arkfb.c b/drivers/video/fbdev/arkfb.c index 60a96fdb5dd8..6c4e5065646f 10064

Re: [PATCH v4 1/4] drm/format-helper: Export line conversion helper for drm_panic

2023-10-05 Thread Jocelyn Falempe
On 04/10/2023 03:45, nerdopolis wrote: On Tuesday, October 3, 2023 10:22:44 AM EDT Jocelyn Falempe wrote: drm_panic will need the low-level drm_fb__line functions. Also add drm_fb_r1_to_xrgb to render the fonts. Signed-off-by: Jocelyn Falempe --- drivers/gpu/drm/drm_format_helper.c |

Re: [REGRESSION] BUG: KFENCE: memory corruption in drm_gem_put_pages+0x186/0x250

2023-10-05 Thread Thomas Zimmermann
Hi Am 01.10.23 um 18:32 schrieb Oleksandr Natalenko: Hello. I've got a VM from a cloud provider, and since v6.5 I observe the following kfence splat in dmesg during boot: ``` BUG: KFENCE: memory corruption in drm_gem_put_pages+0x186/0x250 Corrupted memory at 0xe173a294 [ ! ! ! ! ! !

Re: [REGRESSION] BUG: KFENCE: memory corruption in drm_gem_put_pages+0x186/0x250

2023-10-05 Thread Thomas Zimmermann
Hi Am 02.10.23 um 17:38 schrieb Oleksandr Natalenko: On pondělí 2. října 2023 16:32:45 CEST Matthew Wilcox wrote: On Mon, Oct 02, 2023 at 01:02:52PM +0200, Oleksandr Natalenko wrote: BUG: KFENCE: memory corruption in drm_gem_put_pages+0x186/0x250 Corrupted memory at 0xe173a294 [ ! ! !

Re: [REGRESSION] BUG: KFENCE: memory corruption in drm_gem_put_pages+0x186/0x250

2023-10-05 Thread Oleksandr Natalenko
Hello. On čtvrtek 5. října 2023 9:44:42 CEST Thomas Zimmermann wrote: > Hi > > Am 02.10.23 um 17:38 schrieb Oleksandr Natalenko: > > On pondělí 2. října 2023 16:32:45 CEST Matthew Wilcox wrote: > >> On Mon, Oct 02, 2023 at 01:02:52PM +0200, Oleksandr Natalenko wrote: > >>> BUG: KFENCE: memory

[PATCH] drm/amd/display: Fix mst hub unplug warning

2023-10-05 Thread Wayne Lin
[Why] Unplug mst hub will cause warning. That's because dm_helpers_construct_old_payload() is changed to be called after payload removement from dc link. In dm_helpers_construct_old_payload(), We refer to the vcpi in payload allocation table of dc link to construct the old payload and payload is n

Re: [PATCH v4 2/4] drm/panic: Add a drm panic handler

2023-10-05 Thread Maxime Ripard
Hi, On Tue, Oct 03, 2023 at 04:22:45PM +0200, Jocelyn Falempe wrote: > diff --git a/include/drm/drm_drv.h b/include/drm/drm_drv.h > index 89e2706cac56..e538c87116d3 100644 > --- a/include/drm/drm_drv.h > +++ b/include/drm/drm_drv.h > @@ -43,6 +43,7 @@ struct dma_buf_attachment; > struct drm_displ

Re: bulk_move in ttm_resource manager

2023-10-05 Thread Thomas Hellström
On Wed, 2023-10-04 at 14:44 +0200, Christian König wrote: > Am 04.10.23 um 09:17 schrieb Thomas Hellström: > > On Wed, 2023-10-04 at 03:52 +, Zeng, Oak wrote: > > > Hi Christian, > > >   > > > As a follow up to this thread: > > > https://www.spinics.net/lists/dri-devel/msg410740.html, I starte

Re: [PATCH 3/7] drm/sun4i: dw-hdmi: Switch to bridge functions

2023-10-05 Thread Maxime Ripard
On Mon, Sep 25, 2023 at 05:29:20PM +0200, Jernej Škrabec wrote: > Dne ponedeljek, 25. september 2023 ob 09:57:22 CEST je Maxime Ripard > napisal(a): > > On Sun, Sep 24, 2023 at 09:26:00PM +0200, Jernej Skrabec wrote: > > > Since ddc-en property handling was moved from sun8i dw-hdmi driver to > > >

Re: [PATCH 5/7] drm/sun4i: dw-hdmi: Split driver registration

2023-10-05 Thread Maxime Ripard
On Mon, Sep 25, 2023 at 05:07:45PM +0200, Jernej Škrabec wrote: > Dne ponedeljek, 25. september 2023 ob 09:47:15 CEST je Maxime Ripard > napisal(a): > > On Sun, Sep 24, 2023 at 09:26:02PM +0200, Jernej Skrabec wrote: > > > There is no reason to register two drivers in same place. Using macro > > >

[PATCH v4 2/7] drm/atomic-helper: Add format-conversion state to shadow-plane state

2023-10-05 Thread Thomas Zimmermann
Store an instance of struct drm_format_conv_state in the shadow-plane state struct drm_shadow_plane_state. Many drivers with shadow planes use DRM's format helpers to copy or convert the framebuffer data to backing storage in the scanout buffer. The shadow plane provides the necessary state and man

[PATCH v4 1/7] drm/format-helper: Cache buffers with struct drm_format_conv_state

2023-10-05 Thread Thomas Zimmermann
Hold temporary memory for format conversion in an instance of struct drm_format_conv_state. Update internal helpers of DRM's format-conversion code accordingly. Drivers will later be able to maintain this cache by themselves. Besides caching, struct drm_format_conv_state will be useful to hold add

[PATCH v4 4/7] drm/ofdrm: Preallocate format-conversion buffer in atomic_check

2023-10-05 Thread Thomas Zimmermann
Preallocate the format-conversion state's storage in the plane's atomic_check function if a format conversion is necessary. Allows the update to fail if no memory is available. Avoids the same allocation within atomic_update, which may not fail. Signed-off-by: Thomas Zimmermann --- drivers/gpu/d

[PATCH v4 0/7] drm: Reuse temporary memory for format conversion

2023-10-05 Thread Thomas Zimmermann
DRM's format-conversion helpers require temporary memory. Pass the buffer from the caller and keep it allocated over several calls. Allow the caller to preallocate the buffer memory. The motivation for this patchset is the recent work on a DRM panic handler. [1] The panic handler requires format c

[PATCH v4 3/7] drm/format-helper: Pass format-conversion state to helpers

2023-10-05 Thread Thomas Zimmermann
Pass an instance of struct drm_format_conv_state to DRM's format conversion helpers. Update all callers. Most drivers can use the format-conversion state from their shadow- plane state. The shadow plane's destroy function releases the allocated buffer. Drivers will later be able to allocate a buff

[PATCH v4 6/7] drm/ssd130x: Fix atomic_check for disabled planes

2023-10-05 Thread Thomas Zimmermann
The plane's atomic_check returns -EINVAL if the CRTC has not been set. This is the case for disabled planes, for which atomic_check should return 0. For disabled planes, it also omits the mandatory call to drm_atomic_helper_check_plane_state(). Replace the test with the boiler-plate code that firs

[PATCH v4 5/7] drm/simpledrm: Preallocate format-conversion buffer in atomic_check

2023-10-05 Thread Thomas Zimmermann
Preallocate the format-conversion state's storage in the plane's atomic_check function if a format conversion is necessary. Allows the update to fail if no memory is available. Avoids the same allocation within atomic_update, which may not fail. Also inline drm_plane_helper_atomic_check() into the

[PATCH v4 7/7] drm/ssd130x: Preallocate format-conversion buffer in atomic_check

2023-10-05 Thread Thomas Zimmermann
Preallocate the format-conversion state's storage in the plane's atomic_check function if a format conversion is necessary. Allows the update to fail if no memory is available. Avoids the same allocation within atomic_update, which may not fail. Signed-off-by: Thomas Zimmermann --- drivers/gpu/d

Re: [PATCH v4 6/7] drm/ssd130x: Fix atomic_check for disabled planes

2023-10-05 Thread Geert Uytterhoeven
Hi Thomas, On Thu, Oct 5, 2023 at 11:05 AM Thomas Zimmermann wrote: > The plane's atomic_check returns -EINVAL if the CRTC has not been > set. This is the case for disabled planes, for which atomic_check > should return 0. For disabled planes, it also omits the mandatory > call to drm_atomic_help

Re: [PATCH v4 2/4] drm/panic: Add a drm panic handler

2023-10-05 Thread Jocelyn Falempe
On 05/10/2023 10:18, Maxime Ripard wrote: Hi, On Tue, Oct 03, 2023 at 04:22:45PM +0200, Jocelyn Falempe wrote: diff --git a/include/drm/drm_drv.h b/include/drm/drm_drv.h index 89e2706cac56..e538c87116d3 100644 --- a/include/drm/drm_drv.h +++ b/include/drm/drm_drv.h @@ -43,6 +43,7 @@ struct dma_

[PULL] drm-misc-fixes

2023-10-05 Thread Thomas Zimmermann
Hi Dave and Daniel, here's the weekly PR for drm-misc-fixes. Best regards Thomas drm-misc-fixes-2023-10-05: Short summary of fixes pull: * test: Fix kunit release * panel-orientation: Add quirk for One Mix 25 * nouveau: * Report IB limit via getparams * Replace some magic numbers with

[PATCH v7 0/7] Add support for XLCDC to sam9x7 SoC family.

2023-10-05 Thread Manikandan Muralidharan
This patch series aims to add support for XLCDC IP of sam9x7 SoC family to the DRM subsystem.XLCDC IP has additional registers and new configuration bits compared to the existing register set of HLCDC IP. The new compatible string "microchip,sam9x75-xlcdc" is defined for sam9x75 variant of the sam9

[PATCH v7 1/7] drm: atmel-hlcdc: add flag and driver ops to differentiate XLCDC and HLCDC IP

2023-10-05 Thread Manikandan Muralidharan
Add is_xlcdc flag and LCD IP specific ops in driver data to differentiate XLCDC and HLCDC code within the atmel-hlcdc driver files. Signed-off-by: Manikandan Muralidharan --- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h | 37 1 file changed, 37 insertions(+) diff --git a/dr

[PATCH v7 3/7] drm: atmel-hlcdc: Define SAM9X7 SoC XLCDC specific registers

2023-10-05 Thread Manikandan Muralidharan
From: Durai Manickam KR The register address of the XLCDC IP used in SAM9X7 SoC family are different from the previous HLCDC. Defining those address space with valid macros. Signed-off-by: Durai Manickam KR [manikanda...@microchip.com: Remove unused macro definitions] Signed-off-by: Manikandan

[PATCH v7 2/7] drm: atmel-hlcdc: add LCD controller layer definition for sam9x75

2023-10-05 Thread Manikandan Muralidharan
Add the LCD controller layer definition and descriptor structure for sam9x75 for the following layers: - Base Layer - Overlay1 Layer - Overlay2 Layer - High End Overlay Signed-off-by: Manikandan Muralidharan --- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 97 1 file chang

[PATCH v7 4/7] drm: atmel_hlcdc: Add support for XLCDC in atmel LCD driver

2023-10-05 Thread Manikandan Muralidharan
XLCDC in SAM9X7 has different sets of registers and additional configuration bits when compared to previous HLCDC IP. Read/write operation on the controller registers is now separated using the XLCDC status flag and with HLCDC and XLCDC IP specific ops. HEO scaling, window resampling, Alpha blendin

[PATCH v7 5/7] drm: atmel-hlcdc: add DPI mode support for XLCDC

2023-10-05 Thread Manikandan Muralidharan
Add support for Display Pixel Interface (DPI) Compatible Mode support in atmel-hlcdc driver for XLCDC IP along with legacy pixel mapping. DPI mode BIT is configured in LCDC_CFG5 register. Signed-off-by: Manikandan Muralidharan [durai.manicka...@microchip.com: update DPI mode bit using is_xlcdc fl

[PATCH v7 6/7] drm: atmel-hlcdc: add vertical and horizontal scaling support for XLCDC

2023-10-05 Thread Manikandan Muralidharan
Update the LCDC_HEOCFG30 and LCDC_HEOCFG31 registers of XLCDC IP which supports vertical and horizontal scaling with Bilinear and Bicubic co-efficients taps for Chroma and Luma componenets of the Pixel. Signed-off-by: Manikandan Muralidharan --- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 2

[PATCH v7 7/7] drm: atmel-hlcdc: add support for DSI output formats

2023-10-05 Thread Manikandan Muralidharan
Add support for the following DPI mode if the encoder type is DSI as per the XLCDC IP datasheet: - 16BPPCFG1 - 16BPPCFG2 - 16BPPCFG3 - 18BPPCFG1 - 18BPPCFG2 - 24BPP Signed-off-by: Manikandan Muralidharan [durai.manicka...@microchip.com: update output format using is_xlcdc flag] Signed-off-by: Dur

Re: [PATCH drm-misc-next v5 0/6] [RFC] DRM GPUVM features

2023-10-05 Thread Thomas Hellström
Hi, Danilo On 9/28/23 21:16, Danilo Krummrich wrote: Currently GPUVM offers common infrastructure to track GPU VA allocations and mappings, generically connect GPU VA mappings to their backing buffers and perform more complex mapping operations on the GPU VA space. However, there are more desig

Re: [PATCH 0/9] drm: Annotate structs with __counted_by

2023-10-05 Thread Christian König
Am 02.10.23 um 20:22 schrieb Kees Cook: On Mon, Oct 02, 2023 at 08:11:41PM +0200, Christian König wrote: Am 02.10.23 um 20:08 schrieb Kees Cook: On Mon, Oct 02, 2023 at 08:01:57PM +0200, Christian König wrote: Am 02.10.23 um 18:53 schrieb Kees Cook: On Mon, Oct 02, 2023 at 11:06:19AM -0400, A

Re: [PATCH] drm/atomic: Perform blocking commits on workqueue

2023-10-05 Thread Daniel Vetter
On Tue, Sep 26, 2023 at 01:05:49PM -0400, Ray Strode wrote: > From: Ray Strode > > A drm atomic commit can be quite slow on some hardware. It can lead > to a lengthy queue of commands that need to get processed and waited > on before control can go back to user space. > > If user space is a real

Re: [PATCH] drm/atomic: Perform blocking commits on workqueue

2023-10-05 Thread Ville Syrjälä
On Thu, Oct 05, 2023 at 11:57:41AM +0200, Daniel Vetter wrote: > On Tue, Sep 26, 2023 at 01:05:49PM -0400, Ray Strode wrote: > > From: Ray Strode > > > > A drm atomic commit can be quite slow on some hardware. It can lead > > to a lengthy queue of commands that need to get processed and waited >

Re: [PATCH] drm/i915/pmu: Use local64_try_cmpxchg in i915_pmu_event_read

2023-10-05 Thread Jani Nikula
On Mon, 03 Jul 2023, Uros Bizjak wrote: > Use local64_try_cmpxchg instead of local64_cmpxchg (*ptr, old, new) == old > in i915_pmu_event_read. x86 CMPXCHG instruction returns success in ZF flag, > so this change saves a compare after cmpxchg (and related move instruction > in front of cmpxchg). >

Re: bulk_move in ttm_resource manager

2023-10-05 Thread Christian König
Am 05.10.23 um 10:36 schrieb Thomas Hellström: On Wed, 2023-10-04 at 14:44 +0200, Christian König wrote: Am 04.10.23 um 09:17 schrieb Thomas Hellström: On Wed, 2023-10-04 at 03:52 +, Zeng, Oak wrote: Hi Christian, As a follow up to this thread: https://www.spinics.net/lists/dri-devel/

Re: [PATCH v4 1/7] drm/format-helper: Cache buffers with struct drm_format_conv_state

2023-10-05 Thread Noralf Trønnes
On 10/5/23 11:04, Thomas Zimmermann wrote: > Hold temporary memory for format conversion in an instance of struct > drm_format_conv_state. Update internal helpers of DRM's format-conversion > code accordingly. Drivers will later be able to maintain this cache by > themselves. > > Besides cachin

Re: [PATCH v4 2/7] drm/atomic-helper: Add format-conversion state to shadow-plane state

2023-10-05 Thread Noralf Trønnes
On 10/5/23 11:04, Thomas Zimmermann wrote: > Store an instance of struct drm_format_conv_state in the shadow-plane > state struct drm_shadow_plane_state. Many drivers with shadow planes > use DRM's format helpers to copy or convert the framebuffer data to > backing storage in the scanout buffer.

Re: [PATCH v4 3/7] drm/format-helper: Pass format-conversion state to helpers

2023-10-05 Thread kernel test robot
Hi Thomas, kernel test robot noticed the following build warnings: [auto build test WARNING on 57d3b83a83c5527325efb5bcaf594da09fe4a41b] url: https://github.com/intel-lab-lkp/linux/commits/Thomas-Zimmermann/drm-format-helper-Cache-buffers-with-struct-drm_format_conv_state/20231005-170643

Re: [PATCH v4 3/7] drm/format-helper: Pass format-conversion state to helpers

2023-10-05 Thread Noralf Trønnes
On 10/5/23 11:04, Thomas Zimmermann wrote: > Pass an instance of struct drm_format_conv_state to DRM's format > conversion helpers. Update all callers. > > Most drivers can use the format-conversion state from their shadow- > plane state. The shadow plane's destroy function releases the > alloc

Re: [PATCH v4 3/7] drm/format-helper: Pass format-conversion state to helpers

2023-10-05 Thread Thomas Zimmermann
Hi Am 05.10.23 um 13:10 schrieb Noralf Trønnes: On 10/5/23 11:04, Thomas Zimmermann wrote: Pass an instance of struct drm_format_conv_state to DRM's format conversion helpers. Update all callers. Most drivers can use the format-conversion state from their shadow- plane state. The shadow plan

Re: [PATCH v4 6/7] drm/ssd130x: Fix atomic_check for disabled planes

2023-10-05 Thread Javier Martinez Canillas
Thomas Zimmermann writes: Hello Thomas, Thanks for your patch. > The plane's atomic_check returns -EINVAL if the CRTC has not been > set. This is the case for disabled planes, for which atomic_check > should return 0. For disabled planes, it also omits the mandatory > call to drm_atomic_helper_

Re: [PATCH v4 7/7] drm/ssd130x: Preallocate format-conversion buffer in atomic_check

2023-10-05 Thread Javier Martinez Canillas
Thomas Zimmermann writes: > Preallocate the format-conversion state's storage in the plane's > atomic_check function if a format conversion is necessary. Allows > the update to fail if no memory is available. Avoids the same > allocation within atomic_update, which may not fail. > > Signed-off-by

Re: [PATCH drm-misc-next v5 3/6] drm/gpuvm: add an abstraction for a VM / BO combination

2023-10-05 Thread Thomas Hellström
Hi, On 9/28/23 21:16, Danilo Krummrich wrote: This patch adds an abstraction layer between the drm_gpuva mappings of NIT: imperative:  s/This patch adds/Add/ a particular drm_gem_object and this GEM object itself. The abstraction represents a combination of a drm_gem_object and drm_gpuvm. The

Re: [PATCH] drm/atomic: Perform blocking commits on workqueue

2023-10-05 Thread Christian König
Am 05.10.23 um 11:57 schrieb Daniel Vetter: On Tue, Sep 26, 2023 at 01:05:49PM -0400, Ray Strode wrote: From: Ray Strode A drm atomic commit can be quite slow on some hardware. It can lead to a lengthy queue of commands that need to get processed and waited on before control can go back to use

Re: [PATCH v4 6/7] drm/ssd130x: Fix atomic_check for disabled planes

2023-10-05 Thread Thomas Zimmermann
Hi Javier Am 05.10.23 um 13:37 schrieb Javier Martinez Canillas: Thomas Zimmermann writes: Hello Thomas, Thanks for your patch. The plane's atomic_check returns -EINVAL if the CRTC has not been set. This is the case for disabled planes, for which atomic_check should return 0. For disabled p

Re: [PATCH drm-misc-next v5 4/6] drm/gpuvm: track/lock/validate external/evicted objects

2023-10-05 Thread Thomas Hellström
On 9/28/23 21:16, Danilo Krummrich wrote: Currently the DRM GPUVM offers common infrastructure to track GPU VA allocations and mappings, generically connect GPU VA mappings to their backing buffers and perform more complex mapping operations on the GPU VA space. However, there are more design

Re: [PATCH 1/5] drm/amd/display: Remove migrate_en/dis from dc_fpu_begin().

2023-10-05 Thread Sebastian Andrzej Siewior
On 2023-10-04 08:10:35 [-0400], Hamza Mahfooz wrote: > I did some digging, and it seems like the intention of that patch was to > fix the following splat: > > WARNING: CPU: 5 PID: 1062 at > drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/dc_fpu.c:71 > dc_assert_fp_enabled+0x1a/0x30 [amdgpu] > [...

Re: [PATCH 0/5] drm/amd/display: Remove migrate-disable and move memory allocation.

2023-10-05 Thread Sebastian Andrzej Siewior
On 2023-10-04 08:44:58 [-0400], Harry Wentland wrote: > CI passed. > > Series is > Acked-by: Harry Wentland Thank you. > Harry Sebastian

Re: [REGRESSION] BUG: KFENCE: memory corruption in drm_gem_put_pages+0x186/0x250

2023-10-05 Thread Matthew Wilcox
On Thu, Oct 05, 2023 at 09:56:03AM +0200, Oleksandr Natalenko wrote: > Hello. > > On čtvrtek 5. října 2023 9:44:42 CEST Thomas Zimmermann wrote: > > Hi > > > > Am 02.10.23 um 17:38 schrieb Oleksandr Natalenko: > > > On pondělí 2. října 2023 16:32:45 CEST Matthew Wilcox wrote: > > >> On Mon, Oct 0

Re: [REGRESSION] BUG: KFENCE: memory corruption in drm_gem_put_pages+0x186/0x250

2023-10-05 Thread Oleksandr Natalenko
Hello. On čtvrtek 5. října 2023 14:19:44 CEST Matthew Wilcox wrote: > On Thu, Oct 05, 2023 at 09:56:03AM +0200, Oleksandr Natalenko wrote: > > Hello. > > > > On čtvrtek 5. října 2023 9:44:42 CEST Thomas Zimmermann wrote: > > > Hi > > > > > > Am 02.10.23 um 17:38 schrieb Oleksandr Natalenko: > >

Re: [PATCH v4 6/7] drm/ssd130x: Fix atomic_check for disabled planes

2023-10-05 Thread Javier Martinez Canillas
Thomas Zimmermann writes: Hello Thomas, > Hi Javier > > Am 05.10.23 um 13:37 schrieb Javier Martinez Canillas: [...] >>> - ret = drm_plane_helper_atomic_check(plane, state); >>> + ret = drm_atomic_helper_check_plane_state(plane_state, crtc_state, >>> +

Re: [PATCH v3 1/2] dt-bindings: backlight: Add MPS MP3309C

2023-10-05 Thread Daniel Thompson
On Wed, Oct 04, 2023 at 03:18:24PM +, Flavio Suligoi wrote: > Hi Daniel, > ... > > ... > > > > > > +required: > > > > > > + - compatible > > > > > > + - reg > > > > > > + - max-brightness > > > > > > > > > > Why is this mandatory? > > > > > > > > > > There's no point in setting max-brightnes

Re: [PATCH v4 6/7] drm/ssd130x: Fix atomic_check for disabled planes

2023-10-05 Thread Javier Martinez Canillas
Javier Martinez Canillas writes: > Thomas Zimmermann writes: > > Hello Thomas, > [...] >> >> You have a atomic_disable in that plane, so you're taking the branch at >> [2] for disabling the plane. No atomic_update then. If the plane has >> been enabled, you should take the branch at [3]. Wit

Re: [REGRESSION] BUG: KFENCE: memory corruption in drm_gem_put_pages+0x186/0x250

2023-10-05 Thread Matthew Wilcox
On Thu, Oct 05, 2023 at 02:30:55PM +0200, Oleksandr Natalenko wrote: > No-no, sorry for possible confusion. Let me explain again: > > 1. we had an issue with i915, which was introduced by 0b62af28f249, and later > was fixed by 863a8eb3f270 > 2. now I've discovered another issue, which looks very

[PATCH] drm/atomic-helper: relax unregistered connector check

2023-10-05 Thread Simon Ser
The driver might pull connectors which weren't submitted by user-space into the atomic state. For instance, intel_dp_mst_atomic_master_trans_check() pulls in connectors sharing the same DP-MST stream. However, if the connector is unregistered, this later fails with: [ 559.425658] i915 :00

Re: [PATCH v4 1/7] drm/format-helper: Cache buffers with struct drm_format_conv_state

2023-10-05 Thread Javier Martinez Canillas
Thomas Zimmermann writes: Hello Thomas, > Hold temporary memory for format conversion in an instance of struct > drm_format_conv_state. Update internal helpers of DRM's format-conversion > code accordingly. Drivers will later be able to maintain this cache by > themselves. > > Besides caching, s

Re: [PATCH v4 2/7] drm/atomic-helper: Add format-conversion state to shadow-plane state

2023-10-05 Thread Javier Martinez Canillas
Thomas Zimmermann writes: > Store an instance of struct drm_format_conv_state in the shadow-plane > state struct drm_shadow_plane_state. Many drivers with shadow planes > use DRM's format helpers to copy or convert the framebuffer data to > backing storage in the scanout buffer. The shadow plane

Re: [PATCH v4 3/7] drm/format-helper: Pass format-conversion state to helpers

2023-10-05 Thread Javier Martinez Canillas
Thomas Zimmermann writes: > Pass an instance of struct drm_format_conv_state to DRM's format > conversion helpers. Update all callers. > > Most drivers can use the format-conversion state from their shadow- > plane state. The shadow plane's destroy function releases the > allocated buffer. Driver

Re: bulk_move in ttm_resource manager

2023-10-05 Thread Thomas Hellström
On 10/5/23 12:44, Christian König wrote: Am 05.10.23 um 10:36 schrieb Thomas Hellström: On Wed, 2023-10-04 at 14:44 +0200, Christian König wrote: Am 04.10.23 um 09:17 schrieb Thomas Hellström: On Wed, 2023-10-04 at 03:52 +, Zeng, Oak wrote: Hi Christian,    As a follow up to this thread

Re: [REGRESSION] BUG: KFENCE: memory corruption in drm_gem_put_pages+0x186/0x250

2023-10-05 Thread Oleksandr Natalenko
On čtvrtek 5. října 2023 15:05:27 CEST Matthew Wilcox wrote: > On Thu, Oct 05, 2023 at 02:30:55PM +0200, Oleksandr Natalenko wrote: > > No-no, sorry for possible confusion. Let me explain again: > > > > 1. we had an issue with i915, which was introduced by 0b62af28f249, and > > later was fixed by

Re: [PATCH v3] drm/dp_mst: Fix NULL deref in get_mst_branch_device_by_guid_helper()

2023-10-05 Thread Lukasz Majczak
wt., 26 wrz 2023 o 16:01 Radosław Biernacki napisał(a): > > On Fri, Sep 22, 2023 at 8:34 AM Lukasz Majczak wrote: > > > > As drm_dp_get_mst_branch_device_by_guid() is called from > > drm_dp_get_mst_branch_device_by_guid(), mstb parameter has to be checked, > > otherwise NULL dereference may occur

Re: [PATCH v4 4/7] drm/ofdrm: Preallocate format-conversion buffer in atomic_check

2023-10-05 Thread Javier Martinez Canillas
Thomas Zimmermann writes: > Preallocate the format-conversion state's storage in the plane's > atomic_check function if a format conversion is necessary. Allows > the update to fail if no memory is available. Avoids the same > allocation within atomic_update, which may not fail. > > Signed-off-by

Re: [PATCH v4 5/7] drm/simpledrm: Preallocate format-conversion buffer in atomic_check

2023-10-05 Thread Javier Martinez Canillas
Thomas Zimmermann writes: Hello Thomas, > Preallocate the format-conversion state's storage in the plane's > atomic_check function if a format conversion is necessary. Allows > the update to fail if no memory is available. Avoids the same > allocation within atomic_update, which may not fail. >

[PATCH] drm: Do not overrun array in drm_gem_get_pages()

2023-10-05 Thread Matthew Wilcox (Oracle)
If the shared memory object is larger than the DRM object that it backs, we can overrun the page array. Limit the number of pages we install from each folio to prevent this. Signed-off-by: Matthew Wilcox (Oracle) Reported-by: Oleksandr Natalenko Tested-by: Oleksandr Natalenko Link: https://lor

[PATCH] Documentation/gpu: fix Panfrost documentation build warnings

2023-10-05 Thread Adrián Larumbe
Fix issues revealed by `make htmldocs` after adding Panfrost DRM documentation file. Signed-off-by: Adrián Larumbe Fixes: d124dac2089c ("drm/panfrost: Add fdinfo support GPU load metrics") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202310030917.txzlpoeq-...@int

[PULL] drm-intel-fixes

2023-10-05 Thread Rodrigo Vivi
Hi Dave and Daniel, Here goes drm-intel-fixes-2023-10-05: - Fix for OpenGL CTS regression on Compute Shaders (Nirmoy) - Fix for default engines initialization (Mathias) - Fix TLB invalidation for Multi-GT devices (Chris) Thanks, Rodrigo. The following changes since commit 8a749fd1a8720d4619c91c

Re: [PATCH] drm/amdgpu: Annotate struct amdgpu_bo_list with __counted_by

2023-10-05 Thread Christian König
Am 04.10.23 um 01:29 schrieb Kees Cook: Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURC

Re: [Intel-gfx] [PATCH] drm/dp: switch drm_dp_downstream_*() helpers to struct drm_edid

2023-10-05 Thread Jani Nikula
On Wed, 04 Oct 2023, Ville Syrjälä wrote: > On Wed, Oct 04, 2023 at 07:21:49PM +0300, Jani Nikula wrote: >> Prefer struct drm_edid where possible. With limited users for the >> drm_dp_downstream_*() helpers, this is fairly straightforward. >> >> Signed-off-by: Jani Nikula > > Reviewed-by: Ville

Re: linux-next: manual merge of the drm-intel tree with the drm tree

2023-10-05 Thread Jani Nikula
On Tue, 03 Oct 2023, Stephen Rothwell wrote: > Hi all, > > Today's linux-next merge of the drm-intel tree got a conflict in: > > drivers/gpu/drm/i915/i915_drv.h > > between commits: > > c9517783060a ("drm/i915/dg2: Drop Wa_16011777198") > 5a213086a025 ("drm/i915: Eliminate IS_MTL_GRAPHICS_ST

Re: [PATCH v4 1/7] drm/format-helper: Cache buffers with struct drm_format_conv_state

2023-10-05 Thread Thomas Zimmermann
Hi Am 05.10.23 um 15:18 schrieb Javier Martinez Canillas: Thomas Zimmermann writes: Hello Thomas, Hold temporary memory for format conversion in an instance of struct drm_format_conv_state. Update internal helpers of DRM's format-conversion code accordingly. Drivers will later be able to mai

Re: [PATCH] Documentation/gpu: fix Panfrost documentation build warnings

2023-10-05 Thread Steven Price
On 05/10/2023 15:12, Adrián Larumbe wrote: > Fix issues revealed by `make htmldocs` after adding Panfrost DRM > documentation file. > > Signed-off-by: Adrián Larumbe > Fixes: d124dac2089c ("drm/panfrost: Add fdinfo support GPU load metrics") > Reported-by: kernel test robot > Closes: > https://

Re: [PATCH v4 02/10] drm/sched: Convert drm scheduler to use a work queue rather than kthread

2023-10-05 Thread Matthew Brost
On Thu, Oct 05, 2023 at 12:13:01AM -0400, Luben Tuikov wrote: > On 2023-10-04 23:33, Matthew Brost wrote: > > On Tue, Sep 26, 2023 at 11:32:10PM -0400, Luben Tuikov wrote: > >> Hi, > >> > >> On 2023-09-19 01:01, Matthew Brost wrote: > >>> In XE, the new Intel GPU driver, a choice has made to have a

Re: [PATCH v4 1/7] drm/format-helper: Cache buffers with struct drm_format_conv_state

2023-10-05 Thread Javier Martinez Canillas
Thomas Zimmermann writes: > Hi > [...] >> >> I'm confused, the copy helper is the same than init. What's the point of >> this function ? Why not just call drm_format_conv_state_init() from the >> __drm_gem_duplicate_shadow_plane_state() function in the next patch ? > > I guess that deserves a

Re: [PATCH V4 0/2] Support Anbernic RG351V Panel

2023-10-05 Thread Neil Armstrong
Hi, On Tue, 03 Oct 2023 11:33:53 -0500, Chris Morgan wrote: > From: Chris Morgan > > Add support for the Anbernic RG351V panel. This panel is mostly > identical to the one used in the 353 series, except it has a different > panel ID when queried (0x4000 for the 351V, 0x3052 for the 353 panel) >

Re: [PATCH 0/9] drm: Annotate structs with __counted_by

2023-10-05 Thread Kees Cook
On Thu, Oct 05, 2023 at 11:42:38AM +0200, Christian König wrote: > Am 02.10.23 um 20:22 schrieb Kees Cook: > > On Mon, Oct 02, 2023 at 08:11:41PM +0200, Christian König wrote: > > > Am 02.10.23 um 20:08 schrieb Kees Cook: > > > > On Mon, Oct 02, 2023 at 08:01:57PM +0200, Christian König wrote: > >

Re: [PATCH] drm/amd/display: Fix mst hub unplug warning

2023-10-05 Thread Alex Deucher
On Thu, Oct 5, 2023 at 4:04 AM Wayne Lin wrote: > > [Why] > Unplug mst hub will cause warning. That's because > dm_helpers_construct_old_payload() is changed to be called after > payload removement from dc link. > > In dm_helpers_construct_old_payload(), We refer to the vcpi in > payload allocatio

[PATCH v4 00/32] drm/amd/display: add AMD driver-specific properties for color mgmt

2023-10-05 Thread Melissa Wen
Hello, Just another iteration for AMD driver-specific color properties. Basically, addressing comments from the previous version. Recap: this series extends the current KMS color management API with AMD driver-specific properties to enhance the color management support on AMD Steam Deck. The key

[PATCH v4 01/32] drm/drm_mode_object: increase max objects to accommodate new color props

2023-10-05 Thread Melissa Wen
DRM_OBJECT_MAX_PROPERTY limits the number of properties to be attached and we are increasing that value all time we add a new property (generic or driver-specific). In this series, we are adding 13 new KMS driver-specific properties for AMD color manage: - CRTC Gamma enumerated Transfer Function -

[PATCH v4 04/32] drm/amd/display: add driver-specific property for plane degamma LUT

2023-10-05 Thread Melissa Wen
Hook up driver-specific atomic operations for managing AMD color properties. Create AMD driver-specific color management properties and attach them according to HW capabilities defined by `struct dc_color_caps`. First add plane degamma LUT properties that means user-blob and its size. We will add

[PATCH v4 02/32] drm/drm_property: make replace_property_blob_from_id a DRM helper

2023-10-05 Thread Melissa Wen
Place it in drm_property where drm_property_replace_blob and drm_property_lookup_blob live. Then we can use the DRM helper for driver-specific KMS properties too. Reviewed-by: Harry Wentland Reviewed-by: Liviu Dudau Signed-off-by: Melissa Wen --- drivers/gpu/drm/arm/malidp_crtc.c | 2 +- driv

[PATCH v4 03/32] drm/drm_plane: track color mgmt changes per plane

2023-10-05 Thread Melissa Wen
We will add color mgmt properties to DRM planes in the next patches and we want to track when one of this properties change to define atomic commit behaviors. Using a similar approach from CRTC color props, we set a color_mgmt_changed boolean whenever a plane color prop changes. Reviewed-by: Harry

[PATCH v4 05/32] drm/amd/display: add plane degamma TF driver-specific property

2023-10-05 Thread Melissa Wen
From: Joshua Ashton Allow userspace to tell the kernel driver the input space and, therefore, uses correct predefined transfer function (TF) to go from encoded values to linear values. v2: - rename TF enum prefix from DRM_ to AMDGPU_ (Harry) - remove HLG TF Reviewed-by: Harry Wentland Signed-o

[PATCH v4 09/32] drm/amd/display: add plane 3D LUT driver-specific properties

2023-10-05 Thread Melissa Wen
Add 3D LUT property for plane color transformations using a 3D lookup table. 3D LUT allows for highly accurate and complex color transformations and is suitable to adjust the balance between color channels. It's also more complex to manage and require more computational resources. Since a 3D LUT h

[PATCH v4 06/32] drm/amd/display: explicitly define EOTF and inverse EOTF

2023-10-05 Thread Melissa Wen
Instead of relying on color block names to get the transfer function intention regarding encoding pixel's luminance, define supported Electro-Optical Transfer Functions (EOTFs) and inverse EOTFs, that includes pure gamma or standardized transfer functions. v3: - squash linear and unity TFs to iden

[PATCH v4 08/32] drm/amd/display: add plane HDR multiplier driver-specific property

2023-10-05 Thread Melissa Wen
From: Joshua Ashton Multiplier to 'gain' the plane. When PQ is decoded using the fixed func transfer function to the internal FP16 fb, 1.0 -> 80 nits (on AMD at least) When sRGB is decoded, 1.0 -> 1.0. Therefore, 1.0 multiplier = 80 nits for SDR content. So if you want, 203 nits for SDR content,

[PATCH v4 11/32] drm/amd/display: add plane blend LUT and TF driver-specific properties

2023-10-05 Thread Melissa Wen
From: Joshua Ashton Blend 1D LUT or a pre-defined transfer function (TF) can be set to linearize content before blending, so that it's positioned just before blending planes in the AMD color mgmt pipeline, and after 3D LUT (non-linear space). Shaper and Blend LUTs are 1D LUTs that sandwich 3D LUT

[PATCH v4 07/32] drm/amd/display: document AMDGPU pre-defined transfer functions

2023-10-05 Thread Melissa Wen
Brief documentation about pre-defined transfer function usage on AMD display driver and standardized EOTFs and inverse EOTFs. v3: - Document BT709 OETF (Pekka) - Fix description of sRGB and pure power funcs (Pekka) v4: - Add description of linear and non-linear forms (Harry) Co-developed-by: Har

[PATCH v4 10/32] drm/amd/display: add plane shaper LUT and TF driver-specific properties

2023-10-05 Thread Melissa Wen
On AMD HW, 3D LUT always assumes a preceding shaper 1D LUT used for delinearizing and/or normalizing the color space before applying a 3D LUT. Add pre-defined transfer function to enable delinearizing content with or without shaper LUT, where AMD color module calculates the resulted shaper curve. W

[PATCH v4 13/32] drm/amd/display: add comments to describe DM crtc color mgmt behavior

2023-10-05 Thread Melissa Wen
Describe some expected behavior of the AMD DM color mgmt programming. Reviewed-by: Harry Wentland Signed-off-by: Melissa Wen --- .../drm/amd/display/amdgpu_dm/amdgpu_dm_color.c | 16 ++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/display/amd

[PATCH v4 14/32] drm/amd/display: encapsulate atomic regamma operation

2023-10-05 Thread Melissa Wen
We will wire up MPC 3D LUT to DM CRTC color pipeline in the next patch, but so far, only for atomic interface. By checking set_output_transfer_func in DC drivers with MPC 3D LUT support, we can verify that regamma is only programmed when 3D LUT programming fails. As a groundwork to introduce 3D LUT

[PATCH v4 15/32] drm/amd/display: add CRTC gamma TF support

2023-10-05 Thread Melissa Wen
From: Joshua Ashton Add predefined transfer function programming. There is no post-blending out gamma ROM for hardcoded curves, but we can use AMD color modules to program LUT parameters from pre-defined coefficients and an empty regamma LUT (or bump up LUT parameters with pre-defined TF values).

[PATCH v4 16/32] drm/amd/display: set sdr_ref_white_level to 80 for out_transfer_func

2023-10-05 Thread Melissa Wen
From: Joshua Ashton Otherwise this is just initialized to 0. This needs to actually have a value so that compute_curve can work for PQ EOTF. Reviewed-by: Harry Wentland Signed-off-by: Joshua Ashton Co-developed-by: Melissa Wen Signed-off-by: Melissa Wen --- drivers/gpu/drm/amd/display/amdgp

[PATCH v4 17/32] drm/amd/display: mark plane as needing reset if color props change

2023-10-05 Thread Melissa Wen
From: Joshua Ashton We should reset a plane state if at least one of the color management properties differs from old and new state. Reviewed-by: Harry Wentland Signed-off-by: Joshua Ashton Co-developed-by: Melissa Wen Signed-off-by: Melissa Wen --- drivers/gpu/drm/amd/display/amdgpu_dm/amd

[PATCH v4 18/32] drm/amd/display: decouple steps for mapping CRTC degamma to DC plane

2023-10-05 Thread Melissa Wen
The next patch adds pre-blending degamma to AMD color mgmt pipeline, but pre-blending degamma caps (DPP) is currently in use to provide DRM CRTC atomic degamma or implict degamma on legacy gamma. Detach degamma usage regarging CRTC color properties to manage plane and CRTC color correction combinat

[PATCH v4 12/32] drm/amd/display: add CRTC gamma TF driver-specific property

2023-10-05 Thread Melissa Wen
Add AMD pre-defined transfer function property to default DRM CRTC gamma to convert to wire encoding with or without a user gamma LUT. There is no post-blending regamma ROM for pre-defined TF. When setting Gamma TF (!= Identity) and LUT at the same time, the color module will combine the pre-define

[PATCH v4 23/32] drm/amd/display: add plane shaper LUT support

2023-10-05 Thread Melissa Wen
Map DC shaper LUT to DM plane color management. Shaper LUT can be used to delinearize and/or normalize the color space for computational efficiency and achiving specific visual styles. If a plane degamma is apply to linearize the color space, a custom shaper 1D LUT can be used just before applying

[PATCH v4 19/32] drm/amd/display: add plane degamma TF and LUT support

2023-10-05 Thread Melissa Wen
From: Joshua Ashton Set DC plane with user degamma LUT or predefined TF from driver-specific plane color properties. If plane and CRTC degamma are set in the same time, plane degamma has priority. That means, we only set CRTC degamma if we don't have plane degamma LUT or TF to configure. We retu

[PATCH v4 21/32] drm/amd/display: add dc_fixpt_from_s3132 helper

2023-10-05 Thread Melissa Wen
From: Joshua Ashton Detach value translation from CTM to reuse it for programming HDR multiplier property. Reviewed-by: Harry Wentland Signed-off-by: Joshua Ashton Signed-off-by: Melissa Wen --- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c | 8 +--- drivers/gpu/drm/amd/display/i

[PATCH v4 22/32] drm/amd/display: add HDR multiplier support

2023-10-05 Thread Melissa Wen
From: Joshua Ashton With `dc_fixpt_from_s3132()` translation, we can just use it to set hdr_mult. Reviewed-by: Harry Wentland Signed-off-by: Joshua Ashton Signed-off-by: Melissa Wen --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 1 + drivers/gpu/drm/amd/display/amdgpu_dm/amdgp

[PATCH v4 20/32] drm/amd/display: reject atomic commit if setting both plane and CRTC degamma

2023-10-05 Thread Melissa Wen
DC only has pre-blending degamma caps (plane/DPP) that is currently in use for CRTC/post-blending degamma, so that we don't have HW caps to perform plane and CRTC degamma at the same time. Reject atomic updates when serspace sets both plane and CRTC degamma properties. Reviewed-by: Harry Wentland

  1   2   >