Commit Graph
5770 Commits
Author SHA1 Message Date
Dave Airlie a5f207e272 Merge tag 'drm-misc-fixes-2026-01-07' of https://gitlab.freedesktop.org/drm/misc/kernel into drm-fixes
drm-misc-fixes for v6.19-rc5:

pl111:
- Fix error handling in probe

mediatek/atomic/tidss:
- Fix tidss in another way and revert reordering of pre-enable and post-disable operations,
  as it breaks other bridge drivers.

nouveau:
- Fix regression from fwsec s/r fix.

pci/vga:
- Fix multiple gpu's being reported a 'boot_display'

fb-helper:
- Fix vblank timeout during suspend/reset

Signed-off-by: Dave Airlie <[email protected]>

From: Maarten Lankhorst <[email protected]>
Link: https://patch.msgid.link/[email protected]
2026-01-08 07:41:00 +10:00
Linus Walleij d1c7dc57ff drm/atomic-helper: Export and namespace some functions
Export and namespace those not prefixed with drm_* so
it becomes possible to write custom commit tail functions
in individual drivers using the helper infrastructure.

Tested-by: Marek Vasut <[email protected]>
Reviewed-by: Maxime Ripard <[email protected]>
Signed-off-by: Tomi Valkeinen <[email protected]>
Cc: [email protected] # v6.17+
Fixes: c9b1150a68 ("drm/atomic-helper: Re-order bridge chain pre-enable and post-disable")
Reviewed-by: Aradhya Bhatia <[email protected]>
Reviewed-by: Linus Walleij <[email protected]>
Tested-by: Linus Walleij <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
Link: https://patch.msgid.link/[email protected]
2026-01-03 20:08:17 +01:00
Tomi Valkeinen c1ef9a6cab Revert "drm/atomic-helper: Re-order bridge chain pre-enable and post-disable"
This reverts commit c9b1150a68.

Changing the enable/disable sequence has caused regressions on multiple
platforms: R-Car, MCDE, Rockchip. A series (see link below)  was sent to
fix these, but it was decided that it's better to revert the original
patch and change the enable/disable sequence only in the tidss driver.

Reverting this commit breaks tidss's DSI and OLDI outputs, which will be
fixed in the following commits.

Signed-off-by: Tomi Valkeinen <[email protected]>
Link: https://lore.kernel.org/all/20251202-mcde-drm-regression-thirdfix-v6-0-f1bffd4ec0fa%40kernel.org/
Fixes: c9b1150a68 ("drm/atomic-helper: Re-order bridge chain pre-enable and post-disable")
Cc: [email protected] # v6.17+
Reviewed-by: Aradhya Bhatia <[email protected]>
Reviewed-by: Maxime Ripard <[email protected]>
Reviewed-by: Linus Walleij <[email protected]>
Tested-by: Linus Walleij <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
Link: https://patch.msgid.link/[email protected]
2026-01-03 20:06:54 +01:00
Thomas Hellström 754c232384 drm/pagemap, drm/xe: Ensure that the devmem allocation is idle before use
In situations where no system memory is migrated to devmem, and in
upcoming patches where another GPU is performing the migration to
the newly allocated devmem buffer, there is nothing to ensure any
ongoing clear to the devmem allocation or async eviction from the
devmem allocation is complete.

Address that by passing a struct dma_fence down to the copy
functions, and ensure it is waited for before migration is marked
complete.

v3:
- New patch.
v4:
- Update the logic used for determining when to wait for the
  pre_migrate_fence.
- Update the logic used for determining when to warn for the
  pre_migrate_fence since the scheduler fences apparently
  can signal out-of-order.
v5:
- Fix a UAF (CI)
- Remove references to source P2P migration (Himal)
- Put the pre_migrate_fence after migration.
v6:
- Pipeline the pre_migrate_fence dependency (Matt Brost)

Fixes: c5b3eb5a90 ("drm/xe: Add GPUSVM device memory copy vfunc functions")
Cc: Matthew Brost <[email protected]>
Cc: <[email protected]> # v6.15+
Signed-off-by: Thomas Hellström <[email protected]>
Reviewed-by: Matthew Brost <[email protected]>
Acked-by: Maarten Lankhorst <[email protected]> # For merging through drm-xe.
Link: https://patch.msgid.link/[email protected]
(cherry picked from commit 16b5ad3195)
Signed-off-by: Thomas Hellström <[email protected]>
2025-12-23 10:11:59 +01:00
Dave Airlie 55a271a0f7 Merge tag 'topic/xe-vfio-2025-12-01' of https://gitlab.freedesktop.org/drm/xe/kernel into drm-next
Cross-subsystem Changes:
- Add device specific vfio_pci driver variant for intel graphics (Michal Winiarski)

Driver Changes:
- Add scope-based cleanup helper for runtime PM (Matt Roper)
- Additional xe driver prerequisites and exports (Michal Winiarski)

Signed-off-by: Dave Airlie <[email protected]>

From: Thomas Hellstrom <[email protected]>
Link: https://patch.msgid.link/aS1bNpqeem6PIHrA@fedora
2025-12-05 10:16:25 +10:00
Dave Airlie b3239df349 Merge tag 'drm-misc-next-2025-12-01-1' of https://gitlab.freedesktop.org/drm/misc/kernel into drm-next
Extra drm-misc-next for v6.19-rc1:

UAPI Changes:
- Add support for drm colorop pipeline.
- Add COLOR PIPELINE plane property.
- Add DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE.

Cross-subsystem Changes:
- Attempt to use higher order mappings in system heap allocator.
- Always taint kernel with sw-sync.

Core Changes:
- Small fixes to drm/gem.
- Support emergency restore to drm-client.
- Allocate and release fb_info in single place.
- Rework ttm pipelined eviction fence handling.

Driver Changes:
- Support the drm color pipeline in vkms, amdgfx.
- Add NVJPG driver for tegra.
- Assorted small fixes and updates to rockchip, bridge/dw-hdmi-qp,
  panthor.
- Add ASL CS5263 DP-to-HDMI simple bridge.
- Add and improve support for G LD070WX3-SL01 MIPI DSI, Samsung LTL106AL0,
  Samsung LTL106AL01, Raystar RFF500F-AWH-DNN, Winstar WF70A8SYJHLNGA,
  Wanchanglong w552946aaa, Samsung SOFEF00, Lenovo X13s panel.
- Add support for it66122 to it66121.
- Support mali-G1 gpu in panthor.

Signed-off-by: Dave Airlie <[email protected]>

From: Maarten Lankhorst <[email protected]>
Link: https://patch.msgid.link/[email protected]
2025-12-02 18:09:08 +10:00
Michał Winiarski bd45d46ffc drm/xe/pf: Export helpers for VFIO
Device specific VFIO driver variant for Xe will implement VF migration.
Export everything that's needed for migration ops.

Reviewed-by: Michal Wajdeczko <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Michał Winiarski <[email protected]>
(cherry picked from commit 17f22465c5)
Signed-off-by: Thomas Hellström <[email protected]>
2025-12-01 09:42:37 +01:00
Alex Hung 8e304a4511 drm/colorop: Add DRM_COLOROP_1D_CURVE_GAMMA22 to 1D Curve
Add "DRM_COLOROP_1D_CURVE_GAMMA22" and DRM_COLOROP_1D_CURVE_GAMMA22_INV
subtypes to drm_colorop of DRM_COLOROP_1D_CURVE.

Reviewed-by: Harry Wentland <[email protected]>
Signed-off-by: Alex Hung <[email protected]>
Signed-off-by: Simon Ser <[email protected]>
Link: https://patch.msgid.link/[email protected]
2025-11-26 23:09:44 +01:00
Alex Hung db971856bb drm/colorop: Add 3D LUT support to color pipeline
It is to be used to enable HDR by allowing userpace to create and pass
3D LUTs to kernel and hardware.

new drm_colorop_type: DRM_COLOROP_3D_LUT.

Reviewed-by: Simon Ser <[email protected]>
Signed-off-by: Alex Hung <[email protected]>
Reviewed-by: Daniel Stone <[email protected]>
Reviewed-by: Melissa Wen <[email protected]>
Reviewed-by: Sebastian Wick <[email protected]>
Signed-off-by: Simon Ser <[email protected]>
Link: https://patch.msgid.link/[email protected]
2025-11-26 23:09:42 +01:00
Harry Wentland 2468963482 drm/colorop: allow non-bypass colorops
Not all HW will be able to do bypass on all color
operations. Introduce an 32 bits 'flags' for all colorop
init functions and DRM_COLOROP_FLAG_ALLOW_BYPASS for creating
the BYPASS property when it's true.

Signed-off-by: Alex Hung <[email protected]>
Signed-off-by: Harry Wentland <[email protected]>
Reviewed-by: Daniel Stone <[email protected]>
Reviewed-by: Simon Ser <[email protected]>
Reviewed-by: Melissa Wen <[email protected]>
Reviewed-by: Sebastian Wick <[email protected]>
Signed-off-by: Simon Ser <[email protected]>
Link: https://patch.msgid.link/[email protected]
2025-11-26 23:09:17 +01:00
Harry Wentland 7fa3ee8c0a drm/colorop: Define LUT_1D interpolation
We want to make sure userspace is aware of the 1D LUT
interpolation. While linear interpolation is common it
might not be supported on all HW. Give driver implementers
a way to specify their interpolation.

Reviewed-by: Simon Ser <[email protected]>
Signed-off-by: Alex Hung <[email protected]>
Signed-off-by: Harry Wentland <[email protected]>
Reviewed-by: Daniel Stone <[email protected]>
Reviewed-by: Melissa Wen <[email protected]>
Reviewed-by: Sebastian Wick <[email protected]>
Signed-off-by: Simon Ser <[email protected]>
Link: https://patch.msgid.link/[email protected]
2025-11-26 23:09:14 +01:00
Alex Hung 3410108037 drm/colorop: Add multiplier type
This introduces a new drm_colorop_type: DRM_COLOROP_MULTIPLIER.

It's a simple multiplier to all pixel values. The value is
specified via a S31.32 fixed point provided via the
"MULTIPLIER" property.

Reviewed-by: Simon Ser <[email protected]>
Signed-off-by: Alex Hung <[email protected]>
Reviewed-by: Daniel Stone <[email protected]>
Reviewed-by: Melissa Wen <[email protected]>
Reviewed-by: Sebastian Wick <[email protected]>
Signed-off-by: Simon Ser <[email protected]>
Link: https://patch.msgid.link/[email protected]
2025-11-26 23:03:35 +01:00
Alex Hung 99a4e4f08a drm/colorop: Add 1D Curve Custom LUT type
We've previously introduced DRM_COLOROP_1D_CURVE for
pre-defined 1D curves. But we also have HW that supports
custom curves and userspace needs the ability to pass
custom curves, aka LUTs.

This patch introduces a new colorop type, called
DRM_COLOROP_1D_LUT that provides a SIZE property which
is used by a driver to advertise the supported SIZE
of the LUT, as well as a DATA property which userspace
uses to set the LUT.

DATA and size function in the same way as current drm_crtc
GAMMA and DEGAMMA LUTs.

Reviewed-by: Simon Ser <[email protected]>
Signed-off-by: Alex Hung <[email protected]>
Co-developed-by: Harry Wentland <[email protected]>
Signed-off-by: Harry Wentland <[email protected]>
Reviewed-by: Daniel Stone <[email protected]>
Signed-off-by: Simon Ser <[email protected]>
Link: https://patch.msgid.link/[email protected]
2025-11-26 23:03:35 +01:00
Chaitanya Kumar Borah 9452977513 drm: Add helper to extract lut from struct drm_color_lut32
Add helper to extract lut values in 32-bit precision needed by
hardware.

Signed-off-by: Alex Hung <[email protected]>
Signed-off-by: Uma Shankar <[email protected]>
Signed-off-by: Chaitanya Kumar Borah <[email protected]>
Reviewed-by: Sebastian Wick <[email protected]>
Signed-off-by: Simon Ser <[email protected]>
Link: https://patch.msgid.link/[email protected]
2025-11-26 23:03:35 +01:00
Uma Shankar 621c45ca12 drm: Add Enhanced LUT precision structure
Existing LUT precision structure drm_color_lut has only 16 bit
precision. This is not enough for upcoming enhanced hardwares
and advance usecases like HDR processing. Hence added a new
structure with 32 bit precision values.

Signed-off-by: Alex Hung <[email protected]>
Signed-off-by: Uma Shankar <[email protected]>
Signed-off-by: Chaitanya Kumar Borah <[email protected]>
Reviewed-by: Sebastian Wick <[email protected]>
Signed-off-by: Simon Ser <[email protected]>
Link: https://patch.msgid.link/[email protected]
2025-11-26 23:03:35 +01:00
Harry Wentland a355b3d6a4 drm/colorop: add BT2020/BT709 OETF and Inverse OETF
The BT.709 and BT.2020 OETFs are the same, the only difference
being that the BT.2020 variant is defined with more precision
for 10 and 12-bit per color encodings.

Both are used as encoding functions for video content, and are
therefore defined as OETF (opto-electronic transfer function)
instead of as EOTF (electro-optical transfer function).

Signed-off-by: Alex Hung <[email protected]>
Signed-off-by: Harry Wentland <[email protected]>
Reviewed-by: Daniel Stone <[email protected]>
Reviewed-by: Simon Ser <[email protected]>
Reviewed-by: Sebastian Wick <[email protected]>
Signed-off-by: Simon Ser <[email protected]>
Link: https://patch.msgid.link/[email protected]
2025-11-26 23:03:35 +01:00
Harry Wentland 1b75447412 drm/colorop: Add PQ 125 EOTF and its inverse
The PQ function defines a mapping of code values to nits (cd/m^2).
The max code value maps to 10,000 nits.

Windows DWM's canonical composition color space (CCCS)  defaults
to composing SDR contents to 80 nits and uses a float value of
1.0 to represent this. For this reason AMD HW hard-codes a PQ
function that is scaled by 125, yielding 80 nit PQ values for
1.0 and 10,000 nits at 125.0.

This patch introduces this scaled PQ EOTF and its inverse as
1D curve types.

Reviewed-by: Simon Ser <[email protected]>
Signed-off-by: Alex Hung <[email protected]>
Signed-off-by: Harry Wentland <[email protected]>
Reviewed-by: Daniel Stone <[email protected]>
Reviewed-by: Sebastian Wick <[email protected]>
Signed-off-by: Simon Ser <[email protected]>
Link: https://patch.msgid.link/[email protected]
2025-11-26 23:03:34 +01:00
Alex Hung e341cc6e85 drm/colorop: define a new macro for_each_new_colorop_in_state
Create a new macro for_each_new_colorop_in_state to access new
drm_colorop_state updated from uapi.

Reviewed-by: Simon Ser <[email protected]>
Signed-off-by: Alex Hung <[email protected]>
Reviewed-by: Daniel Stone <[email protected]>
Reviewed-by: Melissa Wen <[email protected]>
Reviewed-by: Sebastian Wick <[email protected]>
Signed-off-by: Simon Ser <[email protected]>
Link: https://patch.msgid.link/[email protected]
2025-11-26 23:03:34 +01:00
Harry Wentland dabeebae4a drm/colorop: pass plane_color_pipeline client cap to atomic check
Drivers will need to know whether an atomic check/commit
originated from a client with DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE
so they can ignore deprecated properties, like COLOR_ENCODING
and COLOR_RANGE.

Pass the plane_color_pipeline bit to drm_atomic_state.

Reviewed-by: Simon Ser <[email protected]>
Signed-off-by: Alex Hung <[email protected]>
Signed-off-by: Harry Wentland <[email protected]>
Reviewed-by: Daniel Stone <[email protected]>
Reviewed-by: Melissa Wen <[email protected]>
Reviewed-by: Sebastian Wick <[email protected]>
Signed-off-by: Simon Ser <[email protected]>
Link: https://patch.msgid.link/[email protected]
2025-11-26 23:03:33 +01:00
Harry Wentland e5719e7f19 drm/colorop: Add 3x4 CTM type
This type is used to support a 3x4 matrix in colorops. A 3x4
matrix uses the last column as a "bias" column. Some HW exposes
support for 3x4. The calculation looks like:

 out   matrix    in
 |R|   |0  1  2  3 |   | R |
 |G| = |4  5  6  7 | x | G |
 |B|   |8  9  10 11|   | B |
                       |1.0|

This is also the first colorop where we need a blob property to
program the property. For that we'll introduce a new DATA
property that can be used by all colorop TYPEs requiring a
blob. The way a DATA blob is read depends on the TYPE of
the colorop.

We only create the DATA property for property types that
need it.

Reviewed-by: Simon Ser <[email protected]>
Reviewed-by: Louis Chauvet <[email protected]>
Signed-off-by: Alex Hung <[email protected]>
Signed-off-by: Harry Wentland <[email protected]>
Reviewed-by: Daniel Stone <[email protected]>
Reviewed-by: Melissa Wen <[email protected]>
Reviewed-by: Sebastian Wick <[email protected]>
Signed-off-by: Simon Ser <[email protected]>
Link: https://patch.msgid.link/[email protected]
2025-11-26 23:03:33 +01:00
Alex Hung 9cf87f864d drm/colorop: Add destroy functions for color pipeline
The functions are to clean up color pipeline when a device driver
fails to create its color pipeline.

Signed-off-by: Alex Hung <[email protected]>
Reviewed-by: Daniel Stone <[email protected]>
Reviewed-by: Simon Ser <[email protected]>
Reviewed-by: Melissa Wen <[email protected]>
Reviewed-by: Sebastian Wick <[email protected]>
Signed-off-by: Simon Ser <[email protected]>
Link: https://patch.msgid.link/[email protected]
2025-11-26 23:03:32 +01:00
Harry Wentland 179ab8e7d7 drm/colorop: Introduce DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE
With the introduction of the pre-blending color pipeline we
can no longer have color operations that don't have a clear
position in the color pipeline. We deprecate all existing
plane properties. For upstream drivers those are:
 - COLOR_ENCODING
 - COLOR_RANGE

Drivers are expected to ignore these properties when
programming the HW. DRM clients that register with
DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE will not be allowed to
set the COLOR_ENCODING and COLOR_RANGE properties.

Setting of the COLOR_PIPELINE plane property or drm_colorop
properties is only allowed for userspace that sets this
client cap.

Reviewed-by: Simon Ser <[email protected]>
Signed-off-by: Alex Hung <[email protected]>
Signed-off-by: Harry Wentland <[email protected]>
Reviewed-by: Daniel Stone <[email protected]>
Reviewed-by: Melissa Wen <[email protected]>
Reviewed-by: Sebastian Wick <[email protected]>
Signed-off-by: Simon Ser <[email protected]>
Link: https://patch.msgid.link/[email protected]
2025-11-26 23:03:32 +01:00
Harry Wentland 2afc3184f3 drm/plane: Add COLOR PIPELINE property
We're adding a new enum COLOR PIPELINE property. This
property will have entries for each COLOR PIPELINE by
referencing the DRM object ID of the first drm_colorop
of the pipeline. 0 disables the entire COLOR PIPELINE.

Userspace can use this to discover the available color
pipelines, as well as set the desired one. The color
pipelines are programmed via properties on the actual
drm_colorop objects.

Reviewed-by: Simon Ser <[email protected]>
Signed-off-by: Alex Hung <[email protected]>
Signed-off-by: Harry Wentland <[email protected]>
Reviewed-by: Daniel Stone <[email protected]>
Reviewed-by: Melissa Wen <[email protected]>
Reviewed-by: Sebastian Wick <[email protected]>
Signed-off-by: Simon Ser <[email protected]>
Link: https://patch.msgid.link/[email protected]
2025-11-26 23:03:32 +01:00
Harry Wentland 78a5add824 drm/colorop: Add NEXT property
We'll construct color pipelines out of drm_colorop by
chaining them via the NEXT pointer. NEXT will point to
the next drm_colorop in the pipeline, or by 0 if we're
at the end of the pipeline.

Reviewed-by: Simon Ser <[email protected]>
Signed-off-by: Alex Hung <[email protected]>
Signed-off-by: Harry Wentland <[email protected]>
Reviewed-by: Daniel Stone <[email protected]>
Reviewed-by: Melissa Wen <[email protected]>
Reviewed-by: Sebastian Wick <[email protected]>
Signed-off-by: Simon Ser <[email protected]>
Link: https://patch.msgid.link/[email protected]
2025-11-26 23:03:32 +01:00
Harry Wentland 8c5ea1745f drm/colorop: Add BYPASS property
We want to be able to bypass each colorop at all times.
Introduce a new BYPASS boolean property for this.

Reviewed-by: Simon Ser <[email protected]>
Reviewed-by: Louis Chauvet <[email protected]>
Signed-off-by: Alex Hung <[email protected]>
Signed-off-by: Harry Wentland <[email protected]>
Reviewed-by: Daniel Stone <[email protected]>
Reviewed-by: Melissa Wen <[email protected]>
Reviewed-by: Sebastian Wick <[email protected]>
Signed-off-by: Simon Ser <[email protected]>
Link: https://patch.msgid.link/[email protected]
2025-11-26 23:03:32 +01:00
Harry Wentland 41651f9d42 drm/colorop: Add 1D Curve subtype
Add a new drm_colorop with DRM_COLOROP_1D_CURVE with two subtypes:
DRM_COLOROP_1D_CURVE_SRGB_EOTF and DRM_COLOROP_1D_CURVE_SRGB_INV_EOTF.

Reviewed-by: Simon Ser <[email protected]>
Reviewed-by: Louis Chauvet <[email protected]>
Signed-off-by: Harry Wentland <[email protected]>
Co-developed-by: Alex Hung <[email protected]>
Signed-off-by: Alex Hung <[email protected]>
Reviewed-by: Daniel Stone <[email protected]>
Reviewed-by: Melissa Wen <[email protected]>
Reviewed-by: Sebastian Wick <[email protected]>
Signed-off-by: Simon Ser <[email protected]>
Link: https://patch.msgid.link/[email protected]
2025-11-26 23:03:32 +01:00
Harry Wentland 84423e5612 drm/colorop: Add TYPE property
Add a read-only TYPE property. The TYPE specifies the colorop
type, such as enumerated curve, 1D LUT, CTM, 3D LUT, PWL LUT,
etc.

For now we're only introducing an enumerated 1D LUT type to
illustrate the concept.

Reviewed-by: Simon Ser <[email protected]>
Reviewed-by: Louis Chauvet <[email protected]>
Signed-off-by: Alex Hung <[email protected]>
Signed-off-by: Harry Wentland <[email protected]>
Reviewed-by: Daniel Stone <[email protected]>
Reviewed-by: Melissa Wen <[email protected]>
Reviewed-by: Sebastian Wick <[email protected]>
Signed-off-by: Simon Ser <[email protected]>
Link: https://patch.msgid.link/[email protected]
2025-11-26 23:03:31 +01:00
Harry Wentland cfc27680ee drm/colorop: Introduce new drm_colorop mode object
This patches introduces a new drm_colorop mode object. This
object represents color transformations and can be used to
define color pipelines.

We also introduce the drm_colorop_state here, as well as
various helpers and state tracking bits.

Reviewed-by: Simon Ser <[email protected]>
Signed-off-by: Alex Hung <[email protected]>
Signed-off-by: Harry Wentland <[email protected]>
Reviewed-by: Daniel Stone <[email protected]>
Reviewed-by: Melissa Wen <[email protected]>
Reviewed-by: Sebastian Wick <[email protected]>
Signed-off-by: Simon Ser <[email protected]>
Link: https://patch.msgid.link/[email protected]
2025-11-26 23:03:30 +01:00
Harry Wentland 4fc183828b drm: Add helper for conversion from signed-magnitude
CTM values are defined as signed-magnitude values. Add
a helper that converts from CTM signed-magnitude fixed
point value to the twos-complement value used by
drm_fixed.

Reviewed-by: Sebastian Wick <[email protected]>
Reviewed-by: Louis Chauvet <[email protected]>
Signed-off-by: Harry Wentland <[email protected]>
Reviewed-by: Daniel Stone <[email protected]>
Reviewed-by: Melissa Wen <[email protected]>
Signed-off-by: Simon Ser <[email protected]>
Link: https://patch.msgid.link/[email protected]
2025-11-26 22:16:13 +01:00
Pierre-Eric Pelloux-Prayer ddf055b80a drm/ttm: rework pipelined eviction fence handling
Until now ttm stored a single pipelined eviction fence which means
drivers had to use a single entity for these evictions.

To lift this requirement, this commit allows up to 8 entities to
be used.

Ideally a dma_resv object would have been used as a container of
the eviction fences, but the locking rules makes it complex.
dma_resv all have the same ww_class, which means "Attempting to
lock more mutexes after ww_acquire_done." is an error.

One alternative considered was to introduced a 2nd ww_class for
specific resv to hold a single "transient" lock (= the resv lock
would only be held for a short period, without taking any other
locks).

The other option, is to statically reserve a fence array, and
extend the existing code to deal with N fences, instead of 1.

The driver is still responsible to reserve the correct number
of fence slots.

Signed-off-by: Pierre-Eric Pelloux-Prayer <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Christian König <[email protected]>
Signed-off-by: Christian König <[email protected]>
2025-11-26 13:12:23 +01:00
Thomas Zimmermann 63c971af40 drm/fb-helper: Allocate and release fb_info in single place
Move the calls to drm_fb_helper_alloc_info() from drivers into a
single place in fbdev helpers. Allocates struct fb_info for a new
framebuffer device. Then call drm_fb_helper_single_fb_probe() to
create an fbdev screen buffer. Also release the instance on errors
by calling drm_fb_helper_release_info().

Simplifies the code and fixes the error cleanup for some of the
drivers.

Regular release of the struct fb_info instance still happens in
drm_fb_helper_fini() as before.

v2:
- remove error rollback in driver implementations (kernel test robot)
- initialize info in TTM implementation (kernel test robot)

Signed-off-by: Thomas Zimmermann <[email protected]>
Acked-by: Christian König <[email protected]> # radeon
Acked-by: Dmitry Baryshkov <[email protected]> # msm
Acked-by: Javier Martinez Canillas <[email protected]>
Link: https://patch.msgid.link/[email protected]
2025-11-25 11:02:43 +01:00
Thomas Zimmermann 6915190a50 drm/client: Support emergency restore via sysrq for all clients
Move the sysrq functionality from DRM fbdev helpers to the DRM device
and in-kernel clients, so that it becomes available on all clients.

DRM fbdev helpers support emergency restoration of the console output
via a special key combination. Press SysRq+v to replace the current
compositor with the kernel's output on the framebuffer console. This
allows users to see the log messages during system emergencies.

By moving the functionality from fbdev helpers to the DRM device, any
in-kernel client can serve as emergency output. This can be used to
bring up drm_log, for example.

Each DRM device registers itself to the list of possible sysrq handlers.
On receiving SysRq+v, the DRM core goes over all registered devices and
restores an in-kernel DRM client for each of them.

See Documentation/admin-guide/sysrq.rst on how to invoke SysRq. Switch
VTs to bring back the user-space compositor.

v2:
- declare placeholders as 'static inline' (kernel test robot)
- fix grammar in commit description

Signed-off-by: Thomas Zimmermann <[email protected]>
Reviewed-by: Jocelyn Falempe <[email protected]>
Link: https://patch.msgid.link/[email protected]
2025-11-25 08:43:47 +01:00
Thomas Zimmermann 943240d342 drm/client: Pass force parameter to client restore
Add force parameter to client restore and pass value through the
layers. The only currently used value is false.

If force is true, the client should restore its display even if it
does not hold the DRM master lock. This is be required for emergency
output, such as sysrq.

While at it, inline drm_fb_helper_lastclose(), which is a trivial
wrapper around drm_fb_helper_restore_fbdev_mode_unlocked().

Signed-off-by: Thomas Zimmermann <[email protected]>
Reviewed-by: Jocelyn Falempe <[email protected]>
Link: https://patch.msgid.link/[email protected]
2025-11-25 08:43:46 +01:00
Dave Airlie ce0478b02e Merge tag 'v6.18-rc6' into drm-next
Linux 6.18-rc6

Backmerge in order to merge msm next

Signed-off-by: Dave Airlie <[email protected]>
2025-11-21 08:55:08 +10:00
Dave Airlie f0ded972d3 Merge tag 'drm-rust-next-2025-11-18' of https://gitlab.freedesktop.org/drm/rust/kernel into drm-next
Cross-subsystem Changes:

Rust
  - Make slice::as_flattened usable on all supported versions of rustc.
  - Add FromBytes::from_bytes_prefix() method.

Core Changes:

  - Update Tyr in MAINTAINERS file.
  - Remove redundant device ptr from Rust GEM object.
  - Change how AlwaysRefCounted is implemented for GEM objects.
  - Add deferred vm_bo cleanup to GPUVM and use it in Panthor.

Driver Changes:

Nova Core
  - Introduction of bitfield! macro, with support for different storage sizes
    and custom visibility.
  - Introduction of safe converters between integer types for which the
    conversion is lossless.
  - GSP initialized up to fully booted state on Ampere.
  - Use more future-proof register for GPU identification.
  - Various simplifications and optimizations.

Nova
  - Select NOVA_CORE.
  - Depend on CONFIG_64BIT.

Signed-off-by: Dave Airlie <[email protected]>

From: Alice Ryhl <[email protected]>
Link: https://patch.msgid.link/[email protected]
2025-11-20 10:44:50 +10:00
Dave Airlie 490fd93366 Merge tag 'drm-misc-next-2025-11-14-1' of https://gitlab.freedesktop.org/drm/misc/kernel into drm-next
drm-misc-next for v6.19:

UAPI Changes:
- Add sysfs entries, coredump support and uevents to QAIC.
- Add fdinfo memory statistics to ivpu.

Cross-subsystem Changes:
- Handle stub fence initialization during module init.
- Stop using system_wq in scheduler and drivers.

Core Changes:
- Documentation updates to ttm, vblank.
- Add EDID quirk for sharp panel.
- Use drm_crtc_vblank_(crtc,waitqueue) more in core and drivers.

Driver Changes:
- Small updates and fixes to panfrost, amdxdna, vmwgfx, ast, ivpu.
- Handle preemption in amdxdna.
- Add PM support to qaic.
- Huge refactor of sun4i's layer code to decouple plane code from output
  and improve support for DE33.
- Add larger page and compression support to nouveau.

Signed-off-by: Dave Airlie <[email protected]>
From: Maarten Lankhorst <[email protected]>
Link: https://patch.msgid.link/[email protected]
2025-11-17 14:21:49 +10:00
Dave Airlie 727bf2dc96 Merge tag 'drm-xe-next-2025-11-14' of https://gitlab.freedesktop.org/drm/xe/kernel into drm-next
Driver Changes:

Avoid TOCTOU when montoring throttle reasons (Lucas)
Add/extend workaround (Nitin)
SRIOV migration work / plumbing (Michal Wajdeczko, Michal Winiarski, Lukasz)
Drop debug flag requirement for VF resource fixup
Fix MTL vm_max_level (Rodrigo)
Changes around TILE_ADDR_RANGE for platform compatibility
(Fei, Lucas)
Add runtime registers for GFX ver >= 35 (Piotr)
Kerneldoc fix (Kriish)
Rework pcode error mapping (Lucas)
Allow lockdown the PF (Michal)
Eliminate GUC code caching of some frequency values (Sk)
Improvements around forcewake referencing (Matt Roper)

Signed-off-by: Dave Airlie <[email protected]>

From: Thomas Hellstrom <[email protected]>
Link: https://patch.msgid.link/aRcJOrisG2qPbucE@fedora
2025-11-17 13:45:14 +10:00
Cristian Ciocaltea 1ff27c5929 drm/bridge: dw-hdmi-qp: Handle platform supported formats and color depth
Extend struct dw_hdmi_qp_plat_data to include the supported display
output formats and maximum bits per color channel.  When provided by the
platform driver, use them to setup the HDMI bridge accordingly.

Additionally, improve debug logging in dw_hdmi_qp_bridge_atomic_enable()
to also show the current HDMI output format and bpc.

Acked-by: Daniel Stone <[email protected]>
Signed-off-by: Cristian Ciocaltea <[email protected]>
Signed-off-by: Heiko Stuebner <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
2025-11-14 23:10:34 +01:00
Michał Winiarski aaecfadc22 drm/intel/bmg: Allow device ID usage with single-argument macros
When INTEL_BMG_G21_IDS were added as a subplatform, token concatenation
operator usage was omitted, making INTEL_BMG_IDS not usable with
single-argument macros.
Fix that by adding the missing operator.

Fixes: 78de8f8766 ("drm/xe: Handle Wa_22010954014 and Wa_14022085890 as device workarounds")
Reviewed-by: Lucas De Marchi <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Michał Winiarski <[email protected]>
2025-11-13 11:48:20 +01:00
Maarten Lankhorst 410d88782a Merge remote-tracking branch 'drm/drm-next' into drm-misc-next
Backmerge to prevent getting out of sync with drm-next too much.

Signed-off-by: Maarten Lankhorst <[email protected]>
2025-11-10 14:42:54 +01:00
Jean Delvare 002621a4df kbuild: Let kernel-doc.py use PYTHON3 override
It is possible to force a specific version of python to be used when
building the kernel by passing PYTHON3= on the make command line.
However kernel-doc.py is currently called with python3 hard-coded and
thus ignores this setting.

Use $(PYTHON3) to run $(KERNELDOC) so that the desired version of
python is used.

Signed-off-by: Jean Delvare <[email protected]>
Reviewed-by: Nicolas Schier <[email protected]>
Reviewed-by: Mauro Carvalho Chehab <[email protected]>
Link: https://patch.msgid.link/20251107192933.2bfe9e57@endymion
Signed-off-by: Nathan Chancellor <[email protected]>
2025-11-08 19:42:22 -07:00
Dave Airlie e237dfe708 Merge tag 'drm-misc-next-2025-11-05-1' of https://gitlab.freedesktop.org/drm/misc/kernel into drm-next
drm-misc-next for v6.19-rc1:

UAPI Changes:
- Add userptr support to ivpu.
- Add IOCTL's for resource and telemetry data in amdxdna.

Core Changes:
- Improve some atomic state checking handling.
- drm/client updates.
- Use forward declarations instead of including drm_print.h
- RUse allocation flags in ttm_pool/device_init and allow specifying max
  useful pool size and propagate ENOSPC.
- Updates and fixes to scheduler and bridge code.
- Add support for quirking DisplayID checksum errors.

Driver Changes:
- Assorted cleanups and fixes in rcar-du, accel/ivpu, panel/nv3052cf,
  sti, imxm, accel/qaic, accel/amdxdna, imagination, tidss, sti,
  panthor, vkms.
- Add Samsung S6E3FC2X01 DDIC/AMS641RW, Synaptics TDDI series DSI,
  TL121BVMS07-00 (IL79900A) panels.
- Add mali MediaTek MT8196 SoC gpu support.
- Add etnaviv GC8000 Nano Ultra VIP r6205 support.
- Document powervr ge7800 support in the devicetree.

Signed-off-by: Dave Airlie <[email protected]>

From: Maarten Lankhorst <[email protected]>
Link: https://patch.msgid.link/[email protected]
2025-11-07 12:41:26 +10:00
Dave Airlie 8f037e11d0 Merge tag 'drm-intel-next-2025-11-04' of https://gitlab.freedesktop.org/drm/i915/kernel into drm-next
drm/i915 feature pull for v6.19:

Features and functionality:
- Enable LNL+ content adaptive sharpness filter (CASF) (Nemesa)
- Use optimized VRR guardband (Ankit, Ville)
- Enable Xe3p LT PHY (Suraj)
- Enable FBC support for Xe3p_LPD display (Sai Teja, Vinod)
- Specify DMC firmware for display version 30.02 (Dnyaneshwar)
- Report reason for disabling PSR to debugfs (Michał)
- Extend i915_display_info with Type-C port details (Khaled)
- Log DSI send packet sequence errors and contents

Refactoring and cleanups:
- Refactoring to prepare for VRR guardband optimization (Ankit)
- Abstract VRR live status wait (Ankit)
- Refactor VRR and DSB timing to handle Set Context Latency explicitly (Ankit)
- Helpers for prefill latency calculations (Ville)
- Refactor SKL+ watermark latency setup (Ville)
- VRR refactoring and cleanups (Ville)
- SKL+ universal plane cleanups (Ville)
- Decouple CDCLK from state->modeset refactor (Ville)
- Refactor VLV/CHV clock functions (Jani)
- Refactor fbdev handling (Jani)
- Call i915 and xe runtime PM from display via function pointers (Jouni)
- IRQ code refactoring  (Jani)
- Drop display dependency on i915 feature check macros (Jani)
- Refactor and unify i915 and xe stolen memory interfaces towards display (Jani)
- Switch to driver agnostic drm to display pointer chase (Jani)
- Use display version over graphics version in display code (Matt A)
- GVT cleanups (Jonathan, Andi)
- Rename a VLV clock function to unify (Michał)
- Explicitly sanitize DMC package header num entries (Luca)
- Remove redundant port clock check from ALPM (Jouni)
- Use sysfs_emit() instead of sprintf() in PMU sysfs (Madhur Kumar)
- Clean up C20 PHY PLL register macros (Imre, Mika))
- Abstract "address in MMIO table" helper for general use (Matt A)
- Improve VRR platform abstractions (Ville)
- Move towards more standard PCI PM code usage (Ville)
- Framebuffer refactoring (Ville)
- Drop display dependency on i915_utils.h (Jani)
- Include cleanups (Jani)

Fixes:
- Workaround docking station DSC issues with high pixel clock and bpp (Imre)
- Fix Panel Replay in DSC mode (Imre)
- Disable tracepoints for PREEMPT_RT as a workaround (Maarten)
- Fix intel_crtc_get_vblank_counter() on PREEMPT_RT (Maarten)
- Fix C10 PHY identification on PTL/WCL (Dnyaneshwar)
- Take AS SDP into account with optimized guardband (Jouni)
- Fix panic structure allocation memory leak (Jani)
- Adjust an FBC workaround platforms (Vinod)
- Add fallback for CDCLK selection (Naladala)
- Avoid using invalid transcoder in MST transport select (Suraj)
- Don't use cursor size reduction on display version 14+ (Nemesa)
- Fix C20 PHY PLL register programming (Imre, Mika)
- Fix PSR frontbuffer flush handling (Jouni)
- Store ALPM parameters in crtc state (Jouni)
- Defeature DRRS on LNL+ (Ville)
- Fix the scope of the large DRAM DIMM workaround (Ville)
- Fix PICA vs. AUX power ordering issue (Gustavo)
- Fix pixel rate for computing watermark line time (Ville)
- Fix framebuffer set_tiling vs. addfb race (Ville)
- DMC event handler fixes (Ville)

DRM Core:
- CRTC sharpness strength property (Nemesa)
- DPCD DSC quirk for Synaptics Panamera devices (Imre)
- Helpers to query the branch DSC max throughput/line-width (Imre)

Merges:
- Backmerge drm-next for v6.18-rc and to sync with drm-xe-next (Jani)

Signed-off-by: Dave Airlie <[email protected]>

From: Jani Nikula <[email protected]>
Link: https://patch.msgid.link/[email protected]
2025-11-07 09:47:56 +10:00
Bagas Sanjaya 3ca8b2668c drm/ttm: Fix @alloc_flags description
Stephen Rothwell reports htmldocs warnings when merging drm-misc tree:

Documentation/gpu/drm-mm:40: include/drm/ttm/ttm_device.h:225: ERROR: Unknown target name: "ttm_allocation". [docutils]
Documentation/gpu/drm-mm:43: drivers/gpu/drm/ttm/ttm_device.c:202: ERROR: Unknown target name: "ttm_allocation". [docutils]
Documentation/gpu/drm-mm:73: include/drm/ttm/ttm_pool.h:68: ERROR: Unknown target name: "ttm_allocation_pool". [docutils]
Documentation/gpu/drm-mm:76: drivers/gpu/drm/ttm/ttm_pool.c:1070: ERROR: Unknown target name: "ttm_allocation_pool". [docutils]

Fix these by adding missing wildcard on TTM_ALLOCATION_* and
TTM_ALLOCATION_POOL_* in @alloc_flags description.

Fixes: 0af5b6a8f8 ("drm/ttm: Replace multiple booleans with flags in pool init")
Fixes: 77e19f8d32 ("drm/ttm: Replace multiple booleans with flags in device init")
Fixes: 402b3a8650 ("drm/ttm: Add an allocation flag to propagate -ENOSPC on OOM")
Reported-by: Stephen Rothwell <[email protected]>
Closes: https://lore.kernel.org/linux-next/[email protected]/
Signed-off-by: Bagas Sanjaya <[email protected]>
Acked-by: Tvrtko Ursulin <[email protected]>
Reviewed-by: Christian König <[email protected]>
Signed-off-by: Tvrtko Ursulin <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
2025-11-06 10:35:47 +00:00
Jani Nikula 8b61583f99 drm/edid: add DRM_EDID_IDENT_INIT() to initialize struct drm_edid_ident
Add a convenience helper for initializing struct drm_edid_ident.

Cc: Tiago Martins Araújo <[email protected]>
Acked-by: Alex Deucher <[email protected]>
Tested-by: Tiago Martins Araújo <[email protected]>
Cc: [email protected]
Link: https://patch.msgid.link/710b2ac6a211606ec1f90afa57b79e8c7375a27e.1761681968.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <[email protected]>
2025-11-04 14:49:21 +02:00
Jouni Högander 1914d6861b drm/{i915, xe}/display: Add display runtime pm parent interface
We have differing implementations for display runtime pm in i915 and xe
drivers. Add struct of function pointers into display_parent_interface
which will contain used implementation of runtime pm.

v2:
  - add _interface suffix to rpm function pointer struct
  - add struct ref_tracker forward declaration
  - use kernel-doc comments

Reviewed-by: Jani Nikula <[email protected]>
Signed-off-by: Jouni Högander <[email protected]>
Link: https://patch.msgid.link/[email protected]
2025-11-03 11:55:20 +02:00
Jani Nikula b3c8fa0d9c drm/{i915, xe}/display: pass parent interface to display probe
Let's gradually start calling i915 and xe parent, or core, drivers from
display via function pointers passed at display probe.

Going forward, the struct intel_display_parent_interface is expected to
include const pointers to sub-structs by functionality, for example:

struct intel_display_rpm {
	struct ref_tracker *(*get)(struct drm_device *drm);
	/* ... */
};

struct intel_display_parent_interface {
	/* ... */
	const struct intel_display_rpm *rpm;
};

This is a baby step towards not building display as part of both i915
and xe drivers, but rather making it an independent driver interfacing
with the two.

v3: useless include additions dropped
v2: unrelated include removal dropped

Cc: Jouni Högander <[email protected]>
Cc: Lucas De Marchi <[email protected]>
Cc: Rodrigo Vivi <[email protected]>
Cc: Ville Syrjälä <[email protected]>
Signed-off-by: Jani Nikula <[email protected]>
Signed-off-by: Jouni Högander <[email protected]>
Link: https://patch.msgid.link/[email protected]
2025-11-03 11:55:19 +02:00
Simona Vetter 7446fbf002 Merge tag 'drm-misc-next-2025-10-28' of https://gitlab.freedesktop.org/drm/misc/kernel into drm-next
drm-misc-next for v6.19-rc1:

UAPI Changes:

Cross-subsystem Changes:
- Update DT bindings for renesas and powervr-rogue.
- Update MAINTAINERS email and add spsc_queue.

Core Changes:
- Allow ttm page protection flags on risc-v.
- Move freeing of drm client memory to driver.

Driver Changes:
- Assorted small fixes and updates to qaic, ivpu, st7571-i2c, gud,
  amdxdna.
- Allow configuration of vkms' display through configfs.
- Add Arm Ethos-U65/U85 accel driver.

Signed-off-by: Simona Vetter <[email protected]>
From: Maarten Lankhorst <[email protected]>
Link: https://patch.msgid.link/[email protected]
2025-10-31 18:47:17 +01:00
Simona Vetter f53128e376 Merge tag 'drm-xe-next-2025-10-28' of https://gitlab.freedesktop.org/drm/xe/kernel into drm-next
Driver Changes:
More xe3p support (Harish, Brian, Balasubramani, Matt Roper)
Make panic support work on VRAM for display (Maarten)
Fix stolen size check (Shuicheng)
xe_pci_test update (Gustavo)
VF migration updates (Tomasz)
A couple of fixes around allocation and PM references (Matt Brost)
Migration update for the MEM_COPY instruction (Matt Auld)
Initial CRI support (Balasubramani, Matt Roper)
Use SVM range helpers in PT layer (Matt Brost)
Drop MAX_GT_TYPE_CHARS constant (Matt Roper)
Fix spelling and typos (Sanjay)
Fix VF FLR synchronization between all GTs (Michal)
Add a Workaround (Nitin)
Access VF's register using dedicated MMIO view (Michal)

Signed-off-by: Simona Vetter <[email protected]>
From: Thomas Hellstrom <[email protected]>
Link: https://patch.msgid.link/aQCl9uJxN6CWJ8Vg@fedora
2025-10-31 18:40:54 +01:00
Tvrtko Ursulin 402b3a8650 drm/ttm: Add an allocation flag to propagate -ENOSPC on OOM
Some graphics APIs differentiate between out-of-graphics-memory and
out-of-host-memory (system memory). Add a device init flag to have -ENOSPC
propagated from the resource managers instead of being converted to
-ENOMEM, to aid driver stacks in determining what error code to return or
whether corrective action can be taken at the driver level.

Co-developed-by: Thomas Hellström <[email protected]>
Cc: Christian König <[email protected]>
Cc: Matthew Brost <[email protected]>
Signed-off-by: Tvrtko Ursulin <[email protected]>
Reviewed-by: Thomas Hellström <[email protected]>
Reviewed-by: Christian König <[email protected]>
Signed-off-by: Tvrtko Ursulin <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
2025-10-31 09:27:28 +00:00