drm/i915/backlight: Modify condition to use panel luminance
According to our internal spec we need to now check if both
panel luminance and smooth brightness are available in panel for
us to be able to change brightness using luminance value.
Baihan Li [Mon, 31 Mar 2025 07:42:11 +0000 (15:42 +0800)]
drm/hisilicon/hibmc: Add MSI irq getting and requesting for HPD
To realize HPD feature, request irq for HPD , add its handler function.
We use pci_alloc_irq_vectors() to get our msi irq, because we have two
interrupts now.
Signed-off-by: Baihan Li <libaihan@huawei.com> Signed-off-by: Yongbang Shi <shiyongbang@huawei.com> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Link: https://lore.kernel.org/r/20250331074212.3370287-9-shiyongbang@huawei.com Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Baihan Li [Mon, 31 Mar 2025 07:42:10 +0000 (15:42 +0800)]
drm/hisilicon/hibmc: Enable this hot plug detect of irq feature
Add HPD interrupt enable functions in drm framework, and also add
detect_ctx functions. Because of the debouncing when HPD pulled out,
add 200 ms delay in detect. Add link reset process to reset link status
when a new connector pulgged in.
Signed-off-by: Baihan Li <libaihan@huawei.com> Signed-off-by: Yongbang Shi <shiyongbang@huawei.com> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Link: https://lore.kernel.org/r/20250331074212.3370287-8-shiyongbang@huawei.com Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Baihan Li [Mon, 31 Mar 2025 07:42:09 +0000 (15:42 +0800)]
drm/hisilicon/hibmc: Add colorbar-cfg feature and its debugfs file
DP controller can support generating a color bar signal over the
DisplayPort interface. This can be useful to check for possible DDR
or GPU problems, as the signal generator resides completely in the DP
block. Add debugfs file that controls colorbar generator.
echo: config the color bar register to display
cat: print the color bar configuration
Signed-off-by: Baihan Li <libaihan@huawei.com> Signed-off-by: Yongbang Shi <shiyongbang@huawei.com> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Link: https://lore.kernel.org/r/20250331074212.3370287-7-shiyongbang@huawei.com Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Baihan Li [Mon, 31 Mar 2025 07:42:08 +0000 (15:42 +0800)]
drm/hisilicon/hibmc: Getting connector info and EDID by using AUX channel
Add registering drm_aux and use it to get connector edid with drm
functions. Add ddc channel in connector initialization to put drm_aux
in drm_connector.
Signed-off-by: Baihan Li <libaihan@huawei.com> Signed-off-by: Yongbang Shi <shiyongbang@huawei.com> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Link: https://lore.kernel.org/r/20250331074212.3370287-6-shiyongbang@huawei.com Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Baihan Li [Mon, 31 Mar 2025 07:42:07 +0000 (15:42 +0800)]
drm/hisilicon/hibmc: Refactor the member of drm_aux in struct hibmc_dp
Because the drm_aux of struct hibmc_dp_dev's member is not easy to get in
hibmc_drm_dp.c, move the drm_aux to struct hibmc_dp. Then there are some
adaptations and modifications to make this patch compile.
Signed-off-by: Baihan Li <libaihan@huawei.com> Signed-off-by: Yongbang Shi <shiyongbang@huawei.com> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Link: https://lore.kernel.org/r/20250331074212.3370287-5-shiyongbang@huawei.com Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Baihan Li [Mon, 31 Mar 2025 07:42:06 +0000 (15:42 +0800)]
drm/hisilicon/hibmc: Add dp serdes cfg in dp process
Add dp serdes cfg in link training process, and related adapting
and modificating. Change some init values about training, because we want
completely to negotiation process, so we start with the maximum rate and
the electrical characteristic level is 0. Because serdes default cfgs is
changed and used in hibmc_kms_init(), we changed the if-statement to check
whether the value is 0.
Signed-off-by: Baihan Li <libaihan@huawei.com> Signed-off-by: Yongbang Shi <shiyongbang@huawei.com> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Link: https://lore.kernel.org/r/20250331074212.3370287-4-shiyongbang@huawei.com Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Baihan Li [Mon, 31 Mar 2025 07:42:05 +0000 (15:42 +0800)]
drm/hisilicon/hibmc: Add dp serdes cfg to adjust serdes rate, voltage and pre-emphasis
This dp controller need features of digital-to-analog conversion and
high-speed transmission in chip by its extern serdes controller. Our
serdes cfg is relatively simple, just need two register configurations.
Don't need too much functions, like: power on/off, initialize, and some
complex configurations, so I'm not going to use the phy framework.
This serdes is inited and configured in dp initialization, and also
integrating them into link training process.
For rate changing, we can change from 1.62-8.2Gpbs by cfg reg.
For voltage and pre-emphasis levels changing, we can cfg different
serdes ffe value.
Signed-off-by: Baihan Li <libaihan@huawei.com> Signed-off-by: Yongbang Shi <shiyongbang@huawei.com> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Link: https://lore.kernel.org/r/20250331074212.3370287-3-shiyongbang@huawei.com Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
accel/amdxdna: Fix incorrect size of ERT_START_NPU commands
When multiple ERT_START_NPU commands are combined in one buffer, the
buffer size calculation is incorrect. Also, the condition to make sure
the buffer size is not beyond 4K is also fixed.
Fixes: aac243092b70 ("accel/amdxdna: Add command execution") Reviewed-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com> Reviewed-by: Maciej Falkowski <maciej.falkowski@linux.intel.com> Signed-off-by: Lizhi Hou <lizhi.hou@amd.com> Link: https://lore.kernel.org/r/20250409210013.10854-1-lizhi.hou@amd.com
Thomas Zimmermann [Tue, 8 Apr 2025 11:31:26 +0000 (13:31 +0200)]
accel/ivpu: Test for imported buffers with drm_gem_is_imported()
Instead of testing import_attach for imported GEM buffers, invoke
drm_gem_is_imported() to do the test. The helper tests the dma_buf
itself while import_attach is just an artifact of the import. Prepares
to make import_attach optional.
Boris Brezillon [Fri, 4 Apr 2025 08:09:33 +0000 (10:09 +0200)]
drm/panthor: Don't update MMU_INT_MASK in panthor_mmu_irq_handler()
Interrupts are automatically unmasked in
panthor_mmu_irq_threaded_handler() when the handler returns. Unmasking
prematurely might generate spurious interrupts if the IRQ line is
shared.
Boris Brezillon [Fri, 4 Apr 2025 08:09:32 +0000 (10:09 +0200)]
drm/panthor: Let IRQ handlers clear the interrupts themselves
MMU handler needs to be in control of the job interrupt clears because
clearing the interrupt also unblocks the writer/reader that triggered
the fault, and we don't want it to be unblocked until we've had a chance
to process the IRQ.
Since clearing the clearing is just one line, let's make it explicit
instead of doing it in the generic code path.
Note that this commit changes the existing behavior in that the MMU
COMPLETED irqs are no longer cleared, which is fine because they are
masked, so we're not risking an interrupt flood.
Changes in v3:
- Mention the fact we no longer clear MMU COMPLETED irqs
- Add Liviu's R-b
Boris Brezillon [Fri, 4 Apr 2025 08:09:31 +0000 (10:09 +0200)]
drm/panthor: Update panthor_mmu::irq::mask when needed
When we clear the faulty bits in the AS mask, we also need to update
the panthor_mmu::irq::mask field otherwise our IRQ handler won't get
called again until the GPU is reset.
Boris Brezillon [Fri, 4 Apr 2025 08:09:30 +0000 (10:09 +0200)]
drm/panthor: Call panthor_gpu_coherency_init() after PM resume()
When the device is coherent, panthor_gpu_coherency_init() will read
GPU_COHERENCY_FEATURES to make sure the GPU supports the ACE-Lite
coherency protocol, which will fail if the clocks/power-domains are
not enabled when the read is done. Move the
panthor_gpu_coherency_init() call after the device has been resumed
to prevent that.
drm/panic: Add support to scanout buffer as array of pages
Some drivers like virtio-gpu, don't map the scanout buffer in the
kernel. Calling vmap() in a panic handler is not safe, and writing an
atomic_vmap() API is more complex than expected [1].
So instead, pass the array of pages of the scanout buffer to the
panic handler, and map only one page at a time to draw the pixels.
This is obviously slow, but acceptable for a panic handler.
kmap_local_page() can be unsafe to call from a panic handler, if
CONFIG_HIGHMEM is set, and the page is in the highmem zone.
So add kmap_local_page_try_from_panic() to handle this case.
Konstantin Shabanov [Thu, 3 Apr 2025 06:47:39 +0000 (06:47 +0000)]
drm/rockchip: vop: Consistently use rk3399 registers consts
As rk3399 has its own registers definitions, update related structs to
use them.
There are no changes in behaviour as updated constants values are the
for rk3288/rk3368/rk3399 chips.
dt-bindings: display: rockchip,vop: Drop assigned-clocks
assigned-clock properties are implicitly allowed in any node with
'clocks' and don't have to be specified. The max here also appears to be
wrong as there's a case with 4 entries.
Andy Yan [Tue, 18 Mar 2025 06:20:17 +0000 (14:20 +0800)]
drm/rockchip: vop2: Make overlay layer select register configuration take effect by vsync
Because the layer/window enable/disable is take effect by vsync, if the
overlay configuration of these layers does not follow vsync and
takes effect immediately instead, when multiple layers are dynamically
enable/disable, inconsistent display contents may be seen on the screen.
This adds the UAPI for the Asahi driver targeting the GPU in the Apple
M1 and M2 series systems on chip. The UAPI design is based on other
modern Vulkan-capable drivers, including Xe and Panthor. Memory
management is based on explicit VM management. Synchronization is
exclusively explicit sync.
This UAPI is validated against our open source Mesa stack, which is
fully conformant to the OpenGL 4.6, OpenGL ES 3.2, OpenCL 3.0, and
Vulkan 1.4 standards. The Vulkan driver supports sparse, exercising the
VM_BIND mechanism.
This patch adds the standalone UAPI header. It is implemented by an open
source DRM driver written in Rust. We fully intend to upstream this
driver when possible. However, as a production graphics driver, it
depends on a significant number of Rust abstractions that will take a
long time to upstream. In the mean time, our userspace is upstream in
Mesa but is not allowed to probe with upstream Mesa as the UAPI is not
yet reviewed and merged in the upstream kernel. Although we ship a
patched Mesa in Fedora Asahi Remix, any containers shipping upstream
Mesa builds are broken for our users, including upstream Flatpak and
Waydroid runtimes. Additionally, it forces us to maintain forks of Mesa
and virglrenderer, which complicates bisects.
The intention in sending out this patch is for this UAPI to be
thoroughly reviewed. Once we as the DRM community are satisfied with the
UAPI, this header lands signifying that the UAPI is stable and must only
be evolved in backwards-compatible ways; it will be the UAPI implemented
in the DRM driver that eventually lands upstream. That promise lets us
enable upstream Mesa, solving all these issues while the upstream Rust
abstractions are developed.
https://github.com/alyssarosenzweig/linux/commits/agx-uapi-v7 contains
the DRM driver implementing this proposed UAPI.
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33984 contains
the Mesa patches to implement this proposed UAPI.
That Linux and Mesa branch together give a complete graphics/compute
stack on top of this UAPI.
Commit 5d2b55e55e61 ("panel/boe-tv101wum-ll2: Use refcounted allocation
in place of devm_kzalloc()") switched from a kmalloc + drm_panel_init
call to a devm_drm_panel_alloc one.
However, the variable it was storing the allocated pointer in doesn't
exist, resulting in a compilation breakage.
Fixes: 5d2b55e55e61 ("panel/boe-tv101wum-ll2: Use refcounted allocation in place of devm_kzalloc()") Signed-off-by: Maxime Ripard <mripard@kernel.org> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Tested-by: Thomas Zimmermann <tzimmermann@suse.de> Link: https://lore.kernel.org/r/20250408122008.1676235-3-mripard@kernel.org Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Commit 77dcbce63779 ("panel/th101mb31ig002-28a: Use refcounted
allocation in place of devm_kzalloc()") switched from a kmalloc +
drm_panel_init call to a devm_drm_panel_alloc one.
However, the variable it was storing the allocated pointer in doesn't
exist, resulting in a compilation breakage.
Fixes: 77dcbce63779 ("panel/th101mb31ig002-28a: Use refcounted allocation in place of devm_kzalloc()") Signed-off-by: Maxime Ripard <mripard@kernel.org> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Tested-by: Thomas Zimmermann <tzimmermann@suse.de> Link: https://lore.kernel.org/r/20250408122008.1676235-2-mripard@kernel.org Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Maxime Ripard [Tue, 8 Apr 2025 12:20:06 +0000 (14:20 +0200)]
drm/panel: auo-a030jtn01: Fix compilation build
Commit 9d7d7c3c9a19 ("panel/auo-a030jtn01: Use refcounted allocation in
place of devm_kzalloc()") switched from a kmalloc + drm_panel_init call
to a devm_drm_panel_alloc one.
However, the variable it was storing the allocated pointer in doesn't
exist, resulting in a compilation breakage.
Fixes: 9d7d7c3c9a19 ("panel/auo-a030jtn01: Use refcounted allocation in place of devm_kzalloc()") Signed-off-by: Maxime Ripard <mripard@kernel.org> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Tested-by: Thomas Zimmermann <tzimmermann@suse.de> Link: https://lore.kernel.org/r/20250408122008.1676235-1-mripard@kernel.org Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Thomas Zimmermann [Mon, 7 Apr 2025 13:47:24 +0000 (15:47 +0200)]
drm/simpledrm: Do not upcast in release helpers
The res pointer passed to simpledrm_device_release_clocks() and
simpledrm_device_release_regulators() points to an instance of
struct simpledrm_device. No need to upcast from struct drm_device.
The upcast is harmless, as DRM device is the first field in struct
simpledrm_device.
Thomas Zimmermann [Mon, 24 Mar 2025 09:44:11 +0000 (10:44 +0100)]
drm/ast: Validate display modes against framebuffer and format limits
Reimplement ast_mode_config_mode_valid() with DRM format helpers and
ast's helpers for framebuffer size calculation. Replaces ast's open-
coded assumptions on bpp and page-alignments.
Thomas Zimmermann [Mon, 24 Mar 2025 09:44:10 +0000 (10:44 +0100)]
drm/ast: Remove vaddr field from struct ast_plane
The vaddr field in struct ast_plane serves no purpose. Its value
can be calculated easily from the VRAM base plus the plane offset.
Do so and remove the field.
In ast_primary_plane_helper_get_scanout_buffer(), remove the test
for vaddr being NULL. This cannot legally happen.
Thomas Zimmermann [Mon, 24 Mar 2025 09:44:09 +0000 (10:44 +0100)]
drm/ast: Fix comment on modeset lock
The ast driver protects the commit tail against concurrent reads
of the display modes by acquiring a lock. The comment is misleading
as the lock is not released in atomic_flush, but at the end of the
commit-tail helper. Rewrite the comment.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Fixes: 1fe182154984 ("drm/ast: Acquire I/O-register lock in atomic_commit_tail function") Cc: Thomas Zimmermann <tzimmermann@suse.de> Cc: Jocelyn Falempe <jfalempe@redhat.com> Cc: Dave Airlie <airlied@redhat.com> Cc: dri-devel@lists.freedesktop.org Cc: <stable@vger.kernel.org> # v6.2+ Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://lore.kernel.org/r/20250324094520.192974-2-tzimmermann@suse.de
Dmitry Baryshkov [Fri, 14 Mar 2025 09:36:50 +0000 (11:36 +0200)]
drm/bridge-connector: hook DisplayPort audio support
Reuse existing code plumbing HDMI audio support and the existing HDMI
audio helpers that register HDMI codec device and plumb in the
DisplayPort audio interfaces to be handled by the drm_bridge_connector.
Dmitry Baryshkov [Fri, 14 Mar 2025 09:36:49 +0000 (11:36 +0200)]
drm/bridge: add function interface for DisplayPort audio implementation
It is common for the DisplayPort bridges to implement audio support. In
preparation to providing a generic framework for DP audio, add
corresponding interface to struct drm_bridge. As suggested by Maxime
for now this is mostly c&p of the corresponding HDMI audio API.
drm/bridge: split HDMI Audio from DRM_BRIDGE_OP_HDMI
As pointed out by Laurent, OP bits are supposed to describe operations.
Split DRM_BRIDGE_OP_HDMI_AUDIO from DRM_BRIDGE_OP_HDMI instead of
overloading DRM_BRIDGE_OP_HDMI.
Luca Ceresoli [Wed, 26 Mar 2025 17:47:37 +0000 (18:47 +0100)]
drm/bridge: make devm_drm_bridge_alloc() mandatory for bridge allocation
All DRM bridges are now supposed to be allocated using
devm_drm_bridge_alloc(), which is cleaner and necessary to support
refcounting.
In the absence of a drm_bridge_init() or such initialization function,
document the new mandatory alloc function on the first DRM bridge core
function that is called after allocation, i.e. drm_bridge_add().
Luca Ceresoli [Wed, 26 Mar 2025 17:47:36 +0000 (18:47 +0100)]
drm/bridge: add support for refcounting
DRM bridges are currently considered as a fixed element of a DRM card, and
thus their lifetime is assumed to extend for as long as the card
exists. New use cases, such as hot-pluggable hardware with video bridges,
require DRM bridges to be added to and removed from a DRM card without
tearing the card down. This is possible for connectors already (used by DP
MST), it is now needed for DRM bridges as well.
As a first preliminary step, make bridges reference-counted to allow a
struct drm_bridge (along with the private driver structure embedding it) to
stay allocated even after the driver has been removed, until the last
reference is put.
Luca Ceresoli [Wed, 26 Mar 2025 17:47:35 +0000 (18:47 +0100)]
drm/bridge: add devm_drm_bridge_alloc()
Add a macro to allocate and initialize a DRM bridge embedded within a
private driver struct.
Compared to current practice, which is based on [devm_]kzalloc() allocation
followed by open-coded initialization of fields, this allows to have a
common and explicit API to allocate and initialize DRM bridges.
Besides being useful to consolidate bridge driver code, this is a
fundamental step in preparation for adding dynamic lifetime to bridges
based on refcount.
Thomas Zimmermann [Tue, 1 Apr 2025 09:37:21 +0000 (11:37 +0200)]
drm/sysfb: vesadrm: Add gamma correction
Add palette support and export GAMMA properties via sysfs. User-space
compositors can use this interface for programming gamma ramps or night
mode.
Vesadrm supports palette updates via VGA DAC registers or VESA palette
calls. Up to 256 palette entries are available. Userspace always supplies
gamma ramps of 256 entries. If the native color format does not match
this because pixel component have less then 8 bits, vesadrm interpolates
among the palette entries.
The code uses CamelCase style in a few places to match the VESA manuals.
v3:
- fix coding style
v2:
- use CONFIG_X86_32 instead of __i386__ (checkpatch)
- protect struct vesadrm.pmi with CONFIG_X86_32
Thomas Zimmermann [Tue, 1 Apr 2025 09:37:20 +0000 (11:37 +0200)]
drm/sysfb: vesadrm: Add EDID support
Enable the connector's EDID property if edid_info contains valid
data. Exports the EDID via sysfs for user-space compositors.
EDID information is not always available. Depending on the system
and kernel configuration, it is either provided by the boot loader
or read by the kernel during early boot stages.
There's only one VESA display, so EDID data always belongs to this
output.
Thomas Zimmermann [Tue, 1 Apr 2025 09:37:19 +0000 (11:37 +0200)]
drm/sysfb: Add vesadrm for VESA displays
Add support for screen_info setups with VIDEO_TYPE_VLFB. Provide the
minimum functionality of reading modes, updating and clearing the display.
There is existing support for these displays provided by simpledrm with
CONFIG_SYSFB_SIMPLEFB=y. Using vesadrm over simpledrm will allow for the
use of additional functionality provided by VESA, such as EDID information,
gamma correction and palette modes. This enhances the user experience and
adds support for more display configuratons.
v4:
- depend on CONFIG_X86
v3:
- depend on !SYSFB_SIMPLEFB (Javier)
Thomas Zimmermann [Tue, 1 Apr 2025 09:37:18 +0000 (11:37 +0200)]
drm/sysfb: efidrm: Add EDID support
Enable the connector's EDID property if edid_info contains valid
data. Exports the EDID via sysfs for user-space compositors.
EDID information is not always available. Depending on the system
and kernel configuration, it is either provided by the boot loader
or read by the kernel during early boot stages.
As of now, there's only one EFI display, so that EDID data always
belongs to this output. This might change if there's ever more than
one EFI display in the system.
Thomas Zimmermann [Tue, 1 Apr 2025 09:37:17 +0000 (11:37 +0200)]
drm/sysfb: Add efidrm for EFI displays
Add support for screen_info setups with VIDEO_TYPE_EFI. Provide the
minimum functionality of reading modes, updating and clearing the display.
There is existing support for these displays provided by simpledrm with
CONFIG_SYSFB_SIMPLEFB=y. Using efidrm over simpledrm will allows for the
mapping of video memory with correct caching. Simpledrm always assumes WC
caching, while fully cached memory is possible with efidrm. Efidrm will
also allow for the use of additional functionality provided by EFI, such
as EDID information.
In addition to efidrm, add struct pixel_format plus initializer macros.
The type and macros describe pixel formats in a generic way on order to
find the DRM format from the screen_info settings. Similar existing code
in SIMPLEFB_FORMATS and fbdev is not really what is needed in efidrm,
but SIMPLEFB_FORMATS can later be converted to struct pixel_format.
v4:
- depend on CONFIG_EFI
- disallow module for now as efi_mem_desc_lookup() is not exported
v3:
- depend on !SYSFB_SIMPLEFB (Javier)
Thomas Zimmermann [Tue, 1 Apr 2025 09:37:16 +0000 (11:37 +0200)]
firmware: sysfb: Move bpp-depth calculation into screen_info helper
Move the calculation of the bits per pixels for screen_info into a
helper function. This will make it available to other callers besides
the firmware code.
Thomas Zimmermann [Tue, 1 Apr 2025 09:37:15 +0000 (11:37 +0200)]
drm/sysfb: ofdrm: Add EDID support
Add EDID support to sysfb connector helpers. Read the EDID property
from the OF node in ofdrm. Without EDID, this does nothing.
Some systems with OF display, such as 32-bit PPC Macintoshs, provide
the system display's EDID data as node property in their DT. Exporting
this information allows compositors to implement correct DPI and
meaningful color management.
v3:
- avoid parser error by clearing EDID extension field
v2:
- return errno codes on errors (Jani)
- simplify EDID read logic (Jani)
Thomas Zimmermann [Tue, 1 Apr 2025 09:37:14 +0000 (11:37 +0200)]
drm/sysfb: Merge primary-plane functions
Merge the primary plane code of ofdrm and simpledrm. Replace the
plane implementation in each driver with the shared helpers. Set
up driver callbacks and format modifiers with initializer macros.
The plane code in ofdrm and simpledrm is very similar. Ofdrm has a
more sophisticated implementation of atomic_disable, which clears
individual scanlines. The code in simpledrm clears the whole buffer
at once. Take the ofdrm version.
Simpledrm supports get_scanout_buffer. Import it into the shared
helpers, which makes it available in ofdrm.
The supported formats are all native formats plus an optional enulated
XRGB8888 if that's not already a native format. Provide an initializer
macro that computes the size of the formats array.
Thomas Zimmermann [Tue, 1 Apr 2025 09:37:13 +0000 (11:37 +0200)]
drm/sysfb: Merge CRTC functions
Merge the CRTC functions of ofdrm and simpledrm. Replace the code
in each driver with the shared helpers. Set up callbacks with
initializer macros.
Ofdrm supports a gamma LUT, while simpledrm does not. So far ofdrm's
LUT size has been hard-coded in the driver CRTC's atomic_check helper.
Now pass the size of the LUT to the sysfb device. Ofdrm's custom
atomic_flush is still required to apply changes to the LUT. Simpledrm
passes a LUT size of 0, which disables the gamma LUT.
Thomas Zimmermann [Tue, 1 Apr 2025 09:37:12 +0000 (11:37 +0200)]
drm/sysfb: Maintain CRTC state in struct drm_sysfb_crtc_state
Move ofdrm's struct ofdrm_crtc_state plus functions to sysfb
helpers and rename everything to drm_sysfb_crtc_state.
The sysfb CRTC state is a regular CRTC state with information on
the primary plane's color format, as required for color management.
Helpers for sysfb planes will later set this up automatically.
In ofdrm and simpledrm, replace existing code with the new helpers.
Ofdrm continues to use the CRTC state for color management. This
has no effect on simpledrm.
Thomas Zimmermann [Tue, 1 Apr 2025 09:37:11 +0000 (11:37 +0200)]
drm/sysfb: Merge connector functions
Merge the connector functions of ofdrm and simpledrm. Replace the
code in each driver with the shared helpers. Set up callbacks with
initializer macros.
No effective code changes. The sysfb connector only returns the
preconfigured display mode.
Thomas Zimmermann [Tue, 1 Apr 2025 09:37:09 +0000 (11:37 +0200)]
drm/sysfb: Provide single mode-init helper
Merge the mode-init functions of ofdrm and simpledrm to the new helper
drm_sysfb_mode(). Also implement the DPI defaults there. Replace the
code in each driver with the shared helper.
Thomas Zimmermann [Tue, 1 Apr 2025 09:37:08 +0000 (11:37 +0200)]
drm/sysfb: Add struct drm_sysfb_device
Add struct drm_sysfb_device that stores the system display's hardware
settings. Further helpers for the mode-setting pipeline will use these
fields. Convert ofdrm and simpledrm by embedding the sysfb device in
their device structs.
Thomas Zimmermann [Tue, 1 Apr 2025 09:37:07 +0000 (11:37 +0200)]
drm: Move sysfb drivers into separate subdirectory
The ofdrm and simpledrm drivers are special as they operate on
externally provided framebuffers. Move them into their own sub-
directory. Will let them share common code.
Thomas Zimmermann [Tue, 1 Apr 2025 09:37:05 +0000 (11:37 +0200)]
drm/ofdrm: Open-code drm_simple_encoder_init()
The helper drm_simple_encoder_init() is a trivial helper around
drm_encoder_init() and therefore deprecated. Open-code the function
and remove the dependency.
Maxime Ripard [Thu, 3 Apr 2025 13:33:33 +0000 (15:33 +0200)]
drm/vc4: tests: Retry pv-muxing tests when EDEADLK
Some functions used by the HVS->PV muxing tests can return with EDEADLK,
meaning the entire sequence should be restarted. It's not a fatal error
and we should treat it as a recoverable error, and recover, instead of
failing the test like we currently do.
Maxime Ripard [Thu, 3 Apr 2025 13:33:32 +0000 (15:33 +0200)]
drm/vc4: tests: Stop allocating the state in test init
The vc4-pv-muxing-combinations and vc5-pv-muxing-combinations test
suites use a common test init function which, in part, allocates the
drm atomic state the test will use.
That allocation relies on drm_kunit_helper_atomic_state_alloc(), and
thus requires a struct drm_modeset_acquire_ctx. This context will then
be stored in the allocated state->acquire_ctx field.
However, the context is local to the test init function, and is cleared
as soon as drm_kunit_helper_atomic_state_alloc() is done. We thus end up
with an dangling pointer to a cleared context in state->acquire_ctx for
our test to consumes.
We should really allocate the context and the state in the test
functions, so we can also control when we're done with it.
Maxime Ripard [Thu, 3 Apr 2025 13:33:30 +0000 (15:33 +0200)]
drm/vc4: tests: Use return instead of assert
The vc4_mock_atomic_add_output() and vc4_mock_atomic_del_output() assert
that the functions they are calling didn't fail. Since some of them can
return EDEADLK, we can't properly deal with it.
Since both functions are expected to return an int, and all caller check
the return value, let's just properly propagate the errors when they
occur.
With that move the increment of the sbuf32 pointer to the end of the
loop, instead of inside the array list initializer, where the
order/sequence of the sbuf32 pointer modifications is not defined.
Fixes: 58523a25cbf7 ("drm/format-helper: Optimize 32-to-24-bpp conversion") Fixes: 3f31a017ddbc ("drm/format-helper: Optimize 32-to-16-bpp conversion") Fixes: 65931bbc5177 ("drm/format-helper: Optimize 32-to-8-bpp conversion") Signed-off-by: Matthew Auld <matthew.auld@intel.com> Cc: Thomas Zimmermann <tzimmermann@suse.de> Cc: Jocelyn Falempe <jfalempe@redhat.com> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Link: https://lore.kernel.org/r/20250402104430.142398-2-matthew.auld@intel.com
Kieran Bingham [Sun, 30 Mar 2025 10:23:53 +0000 (11:23 +0100)]
drm: renesas: Extend RZ/G2L supported KMS formats
The RZ/G2L driver utilises the VSPD to read data from input sources.
The rzg2l_du_kms component lists a restricted subset of the capabilities
of the VSPD which prevents additional formats from being used for
display planes.
The supported display plane formats are mapped in rzg2l_du_vsp_formats[].
Extend the rzg2l_du_format_infos[] table with the corresponding mappings
between the supported DRM formats and the formats exposed by the VSP in
rzg2l_du_vsp_formats, maintaining the same ordering in both tables.
The RPF module on VSPD supports various format conversion and send the
image data to BRS(Blend ROP Sub Unit) for further processing.
Thomas Weißschuh [Wed, 2 Apr 2025 20:21:57 +0000 (21:21 +0100)]
tools/include: make uapi/linux/types.h usable from assembly
The "real" linux/types.h UAPI header gracefully degrades to a NOOP when
included from assembly code.
Mirror this behaviour in the tools/ variant.
Test for __ASSEMBLER__ over __ASSEMBLY__ as the former is provided by the
toolchain automatically.
Reported-by: Mark Brown <broonie@kernel.org> Closes: https://lore.kernel.org/lkml/af553c62-ca2f-4956-932c-dd6e3a126f58@sirena.org.uk/ Fixes: c9fbaa879508 ("selftests: vDSO: parse_vdso: Use UAPI headers instead of libc headers") Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Link: https://patch.msgid.link/20250321-uapi-consistency-v1-1-439070118dc0@linutronix.de Signed-off-by: Mark Brown <broonie@kernel.org> Reviewed-by: Mark Brown <broonie@kernel.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Merge tag 'soundwire-6.15-rc1-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire
Pull soundwire fix from Vinod Koul:
- add missing config symbol CONFIG_SND_HDA_EXT_CORE required for asoc
driver CONFIG_SND_SOF_SOF_HDA_SDW_BPT
* tag 'soundwire-6.15-rc1-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire:
ASoC: SOF: Intel: Let SND_SOF_SOF_HDA_SDW_BPT select SND_HDA_EXT_CORE
Len Brown [Sun, 6 Apr 2025 18:49:20 +0000 (14:49 -0400)]
tools/power turbostat: v2025.05.06
Support up to 8192 processors
Add cpuidle governor debug telemetry, disabled by default
Update default output to exclude cpuidle invocation counts
Bug fixes
Merge tag 'perf-urgent-2025-04-06' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull perf event fix from Ingo Molnar:
"Fix a perf events time accounting bug"
* tag 'perf-urgent-2025-04-06' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
perf/core: Fix child_total_time_enabled accounting bug at task exit
Merge tag 'sched-urgent-2025-04-06' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull scheduler fixes from Ingo Molnar:
- Fix a nonsensical Kconfig combination
- Remove an unnecessary rseq-notification
* tag 'sched-urgent-2025-04-06' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
rseq: Eliminate useless task_work on execve
sched/isolation: Make CONFIG_CPU_ISOLATION depend on CONFIG_SMP
... and don't error out so hard on missing module descriptions.
Before commit 6c6c1fc09de3 ("modpost: require a MODULE_DESCRIPTION()")
we used to warn about missing module descriptions, but only when
building with extra warnigns (ie 'W=1').
After that commit the warning became an unconditional hard error.
And it turns out not all modules have been converted despite the claims
to the contrary. As reported by Damian Tometzki, the slub KUnit test
didn't have a module description, and apparently nobody ever really
noticed.
The reason nobody noticed seems to be that the slub KUnit tests get
disabled by SLUB_TINY, which also ends up disabling a lot of other code,
both in tests and in slub itself. And so anybody doing full build tests
didn't actually see this failre.
So let's disable SLUB_TINY for build-only tests, since it clearly ends
up limiting build coverage. Also turn the missing module descriptions
error back into a warning, but let's keep it around for non-'W=1'
builds.
Len Brown [Sun, 6 Apr 2025 15:18:39 +0000 (11:18 -0400)]
tools/power turbostat: report CoreThr per measurement interval
The CoreThr column displays total thermal throttling events
since boot time.
Change it to report events during the measurement interval.
This is more useful for showing a user the current conditions.
Total events since boot time are still available to the user via
/sys/devices/system/cpu/cpu*/thermal_throttle/*
Document CoreThr on turbostat.8
Fixes: eae97e053fe30 ("turbostat: Support thermal throttle count print") Reported-by: Arjan van de Ven <arjan@linux.intel.com> Signed-off-by: Len Brown <len.brown@intel.com> Cc: Chen Yu <yu.c.chen@intel.com>
Justin Ernst [Wed, 19 Mar 2025 20:27:31 +0000 (15:27 -0500)]
tools/power turbostat: Increase CPU_SUBSET_MAXCPUS to 8192
On systems with >= 1024 cpus (in my case 1152), turbostat fails with the error output:
"turbostat: /sys/fs/cgroup/cpuset.cpus.effective: cpu str malformat 0-1151"
A similar error appears with the use of turbostat --cpu when the inputted cpu
range contains a cpu number >= 1024:
# turbostat -c 1100-1151
"--cpu 1100-1151" malformed
...
Both errors are caused by parse_cpu_str() reaching its limit of CPU_SUBSET_MAXCPUS.
It's a good idea to limit the maximum cpu number being parsed, but 1024 is too low.
For a small increase in compute and allocated memory, increasing CPU_SUBSET_MAXCPUS
brings support for parsing cpu numbers >= 1024.
Increase CPU_SUBSET_MAXCPUS to 8192, a common setting for CONFIG_NR_CPUS on x86_64.
Signed-off-by: Justin Ernst <justin.ernst@hpe.com> Signed-off-by: Len Brown <len.brown@intel.com>
Merge tag 'timers-cleanups-2025-04-06' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull timer cleanups from Thomas Gleixner:
"A set of final cleanups for the timer subsystem:
- Convert all del_timer[_sync]() instances over to the new
timer_delete[_sync]() API and remove the legacy wrappers.
Conversion was done with coccinelle plus some manual fixups as
coccinelle chokes on scoped_guard().
- The final cleanup of the hrtimer_init() to hrtimer_setup()
conversion.
This has been delayed to the end of the merge window, so that all
patches which have been merged through other trees are in mainline
and all new users are catched.
Doing this right before rc1 ensures that new code which is merged post
rc1 is not introducing new instances of the original functionality"
* tag 'timers-cleanups-2025-04-06' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
tracing/timers: Rename the hrtimer_init event to hrtimer_setup
hrtimers: Rename debug_init_on_stack() to debug_setup_on_stack()
hrtimers: Rename debug_init() to debug_setup()
hrtimers: Rename __hrtimer_init_sleeper() to __hrtimer_setup_sleeper()
hrtimers: Remove unnecessary NULL check in hrtimer_start_range_ns()
hrtimers: Make callback function pointer private
hrtimers: Merge __hrtimer_init() into __hrtimer_setup()
hrtimers: Switch to use __htimer_setup()
hrtimers: Delete hrtimer_init()
treewide: Convert new and leftover hrtimer_init() users
treewide: Switch/rename to timer_delete[_sync]()