Commit 77de4a27 authored by Dave Airlie's avatar Dave Airlie
Browse files

Merge tag 'drm-misc-fixes-2025-12-18' of...

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: default avatarDave 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
parents 46eb784f 2bfca4fe
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
#include <linux/iopoll.h>
#include <linux/pci.h>
#include <linux/xarray.h>
#include <asm/hypervisor.h>

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

	if (!hypervisor_is_type(X86_HYPER_NATIVE)) {
		XDNA_ERR(xdna, "Running under hypervisor not supported");
		return -EINVAL;
	}

	ndev = drmm_kzalloc(&xdna->ddev, sizeof(*ndev), GFP_KERNEL);
	if (!ndev)
		return -ENOMEM;
+6 −2
Original line number Diff line number Diff line
@@ -969,8 +969,10 @@ int drm_gem_change_handle_ioctl(struct drm_device *dev, void *data,
	if (!obj)
		return -ENOENT;

	if (args->handle == args->new_handle)
		return 0;
	if (args->handle == args->new_handle) {
		ret = 0;
		goto out;
	}

	mutex_lock(&file_priv->prime.lock);

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

out_unlock:
	mutex_unlock(&file_priv->prime.lock);
out:
	drm_gem_object_put(obj);

	return ret;
}
+1 −0
Original line number Diff line number Diff line
@@ -1165,6 +1165,7 @@ config DRM_PANEL_VISIONOX_RM69299
	tristate "Visionox RM69299"
	depends on OF
	depends on DRM_MIPI_DSI
	depends on BACKLIGHT_CLASS_DEVICE
	help
	  Say Y here if you want to enable support for Visionox
	  RM69299  DSI Video Mode panel.
+2 −0
Original line number Diff line number Diff line
@@ -212,6 +212,8 @@ static int sony_td4353_jdi_probe(struct mipi_dsi_device *dsi)
	if (ret)
		return dev_err_probe(dev, ret, "Failed to get backlight\n");

	ctx->panel.prepare_prev_first = true;

	drm_panel_add(&ctx->panel);

	ret = mipi_dsi_attach(dsi);
+35 −5
Original line number Diff line number Diff line
@@ -156,24 +156,29 @@ static int set_up_atomic_state(struct kunit *test,

	if (connector) {
		conn_state = drm_atomic_get_connector_state(state, connector);
		KUNIT_ASSERT_NOT_ERR_OR_NULL(test, conn_state);
		if (IS_ERR(conn_state))
			return PTR_ERR(conn_state);

		ret = drm_atomic_set_crtc_for_connector(conn_state, crtc);
		KUNIT_EXPECT_EQ(test, ret, 0);
		if (ret)
			return ret;
	}

	crtc_state = drm_atomic_get_crtc_state(state, crtc);
	KUNIT_ASSERT_NOT_ERR_OR_NULL(test, crtc_state);
	if (IS_ERR(crtc_state))
		return PTR_ERR(crtc_state);

	ret = drm_atomic_set_mode_for_crtc(crtc_state, &drm_atomic_test_mode);
	KUNIT_EXPECT_EQ(test, ret, 0);
	if (ret)
		return ret;

	crtc_state->enable = true;
	crtc_state->active = true;

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

	// first modeset to enable
retry_set_up:
	ret = set_up_atomic_state(test, priv, old_conn, &ctx);
	if (ret == -EDEADLK) {
		ret = drm_modeset_backoff(&ctx);
		if (!ret)
			goto retry_set_up;
	}
	KUNIT_ASSERT_EQ(test, ret, 0);

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

	drm_modeset_acquire_init(&ctx, 0);

retry_set_up:
	ret = set_up_atomic_state(test, priv, NULL, &ctx);
	if (ret == -EDEADLK) {
		ret = drm_modeset_backoff(&ctx);
		if (!ret)
			goto retry_set_up;
	}
	KUNIT_ASSERT_EQ(test, ret, 0);

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

retry:
	crtc_state = drm_atomic_get_crtc_state(state, priv->crtc);
	if (PTR_ERR(crtc_state) == -EDEADLK) {
		drm_atomic_state_clear(state);
		ret = drm_modeset_backoff(&ctx);
		if (!ret)
			goto retry;
	}
	KUNIT_ASSERT_NOT_ERR_OR_NULL(test, crtc_state);

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

	ret = drm_atomic_helper_check_modeset(drm, state);
	if (ret == -EDEADLK) {
		drm_atomic_state_clear(state);
		ret = drm_modeset_backoff(&ctx);
		if (!ret)
			goto retry;
	}
	KUNIT_ASSERT_EQ(test, ret, param->expected_result);

	drm_modeset_drop_locks(&ctx);
Loading