]> Git Repo - linux.git/log
linux.git
5 months agodrm/v3d: Use v3d_perfmon_find()
Christian Gmeiner [Mon, 23 Sep 2024 15:19:59 +0000 (17:19 +0200)]
drm/v3d: Use v3d_perfmon_find()

Replace the open-coded v3d_perfmon_find() with the real thing.

Signed-off-by: Christian Gmeiner <[email protected]>
Reviewed-by: Maíra Canal <[email protected]>
Signed-off-by: Maíra Canal <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 months agodrm: renesas: rcar-du: Add drm_panic support for non-vsp
Geert Uytterhoeven [Mon, 27 May 2024 13:35:49 +0000 (15:35 +0200)]
drm: renesas: rcar-du: Add drm_panic support for non-vsp

Add support for the drm_panic module for DU variants not using the
VSP-compositor, to display a message on the screen when a kernel panic
occurs.

Signed-off-by: Geert Uytterhoeven <[email protected]>
Reviewed-by: Jocelyn Falempe <[email protected]>
Acked-by: Sui Jingfeng <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/b633568d2e3f405b21debdd60854fe39780254d6.1716816897.git.geert+renesas@glider.be
Signed-off-by: Maxime Ripard <[email protected]>
5 months agodrm: renesas: shmobile: Add drm_panic support
Geert Uytterhoeven [Mon, 27 May 2024 13:34:48 +0000 (15:34 +0200)]
drm: renesas: shmobile: Add drm_panic support

Add support for the drm_panic module, which displays a message on
the screen when a kernel panic occurs.

Signed-off-by: Geert Uytterhoeven <[email protected]>
Reviewed-by: Jocelyn Falempe <[email protected]>
Acked-by: Sui Jingfeng <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/292638fde9aef8b00e984245f43dc02a818cf322.1716816827.git.geert+renesas@glider.be
Signed-off-by: Maxime Ripard <[email protected]>
5 months agodrm/sched: Add locking to drm_sched_entity_modify_sched
Tvrtko Ursulin [Tue, 24 Sep 2024 10:19:07 +0000 (11:19 +0100)]
drm/sched: Add locking to drm_sched_entity_modify_sched

Without the locking amdgpu currently can race between
amdgpu_ctx_set_entity_priority() (via drm_sched_entity_modify_sched()) and
drm_sched_job_arm(), leading to the latter accesing potentially
inconsitent entity->sched_list and entity->num_sched_list pair.

v2:
 * Improve commit message. (Philipp)

Signed-off-by: Tvrtko Ursulin <[email protected]>
Fixes: b37aced31eb0 ("drm/scheduler: implement a function to modify sched list")
Cc: Christian König <[email protected]>
Cc: Alex Deucher <[email protected]>
Cc: Luben Tuikov <[email protected]>
Cc: Matthew Brost <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Daniel Vetter <[email protected]>
Cc: [email protected]
Cc: Philipp Stanner <[email protected]>
Cc: <[email protected]> # v5.7+
Reviewed-by: Christian König <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Christian König <[email protected]>
5 months agodrm/ci: uprev mesa, IGT and deqp-runner
Vignesh Raman [Tue, 10 Sep 2024 13:19:24 +0000 (18:49 +0530)]
drm/ci: uprev mesa, IGT and deqp-runner

Uprev mesa, IGT to the latest version and deqp-runner
to v0.20.0. Also update expectation files.

Acked-by: Helen Koike <[email protected]>
Reviewed-by: Daniel Stone <[email protected]>
Signed-off-by: Vignesh Raman <[email protected]>
Signed-off-by: Helen Koike <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 months agodrm/scheduler: Improve documentation
Shuicheng Lin [Tue, 17 Sep 2024 14:47:32 +0000 (14:47 +0000)]
drm/scheduler: Improve documentation

Function drm_sched_entity_push_job() doesn't have a return value,
remove the return value description for it.
Correct several other typo errors.

v2 (Philipp):
- more correction with related comments.

Signed-off-by: Shuicheng Lin <[email protected]>
Reviewed-by: Philipp Stanner <[email protected]>
Signed-off-by: Simona Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 months agoaccel/ivpu: Fix a typo
Andrew Kreimer [Mon, 9 Sep 2024 13:56:38 +0000 (16:56 +0300)]
accel/ivpu: Fix a typo

Fix a typo in comments.

Reported-by: Matthew Wilcox <[email protected]>
Signed-off-by: Andrew Kreimer <[email protected]>
Signed-off-by: Simona Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 months agodrm: Link drm_rect.o into DRM core module
Thomas Zimmermann [Thu, 19 Sep 2024 18:53:43 +0000 (20:53 +0200)]
drm: Link drm_rect.o into DRM core module

Several places in drm.ko use struct drm_rect and its helpers. This
only works as the called interfaces are declared as static inline in
the header file. Fix the issue by linking drm_rect.o into drm.ko.

Signed-off-by: Thomas Zimmermann <[email protected]>
Suggested-by: Ville Syrjälä <[email protected]>
Reviewed-by: Ville Syrjälä <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 months agodrm/sti: avoid potential dereference of error pointers
Ma Ke [Fri, 13 Sep 2024 09:04:12 +0000 (17:04 +0800)]
drm/sti: avoid potential dereference of error pointers

The return value of drm_atomic_get_crtc_state() needs to be
checked. To avoid use of error pointer 'crtc_state' in case
of the failure.

Cc: [email protected]
Fixes: dd86dc2f9ae1 ("drm/sti: implement atomic_check for the planes")
Signed-off-by: Ma Ke <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Alain Volmat <[email protected]>
5 months agodrm/sti: avoid potential dereference of error pointers in sti_gdp_atomic_check
Ma Ke [Mon, 9 Sep 2024 06:33:59 +0000 (14:33 +0800)]
drm/sti: avoid potential dereference of error pointers in sti_gdp_atomic_check

The return value of drm_atomic_get_crtc_state() needs to be
checked. To avoid use of error pointer 'crtc_state' in case
of the failure.

Cc: [email protected]
Fixes: dd86dc2f9ae1 ("drm/sti: implement atomic_check for the planes")
Signed-off-by: Ma Ke <[email protected]>
Acked-by: Alain Volmat <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Alain Volmat <[email protected]>
5 months agodrm/sti: avoid potential dereference of error pointers in sti_hqvdp_atomic_check
Ma Ke [Fri, 13 Sep 2024 09:09:26 +0000 (17:09 +0800)]
drm/sti: avoid potential dereference of error pointers in sti_hqvdp_atomic_check

The return value of drm_atomic_get_crtc_state() needs to be
checked. To avoid use of error pointer 'crtc_state' in case
of the failure.

Cc: [email protected]
Fixes: dd86dc2f9ae1 ("drm/sti: implement atomic_check for the planes")
Signed-off-by: Ma Ke <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Alain Volmat <[email protected]>
5 months agodma-buf: Add syntax highlighting to code listings in the document
Tommy Chiang [Fri, 19 Jan 2024 03:31:26 +0000 (03:31 +0000)]
dma-buf: Add syntax highlighting to code listings in the document

This patch tries to improve the display of the code listing
on The Linux Kernel documentation website for dma-buf [1] .

Originally, it appears that it was attempting to escape
the '*' character, but looks like it's not necessary (now),
so we are seeing something like '\*' on the webite.

This patch removes these unnecessary backslashes and adds syntax
highlighting to improve the readability of the code listing.

[1] https://docs.kernel.org/driver-api/dma-buf.html

Signed-off-by: Tommy Chiang <[email protected]>
Reviewed-by: T.J. Mercier <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Christian König <[email protected]>
5 months agodrm/mcde: Enable module autoloading
Liao Chen [Mon, 2 Sep 2024 11:33:20 +0000 (11:33 +0000)]
drm/mcde: Enable module autoloading

Add MODULE_DEVICE_TABLE(), so modules could be properly autoloaded based
on the alias from of_device_id table.

Signed-off-by: Liao Chen <[email protected]>
Reviewed-by: Linus Walleij <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Dmitry Baryshkov <[email protected]>
5 months agodrm/bridge: it6505: Enable module autoloading
Liao Chen [Mon, 2 Sep 2024 11:33:18 +0000 (11:33 +0000)]
drm/bridge: it6505: Enable module autoloading

Add MODULE_DEVICE_TABLE(), so modules could be properly autoloaded based
on the alias from of_device_id table.

Signed-off-by: Liao Chen <[email protected]>
Reviewed-by: Neil Armstrong <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Dmitry Baryshkov <[email protected]>
5 months agodt-bindings: lcdif: Document the dmas/dma-names properties
Fabio Estevam [Tue, 3 Sep 2024 16:27:29 +0000 (13:27 -0300)]
dt-bindings: lcdif: Document the dmas/dma-names properties

i.MX28 has an RX DMA channel associated with the LCDIF controller.

Document the 'dmas' and 'dma-names' properties to fix the following
dt-schema warnings:

lcdif@80030000: 'dma-names', 'dmas' do not match any of the regexes: 'pinctrl-[0-9]+'

Signed-off-by: Fabio Estevam <[email protected]>
Reviewed-by: Krzysztof Kozlowski <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
[DB: added extra empty line, requested by Krzysztof]
Signed-off-by: Dmitry Baryshkov <[email protected]>
5 months agodrm/panel: nt35510: Make new commands optional
Linus Walleij [Sun, 8 Sep 2024 21:50:30 +0000 (23:50 +0200)]
drm/panel: nt35510: Make new commands optional

The commit introducing the Frida display started to write the
SETVCMOFF registers unconditionally, and some (not all!) Hydis
display seem to be affected by ghosting after the commit.

Make SETVCMOFF optional and only send these commands on the
Frida display for now.

Reported-by: Stefan Hansson <[email protected]>
Fixes: 219a1f49094f ("drm/panel: nt35510: support FRIDA FRD400B25025-A-CTK")
Acked-by: Jessica Zhang <[email protected]>
Tested-by: Stefan Hansson <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 months agodrm/imx: Add missing DRM_BRIDGE_CONNECTOR dependency
Alexander Stein [Fri, 6 Sep 2024 06:38:56 +0000 (08:38 +0200)]
drm/imx: Add missing DRM_BRIDGE_CONNECTOR dependency

When drm/bridge-connector was moved to DRM_DISPLAY_HELPER not all
users were updated. Add missing Kconfig selections.

Fixes: 9da7ec9b19d8 ("drm/bridge-connector: move to DRM_DISPLAY_HELPER module")
Signed-off-by: Alexander Stein <[email protected]>
Reviewed-by: Dmitry Baryshkov <[email protected]>
Acked-by: Philipp Zabel <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Dmitry Baryshkov <[email protected]>
5 months agodrm: panel-orientation-quirks: Add quirk for AYA NEO GEEK
Joaquín Ignacio Aramendía [Mon, 16 Sep 2024 13:18:55 +0000 (15:18 +0200)]
drm: panel-orientation-quirks: Add quirk for AYA NEO GEEK

Add quirk orientation for AYA NEO GEEK. The name appears without
spaces in DMI strings. The board name is completely different to
the previous models making it difficult to reuse their quirks
despite being the same resolution and using the same orientation.

Tested by the JELOS team that has been patching their own kernel for a
while now and confirmed by users in the AYA NEO and ChimeraOS discord
servers.

Signed-off-by: Joaquín Ignacio Aramendía <[email protected]>
Signed-off-by: Tobias Jakobi <[email protected]>
Reviewed-by: Dmitry Baryshkov <[email protected]>
Reviewed-by: Hans de Goede <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/40350b0d63fe2b54e7cba1e14be50917203f0079.1726492131.git.tjakobi@math.uni-bielefeld.de
Signed-off-by: Dmitry Baryshkov <[email protected]>
5 months agodrm: panel-orientation-quirks: Add quirk for AYA NEO Founder edition
Joaquín Ignacio Aramendía [Mon, 16 Sep 2024 13:18:53 +0000 (15:18 +0200)]
drm: panel-orientation-quirks: Add quirk for AYA NEO Founder edition

Add quirk orientation for AYA NEO Founder. The name appears with spaces in
DMI strings as other devices of the brand. The panel is the same as the
NEXT and 2021 models. Those could not be reused as the former has VENDOR
name as "AYANEO" without spaces and the latter has "AYADEVICE".

Tested by the JELOS team that has been patching their own kernel for a
while now and confirmed by users in the AYA NEO and ChimeraOS discord
servers.

Signed-off-by: Joaquín Ignacio Aramendía <[email protected]>
Signed-off-by: Tobias Jakobi <[email protected]>
Reviewed-by: Dmitry Baryshkov <[email protected]>
Reviewed-by: Hans de Goede <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/f71889a0b39f13f4b78481bd030377ca15035680.1726492131.git.tjakobi@math.uni-bielefeld.de
Signed-off-by: Dmitry Baryshkov <[email protected]>
5 months agodrm: panel-orientation-quirks: Add quirk for AYA NEO 2 model
Joaquín Ignacio Aramendía [Mon, 16 Sep 2024 13:18:51 +0000 (15:18 +0200)]
drm: panel-orientation-quirks: Add quirk for AYA NEO 2 model

Add quirk orientation for AYA NEO 2. The name appears without spaces in
DMI strings. That made it difficult to reuse the 2021 match. Also the
display is larger in resolution.

Tested by the JELOS team that has been patching their own kernel for a
while now and confirmed by users in the AYA NEO and ChimeraOS discord
servers.

Signed-off-by: Joaquín Ignacio Aramendía <[email protected]>
Signed-off-by: Tobias Jakobi <[email protected]>
Reviewed-by: Dmitry Baryshkov <[email protected]>
Reviewed-by: Hans de Goede <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/2b35545b77a9fd8c9699b751ca282226dcecb1dd.1726492131.git.tjakobi@math.uni-bielefeld.de
Signed-off-by: Dmitry Baryshkov <[email protected]>
5 months agodrm/imx/ipuv3: Use IRQF_NO_AUTOEN flag in request_irq()
Jinjie Ruan [Thu, 12 Sep 2024 08:30:18 +0000 (16:30 +0800)]
drm/imx/ipuv3: Use IRQF_NO_AUTOEN flag in request_irq()

disable_irq() after request_irq() still has a time gap in which
interrupts can come. request_irq() with IRQF_NO_AUTOEN flag will
disable IRQ auto-enable when request IRQ.

Fixes: 47b1be5c0f4e ("staging: imx/drm: request irq only after adding the crtc")
Reviewed-by: Dmitry Baryshkov <[email protected]>
Signed-off-by: Jinjie Ruan <[email protected]>
Reviewed-by: Philipp Zabel <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Dmitry Baryshkov <[email protected]>
5 months agodrm/imx/dcss: Use IRQF_NO_AUTOEN flag in request_irq()
Jinjie Ruan [Thu, 12 Sep 2024 08:30:17 +0000 (16:30 +0800)]
drm/imx/dcss: Use IRQF_NO_AUTOEN flag in request_irq()

disable_irq() after request_irq() still has a time gap in which
interrupts can come. request_irq() with IRQF_NO_AUTOEN flag will
disable IRQ auto-enable when request IRQ.

Fixes: 9021c317b770 ("drm/imx: Add initial support for DCSS on iMX8MQ")
Reviewed-by: Dmitry Baryshkov <[email protected]>
Signed-off-by: Jinjie Ruan <[email protected]>
Reviewed-by: Laurentiu Palcu <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Dmitry Baryshkov <[email protected]>
5 months agodrm/imx/dcss: Use IRQF_NO_AUTOEN flag in request_irq()
Jinjie Ruan [Thu, 12 Sep 2024 08:30:16 +0000 (16:30 +0800)]
drm/imx/dcss: Use IRQF_NO_AUTOEN flag in request_irq()

disable_irq() after request_irq() still has a time gap in which
interrupts can come. request_irq() with IRQF_NO_AUTOEN flag will
disable IRQ auto-enable when request IRQ.

Fixes: 9021c317b770 ("drm/imx: Add initial support for DCSS on iMX8MQ")
Signed-off-by: Jinjie Ruan <[email protected]>
Reviewed-by: Laurentiu Palcu <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
[DB: fixed the subject]
Signed-off-by: Dmitry Baryshkov <[email protected]>
5 months agoudmabuf: reuse folio array when pin folios
Huan Yang [Wed, 18 Sep 2024 02:52:30 +0000 (10:52 +0800)]
udmabuf: reuse folio array when pin folios

When invoke memfd_pin_folios, we need offer an array to save each folio
which we pinned.

The current way is dynamic alloc an array(use kvmalloc), get folios,
save into udmabuf and then free.

Depend on the size, kvmalloc can do something different:

Below PAGE_SIZE, slab allocator will be used, which have good alloc
performance, due to it cached page.

PAGE_SIZE - PCP Order, PCP(per-cpu-pageset) also given buddy page a
cache in each CPU, so different CPU no need to hold some lock(zone or
some) to get the locally page. If PCP cached page, the access also fast.

PAGE_SIZE - BUDDY_MAX, try to get page from buddy, due to kvmalloc adjusted
the gfp flags, if zone freelist can't alloc page(fast path), we will not
enter slowpath to reclaim memory. Due to need hold lock and check, may
slow, but still fast than vmalloc.

Anything wrong will fallback into vmalloc to alloc memory, it obtains
contiguous virtual addresses by loop alloc order 0 page(PAGE_SIZE), and
then map it into vmalloc area. If necessary, page alloc may enter
slowpath to reclaim memory. Hence, if fallback into vmalloc, it's slow.

When create, we need to iter each udmabuf item, then pin it's range
folios, if each item's range folio's count is large, we may fallback each
into vmalloc.

This patch find the largest range folio in items, then alloc this size's
folio array. When pin range folios, reuse this array.

Signed-off-by: Huan Yang <[email protected]>
Acked-by: Vivek Kasireddy <[email protected]>
Signed-off-by: Vivek Kasireddy <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 months agoudmabuf: remove udmabuf_folio
Huan Yang [Wed, 18 Sep 2024 02:52:29 +0000 (10:52 +0800)]
udmabuf: remove udmabuf_folio

Currently, udmabuf handles folio by create an unpin list to record
each folio obtained from the list and unpinning them when released. To
maintain this, many struct have been established.

However, maintain this requires a significant amount of memory and
iter the list is a substantial overhead, which is not friendly to the
CPU cache.

When create, we arranged the folio array in the order of pin and set
the offset according to pgcnt. So, if record each pinned folio when
create, then can easy unpin it. Compare to use list to record it,
an array also can do this.

Hence, this patch setup a pinned_folios array(size is the pgcnt) to
instead of udmabuf_folio struct, it record each folio which pinned when
invoke memfd_pin_folios, then unpin folio by iter pinned_folios.

Note that, since a folio may be pinned multiple times, each folio can be
added to pinned_folios multiple times, depend on how many times the
folio has been pinned when create.

Compare to udmabuf_folio(24 byte size), a folio pointer is 8 byte, if no
large folio - each folio is PAGE_SIZE - and need to unpin when release.
So need to record each folio, by this patch, each folio can save 16 byte.

But if large folio used, depend on the large folio's number, the
pinned_folios array may take more memory, but it still can makes unpin
access more cache-friendly.

Signed-off-by: Huan Yang <[email protected]>
Acked-by: Vivek Kasireddy <[email protected]>
Signed-off-by: Vivek Kasireddy <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 months agoudmabuf: introduce udmabuf init and deinit helper
Huan Yang [Wed, 18 Sep 2024 02:52:28 +0000 (10:52 +0800)]
udmabuf: introduce udmabuf init and deinit helper

After udmabuf is allocated, its resources need to be initialized,
including various array structures. The current array structure has
already been greatly expanded.

Also, before udmabuf needs to be kfree, the occupied resources need to
be released.

This part is repetitive and maybe overlooked.

This patch give a helper function when init and deinit, by this,
reduce duplicate code.

Signed-off-by: Huan Yang <[email protected]>
Acked-by: Vivek Kasireddy <[email protected]>
Signed-off-by: Vivek Kasireddy <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 months agoudmabuf: udmabuf_create pin folio codestyle cleanup
Huan Yang [Wed, 18 Sep 2024 02:52:27 +0000 (10:52 +0800)]
udmabuf: udmabuf_create pin folio codestyle cleanup

This patch aim to simplify the memfd folio pin during the udmabuf
create. No functional changes.

This patch create a udmabuf_pin_folios function, in this, do the memfd
pin folio and then record each pinned folio, offset.

This patch simplify the pinned folio record, iter by each pinned folio,
and then record each offset in it.

Compare to iter by pgcnt, more readable.

Suggested-by: Vivek Kasireddy <[email protected]>
Signed-off-by: Huan Yang <[email protected]>
Acked-by: Vivek Kasireddy <[email protected]>
Signed-off-by: Vivek Kasireddy <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 months agoudmabuf: fix vmap_udmabuf error page set
Huan Yang [Wed, 18 Sep 2024 02:52:26 +0000 (10:52 +0800)]
udmabuf: fix vmap_udmabuf error page set

Currently vmap_udmabuf set page's array by each folio.
But, ubuf->folios is only contain's the folio's head page.

That mean we repeatedly mapped the folio head page to the vmalloc area.

Due to udmabuf can use hugetlb, if HVO enabled, tail page may not exist,
so, we can't use page array to map, instead, use pfn array.

By this, we removed page usage in udmabuf totally.

Fixes: 5e72b2b41a21 ("udmabuf: convert udmabuf driver to use folios")
Suggested-by: Vivek Kasireddy <[email protected]>
Signed-off-by: Huan Yang <[email protected]>
Acked-by: Vivek Kasireddy <[email protected]>
Signed-off-by: Vivek Kasireddy <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 months agoudmabuf: change folios array from kmalloc to kvmalloc
Huan Yang [Wed, 18 Sep 2024 02:52:25 +0000 (10:52 +0800)]
udmabuf: change folios array from kmalloc to kvmalloc

When PAGE_SIZE 4096, MAX_PAGE_ORDER 10, 64bit machine,
page_alloc only support 4MB.
If above this, trigger this warn and return NULL.

udmabuf can change size limit, if change it to 3072(3GB), and then alloc
3GB udmabuf, will fail create.

[ 4080.876581] ------------[ cut here ]------------
[ 4080.876843] WARNING: CPU: 3 PID: 2015 at mm/page_alloc.c:4556 __alloc_pages+0x2c8/0x350
[ 4080.878839] RIP: 0010:__alloc_pages+0x2c8/0x350
[ 4080.879470] Call Trace:
[ 4080.879473]  <TASK>
[ 4080.879473]  ? __alloc_pages+0x2c8/0x350
[ 4080.879475]  ? __warn.cold+0x8e/0xe8
[ 4080.880647]  ? __alloc_pages+0x2c8/0x350
[ 4080.880909]  ? report_bug+0xff/0x140
[ 4080.881175]  ? handle_bug+0x3c/0x80
[ 4080.881556]  ? exc_invalid_op+0x17/0x70
[ 4080.881559]  ? asm_exc_invalid_op+0x1a/0x20
[ 4080.882077]  ? udmabuf_create+0x131/0x400

Because MAX_PAGE_ORDER, kmalloc can max alloc 4096 * (1 << 10), 4MB
memory, each array entry is pointer(8byte), so can save 524288 pages(2GB).

Further more, costly order(order 3) may not be guaranteed that it can be
applied for, due to fragmentation.

This patch change udmabuf array use kvmalloc_array, this can fallback
alloc into vmalloc, which can guarantee allocation for any size and does
not affect the performance of kmalloc allocations.

Signed-off-by: Huan Yang <[email protected]>
Acked-by: Christian König <[email protected]>
Acked-by: Vivek Kasireddy <[email protected]>
Signed-off-by: Vivek Kasireddy <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 months agoudmabuf: pre-fault when first page fault
Huan Yang [Wed, 18 Sep 2024 02:52:24 +0000 (10:52 +0800)]
udmabuf: pre-fault when first page fault

The current udmabuf mmap only fills the physical memory to the
corresponding virtual address when the user actually accesses the
virtual address.

However, the current udmabuf has already obtained and pinned the folio
upon completion of the creation.This means that the physical memory has
already been acquired, rather than being accessed dynamically.

As a result, the page fault has lost its purpose as a demanding
page. Due to the fact that page fault requires trapping into kernel mode
and filling in when accessing the corresponding virtual address in mmap,
when creating a large size udmabuf, this represents a considerable
overhead.

This patch fill the pfn into page table, and then pre-fault each pfn
into vma, when first access.

Notice, if anything wrong , we do not return an error during this
pre-fault step. However, an error will be returned if the failure occurs
when the addr is truly accessed

Suggested-by: Vivek Kasireddy <[email protected]>
Signed-off-by: Huan Yang <[email protected]>
Acked-by: Vivek Kasireddy <[email protected]>
Signed-off-by: Vivek Kasireddy <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 months agoMAINTAINERS: udmabuf: Add myself as co-maintainer for udmabuf driver
Vivek Kasireddy [Thu, 22 Aug 2024 04:58:06 +0000 (21:58 -0700)]
MAINTAINERS: udmabuf: Add myself as co-maintainer for udmabuf driver

I would like to help maintain the udmabuf driver, in light of the
recent changes that converted the driver to use folios instead
of pages. Furthermore, I also contribute to Qemu's virtio-gpu
module (and UI modules), that are primary users of udmabuf driver.

Cc: Gerd Hoffmann <[email protected]>
Cc: Daniel Vetter <[email protected]>
Acked-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Vivek Kasireddy <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 months agodma-buf/dma-fence: Use a successful read_trylock() annotation for dma_fence_begin_sig...
Thomas Hellström [Fri, 28 Apr 2023 12:52:32 +0000 (14:52 +0200)]
dma-buf/dma-fence: Use a successful read_trylock() annotation for dma_fence_begin_signalling()

Condsider the following call sequence:

/* Upper layer */
dma_fence_begin_signalling();
lock(tainted_shared_lock);
/* Driver callback */
dma_fence_begin_signalling();
...

The driver might here use a utility that is annotated as intended for the
dma-fence signalling critical path. Now if the upper layer isn't correctly
annotated yet for whatever reason, resulting in

/* Upper layer */
lock(tainted_shared_lock);
/* Driver callback */
dma_fence_begin_signalling();

We will receive a false lockdep locking order violation notification from
dma_fence_begin_signalling(). However entering a dma-fence signalling
critical section itself doesn't block and could not cause a deadlock.

So use a successful read_trylock() annotation instead for
dma_fence_begin_signalling(). That will make sure that the locking order
is correctly registered in the first case, and doesn't register any
locking order in the second case.

The alternative is of course to make sure that the "Upper layer" is always
correctly annotated. But experience shows that's not easily achievable
in all cases.

Signed-off-by: Thomas Hellström <[email protected]>
Reviewed-by: Daniel Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 months agodrm/rockchip: Load crtc devices in preferred order
Jonas Karlman [Sun, 8 Sep 2024 14:55:04 +0000 (14:55 +0000)]
drm/rockchip: Load crtc devices in preferred order

On RK3399 the VOPL is loaded before VOPB and get registered as crtc-0.
However, on RK3288 and PX30 VOPB is gets registered as crtc-0 instead of
VOPL.

With VOPL registered as crtc-0 the kernel kms client is not able to
enable 4K display modes for console use on RK3399.

Load VOPB before VOPL to help kernel kms client make use of 4K display
modes for console use on RK3399.

Signed-off-by: Jonas Karlman <[email protected]>
Signed-off-by: Heiko Stuebner <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 months agodrm/rockchip: dw_hdmi: Enable 4K@60Hz mode on RK3399 and RK356x
Jonas Karlman [Sun, 8 Sep 2024 14:55:03 +0000 (14:55 +0000)]
drm/rockchip: dw_hdmi: Enable 4K@60Hz mode on RK3399 and RK356x

Use a maximum TMDS clock rate limit of 594MHz to enable use of HDMI2.0
modes, e.g. 4K@60Hz, on RK3399 and RK3568.

Signed-off-by: Jonas Karlman <[email protected]>
Tested-by: Diederik de Haas <[email protected]> # Quartz64 Model B
Signed-off-by: Heiko Stuebner <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 months agodrm/rockchip: dw_hdmi: Use auto-generated tables
Douglas Anderson [Sun, 8 Sep 2024 14:55:02 +0000 (14:55 +0000)]
drm/rockchip: dw_hdmi: Use auto-generated tables

The previous tables for mpll_cfg and curr_ctrl were created using the
20-pages of example settings provided by the PHY vendor.  Those
example settings weren't particularly dense, so there were places
where we were guessing what the settings would be for 10-bit and
12-bit (not that we use those anyway).  It was also always a lot of
extra work every time we wanted to add a new clock rate since we had
to cross-reference several tables.

In <https://crrev.com/c/285855> I've gone through the work to figure
out how to generate this table automatically.  Let's now use the
automatically generated table and then we'll never need to look at it
again.

We only support 8-bit mode right now and only support a small number
of clock rates and I've verified that the only 8-bit rate that was
affected was 148.5.  That mode appears to have been wrong in the old
table.

Signed-off-by: Douglas Anderson <[email protected]>
Signed-off-by: Yakir Yang <[email protected]>
Signed-off-by: Jonas Karlman <[email protected]>
Signed-off-by: Heiko Stuebner <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 months agodrm/rockchip: dw_hdmi: Set cur_ctr to 0 always
Douglas Anderson [Sun, 8 Sep 2024 14:55:01 +0000 (14:55 +0000)]
drm/rockchip: dw_hdmi: Set cur_ctr to 0 always

Jitter was improved by lowering the MPLL bandwidth to account for high
frequency noise in the rk3288 PLL.  In each case MPLL bandwidth was
lowered only enough to get us a comfortable margin.  We believe that
lowering the bandwidth like this is safe given sufficient testing.

Signed-off-by: Douglas Anderson <[email protected]>
Signed-off-by: Yakir Yang <[email protected]>
Signed-off-by: Jonas Karlman <[email protected]>
Signed-off-by: Heiko Stuebner <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 months agodrm/rockchip: dw_hdmi: Add phy_config for 594Mhz pixel clock
Nickey Yang [Sun, 8 Sep 2024 14:55:00 +0000 (14:55 +0000)]
drm/rockchip: dw_hdmi: Add phy_config for 594Mhz pixel clock

Add phy_config for 594Mhz pixel clock used for HDMI2.0 display modes.

Signed-off-by: Nickey Yang <[email protected]>
Signed-off-by: Jonas Karlman <[email protected]>
Signed-off-by: Heiko Stuebner <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 months agodrm/rockchip: dw_hdmi: Adjust cklvl & txlvl for RF/EMI
Yakir Yang [Sun, 8 Sep 2024 14:54:59 +0000 (14:54 +0000)]
drm/rockchip: dw_hdmi: Adjust cklvl & txlvl for RF/EMI

Dut to the high HDMI signal voltage driver, Mickey have meet
a serious RF/EMI problem, so we decided to reduce HDMI signal
voltage to a proper value.

The default params for phy is cklvl = 20 & txlvl = 13 (RF/EMI failed)
  ck: lvl = 13, term=100, vlo = 2.71, vhi=3.14, vswing = 0.43
  tx: lvl = 20, term=100, vlo = 2.81, vhi=3.16, vswing = 0.35

1. We decided to reduce voltage value to lower, but VSwing still
keep high, RF/EMI have been improved but still failed.
   ck: lvl =  6, term=100, vlo = 2.61, vhi=3.11, vswing = 0.50
   tx: lvl =  6, term=100, vlo = 2.61, vhi=3.11, vswing = 0.50

2. We try to keep voltage value and vswing both lower, then RF/EMI
test all passed  ;)
   ck: lvl = 11, term= 66, vlo = 2.68, vhi=3.09, vswing = 0.40
   tx: lvl = 11, term= 66, vlo = 2.68, vhi=3.09, vswing = 0.40
When we back to run HDMI different test and single-end test, we see
different test passed, but signle-end test failed. The oscilloscope
show that simgle-end clock's VL value is 1.78v (which remind LowLimit
should not lower then 2.6v).

3. That's to say there are some different between PHY document and
measure value. And according to experiment 2 results, we need to
higher clock voltage and lower data voltage, then we can keep RF/EMI
satisfied and single-end & differen test passed.
  ck: lvl =  9, term=100, vlo = 2.65, vhi=3.12, vswing = 0.47
  tx: lvl = 16, term=100, vlo = 2.75, vhi=3.15, vswing = 0.39

Signed-off-by: Yakir Yang <[email protected]>
Signed-off-by: Jonas Karlman <[email protected]>
Signed-off-by: Heiko Stuebner <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 months agodrm/rockchip: dw_hdmi: Filter modes based on hdmiphy_clk
Jonas Karlman [Sun, 8 Sep 2024 14:54:58 +0000 (14:54 +0000)]
drm/rockchip: dw_hdmi: Filter modes based on hdmiphy_clk

RK3228 and RK3328 clock rate is being validated against a mpll config
table intended for a Synopsys phy, and not the used inno-hdmi-phy.

Instead get a reference to the hdmiphy clk and validate rates against
it to enable use of HDMI2.0 modes, e.g. 4K@60Hz, on RK3228 and RK3328.

For Synopsis phy the max_tmds_clock validation is sufficient.

Signed-off-by: Jonas Karlman <[email protected]>
Tested-by: Diederik de Haas <[email protected]> # Rock64
Signed-off-by: Heiko Stuebner <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 months agodrm/rockchip: Fix a typo
Andrew Kreimer [Sun, 15 Sep 2024 12:39:43 +0000 (15:39 +0300)]
drm/rockchip: Fix a typo

Fix a typo in comments.

Reported-by: Matthew Wilcox <[email protected]>
Signed-off-by: Andrew Kreimer <[email protected]>
Acked-by: Andy Yan<[email protected]>
Signed-off-by: Heiko Stuebner <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 months agodrm/ast: Warn about unsupported TX chips
Thomas Zimmermann [Mon, 16 Sep 2024 08:25:15 +0000 (10:25 +0200)]
drm/ast: Warn about unsupported TX chips

A number of TX chips are listed in VGACRD1, but not supported by
the ast driver. Whether any existing product uses such a chip is
unknown. Warn if the driver encounters any. We can then add
support as necessary.

Signed-off-by: Thomas Zimmermann <[email protected]>
Suggested-by: Jocelyn Falempe <[email protected]>
Reviewed-by: Jocelyn Falempe <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 months agodrm/ast: Use TX-chip register constants
Thomas Zimmermann [Mon, 16 Sep 2024 08:25:14 +0000 (10:25 +0200)]
drm/ast: Use TX-chip register constants

Replace magic values with named constants when reading the TX chip
from VGACRD1.

Signed-off-by: Thomas Zimmermann <[email protected]>
Reviewed-by: Jocelyn Falempe <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 months agodrm/ast: Rename register constants for TX-chip types
Thomas Zimmermann [Mon, 16 Sep 2024 08:25:13 +0000 (10:25 +0200)]
drm/ast: Rename register constants for TX-chip types

The type of the TX chip is provided in VGACRD1. Rename the constants
accordingly.

Signed-off-by: Thomas Zimmermann <[email protected]>
Reviewed-by: Jocelyn Falempe <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
6 months agodrm/panic: Fix uninitialized spinlock acquisition with CONFIG_DRM_PANIC=n
Lyude Paul [Mon, 16 Sep 2024 23:00:08 +0000 (19:00 -0400)]
drm/panic: Fix uninitialized spinlock acquisition with CONFIG_DRM_PANIC=n

It turns out that if you happen to have a kernel config where
CONFIG_DRM_PANIC is disabled and spinlock debugging is enabled, along with
KMS being enabled - we'll end up trying to acquire an uninitialized
spin_lock with drm_panic_lock() when we try to do a commit:

  rvkms rvkms.0: [drm:drm_atomic_commit] committing 0000000068d2ade1
  INFO: trying to register non-static key.
  The code is fine but needs lockdep annotation, or maybe
  you didn't initialize this object before use?
  turning off the locking correctness validator.
  CPU: 4 PID: 1347 Comm: modprobe Not tainted 6.10.0-rc1Lyude-Test+ #272
  Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS edk2-20240524-3.fc40 05/24/2024
  Call Trace:
   <TASK>
   dump_stack_lvl+0x77/0xa0
   assign_lock_key+0x114/0x120
   register_lock_class+0xa8/0x2c0
   __lock_acquire+0x7d/0x2bd0
   ? __vmap_pages_range_noflush+0x3a8/0x550
   ? drm_atomic_helper_swap_state+0x2ad/0x3a0
   lock_acquire+0xec/0x290
   ? drm_atomic_helper_swap_state+0x2ad/0x3a0
   ? lock_release+0xee/0x310
   _raw_spin_lock_irqsave+0x4e/0x70
   ? drm_atomic_helper_swap_state+0x2ad/0x3a0
   drm_atomic_helper_swap_state+0x2ad/0x3a0
   drm_atomic_helper_commit+0xb1/0x270
   drm_atomic_commit+0xaf/0xe0
   ? __pfx___drm_printfn_info+0x10/0x10
   drm_client_modeset_commit_atomic+0x1a1/0x250
   drm_client_modeset_commit_locked+0x4b/0x180
   drm_client_modeset_commit+0x27/0x50
   __drm_fb_helper_restore_fbdev_mode_unlocked+0x76/0x90
   drm_fb_helper_set_par+0x38/0x40
   fbcon_init+0x3c4/0x690
   visual_init+0xc0/0x120
   do_bind_con_driver+0x409/0x4c0
   do_take_over_console+0x233/0x280
   do_fb_registered+0x11f/0x210
   fbcon_fb_registered+0x2c/0x60
   register_framebuffer+0x248/0x2a0
   __drm_fb_helper_initial_config_and_unlock+0x58a/0x720
   drm_fbdev_generic_client_hotplug+0x6e/0xb0
   drm_client_register+0x76/0xc0
   _RNvXs_CsHeezP08sTT_5rvkmsNtB4_5RvkmsNtNtCs1cdwasc6FUb_6kernel8platform6Driver5probe+0xed2/0x1060 [rvkms]
   ? _RNvMs_NtCs1cdwasc6FUb_6kernel8platformINtB4_7AdapterNtCsHeezP08sTT_5rvkms5RvkmsE14probe_callbackBQ_+0x2b/0x70 [rvkms]
   ? acpi_dev_pm_attach+0x25/0x110
   ? platform_probe+0x6a/0xa0
   ? really_probe+0x10b/0x400
   ? __driver_probe_device+0x7c/0x140
   ? driver_probe_device+0x22/0x1b0
   ? __device_attach_driver+0x13a/0x1c0
   ? __pfx___device_attach_driver+0x10/0x10
   ? bus_for_each_drv+0x114/0x170
   ? __device_attach+0xd6/0x1b0
   ? bus_probe_device+0x9e/0x120
   ? device_add+0x288/0x4b0
   ? platform_device_add+0x75/0x230
   ? platform_device_register_full+0x141/0x180
   ? rust_helper_platform_device_register_simple+0x85/0xb0
   ? _RNvMs2_NtCs1cdwasc6FUb_6kernel8platformNtB5_6Device13create_simple+0x1d/0x60
   ? _RNvXs0_CsHeezP08sTT_5rvkmsNtB5_5RvkmsNtCs1cdwasc6FUb_6kernel6Module4init+0x11e/0x160 [rvkms]
   ? 0xffffffffc083f000
   ? init_module+0x20/0x1000 [rvkms]
   ? kernfs_xattr_get+0x3e/0x80
   ? do_one_initcall+0x148/0x3f0
   ? __lock_acquire+0x5ef/0x2bd0
   ? __lock_acquire+0x5ef/0x2bd0
   ? __lock_acquire+0x5ef/0x2bd0
   ? put_cpu_partial+0x51/0x1d0
   ? lock_acquire+0xec/0x290
   ? put_cpu_partial+0x51/0x1d0
   ? lock_release+0xee/0x310
   ? put_cpu_partial+0x51/0x1d0
   ? fs_reclaim_acquire+0x69/0xf0
   ? lock_acquire+0xec/0x290
   ? fs_reclaim_acquire+0x69/0xf0
   ? kfree+0x22f/0x340
   ? lock_release+0xee/0x310
   ? kmalloc_trace_noprof+0x48/0x340
   ? do_init_module+0x22/0x240
   ? kmalloc_trace_noprof+0x155/0x340
   ? do_init_module+0x60/0x240
   ? __se_sys_finit_module+0x2e0/0x3f0
   ? do_syscall_64+0xa4/0x180
   ? syscall_exit_to_user_mode+0x108/0x140
   ? do_syscall_64+0xb0/0x180
   ? vma_end_read+0xd0/0xe0
   ? do_user_addr_fault+0x309/0x640
   ? clear_bhb_loop+0x45/0xa0
   ? clear_bhb_loop+0x45/0xa0
   ? clear_bhb_loop+0x45/0xa0
   ? entry_SYSCALL_64_after_hwframe+0x76/0x7e
   </TASK>

Fix this by stubbing these macros out when this config option isn't
enabled, along with fixing the unused variable warning that introduces.

Signed-off-by: Lyude Paul <[email protected]>
Reviewed-by: Daniel Vetter <[email protected]>
Fixes: e2a1cda3e0c7 ("drm/panic: Add drm panic locking")
Cc: <[email protected]> # v6.10+
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
6 months agodrm/v3d: Appease lockdep while updating GPU stats
Tvrtko Ursulin [Tue, 13 Aug 2024 10:25:05 +0000 (11:25 +0100)]
drm/v3d: Appease lockdep while updating GPU stats

Lockdep thinks our seqcount_t usage is unsafe because the update path can
be both from irq and worker context:

 [ ] ================================
 [ ] WARNING: inconsistent lock state
 [ ] 6.10.3-v8-16k-numa #159 Tainted: G        WC
 [ ] --------------------------------
 [ ] inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-W} usage.
 [ ] swapper/0/0 [HC1[1]:SC0[0]:HE0:SE1] takes:
 [ ] ffff80003d7c08d0 (&v3d_priv->stats[i].lock){?.+.}-{0:0}, at: v3d_irq+0xc8/0x660 [v3d]
 [ ] {HARDIRQ-ON-W} state was registered at:
 [ ]   lock_acquire+0x1f8/0x328
 [ ]   v3d_job_start_stats.isra.0+0xd8/0x218 [v3d]
 [ ]   v3d_bin_job_run+0x23c/0x388 [v3d]
 [ ]   drm_sched_run_job_work+0x520/0x6d0 [gpu_sched]
 [ ]   process_one_work+0x62c/0xb48
 [ ]   worker_thread+0x468/0x5b0
 [ ]   kthread+0x1c4/0x1e0
 [ ]   ret_from_fork+0x10/0x20
 [ ] irq event stamp: 337094
 [ ] hardirqs last  enabled at (337093): [<ffffc0008144ce7c>] default_idle_call+0x11c/0x140
 [ ] hardirqs last disabled at (337094): [<ffffc0008144a354>] el1_interrupt+0x24/0x58
 [ ] softirqs last  enabled at (337082): [<ffffc00080061d90>] handle_softirqs+0x4e0/0x538
 [ ] softirqs last disabled at (337073): [<ffffc00080010364>] __do_softirq+0x1c/0x28
 [ ]
                other info that might help us debug this:
 [ ]  Possible unsafe locking scenario:

 [ ]        CPU0
 [ ]        ----
 [ ]   lock(&v3d_priv->stats[i].lock);
 [ ]   <Interrupt>
 [ ]     lock(&v3d_priv->stats[i].lock);
 [ ]
                *** DEADLOCK ***

 [ ] no locks held by swapper/0/0.
 [ ]
               stack backtrace:
 [ ] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G        WC         6.10.3-v8-16k-numa #159
 [ ] Hardware name: Raspberry Pi 5 Model B Rev 1.0 (DT)
 [ ] Call trace:
 [ ]  dump_backtrace+0x170/0x1b8
 [ ]  show_stack+0x20/0x38
 [ ]  dump_stack_lvl+0xb4/0xd0
 [ ]  dump_stack+0x18/0x28
 [ ]  print_usage_bug+0x3cc/0x3f0
 [ ]  mark_lock+0x4d0/0x968
 [ ]  __lock_acquire+0x784/0x18c8
 [ ]  lock_acquire+0x1f8/0x328
 [ ]  v3d_job_update_stats+0xec/0x2e0 [v3d]
 [ ]  v3d_irq+0xc8/0x660 [v3d]
 [ ]  __handle_irq_event_percpu+0x1f8/0x488
 [ ]  handle_irq_event+0x88/0x128
 [ ]  handle_fasteoi_irq+0x298/0x408
 [ ]  generic_handle_domain_irq+0x50/0x78

But it is a false positive because all the queue-stats pairs have their
own lock and jobs are also one at a time.

Nevertheless we can appease lockdep by disabling local interrupts to make
it see lock usage is consistent.

Cc: Maíra Canal <[email protected]>
Fixes: 6abe93b621ab ("drm/v3d: Fix race-condition between sysfs/fdinfo and interrupt handler")
Signed-off-by: Tvrtko Ursulin <[email protected]>
Signed-off-by: Maíra Canal <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
6 months agodrm/panel: raydium-rm69380: transition to mipi_dsi wrapped functions
Tejas Vipin [Sat, 14 Sep 2024 03:43:41 +0000 (09:13 +0530)]
drm/panel: raydium-rm69380: transition to mipi_dsi wrapped functions

Changes the raydium-rm69380 panel to use multi style functions for
improved error handling.

Reviewed-by: Douglas Anderson <[email protected]>
Signed-off-by: Tejas Vipin <[email protected]>
Signed-off-by: Douglas Anderson <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
6 months agodrm/omap: Fix locking in omap_gem_new_dmabuf()
Tomi Valkeinen [Tue, 6 Aug 2024 13:50:29 +0000 (16:50 +0300)]
drm/omap: Fix locking in omap_gem_new_dmabuf()

omap_gem_new_dmabuf() creates the new gem object, and then takes and
holds the omap_obj->lock for the rest of the function. This has two
issues:

- omap_gem_free_object(), which is called in the error paths, also takes
  the same lock, leading to deadlock
- Even if the above wouldn't happen, in the error cases
  omap_gem_new_dmabuf() still unlocks omap_obj->lock, even after the
  omap_obj has already been freed.

Furthermore, I don't think there's any reason to take the lock at all,
as the object was just created and not yet shared with anyone else.

To fix all this, drop taking the lock.

Fixes: 3cbd0c587b12 ("drm/omap: gem: Replace struct_mutex usage with omap_obj private lock")
Reported-by: Dan Carpenter <[email protected]>
Closes: https://lore.kernel.org/all/[email protected]/
Reviewed-by: Sebastian Reichel <[email protected]>
Signed-off-by: Tomi Valkeinen <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
6 months agodrm/omap: Hide sparse warnings
Tomi Valkeinen [Tue, 6 Aug 2024 13:50:28 +0000 (16:50 +0300)]
drm/omap: Hide sparse warnings

sparse reports:

drivers/gpu/drm/omapdrm/omap_dmm_tiler.c:122:16: warning: incorrect type in argument 1 (different address spaces)
drivers/gpu/drm/omapdrm/omap_dmm_tiler.c:122:16:    expected void const volatile [noderef] __iomem *addr
drivers/gpu/drm/omapdrm/omap_dmm_tiler.c:122:16:    got unsigned int [usertype] *wa_dma_data
drivers/gpu/drm/omapdrm/omap_dmm_tiler.c:130:9: warning: incorrect type in argument 2 (different address spaces)
drivers/gpu/drm/omapdrm/omap_dmm_tiler.c:130:9:    expected void volatile [noderef] __iomem *addr
drivers/gpu/drm/omapdrm/omap_dmm_tiler.c:130:9:    got unsigned int [usertype] *wa_dma_data
drivers/gpu/drm/omapdrm/omap_dmm_tiler.c:414:9: warning: incorrect type in argument 1 (different address spaces)
drivers/gpu/drm/omapdrm/omap_dmm_tiler.c:414:9:    expected void const volatile [noderef] __iomem *addr
drivers/gpu/drm/omapdrm/omap_dmm_tiler.c:414:9:    got unsigned int *

These come from pieces of code which do essentially:

p = dma_alloc_coherent()

dma_transfer_to_p()
readl(p)

writel(x, p)
dma_transfer_from_p()

I think we would do just fine without readl() and writel(), accessing
the memory without any extras, but ensuring that the necessary barriers
are in place. But this code is for a legacy platform, has been working
for ages, and it's doing work-arounds for hardware issues, and those
hardware issues are very difficult to trigger... So I would just rather
leave the code be as it is now.

However, the warnings are not nice. Hide the warnings by a (__iomem void
*) typecast.

Reported-by: kernel test robot <[email protected]>
Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
Cc: Ville Syrjälä <[email protected]>
Reviewed-by: Sebastian Reichel <[email protected]>
Signed-off-by: Tomi Valkeinen <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
6 months agodrm/omap: Fix possible NULL dereference
Tomi Valkeinen [Tue, 6 Aug 2024 13:50:27 +0000 (16:50 +0300)]
drm/omap: Fix possible NULL dereference

smatch reports:

drivers/gpu/drm/omapdrm/dss/base.c:176 omapdss_device_disconnect() error: we previously assumed 'src' could be null (see line 169)

This code is mostly from a time when omapdrm had its own display device
model. I can't honestly remember the details, and I don't think it's
worth digging in deeply into that for a legacy driver.

However, it looks like we only call omapdss_device_disconnect() and
omapdss_device_connect() with NULL as the src parameter. We can thus
drop the src parameter from both functions, and fix the smatch warning.

I don't think omapdss_device_disconnect() ever gets NULL for the dst
parameter (if it did, we'd crash soon after returning from the
function), but I have kept the !dst check, just in case, but I added a
WARN_ON() there.

Also, if the dst parameter can be NULL, we can't always get the struct
dss_device pointer from dst->dss (which is only used for a debug print).
To make sure we can't hit that issue, do it similarly to the
omapdss_device_connect() function: add 'struct dss_device *dss' as the
first parameter, so that we always have it regardless of the dst.

Fixes: 79107f274b2f ("drm/omap: Add support for drm_bridge")
Reviewed-by: Sebastian Reichel <[email protected]>
Signed-off-by: Tomi Valkeinen <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
6 months agoaccel/qaic: Change to use DEFINE_SHOW_ATTRIBUTE macro
Longlong Xia [Mon, 19 Aug 2024 09:58:16 +0000 (17:58 +0800)]
accel/qaic: Change to use DEFINE_SHOW_ATTRIBUTE macro

Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.
No functional change.

Signed-off-by: Longlong Xia <[email protected]>
Reviewed-by: Jeffrey Hugo <[email protected]>
Signed-off-by: Jeffrey Hugo <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
6 months agodrm/ast: Avoid upcasting to struct ast_device
Thomas Zimmermann [Wed, 11 Sep 2024 11:51:28 +0000 (13:51 +0200)]
drm/ast: Avoid upcasting to struct ast_device

Several functions receive an instance of struct drm_device only to
upcast it to struct ast_device. Improve type safety by passing the
AST device directly.

Signed-off-by: Thomas Zimmermann <[email protected]>
Reviewed-by: Jocelyn Falempe <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
6 months agodrm/ast: Respect return value from CRTC init
Thomas Zimmermann [Wed, 11 Sep 2024 11:51:27 +0000 (13:51 +0200)]
drm/ast: Respect return value from CRTC init

Return an error if CRTC initialization fails.

Signed-off-by: Thomas Zimmermann <[email protected]>
Reviewed-by: Jocelyn Falempe <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
6 months agodrm/ast: vga: Inline ast_vga_connector_init()
Thomas Zimmermann [Wed, 11 Sep 2024 11:51:26 +0000 (13:51 +0200)]
drm/ast: vga: Inline ast_vga_connector_init()

Inline ast_vga_connector_init() into its only caller. The helper
currently only does half of the connector-init work and is trivial
enough to be inlined. While at it, remove the error message from the
call to ast_ddc_create(). The function already warns on errors.

Also set the local variables for encoder and connector as late as
possible, so that the compiler warns if we use them before having
initialized the instance.

Signed-off-by: Thomas Zimmermann <[email protected]>
Reviewed-by: Jocelyn Falempe <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
6 months agodrm/ast: sil164: Inline ast_sil164_connector_init()
Thomas Zimmermann [Wed, 11 Sep 2024 11:51:25 +0000 (13:51 +0200)]
drm/ast: sil164: Inline ast_sil164_connector_init()

Inline ast_sil164_connector_init() into its only caller. The helper
currently only does half of the connector-init work and is trivial
enough to be inlined. While at it, remove the error message from the
call to ast_ddc_create(). The function already warns on errors.

Also set the local variables for encoder and connector as late as
possible, so that the compiler warns if we use them before having
initialized the instance.

Signed-off-by: Thomas Zimmermann <[email protected]>
Reviewed-by: Jocelyn Falempe <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
6 months agodrm/ast: dp501: Avoid upcasting to struct ast_device
Thomas Zimmermann [Wed, 11 Sep 2024 11:51:24 +0000 (13:51 +0200)]
drm/ast: dp501: Avoid upcasting to struct ast_device

Several functions receive an instance of struct drm_device only to
upcast it to struct ast_device. Improve type safety by passing the
AST device directly.

Signed-off-by: Thomas Zimmermann <[email protected]>
Reviewed-by: Jocelyn Falempe <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
6 months agodrm/ast: dp501: Inline ast_dp501_connector_init()
Thomas Zimmermann [Wed, 11 Sep 2024 11:51:23 +0000 (13:51 +0200)]
drm/ast: dp501: Inline ast_dp501_connector_init()

Inline ast_dp501_connector_init() into its only caller. The helper
currently only does half of the connector-init work and is trivial
enough to be inlined.

Also set the local variables for encoder and connector as late as
possible, so that the compiler warns if we use them before having
initialized the instance.

Signed-off-by: Thomas Zimmermann <[email protected]>
Reviewed-by: Jocelyn Falempe <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
6 months agodrm/ast: astdp: Replace ast_dp_set_on_off()
Thomas Zimmermann [Wed, 11 Sep 2024 11:51:22 +0000 (13:51 +0200)]
drm/ast: astdp: Replace ast_dp_set_on_off()

Replace ast_dp_set_on_off() with ast_dp_set_enable(). The helper's
new name reflects the performed operation. If enabling fails, the
new helper prints a warning. The code that waits for the programmed
effect to take place is now located in __ast_dp_wait_enable().

Also align the register constants with the rest of the code.

Signed-off-by: Thomas Zimmermann <[email protected]>
Reviewed-by: Jocelyn Falempe <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
6 months agodrm/ast: astdp: Replace power_on helpers
Thomas Zimmermann [Wed, 11 Sep 2024 11:51:21 +0000 (13:51 +0200)]
drm/ast: astdp: Replace power_on helpers

Replace the helper for controlling power on the physical connector,
ast_dp_power_on_off(), with ast_dp_set_phy_sleep(). The new name
reflects the effect of the operation. Simplify the implementation.
The call now controls sleeping, hence semantics are inversed. Each
'on' becomes an 'off' operation and vice versa.

Do the same for ast_dp_power_is_on() and also align naming of the
register constant with the rest of the code.

Signed-off-by: Thomas Zimmermann <[email protected]>
Reviewed-by: Jocelyn Falempe <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
6 months agodrm/ast: astdp: Avoid upcasting to struct ast_device
Thomas Zimmermann [Wed, 11 Sep 2024 11:51:20 +0000 (13:51 +0200)]
drm/ast: astdp: Avoid upcasting to struct ast_device

Several functions receive an instance of struct drm_device only to
upcast it to struct ast_device. Improve type safety by passing the
AST device directly.

Signed-off-by: Thomas Zimmermann <[email protected]>
Reviewed-by: Jocelyn Falempe <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
6 months agodrm/ast: astdp: Inline ast_astdp_connector_init()
Thomas Zimmermann [Wed, 11 Sep 2024 11:51:19 +0000 (13:51 +0200)]
drm/ast: astdp: Inline ast_astdp_connector_init()

Inline ast_astdp_connector_init() into its only caller. The helper
currently only does half of the connector-init work and is trivial
enough to be inlined.

Also set the local variables for encoder and connector as late as
possible, so that the compiler warns if we use them before having
initialized the instance.

Signed-off-by: Thomas Zimmermann <[email protected]>
Reviewed-by: Jocelyn Falempe <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
6 months agodrm/imagination: annotate pvr_fw_version_packed() with __maybe_unused
Jani Nikula [Tue, 10 Sep 2024 10:03:41 +0000 (13:03 +0300)]
drm/imagination: annotate pvr_fw_version_packed() with __maybe_unused

Building with clang and W=1 leads to warning about unused
pvr_fw_version_packed(). Fix by annotating it with __maybe_unused.

See also commit 6863f5643dd7 ("kbuild: allow Clang to find unused static
inline functions for W=1 build").

Reviewed-by: Matt Coster <[email protected]>
Tested-by: Nathan Chancellor <[email protected]> # build
Link: https://patchwork.freedesktop.org/patch/msgid/190e4eefef6c5e62052a01af0084c69361e216ef.1725962479.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <[email protected]>
6 months agodrm/kmb: annotate set_test_mode_src_osc_freq_target_{low, hi}_bits() with __maybe_unused
Jani Nikula [Tue, 10 Sep 2024 10:03:39 +0000 (13:03 +0300)]
drm/kmb: annotate set_test_mode_src_osc_freq_target_{low, hi}_bits() with __maybe_unused

Building with clang and and W=1 leads to warning about unused
set_test_mode_src_osc_freq_target_low_bits() and
set_test_mode_src_osc_freq_target_hi_bits(). Fix by annotating them with
__maybe_unused.

See also commit 6863f5643dd7 ("kbuild: allow Clang to find unused static
inline functions for W=1 build").

Acked-by: Anitha Chrisanthus <[email protected]>
Tested-by: Nathan Chancellor <[email protected]> # build
Link: https://patchwork.freedesktop.org/patch/msgid/29a83771edd9b85032095ed3ecc1e91a77229b90.1725962479.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <[email protected]>
6 months agodrm/panel: sony-acx565akm: Use %*ph to print small buffer
Andy Shevchenko [Wed, 11 Sep 2024 20:01:25 +0000 (23:01 +0300)]
drm/panel: sony-acx565akm: Use %*ph to print small buffer

Use %*ph format to print small buffer as hex string.

Signed-off-by: Andy Shevchenko <[email protected]>
Reviewed-by: Neil Armstrong <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Neil Armstrong <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
6 months agodrm: panel: nt36523: use devm_mipi_dsi_* function to register and attach dsi
Jianhua Lu [Wed, 4 Sep 2024 14:29:07 +0000 (22:29 +0800)]
drm: panel: nt36523: use devm_mipi_dsi_* function to register and attach dsi

Switch to devm_mipi_dsi_* function, we don't need to detach and
unregister dsi manually any more.

Signed-off-by: Jianhua Lu <[email protected]>
Reviewed-by: Neil Armstrong <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Neil Armstrong <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
6 months agodrm/panel: khadas-ts050: make ts050[v2]_panel_data static
Min-Hua Chen [Sun, 8 Sep 2024 13:35:30 +0000 (21:35 +0800)]
drm/panel: khadas-ts050: make ts050[v2]_panel_data static

make ts050_panel_data and ts050v2_panel_data static because they
are only used in drivers/gpu/drm/panel/panel-khadas-ts050.c,
and fix the following sparse warnings:

drivers/gpu/drm/panel/panel-khadas-ts050.c:620:32:
sparse: warning: symbol 'ts050_panel_data' was not declared. Should it be static?
drivers/gpu/drm/panel/panel-khadas-ts050.c:625:32:
sparse: warning: symbol 'ts050v2_panel_data' was not declared. Should it be static?

No functional changes intended.

Signed-off-by: Min-Hua Chen <[email protected]>
Reviewed-by: Neil Armstrong <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Neil Armstrong <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
6 months agodrm/bridge: imx8mp-hdmi-tx: allow 0.5% margin with selected clock
Dominique Martinet [Sat, 7 Sep 2024 05:54:33 +0000 (14:54 +0900)]
drm/bridge: imx8mp-hdmi-tx: allow 0.5% margin with selected clock

This allows the hdmi driver to pick e.g. 64.8MHz instead of 65Mhz when we
cannot output the exact frequency, enabling the imx8mp HDMI output to
support more modes

Tested-by: Adam Ford <[email protected]> #imx8mp-beacon
Reviewed-by: Frieder Schrempf <[email protected]>
Tested-by: Frieder Schrempf <[email protected]>
Signed-off-by: Dominique Martinet <[email protected]>
Reviewed-by: Neil Armstrong <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Neil Armstrong <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
6 months agodrm/bridge: imx8qxp-ldb: Switch to RUNTIME_PM_OPS()
Fabio Estevam [Wed, 26 Jun 2024 23:07:04 +0000 (20:07 -0300)]
drm/bridge: imx8qxp-ldb: Switch to RUNTIME_PM_OPS()

Replace SET_RUNTIME_PM_OPS with its modern RUNTIME_PM_OPS() alternative.

The combined usage of pm_ptr() and RUNTIME_PM_OPS()
allows the compiler to evaluate if the runtime suspend/resume() functions
are used at build time or are simply dead code.

This allows removing the __maybe_unused notation from the runtime
suspend/resume() functions.

Signed-off-by: Fabio Estevam <[email protected]>
Reviewed-by: Neil Armstrong <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Neil Armstrong <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
6 months agodrm/bridge: dw-hdmi-cec: Switch to SYSTEM_SLEEP_PM_OPS()
Fabio Estevam [Wed, 26 Jun 2024 23:07:03 +0000 (20:07 -0300)]
drm/bridge: dw-hdmi-cec: Switch to SYSTEM_SLEEP_PM_OPS()

Replace SET_SYSTEM_SLEEP_PM_OPS with its modern SYSTEM_SLEEP_PM_OPS()
alternative.

The combined usage of pm_ptr() and SYSTEM_SLEEP_PM_OPS()
allows the compiler to evaluate if the runtime suspend/resume() functions
are used at build time or are simply dead code.

This allows removing the __maybe_unused notation from the runtime
suspend/resume() functions.

Signed-off-by: Fabio Estevam <[email protected]>
Reviewed-by: Neil Armstrong <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Neil Armstrong <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
6 months agodrm/bridge: samsung-dsim: Switch to RUNTIME_PM_OPS()
Fabio Estevam [Wed, 26 Jun 2024 23:07:02 +0000 (20:07 -0300)]
drm/bridge: samsung-dsim: Switch to RUNTIME_PM_OPS()

Replace SET_RUNTIME_PM_OPS with its modern RUNTIME_PM_OPS() alternative.

The combined usage of pm_ptr() and RUNTIME_PM_OPS()
allows the compiler to evaluate if the runtime suspend/resume() functions
are used at build time or are simply dead code.

This allows removing the __maybe_unused notation from the runtime
suspend/resume() functions.

Signed-off-by: Fabio Estevam <[email protected]>
Reviewed-by: Neil Armstrong <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Neil Armstrong <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
6 months agodrm/bridge: imx8qxp-pixel-combiner: Switch to RUNTIME_PM_OPS()
Fabio Estevam [Wed, 26 Jun 2024 23:07:01 +0000 (20:07 -0300)]
drm/bridge: imx8qxp-pixel-combiner: Switch to RUNTIME_PM_OPS()

Replace SET_RUNTIME_PM_OPS with its modern RUNTIME_PM_OPS() alternative.

The combined usage of pm_ptr() and RUNTIME_PM_OPS()
allows the compiler to evaluate if the runtime suspend/resume() functions
are used at build time or are simply dead code.

This allows removing the __maybe_unused notation from the runtime
suspend/resume() functions.

Signed-off-by: Fabio Estevam <[email protected]>
Reviewed-by: Neil Armstrong <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Neil Armstrong <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
6 months agodrm/bridge: imx8qm-ldb: Switch to RUNTIME_PM_OPS()
Fabio Estevam [Wed, 26 Jun 2024 23:07:00 +0000 (20:07 -0300)]
drm/bridge: imx8qm-ldb: Switch to RUNTIME_PM_OPS()

Replace SET_RUNTIME_PM_OPS with its modern RUNTIME_PM_OPS() alternative.

The combined usage of pm_ptr() and RUNTIME_PM_OPS()
allows the compiler to evaluate if the runtime suspend/resume() functions
are used at build time or are simply dead code.

This allows removing the __maybe_unused notation from the runtime
suspend/resume() functions.

Signed-off-by: Fabio Estevam <[email protected]>
Reviewed-by: Neil Armstrong <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Neil Armstrong <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
6 months agodrm/bridge: imx8mp-hdmi-tx: Switch to SYSTEM_SLEEP_PM_OPS()
Fabio Estevam [Wed, 26 Jun 2024 23:06:59 +0000 (20:06 -0300)]
drm/bridge: imx8mp-hdmi-tx: Switch to SYSTEM_SLEEP_PM_OPS()

Replace SET_SYSTEM_SLEEP_PM_OPS with its modern SYSTEM_SLEEP_PM_OPS()
alternative.

The combined usage of pm_ptr() and SYSTEM_SLEEP_PM_OPS()
allows the compiler to evaluate if the runtime suspend/resume() functions
are used at build time or are simply dead code.

This allows removing the __maybe_unused notation from the runtime
suspend/resume() functions.

Signed-off-by: Fabio Estevam <[email protected]>
Reviewed-by: Neil Armstrong <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Neil Armstrong <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
6 months agodrm/bridge: tc358767: Support write-only registers
Alexander Stein [Wed, 4 Sep 2024 12:05:45 +0000 (14:05 +0200)]
drm/bridge: tc358767: Support write-only registers

Most registers are read-writable, but some are only RO or even WO.
regmap does not support using readable_reg and wr_table when outputting
in debugfs, so switch to writeable_reg.
First check for RO or WO registers and fallback tc_readable_reg() for the
leftover RW registers.

Signed-off-by: Alexander Stein <[email protected]>
Reviewed-by: Robert Foss <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Neil Armstrong <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
6 months agodrm/bridge: tc358767: Only print GPIO debug output if they actually occur
Alexander Stein [Wed, 4 Sep 2024 12:05:44 +0000 (14:05 +0200)]
drm/bridge: tc358767: Only print GPIO debug output if they actually occur

Currently the output the following output is printed upon each interrupt:
 tc358767 1-000f: GPIO0:
This spams the kernel log while debugging an IRQ storm from the bridge.
Only print the debug output if the GPIO hotplug event actually happened.

Signed-off-by: Alexander Stein <[email protected]>
Reviewed-by: Robert Foss <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Neil Armstrong <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
6 months agodrm/bridge: tc358767: Use dev_err_probe
Alexander Stein [Wed, 4 Sep 2024 12:05:43 +0000 (14:05 +0200)]
drm/bridge: tc358767: Use dev_err_probe

The function calls preceding these returns can return -EPROBE_DEFER. So
use dev_err_probe to add some information to
/sys/kernel/debug/devices_deferred

Signed-off-by: Alexander Stein <[email protected]>
Reviewed-by: Dmitry Baryshkov <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Neil Armstrong <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
6 months agodrm/bochs: use devm_ioremap_wc() to map framebuffer
Yan Zhao [Mon, 9 Sep 2024 13:16:43 +0000 (21:16 +0800)]
drm/bochs: use devm_ioremap_wc() to map framebuffer

Opt for devm_ioremap_wc() over devm_ioremap() when mapping the framebuffer.

Using devm_ioremap() results in the VA being mapped with PAT=UC-, which
considerably slows down drm_fb_memcpy(). In contrast, devm_ioremap_wc()
maps the VA with PAT set to WC, leading to better performance on platforms
where access to UC memory is much slower than WC memory.

Here's the performance data measured in a guest on the physical machine
"Sapphire Rapids XCC".
With host KVM honors guest PAT memory types, the effective memory type
for this framebuffer range is
- WC when devm_ioremap_wc() is used
- UC- when devm_ioremap() is used.

The data presented is an average from 10 execution runs.

Cycles: Avg cycles of executed bochs_primary_plane_helper_atomic_update()
        from VM boot to GDM show up
Cnt:    Avg cnt of executed bochs_primary_plane_helper_atomic_update()
        from VM boot to GDM show up
T:      Avg time of each bochs_primary_plane_helper_atomic_update().

 -------------------------------------------------
|            | devm_ioremap() | devm_ioremap_wc() |
|------------|----------------|-------------------|
|  Cycles    |    211.545M    |   0.157M          |
|------------|----------------|-------------------|
|  Cnt       |     142        |   1917            |
|------------|----------------|-------------------|
|  T         |    0.1748s     |   0.0004s         |
 -------------------------------------------------

Note:
Following the rebase to [3], the previously reported GDM failure on the
VGA device [1] can no longer be reproduced, thanks to the memory management
improvements made in [2]. Despite this, I have proceeded to submit this
patch because of the noticeable performance improvements it provides.

Reported-by: Vitaly Kuznetsov <[email protected]>
Closes: https://lore.kernel.org/all/[email protected]/#t
Cc: Sean Christopherson <[email protected]>
Cc: Paolo Bonzini <[email protected]>
Cc: Kevin Tian <[email protected]>
Cc: Thomas Zimmermann <[email protected]>
Signed-off-by: Yan Zhao <[email protected]>
Link: https://lore.kernel.org/all/[email protected]/#t
Link: https://patchwork.freedesktop.org/series/138086
Link: https://gitlab.freedesktop.org/drm/misc/kernel/-/tree/drm-misc-next
Reviewed-by: Thomas Zimmermann <[email protected]>
Tested-by: Vitaly Kuznetsov <[email protected]>
Tested-by: Thomas Zimmermann <[email protected]>
Signed-off-by: Thomas Zimmermann <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
6 months agodrm/panthor: Display FW version information
Steven Price [Fri, 6 Sep 2024 09:40:25 +0000 (10:40 +0100)]
drm/panthor: Display FW version information

The version number output when loading the firmware is actually the
interface version not the version of the firmware itself. Update the
message to make this clearer.

However, the firmware binary has a git SHA embedded into it which can be
used to identify which firmware binary is being loaded. So output this
as a drm_info() so that it's obvious from a dmesg log which firmware
binary is being used.

Reviewed-by: Boris Brezillon <[email protected]>
Reviewed-by: Liviu Dudau <[email protected]>
Signed-off-by: Steven Price <[email protected]>
Signed-off-by: Boris Brezillon <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
6 months agodrm/bridge: ti-sn65dsi86: annotate ti_sn_pwm_pin_{request, release} with __maybe_unused
Jani Nikula [Tue, 10 Sep 2024 10:03:40 +0000 (13:03 +0300)]
drm/bridge: ti-sn65dsi86: annotate ti_sn_pwm_pin_{request, release} with __maybe_unused

Building with clang, W=1, CONFIG_PM=n and CONFIG_OF_GPIO=n leads to
warning about unused ti_sn_pwm_pin_request() and
ti_sn_pwm_pin_release(). Fix by annotating them with __maybe_unused.

See also commit 6863f5643dd7 ("kbuild: allow Clang to find unused static
inline functions for W=1 build").

Signed-off-by: Jani Nikula <[email protected]>
Reviewed-by: Douglas Anderson <[email protected]>
Signed-off-by: Douglas Anderson <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/136ecd978aedd7df39d1b1c37b70596027ff0a3e.1725962479.git.jani.nikula@intel.com
6 months agodrm/panel: himax-hx83112a: transition to mipi_dsi wrapped functions
Tejas Vipin [Wed, 4 Sep 2024 14:15:21 +0000 (19:45 +0530)]
drm/panel: himax-hx83112a: transition to mipi_dsi wrapped functions

Changes the himax-hx83112a panel to use multi style functions for
improved error handling.

Signed-off-by: Tejas Vipin <[email protected]>
Reviewed-by: Douglas Anderson <[email protected]>
Reviewed-by: Jessica Zhang <[email protected]>
Signed-off-by: Douglas Anderson <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
6 months agodrm/tests: Add test for drm_framebuffer_free()
Carlos Eduardo Gallo Filho [Wed, 11 Sep 2024 00:15:34 +0000 (21:15 -0300)]
drm/tests: Add test for drm_framebuffer_free()

Add a single KUnit test case for the drm_framebuffer_free function.

Signed-off-by: Carlos Eduardo Gallo Filho <[email protected]>
Acked-by: Maxime Ripard <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Maxime Ripard <[email protected]>
6 months agodrm/tests: Add test for drm_framebuffer_init()
Carlos Eduardo Gallo Filho [Wed, 11 Sep 2024 00:15:33 +0000 (21:15 -0300)]
drm/tests: Add test for drm_framebuffer_init()

Add three KUnit test cases for the drm_framebuffer_init function:

1. Test if expected values are being set after drm_framebuffer_init() call.
2. Try to init a framebuffer without setting its format.
3. Try calling drm_framebuffer_init() with mismatch of the drm_device
   passed at the first argument and the one pointed by fb->dev.

Signed-off-by: Carlos Eduardo Gallo Filho <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Maxime Ripard <[email protected]>
6 months agodrm/tests: Add test for drm_framebuffer_lookup()
Carlos Eduardo Gallo Filho [Wed, 11 Sep 2024 00:15:32 +0000 (21:15 -0300)]
drm/tests: Add test for drm_framebuffer_lookup()

Add two KUnit test cases for the drm_framebuffer_lookup function, one
for the base case, that tests if the lookup finds the correct framebuffer
object and another that tests the lookup for an inexistent framebuffer.

Signed-off-by: Carlos Eduardo Gallo Filho <[email protected]>
Acked-by: Maxime Ripard <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Maxime Ripard <[email protected]>
6 months agodrm/tests: Add test for drm_framebuffer_cleanup()
Carlos Eduardo Gallo Filho [Wed, 11 Sep 2024 00:15:31 +0000 (21:15 -0300)]
drm/tests: Add test for drm_framebuffer_cleanup()

Add a single KUnit test case for the drm_framebuffer_cleanup function.

Signed-off-by: Carlos Eduardo Gallo Filho <[email protected]>
Acked-by: Maxime Ripard <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Maxime Ripard <[email protected]>
6 months agodrm/tests: Add test for drm_framebuffer_check_src_coords()
Carlos Eduardo Gallo Filho [Wed, 11 Sep 2024 00:15:30 +0000 (21:15 -0300)]
drm/tests: Add test for drm_framebuffer_check_src_coords()

Add a parametrized test for the drm_framebuffer_check_src_coords function.

Signed-off-by: Carlos Eduardo Gallo Filho <[email protected]>
Acked-by: Maxime Ripard <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Maxime Ripard <[email protected]>
6 months agodrm/tests: Add test case for drm_internal_framebuffer_create()
Carlos Eduardo Gallo Filho [Wed, 11 Sep 2024 00:15:29 +0000 (21:15 -0300)]
drm/tests: Add test case for drm_internal_framebuffer_create()

Introduce a test to cover the creation of framebuffer with
modifier on a device that doesn't support it.

Signed-off-by: Carlos Eduardo Gallo Filho <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Maxime Ripard <[email protected]>
6 months agodrm/tests: Replace strcpy to strscpy on drm_test_framebuffer_create test
Carlos Eduardo Gallo Filho [Wed, 11 Sep 2024 00:15:28 +0000 (21:15 -0300)]
drm/tests: Replace strcpy to strscpy on drm_test_framebuffer_create test

Replace the use of strcpy to strscpy on the test_to_desc of the
drm_test_framebuffer_create test for better security and reliability.

Signed-off-by: Carlos Eduardo Gallo Filho <[email protected]>
Acked-by: Maxime Ripard <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Maxime Ripard <[email protected]>
6 months agodrm/tests: Add parameters to the drm_test_framebuffer_create test
Carlos Eduardo Gallo Filho [Wed, 11 Sep 2024 00:15:27 +0000 (21:15 -0300)]
drm/tests: Add parameters to the drm_test_framebuffer_create test

Extend the existing test case to cover:
1. Invalid flag atribute in the struct drm_mode_fb_cmd2.
2. Pixel format which requires non-linear modifier with
DRM_FORMAT_MOD_LINEAR set.
3. Buffer offset for inexistent plane

Signed-off-by: Carlos Eduardo Gallo Filho <[email protected]>
Acked-by: Maxime Ripard <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Maxime Ripard <[email protected]>
6 months agodrm/tests: Stop using deprecated dev_private member on drm_framebuffer tests
Carlos Eduardo Gallo Filho [Wed, 11 Sep 2024 00:15:26 +0000 (21:15 -0300)]
drm/tests: Stop using deprecated dev_private member on drm_framebuffer tests

The dev_private member of drm_device is deprecated and its use should
be avoided. Stop using it by embedding the drm_device onto a mock struct.

The new mock struct allows to share variables and even further mocks
over the tests in a cleaner way than using dev_private void pointer.

Also start using drm_kunit_helper_alloc_drm_device() for allocating
the drm_device mock.

Signed-off-by: Carlos Eduardo Gallo Filho <[email protected]>
Acked-by: Maxime Ripard <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Maxime Ripard <[email protected]>
6 months agodrm/ast: Remove TX-chip bitmask
Thomas Zimmermann [Tue, 3 Sep 2024 13:25:29 +0000 (15:25 +0200)]
drm/ast: Remove TX-chip bitmask

The CRTC has only one output attached to it. Store the output's type
of TX chip in a single field and remove the related bitmask.

Turn the type-less output field in struct ast_device into a union, as
only one of its fields will be used at a time.

Signed-off-by: Thomas Zimmermann <[email protected]>
Reviewed-by: Jocelyn Falempe <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
6 months agoMerge drm/drm-next into drm-misc-next
Thomas Zimmermann [Wed, 11 Sep 2024 07:48:49 +0000 (09:48 +0200)]
Merge drm/drm-next into drm-misc-next

Backmerging to get fixes from v6.12-rc7.

Signed-off-by: Thomas Zimmermann <[email protected]>
6 months agoMerge v6.11-rc7 into drm-next
Simona Vetter [Wed, 11 Sep 2024 07:18:15 +0000 (09:18 +0200)]
Merge v6.11-rc7 into drm-next

Thomas needs 5a498d4d06d6 ("drm/fbdev-dma: Only install deferred I/O
if necessary") in drm-misc, so start the backmerge cascade.

Signed-off-by: Simona Vetter <[email protected]>
6 months agoMerge tag 'drm-misc-next-fixes-2024-09-05' of https://gitlab.freedesktop.org/drm...
Dave Airlie [Wed, 11 Sep 2024 03:21:55 +0000 (13:21 +1000)]
Merge tag 'drm-misc-next-fixes-2024-09-05' of https://gitlab.freedesktop.org/drm/misc/kernel into drm-next

Short summary of fixes pull:

tegra:
- Fix uninitialized variable in EDID code

Signed-off-by: Dave Airlie <[email protected]>
From: Thomas Zimmermann <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
6 months agoMerge tag 'exynos-drm-next-for-v6.12' of git://git.kernel.org/pub/scm/linux/kernel...
Dave Airlie [Wed, 11 Sep 2024 03:05:37 +0000 (13:05 +1000)]
Merge tag 'exynos-drm-next-for-v6.12' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos into drm-next

Three cleanups
- Drop stale exynos file pattern from MAINTAINERS file
  The old "exynos" directory is removed from MAINTAINERS as Samsung Exynos display bindings have been relocated. This resolves a warning from get_maintainers.pl about no files matching the outdated directory.

- Constify struct exynos_drm_ipp_funcs
  By making struct exynos_drm_ipp_funcs constant, the patch enhances security by moving the structure to a read-only section of memory. This change results in a slight reduction in the data section size.

- Remove unnecessary code
  The function exynos_atomic_commit is removed as it became redundant after a previous update. This cleans up the code and eliminates unused function declarations.

One fixup
- Fix wrong assignment in gsc_bind()
  A double assignment in gsc_bind() was flagged by the cocci tool and corrected to fix an incorrect assignment, addressing a potential issue introduced in a prior commit.

Signed-off-by: Dave Airlie <[email protected]>
From: Inki Dae <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
6 months agoMerge tag 'amd-drm-next-6.12-2024-09-06' of https://gitlab.freedesktop.org/agd5f...
Dave Airlie [Wed, 11 Sep 2024 01:21:55 +0000 (11:21 +1000)]
Merge tag 'amd-drm-next-6.12-2024-09-06' of https://gitlab.freedesktop.org/agd5f/linux into drm-next

amd-drm-next-6.12-2024-09-06:

amdgpu:
- IPS updates
- Post divider fix
- DML2 updates
- Misc static checker fixes
- DCN 3.5 fixes
- Replay fixes
- DMCUB updates
- SWSMU fixes
- DP MST fixes
- Add debug flag for per queue resets
- devcoredump updates
- SR-IOV fixes
- MES fixes
- Always allocate cleared VRAM for GEM
- Pipe reset for GC 9.4.3
- ODM policy fixes
- Per queue reset support for GC 10
- Per queue reset support for GC 11
- Per queue reset support for GC 12
- Display flickering fixes
- MPO fixes
- Display sharpening updates

amdkfd:
- SVM fix for IH for APUs

Signed-off-by: Dave Airlie <[email protected]>
From: Alex Deucher <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
6 months agoMerge tag 'drm-intel-gt-next-2024-09-06' of https://gitlab.freedesktop.org/drm/i915...
Dave Airlie [Tue, 10 Sep 2024 23:11:53 +0000 (09:11 +1000)]
Merge tag 'drm-intel-gt-next-2024-09-06' of https://gitlab.freedesktop.org/drm/i915/kernel into drm-next

Driver Changes:

- Expose fan speed via hwmon (Raag)
- Correction to Wa_14019159160 on ARL (John H)
- Whitelist COMMON_SLICE_CHICKEN1 for UMD access on DG2/MTL/ARL (Dnyaneshwar)
- Do not attempt to load the GSC multiple times to avoid hanging GSC HW (Daniele)

- Populate /sys/class/drm/cardX/engines/ even if one engine fails (Andi)
- Use kmemdup_array instead of kmemdup for multiple allocation (Yu)
- Remove extra unlikely() (Hongbo)

Signed-off-by: Dave Airlie <[email protected]>
From: Joonas Lahtinen <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
6 months agodrm/panel: samsung-s6e3fa7: transition to mipi_dsi wrapped functions
Tejas Vipin [Mon, 2 Sep 2024 07:10:19 +0000 (12:40 +0530)]
drm/panel: samsung-s6e3fa7: transition to mipi_dsi wrapped functions

Changes the samsung-s6e3fa7 panel to use multi style functions for
improved error handling.

Signed-off-by: Tejas Vipin <[email protected]>
Reviewed-by: Douglas Anderson <[email protected]>
Reviewed-by: Jessica Zhang <[email protected]>
Signed-off-by: Douglas Anderson <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
6 months agoMerge tag 'drm-xe-next-2024-09-05' of https://gitlab.freedesktop.org/drm/xe/kernel...
Dave Airlie [Tue, 10 Sep 2024 03:17:56 +0000 (13:17 +1000)]
Merge tag 'drm-xe-next-2024-09-05' of https://gitlab.freedesktop.org/drm/xe/kernel into drm-next

Cross-subsystem Changes:
- Split dma fence array creation into alloc and arm (Matthew Brost)

Driver Changes:
- Move kernel_lrc to execlist backend (Ilia)
- Fix type width for pcode coommand (Karthik)
- Make xe_drm.h include unambiguous (Jani)
- Fixes and debug improvements for GSC load (Daniele)
- Track resources and VF state by PF (Michal Wajdeczko)
- Fix memory leak on error path (Nirmoy)
- Cleanup header includes (Matt Roper)
- Move pcode logic to tile scope (Matt Roper)
- Move hwmon logic to device scope (Matt Roper)
- Fix media TLB invalidation (Matthew Brost)
- Threshold config fixes for PF (Michal Wajdeczko)
- Remove extra "[drm]" from logs (Michal Wajdeczko)
- Add missing runtime ref (Rodrigo Vivi)
- Fix circular locking on runtime suspend (Rodrigo Vivi)
- Fix rpm in TTM swapout path (Thomas)

Signed-off-by: Dave Airlie <[email protected]>
From: Lucas De Marchi <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/eirx5vdvoflbbqlrzi5cip6bpu3zjojm2pxseufu3rlq4pp6xv@eytjvhizfyu6
6 months agodrm/vc4: hvs: Correct logic on stopping an HVS channel
Dave Stevenson [Fri, 21 Jun 2024 15:20:55 +0000 (16:20 +0100)]
drm/vc4: hvs: Correct logic on stopping an HVS channel

When factoring out __vc4_hvs_stop_channel, the logic got inverted from
if (condition)
  // stop channel
to
if (condition)
  goto out
//stop channel
out:
and also changed the exact register writes used to stop the channel.

Correct the logic so that the channel is actually stopped, and revert
to the original register writes.

Fixes: 6d01a106b4c8 ("drm/vc4: crtc: Move HVS init and close to a function")
Reviewed-by: Maxime Ripard <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Dave Stevenson <[email protected]>
6 months agodrm/vc4: hvs: Enable SCALER_CONTROL early in HVS init
Tim Gover [Fri, 21 Jun 2024 15:20:54 +0000 (16:20 +0100)]
drm/vc4: hvs: Enable SCALER_CONTROL early in HVS init

Always enable SCALER_CONTROL before attempting other HVS
operations. It's safe to write to some parts of the HVS but
in general it's dangerous to do this because it can cause bus
lockups.

Signed-off-by: Tim Gover <[email protected]>
Reviewed-by: Maxime Ripard <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Dave Stevenson <[email protected]>
6 months agodrm/vc4: plane: Move the buffer offset out of the vc4_plane_state
Dave Stevenson [Fri, 21 Jun 2024 15:20:53 +0000 (16:20 +0100)]
drm/vc4: plane: Move the buffer offset out of the vc4_plane_state

The offset fields in vc4_plane_state are described as being
the offset for each buffer in the bo, however it is used to
store the complete DMA address that is then written into the
register.

The DMA address including the fb ofset can be retrieved
using drm_fb_dma_get_gem_addr, and the offset adjustment due to
clipping is local to vc4_plane_mode_set.
Drop the offset field from the state, and compute the complete
DMA address in vc4_plane_mode_set.

Reviewed-by: Maxime Ripard <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Dave Stevenson <[email protected]>
This page took 0.123789 seconds and 4 git commands to generate.