diff mbox series

drm/i915/selftests: Properly reset mock object propers for each test

Message ID 20211021202048.2638668-1-daniel.vetter@ffwll.ch (mailing list archive)
State New, archived
Headers show
Series drm/i915/selftests: Properly reset mock object propers for each test | expand

Commit Message

Daniel Vetter Oct. 21, 2021, 8:20 p.m. UTC
I forgot to do this properly in

commit 6f11f37459d8f9f74ff1c299c0bedd50b458057a
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Fri Jul 23 10:34:55 2021 +0200

    drm/plane: remove drm_helper_get_plane_damage_clips

intel-gfx CI didn't spot this because we run each selftest in each own
invocations, which means reloading i915.ko. But if you just run all
the selftests in one go at boot-up, then it falls apart and eventually
we cross over the hardcoded limited of how many properties can be
attached to a single object.

Fix this by resetting the property count. Nothing else to clean up
since it's all static storage anyway.

Reported-and-tested-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Fixes: 6f11f37459d8 ("drm/plane: remove drm_helper_get_plane_damage_clips")
Cc: José Roberto de Souza <jose.souza@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Daniel Vetter <daniel.vetter@intel.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/selftests/test-drm_damage_helper.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Daniel Vetter Oct. 22, 2021, 9:09 a.m. UTC | #1
On Thu, Oct 21, 2021 at 10:20:48PM +0200, Daniel Vetter wrote:
> I forgot to do this properly in
> 
> commit 6f11f37459d8f9f74ff1c299c0bedd50b458057a
> Author: Daniel Vetter <daniel.vetter@ffwll.ch>
> Date:   Fri Jul 23 10:34:55 2021 +0200
> 
>     drm/plane: remove drm_helper_get_plane_damage_clips
> 
> intel-gfx CI didn't spot this because we run each selftest in each own
> invocations, which means reloading i915.ko. But if you just run all
> the selftests in one go at boot-up, then it falls apart and eventually
> we cross over the hardcoded limited of how many properties can be
> attached to a single object.
> 
> Fix this by resetting the property count. Nothing else to clean up
> since it's all static storage anyway.
> 
> Reported-and-tested-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> Fixes: 6f11f37459d8 ("drm/plane: remove drm_helper_get_plane_damage_clips")
> Cc: José Roberto de Souza <jose.souza@intel.com>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Cc: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
> Cc: Hans de Goede <hdegoede@redhat.com>
> Cc: Daniel Vetter <daniel.vetter@intel.com>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Maxime Ripard <mripard@kernel.org>
> Cc: Thomas Zimmermann <tzimmermann@suse.de>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>

Merged to drm-misc-fixes with Thomas' irc ack. Will unfortunately miss
this -rc since the drm pull train left the station already, but it'll be
there in a week.
-Daniel

> ---
>  drivers/gpu/drm/selftests/test-drm_damage_helper.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/gpu/drm/selftests/test-drm_damage_helper.c b/drivers/gpu/drm/selftests/test-drm_damage_helper.c
> index 1c19a5d3eefb..8d8d8e214c28 100644
> --- a/drivers/gpu/drm/selftests/test-drm_damage_helper.c
> +++ b/drivers/gpu/drm/selftests/test-drm_damage_helper.c
> @@ -30,6 +30,7 @@ static void mock_setup(struct drm_plane_state *state)
>  	mock_device.driver = &mock_driver;
>  	mock_device.mode_config.prop_fb_damage_clips = &mock_prop;
>  	mock_plane.dev = &mock_device;
> +	mock_obj_props.count = 0;
>  	mock_plane.base.properties = &mock_obj_props;
>  	mock_prop.base.id = 1; /* 0 is an invalid id */
>  	mock_prop.dev = &mock_device;
> -- 
> 2.33.0
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/selftests/test-drm_damage_helper.c b/drivers/gpu/drm/selftests/test-drm_damage_helper.c
index 1c19a5d3eefb..8d8d8e214c28 100644
--- a/drivers/gpu/drm/selftests/test-drm_damage_helper.c
+++ b/drivers/gpu/drm/selftests/test-drm_damage_helper.c
@@ -30,6 +30,7 @@  static void mock_setup(struct drm_plane_state *state)
 	mock_device.driver = &mock_driver;
 	mock_device.mode_config.prop_fb_damage_clips = &mock_prop;
 	mock_plane.dev = &mock_device;
+	mock_obj_props.count = 0;
 	mock_plane.base.properties = &mock_obj_props;
 	mock_prop.base.id = 1; /* 0 is an invalid id */
 	mock_prop.dev = &mock_device;