Skip to content

Commit 098456f

Browse files
committed
Merge tag 'drm-misc-next-2025-10-21' of https://gitlab.freedesktop.org/drm/misc/kernel into drm-next
drm-misc-next for v6.19: UAPI Changes: amdxdna: - Support reading last hardware error Cross-subsystem Changes: dma-buf: - heaps: Create heap per CMA reserved location; Improve user-space documentation Core Changes: atomic: - Clean up and improve state-handling interfaces, update drivers bridge: - Improve ref counting buddy: - Optimize block management Driver Changes: amdxdna: - Fix runtime power management - Support firmware debug output ast: - Set quirks for each chip model atmel-hlcdc: - Set LCDC_ATTRE register in plane disable - Set correct values for plane scaler bochs: - Use vblank timer bridge: - synopsis: Support CEC; Init timer with correct frequency cirrus-qemu: - Use vblank timer imx: - Clean up ivu: - Update JSM API to 3.33.0 - Reset engine on more job errors - Return correct error codes for jobs komeda: - Use drm_ logging functions panel: - edp: Support AUO B116XAN02.0 panfrost: - Embed struct drm_driver in Panfrost device - Improve error handling - Clean up job handling panthor: - Support custom ASN_HASH for mt8196 renesas: - rz-du: Fix dependencies rockchip: - dsi: Add support for RK3368 - Fix LUT size for RK3386 sitronix: - Fix output position when clearing screens qaic: - Support dma-buf exports - Support new firmware's READ_DATA implementation - Replace kcalloc with memdup - Replace snprintf() with sysfs_emit() - Avoid overflows in arithmetics - Clean up - Fixes qxl: - Use vblank timer rockchip: - Clean up mode-setting code vgem: - Fix fence timer deadlock virtgpu: - Use vblank timer Signed-off-by: Simona Vetter <simona.vetter@ffwll.ch> From: Thomas Zimmermann <tzimmermann@suse.de> Link: https://lore.kernel.org/r/20251021111837.GA40643@linux.fritz.box
2 parents 6200442 + 7ea0468 commit 098456f

138 files changed

Lines changed: 2485 additions & 1105 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Documentation/devicetree/bindings/display/rockchip/rockchip,dw-mipi-dsi.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ properties:
1717
- rockchip,px30-mipi-dsi
1818
- rockchip,rk3128-mipi-dsi
1919
- rockchip,rk3288-mipi-dsi
20+
- rockchip,rk3368-mipi-dsi
2021
- rockchip,rk3399-mipi-dsi
2122
- rockchip,rk3568-mipi-dsi
2223
- rockchip,rv1126-mipi-dsi
@@ -73,6 +74,7 @@ allOf:
7374
enum:
7475
- rockchip,px30-mipi-dsi
7576
- rockchip,rk3128-mipi-dsi
77+
- rockchip,rk3368-mipi-dsi
7678
- rockchip,rk3568-mipi-dsi
7779
- rockchip,rv1126-mipi-dsi
7880

Documentation/devicetree/bindings/gpu/arm,mali-valhall-csf.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ properties:
1818
oneOf:
1919
- items:
2020
- enum:
21+
- mediatek,mt8196-mali
2122
- rockchip,rk3588-mali
2223
- const: arm,mali-valhall-csf # Mali Valhall GPU model/revision is fully discoverable
2324

@@ -91,7 +92,6 @@ required:
9192
- interrupts
9293
- interrupt-names
9394
- clocks
94-
- mali-supply
9595

9696
additionalProperties: false
9797

@@ -108,6 +108,8 @@ allOf:
108108
power-domains:
109109
maxItems: 1
110110
power-domain-names: false
111+
required:
112+
- mali-supply
111113

112114
examples:
113115
- |

Documentation/userspace-api/dma-buf-heaps.rst

Lines changed: 49 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,52 @@ following heaps:
1616

1717
- The ``system`` heap allocates virtually contiguous, cacheable, buffers.
1818

19-
- The ``cma`` heap allocates physically contiguous, cacheable,
20-
buffers. Only present if a CMA region is present. Such a region is
21-
usually created either through the kernel commandline through the
22-
``cma`` parameter, a memory region Device-Tree node with the
23-
``linux,cma-default`` property set, or through the ``CMA_SIZE_MBYTES`` or
24-
``CMA_SIZE_PERCENTAGE`` Kconfig options. The heap's name in devtmpfs is
25-
``default_cma_region``. For backwards compatibility, when the
26-
``DMABUF_HEAPS_CMA_LEGACY`` Kconfig option is set, a duplicate node is
27-
created following legacy naming conventions; the legacy name might be
28-
``reserved``, ``linux,cma``, or ``default-pool``.
19+
- The ``default_cma_region`` heap allocates physically contiguous,
20+
cacheable, buffers. Only present if a CMA region is present. Such a
21+
region is usually created either through the kernel commandline
22+
through the ``cma`` parameter, a memory region Device-Tree node with
23+
the ``linux,cma-default`` property set, or through the
24+
``CMA_SIZE_MBYTES`` or ``CMA_SIZE_PERCENTAGE`` Kconfig options. Prior
25+
to Linux 6.17, its name wasn't stable and could be called
26+
``reserved``, ``linux,cma``, or ``default-pool``, depending on the
27+
platform.
28+
29+
- A heap will be created for each reusable region in the device tree
30+
with the ``shared-dma-pool`` compatible, using the full device tree
31+
node name as its name. The buffer semantics are identical to
32+
``default-cma-region``.
33+
34+
Naming Convention
35+
=================
36+
37+
``dma-buf`` heaps name should meet a number of constraints:
38+
39+
- The name must be stable, and must not change from one version to the other.
40+
Userspace identifies heaps by their name, so if the names ever change, we
41+
would be likely to introduce regressions.
42+
43+
- The name must describe the memory region the heap will allocate from, and
44+
must uniquely identify it in a given platform. Since userspace applications
45+
use the heap name as the discriminant, it must be able to tell which heap it
46+
wants to use reliably if there's multiple heaps.
47+
48+
- The name must not mention implementation details, such as the allocator. The
49+
heap driver will change over time, and implementation details when it was
50+
introduced might not be relevant in the future.
51+
52+
- The name should describe properties of the buffers that would be allocated.
53+
Doing so will make heap identification easier for userspace. Such properties
54+
are:
55+
56+
- ``contiguous`` for physically contiguous buffers;
57+
58+
- ``protected`` for encrypted buffers not accessible the OS;
59+
60+
- The name may describe intended usage. Doing so will make heap identification
61+
easier for userspace applications and users.
62+
63+
For example, assuming a platform with a reserved memory region located
64+
at the RAM address 0x42000000, intended to allocate video framebuffers,
65+
physically contiguous, and backed by the CMA kernel allocator, good
66+
names would be ``memory@42000000-contiguous`` or ``video@42000000``, but
67+
``cma-video`` wouldn't.

MAINTAINERS

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2092,7 +2092,8 @@ F: drivers/gpu/drm/arm/display/komeda/
20922092
ARM MALI PANFROST DRM DRIVER
20932093
M: Boris Brezillon <boris.brezillon@collabora.com>
20942094
M: Rob Herring <robh@kernel.org>
2095-
R: Steven Price <steven.price@arm.com>
2095+
M: Steven Price <steven.price@arm.com>
2096+
M: Adrián Larumbe <adrian.larumbe@collabora.com>
20962097
L: dri-devel@lists.freedesktop.org
20972098
S: Supported
20982099
T: git https://gitlab.freedesktop.org/drm/misc/kernel.git
@@ -7309,6 +7310,7 @@ F: Documentation/userspace-api/dma-buf-alloc-exchange.rst
73097310
F: drivers/dma-buf/
73107311
F: include/linux/*fence.h
73117312
F: include/linux/dma-buf.h
7313+
F: include/linux/dma-buf/
73127314
F: include/linux/dma-resv.h
73137315
K: \bdma_(?:buf|fence|resv)\b
73147316

@@ -7637,7 +7639,6 @@ F: drivers/accel/
76377639
F: include/drm/drm_accel.h
76387640

76397641
DRM DRIVER FOR ALLWINNER DE2 AND DE3 ENGINE
7640-
M: Maxime Ripard <mripard@kernel.org>
76417642
M: Chen-Yu Tsai <wens@csie.org>
76427643
R: Jernej Skrabec <jernej.skrabec@gmail.com>
76437644
L: dri-devel@lists.freedesktop.org
@@ -7747,7 +7748,8 @@ F: Documentation/devicetree/bindings/display/panel/panel-edp.yaml
77477748
F: drivers/gpu/drm/panel/panel-edp.c
77487749

77497750
DRM DRIVER FOR GENERIC USB DISPLAY
7750-
S: Orphan
7751+
M: Ruben Wauters <rubenru09@aol.com>
7752+
S: Maintained
77517753
W: https://github.com/notro/gud/wiki
77527754
T: git https://gitlab.freedesktop.org/drm/misc/kernel.git
77537755
F: drivers/gpu/drm/gud/
@@ -7888,7 +7890,7 @@ DRM DRIVER for Qualcomm display hardware
78887890
M: Rob Clark <robin.clark@oss.qualcomm.com>
78897891
M: Dmitry Baryshkov <lumag@kernel.org>
78907892
R: Abhinav Kumar <abhinav.kumar@linux.dev>
7891-
R: Jessica Zhang <jessica.zhang@oss.qualcomm.com>
7893+
R: Jessica Zhang <jesszhan0024@gmail.com>
78927894
R: Sean Paul <sean@poorly.run>
78937895
R: Marijn Suijten <marijn.suijten@somainline.org>
78947896
L: linux-arm-msm@vger.kernel.org
@@ -8251,7 +8253,6 @@ F: drivers/gpu/nova-core/
82518253
F: rust/kernel/drm/
82528254

82538255
DRM DRIVERS FOR ALLWINNER A10
8254-
M: Maxime Ripard <mripard@kernel.org>
82558256
M: Chen-Yu Tsai <wens@csie.org>
82568257
L: dri-devel@lists.freedesktop.org
82578258
S: Supported
@@ -8601,7 +8602,7 @@ F: drivers/gpu/drm/clients/drm_log.c
86018602

86028603
DRM PANEL DRIVERS
86038604
M: Neil Armstrong <neil.armstrong@linaro.org>
8604-
R: Jessica Zhang <jessica.zhang@oss.qualcomm.com>
8605+
R: Jessica Zhang <jesszhan0024@gmail.com>
86058606
L: dri-devel@lists.freedesktop.org
86068607
S: Maintained
86078608
T: git https://gitlab.freedesktop.org/drm/misc/kernel.git

drivers/accel/amdxdna/TODO

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
- Add debugfs support
2-
- Add debug BO support

drivers/accel/amdxdna/aie2_ctx.c

Lines changed: 117 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -226,11 +226,10 @@ aie2_sched_resp_handler(void *handle, void __iomem *data, size_t size)
226226
}
227227

228228
static int
229-
aie2_sched_nocmd_resp_handler(void *handle, void __iomem *data, size_t size)
229+
aie2_sched_drvcmd_resp_handler(void *handle, void __iomem *data, size_t size)
230230
{
231231
struct amdxdna_sched_job *job = handle;
232232
int ret = 0;
233-
u32 status;
234233

235234
if (unlikely(!data))
236235
goto out;
@@ -240,8 +239,7 @@ aie2_sched_nocmd_resp_handler(void *handle, void __iomem *data, size_t size)
240239
goto out;
241240
}
242241

243-
status = readl(data);
244-
XDNA_DBG(job->hwctx->client->xdna, "Resp status 0x%x", status);
242+
job->drv_cmd->result = readl(data);
245243

246244
out:
247245
aie2_sched_notify(job);
@@ -314,8 +312,18 @@ aie2_sched_job_run(struct drm_sched_job *sched_job)
314312
kref_get(&job->refcnt);
315313
fence = dma_fence_get(job->fence);
316314

317-
if (unlikely(!cmd_abo)) {
318-
ret = aie2_sync_bo(hwctx, job, aie2_sched_nocmd_resp_handler);
315+
if (job->drv_cmd) {
316+
switch (job->drv_cmd->opcode) {
317+
case SYNC_DEBUG_BO:
318+
ret = aie2_sync_bo(hwctx, job, aie2_sched_drvcmd_resp_handler);
319+
break;
320+
case ATTACH_DEBUG_BO:
321+
ret = aie2_config_debug_bo(hwctx, job, aie2_sched_drvcmd_resp_handler);
322+
break;
323+
default:
324+
ret = -EINVAL;
325+
break;
326+
}
319327
goto out;
320328
}
321329

@@ -610,10 +618,14 @@ int aie2_hwctx_init(struct amdxdna_hwctx *hwctx)
610618
goto free_entity;
611619
}
612620

621+
ret = amdxdna_pm_resume_get(xdna);
622+
if (ret)
623+
goto free_col_list;
624+
613625
ret = aie2_alloc_resource(hwctx);
614626
if (ret) {
615627
XDNA_ERR(xdna, "Alloc hw resource failed, ret %d", ret);
616-
goto free_col_list;
628+
goto suspend_put;
617629
}
618630

619631
ret = aie2_map_host_buf(xdna->dev_handle, hwctx->fw_ctx_id,
@@ -628,6 +640,7 @@ int aie2_hwctx_init(struct amdxdna_hwctx *hwctx)
628640
XDNA_ERR(xdna, "Create syncobj failed, ret %d", ret);
629641
goto release_resource;
630642
}
643+
amdxdna_pm_suspend_put(xdna);
631644

632645
hwctx->status = HWCTX_STAT_INIT;
633646
ndev = xdna->dev_handle;
@@ -640,6 +653,8 @@ int aie2_hwctx_init(struct amdxdna_hwctx *hwctx)
640653

641654
release_resource:
642655
aie2_release_resource(hwctx);
656+
suspend_put:
657+
amdxdna_pm_suspend_put(xdna);
643658
free_col_list:
644659
kfree(hwctx->col_list);
645660
free_entity:
@@ -759,6 +774,74 @@ static int aie2_hwctx_cu_config(struct amdxdna_hwctx *hwctx, void *buf, u32 size
759774
return ret;
760775
}
761776

777+
static void aie2_cmd_wait(struct amdxdna_hwctx *hwctx, u64 seq)
778+
{
779+
struct dma_fence *out_fence = aie2_cmd_get_out_fence(hwctx, seq);
780+
781+
if (!out_fence) {
782+
XDNA_ERR(hwctx->client->xdna, "Failed to get fence");
783+
return;
784+
}
785+
786+
dma_fence_wait_timeout(out_fence, false, MAX_SCHEDULE_TIMEOUT);
787+
dma_fence_put(out_fence);
788+
}
789+
790+
static int aie2_hwctx_cfg_debug_bo(struct amdxdna_hwctx *hwctx, u32 bo_hdl,
791+
bool attach)
792+
{
793+
struct amdxdna_client *client = hwctx->client;
794+
struct amdxdna_dev *xdna = client->xdna;
795+
struct amdxdna_drv_cmd cmd = { 0 };
796+
struct amdxdna_gem_obj *abo;
797+
u64 seq;
798+
int ret;
799+
800+
abo = amdxdna_gem_get_obj(client, bo_hdl, AMDXDNA_BO_DEV);
801+
if (!abo) {
802+
XDNA_ERR(xdna, "Get bo %d failed", bo_hdl);
803+
return -EINVAL;
804+
}
805+
806+
if (attach) {
807+
if (abo->assigned_hwctx != AMDXDNA_INVALID_CTX_HANDLE) {
808+
ret = -EBUSY;
809+
goto put_obj;
810+
}
811+
cmd.opcode = ATTACH_DEBUG_BO;
812+
} else {
813+
if (abo->assigned_hwctx != hwctx->id) {
814+
ret = -EINVAL;
815+
goto put_obj;
816+
}
817+
cmd.opcode = DETACH_DEBUG_BO;
818+
}
819+
820+
ret = amdxdna_cmd_submit(client, &cmd, AMDXDNA_INVALID_BO_HANDLE,
821+
&bo_hdl, 1, hwctx->id, &seq);
822+
if (ret) {
823+
XDNA_ERR(xdna, "Submit command failed");
824+
goto put_obj;
825+
}
826+
827+
aie2_cmd_wait(hwctx, seq);
828+
if (cmd.result) {
829+
XDNA_ERR(xdna, "Response failure 0x%x", cmd.result);
830+
goto put_obj;
831+
}
832+
833+
if (attach)
834+
abo->assigned_hwctx = hwctx->id;
835+
else
836+
abo->assigned_hwctx = AMDXDNA_INVALID_CTX_HANDLE;
837+
838+
XDNA_DBG(xdna, "Config debug BO %d to %s", bo_hdl, hwctx->name);
839+
840+
put_obj:
841+
amdxdna_gem_put_obj(abo);
842+
return ret;
843+
}
844+
762845
int aie2_hwctx_config(struct amdxdna_hwctx *hwctx, u32 type, u64 value, void *buf, u32 size)
763846
{
764847
struct amdxdna_dev *xdna = hwctx->client->xdna;
@@ -768,14 +851,40 @@ int aie2_hwctx_config(struct amdxdna_hwctx *hwctx, u32 type, u64 value, void *bu
768851
case DRM_AMDXDNA_HWCTX_CONFIG_CU:
769852
return aie2_hwctx_cu_config(hwctx, buf, size);
770853
case DRM_AMDXDNA_HWCTX_ASSIGN_DBG_BUF:
854+
return aie2_hwctx_cfg_debug_bo(hwctx, (u32)value, true);
771855
case DRM_AMDXDNA_HWCTX_REMOVE_DBG_BUF:
772-
return -EOPNOTSUPP;
856+
return aie2_hwctx_cfg_debug_bo(hwctx, (u32)value, false);
773857
default:
774858
XDNA_DBG(xdna, "Not supported type %d", type);
775859
return -EOPNOTSUPP;
776860
}
777861
}
778862

863+
int aie2_hwctx_sync_debug_bo(struct amdxdna_hwctx *hwctx, u32 debug_bo_hdl)
864+
{
865+
struct amdxdna_client *client = hwctx->client;
866+
struct amdxdna_dev *xdna = client->xdna;
867+
struct amdxdna_drv_cmd cmd = { 0 };
868+
u64 seq;
869+
int ret;
870+
871+
cmd.opcode = SYNC_DEBUG_BO;
872+
ret = amdxdna_cmd_submit(client, &cmd, AMDXDNA_INVALID_BO_HANDLE,
873+
&debug_bo_hdl, 1, hwctx->id, &seq);
874+
if (ret) {
875+
XDNA_ERR(xdna, "Submit command failed");
876+
return ret;
877+
}
878+
879+
aie2_cmd_wait(hwctx, seq);
880+
if (cmd.result) {
881+
XDNA_ERR(xdna, "Response failure 0x%x", cmd.result);
882+
return ret;
883+
}
884+
885+
return 0;
886+
}
887+
779888
static int aie2_populate_range(struct amdxdna_gem_obj *abo)
780889
{
781890
struct amdxdna_dev *xdna = to_xdna_dev(to_gobj(abo)->dev);

0 commit comments

Comments
 (0)