Skip to content

Commit 77de4a2

Browse files
committed
Merge tag 'drm-misc-fixes-2025-12-18' of https://gitlab.freedesktop.org/drm/misc/kernel into drm-fixes
drm-misc-fixes for v6.19-rc2: - Add -EDEADLK handling in drm unit tests. - Plug DRM_IOCTL_GEM_CHANGE_HANDLE leak. - Fix regression in sony-td4353-jdi. - Kconfig fix for visionox-rm69299. - Do not load amdxdna when running virtualized. Signed-off-by: Dave Airlie <airlied@redhat.com> From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Link: https://patch.msgid.link/21861d1b-54bf-4853-9c35-97abe3c5deba@linux.intel.com
2 parents 46eb784 + 2bfca4f commit 77de4a2

6 files changed

Lines changed: 193 additions & 7 deletions

File tree

drivers/accel/amdxdna/aie2_pci.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include <linux/iopoll.h>
1818
#include <linux/pci.h>
1919
#include <linux/xarray.h>
20+
#include <asm/hypervisor.h>
2021

2122
#include "aie2_msg_priv.h"
2223
#include "aie2_pci.h"
@@ -508,6 +509,11 @@ static int aie2_init(struct amdxdna_dev *xdna)
508509
unsigned long bars = 0;
509510
int i, nvec, ret;
510511

512+
if (!hypervisor_is_type(X86_HYPER_NATIVE)) {
513+
XDNA_ERR(xdna, "Running under hypervisor not supported");
514+
return -EINVAL;
515+
}
516+
511517
ndev = drmm_kzalloc(&xdna->ddev, sizeof(*ndev), GFP_KERNEL);
512518
if (!ndev)
513519
return -ENOMEM;

drivers/gpu/drm/drm_gem.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -969,8 +969,10 @@ int drm_gem_change_handle_ioctl(struct drm_device *dev, void *data,
969969
if (!obj)
970970
return -ENOENT;
971971

972-
if (args->handle == args->new_handle)
973-
return 0;
972+
if (args->handle == args->new_handle) {
973+
ret = 0;
974+
goto out;
975+
}
974976

975977
mutex_lock(&file_priv->prime.lock);
976978

@@ -1002,6 +1004,8 @@ int drm_gem_change_handle_ioctl(struct drm_device *dev, void *data,
10021004

10031005
out_unlock:
10041006
mutex_unlock(&file_priv->prime.lock);
1007+
out:
1008+
drm_gem_object_put(obj);
10051009

10061010
return ret;
10071011
}

drivers/gpu/drm/panel/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1165,6 +1165,7 @@ config DRM_PANEL_VISIONOX_RM69299
11651165
tristate "Visionox RM69299"
11661166
depends on OF
11671167
depends on DRM_MIPI_DSI
1168+
depends on BACKLIGHT_CLASS_DEVICE
11681169
help
11691170
Say Y here if you want to enable support for Visionox
11701171
RM69299 DSI Video Mode panel.

drivers/gpu/drm/panel/panel-sony-td4353-jdi.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,8 @@ static int sony_td4353_jdi_probe(struct mipi_dsi_device *dsi)
212212
if (ret)
213213
return dev_err_probe(dev, ret, "Failed to get backlight\n");
214214

215+
ctx->panel.prepare_prev_first = true;
216+
215217
drm_panel_add(&ctx->panel);
216218

217219
ret = mipi_dsi_attach(dsi);

drivers/gpu/drm/tests/drm_atomic_state_test.c

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,24 +156,29 @@ static int set_up_atomic_state(struct kunit *test,
156156

157157
if (connector) {
158158
conn_state = drm_atomic_get_connector_state(state, connector);
159-
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, conn_state);
159+
if (IS_ERR(conn_state))
160+
return PTR_ERR(conn_state);
160161

161162
ret = drm_atomic_set_crtc_for_connector(conn_state, crtc);
162-
KUNIT_EXPECT_EQ(test, ret, 0);
163+
if (ret)
164+
return ret;
163165
}
164166

165167
crtc_state = drm_atomic_get_crtc_state(state, crtc);
166-
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, crtc_state);
168+
if (IS_ERR(crtc_state))
169+
return PTR_ERR(crtc_state);
167170

168171
ret = drm_atomic_set_mode_for_crtc(crtc_state, &drm_atomic_test_mode);
169-
KUNIT_EXPECT_EQ(test, ret, 0);
172+
if (ret)
173+
return ret;
170174

171175
crtc_state->enable = true;
172176
crtc_state->active = true;
173177

174178
if (connector) {
175179
ret = drm_atomic_commit(state);
176-
KUNIT_ASSERT_EQ(test, ret, 0);
180+
if (ret)
181+
return ret;
177182
} else {
178183
// dummy connector mask
179184
crtc_state->connector_mask = DRM_TEST_CONN_0;
@@ -206,7 +211,13 @@ static void drm_test_check_connector_changed_modeset(struct kunit *test)
206211
drm_modeset_acquire_init(&ctx, 0);
207212

208213
// first modeset to enable
214+
retry_set_up:
209215
ret = set_up_atomic_state(test, priv, old_conn, &ctx);
216+
if (ret == -EDEADLK) {
217+
ret = drm_modeset_backoff(&ctx);
218+
if (!ret)
219+
goto retry_set_up;
220+
}
210221
KUNIT_ASSERT_EQ(test, ret, 0);
211222

212223
state = drm_kunit_helper_atomic_state_alloc(test, drm, &ctx);
@@ -277,13 +288,26 @@ static void drm_test_check_valid_clones(struct kunit *test)
277288

278289
drm_modeset_acquire_init(&ctx, 0);
279290

291+
retry_set_up:
280292
ret = set_up_atomic_state(test, priv, NULL, &ctx);
293+
if (ret == -EDEADLK) {
294+
ret = drm_modeset_backoff(&ctx);
295+
if (!ret)
296+
goto retry_set_up;
297+
}
281298
KUNIT_ASSERT_EQ(test, ret, 0);
282299

283300
state = drm_kunit_helper_atomic_state_alloc(test, drm, &ctx);
284301
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, state);
285302

303+
retry:
286304
crtc_state = drm_atomic_get_crtc_state(state, priv->crtc);
305+
if (PTR_ERR(crtc_state) == -EDEADLK) {
306+
drm_atomic_state_clear(state);
307+
ret = drm_modeset_backoff(&ctx);
308+
if (!ret)
309+
goto retry;
310+
}
287311
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, crtc_state);
288312

289313
crtc_state->encoder_mask = param->encoder_mask;
@@ -292,6 +316,12 @@ static void drm_test_check_valid_clones(struct kunit *test)
292316
crtc_state->mode_changed = true;
293317

294318
ret = drm_atomic_helper_check_modeset(drm, state);
319+
if (ret == -EDEADLK) {
320+
drm_atomic_state_clear(state);
321+
ret = drm_modeset_backoff(&ctx);
322+
if (!ret)
323+
goto retry;
324+
}
295325
KUNIT_ASSERT_EQ(test, ret, param->expected_result);
296326

297327
drm_modeset_drop_locks(&ctx);

0 commit comments

Comments
 (0)