From: Mario Limonciello <mario.limonciello@amd.com>
To: <dri-devel@lists.freedesktop.org>, <harry.wentland@amd.com>,
Simona Vetter <simona@ffwll.ch>,
Alex Deucher <alexander.deucher@amd.com>,
"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@gmail.com>
Cc: Xaver Hugl <xaver.hugl@gmail.com>,
<amd-gfx@lists.freedesktop.org>,
"open list:INTEL DRM DISPLAY FOR XE AND I915 DRIVERS"
<intel-gfx@lists.freedesktop.org>,
"open list:INTEL DRM DISPLAY FOR XE AND I915 DRIVERS"
<intel-xe@lists.freedesktop.org>,
Hans de Goede <hansg@kernel.org>,
"Mario Limonciello (AMD)" <superm1@kernel.org>
Subject: [PATCH v8 10/14] drm/amd/display: Update KUnit backlight tests for luminance property and fixtures
Date: Mon, 7 Sep 2026 23:40:31 -0500 [thread overview]
Message-ID: <20260908044035.62093-11-mario.limonciello@amd.com> (raw)
In-Reply-To: <20260908044035.62093-1-mario.limonciello@amd.com>
From: "Mario Limonciello (AMD)" <superm1@kernel.org>
Initialize backlight connector state and display manager dc_lock in
KUnit connector and adev allocators, and update property count
expectations in tests to account for the newly attached LUMINANCE property.
Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
---
.../amdgpu_dm/tests/amdgpu_dm_backlight_test.c | 14 +++++++++++---
.../amdgpu_dm/tests/amdgpu_dm_kunit_helpers.c | 8 +++++++-
2 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_backlight_test.c b/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_backlight_test.c
index e03173d4e5bd8..c5f65e9a90ca8 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_backlight_test.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_backlight_test.c
@@ -52,6 +52,7 @@ static void setup_test_connector(struct kunit *test,
fixture->aconnector->dc_link = fixture->link;
fixture->aconnector->base.dev = &fixture->adev->ddev;
fixture->link->connector_signal = signal;
+ drm_backlight_connector_init(&fixture->aconnector->base);
}
static void setup_test_dm_ddev(struct kunit *test, struct amdgpu_display_manager *dm)
@@ -483,12 +484,17 @@ static void dm_test_register_backlight_device_success(struct kunit *test)
struct dc_link *link = dm_kunit_alloc_link(test);
struct drm_minor *primary;
unsigned int max;
+ int ret;
+
+ ret = drmm_mode_config_init(&adev->ddev);
+ KUNIT_ASSERT_EQ(test, ret, 0);
setup_test_link_service(test, link);
link->dc->link_srv->edp_get_backlight_level = dm_test_get_backlight_level_error;
primary = kunit_kzalloc(test, sizeof(*primary), GFP_KERNEL);
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, primary);
adev->ddev.primary = primary;
+ adev->dm.ddev = &adev->ddev;
adev->dm.backlight_link[0] = link;
aconnector = dm_kunit_alloc_connector(test, adev, link);
@@ -1884,9 +1890,11 @@ static void dm_test_setup_backlight_device_attaches_abm_property(struct kunit *t
KUNIT_EXPECT_EQ(test, dm->num_of_edps, 1);
KUNIT_EXPECT_EQ(test, aconnector->bl_idx, 0);
- KUNIT_EXPECT_EQ(test, aconnector->base.base.properties->count, old_count + 1);
- KUNIT_EXPECT_PTR_EQ(test, aconnector->base.base.properties->properties[old_count], prop);
- KUNIT_EXPECT_EQ(test, aconnector->base.base.properties->values[old_count],
+ KUNIT_EXPECT_EQ(test, aconnector->base.base.properties->count, old_count + 2);
+ KUNIT_EXPECT_PTR_EQ(test,
+ aconnector->base.base.properties->properties[old_count + 1],
+ prop);
+ KUNIT_EXPECT_EQ(test, aconnector->base.base.properties->values[old_count + 1],
(uint64_t)ABM_SYSFS_CONTROL);
amdgpu_dm_set_backlight_param(saved_backlight);
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_kunit_helpers.c b/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_kunit_helpers.c
index aad122c7229f5..ed5045c948fe9 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_kunit_helpers.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_kunit_helpers.c
@@ -7,6 +7,7 @@
#include <kunit/test.h>
#include <linux/module.h>
+#include <drm/drm_backlight.h>
#include <drm/drm_kunit_helpers.h>
#include <drm/drm_managed.h>
@@ -32,7 +33,11 @@ struct amdgpu_device *dm_kunit_alloc_adev(struct kunit *test)
DRIVER_MODESET | DRIVER_ATOMIC);
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, drm);
- return drm_to_adev(drm);
+ struct amdgpu_device *adev = drm_to_adev(drm);
+
+ mutex_init(&adev->dm.dc_lock);
+
+ return adev;
}
EXPORT_SYMBOL(dm_kunit_alloc_adev);
@@ -172,6 +177,7 @@ struct amdgpu_dm_connector *dm_kunit_alloc_connector(struct kunit *test,
if (adev)
aconnector->base.dev = &adev->ddev;
aconnector->dc_link = link;
+ drm_backlight_connector_init(&aconnector->base);
return aconnector;
}
--
2.43.0
next prev parent reply other threads:[~2026-09-08 4:41 UTC|newest]
Thread overview: 69+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-08 4:40 [PATCH v8 00/14] Add support for a DRM backlight capability Mario Limonciello
2026-09-08 4:40 ` [PATCH v8 01/14] Revert "backlight: Remove notifier" Mario Limonciello
2026-09-08 4:51 ` sashiko-bot
2026-09-08 4:40 ` [PATCH v8 02/14] backlight: add kernel-internal backlight API Mario Limonciello
2026-09-08 4:52 ` sashiko-bot
2026-09-08 15:45 ` Jani Nikula
2026-09-08 16:00 ` Mario Limonciello
2026-09-08 16:33 ` Jani Nikula
2026-09-22 8:23 ` Thomas Zimmermann
2026-09-22 8:49 ` Javier Martinez Canillas
2026-09-22 11:34 ` Mario Limonciello
2026-09-22 12:05 ` Thomas Zimmermann
2026-09-25 12:52 ` Xaver Hugl
2026-09-22 12:26 ` Maxime Ripard
2026-09-22 11:37 ` Mario Limonciello
2026-09-08 4:40 ` [PATCH v8 03/14] drm/property: add a per-connector luminance flag Mario Limonciello
2026-09-08 4:54 ` sashiko-bot
2026-09-22 8:32 ` Thomas Zimmermann
2026-09-25 16:30 ` Leo Li
2026-10-01 19:05 ` Harry Wentland
2026-09-08 4:40 ` [PATCH v8 04/14] drm: add connector backlight (LUMINANCE) infrastructure Mario Limonciello
2026-09-08 4:54 ` sashiko-bot
2026-09-08 15:48 ` Jani Nikula
2026-09-22 11:42 ` Javier Martinez Canillas
2026-09-22 12:08 ` Thomas Zimmermann
2026-09-22 11:58 ` Thomas Zimmermann
2026-10-01 19:12 ` Harry Wentland
2026-10-01 19:29 ` Xaver Hugl
2026-10-02 8:00 ` Maxime Ripard
2026-09-08 4:40 ` [PATCH v8 05/14] drm: add DRM_CLIENT_CAP_LUMINANCE Mario Limonciello
2026-09-08 4:55 ` sashiko-bot
2026-09-08 4:40 ` [PATCH v8 06/14] drm/amd/display: Pass up errors reading actual brightness Mario Limonciello
2026-09-08 4:40 ` [PATCH v8 07/14] drm/amd: Indicate driver supports luminance Mario Limonciello
2026-09-22 8:53 ` Thomas Zimmermann
2026-09-08 4:40 ` [PATCH v8 08/14] drm/amd/display: use drm backlight Mario Limonciello
2026-09-08 4:57 ` sashiko-bot
2026-09-08 4:40 ` [PATCH v8 09/14] drm/amdgpu: Check bios_scratch_reg_offset in backlight level helper Mario Limonciello
2026-09-08 4:51 ` sashiko-bot
2026-09-08 4:40 ` Mario Limonciello [this message]
2026-09-08 4:54 ` [PATCH v8 10/14] drm/amd/display: Update KUnit backlight tests for luminance property and fixtures sashiko-bot
2026-09-08 4:40 ` [PATCH v8 11/14] drm/bridge: auto-link panel backlight in bridge connector Mario Limonciello
2026-09-08 4:40 ` [PATCH v8 12/14] drm/xe: Indicate support for luminance on the connector Mario Limonciello
2026-09-08 4:57 ` sashiko-bot
2026-09-08 4:40 ` [PATCH v8 13/14] drm/i915: " Mario Limonciello
2026-09-08 4:40 ` [PATCH v8 14/14] drm/i915/display: use drm backlight Mario Limonciello
2026-09-08 5:03 ` sashiko-bot
2026-09-08 4:51 ` ✗ CI.checkpatch: warning for Add support for a DRM backlight capability (rev3) Patchwork
2026-09-08 4:53 ` ✓ CI.KUnit: success " Patchwork
2026-09-08 5:09 ` ✗ CI.checksparse: warning " Patchwork
2026-09-08 5:51 ` ✓ Xe.CI.BAT: success " Patchwork
2026-09-08 6:31 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-09-08 9:32 ` ✓ i915.CI.BAT: success " Patchwork
2026-09-08 18:45 ` ✗ i915.CI.Full: failure " Patchwork
2026-09-22 8:33 ` [PATCH v8 00/14] Add support for a DRM backlight capability Javier Martinez Canillas
2026-09-22 11:41 ` Mario Limonciello
2026-09-22 12:16 ` Maxime Ripard
2026-09-22 12:23 ` Thomas Zimmermann
2026-09-22 12:35 ` Maxime Ripard
2026-09-23 6:39 ` Thomas Zimmermann
2026-10-01 16:06 ` Maxime Ripard
2026-10-01 16:10 ` Mario Limonciello
2026-10-01 16:20 ` Maxime Ripard
2026-09-23 8:07 ` Xaver Hugl
2026-10-01 16:18 ` Maxime Ripard
2026-10-01 16:21 ` Mario Limonciello
2026-10-01 16:55 ` Javier Martinez Canillas
2026-10-02 8:01 ` Maxime Ripard
2026-09-22 12:28 ` Javier Martinez Canillas
2026-09-23 20:12 ` Mario Limonciello
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260908044035.62093-11-mario.limonciello@amd.com \
--to=mario.limonciello@amd.com \
--cc=airlied@gmail.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=hansg@kernel.org \
--cc=harry.wentland@amd.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=simona@ffwll.ch \
--cc=superm1@kernel.org \
--cc=tzimmermann@suse.de \
--cc=xaver.hugl@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.