Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package evdi for openSUSE:Factory checked in 
at 2026-09-29 17:50:39
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/evdi (Old)
 and      /work/SRC/openSUSE:Factory/.evdi.new.383539 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "evdi"

Tue Sep 29 17:50:39 2026 rev:17 rq:1381266 version:1.15.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/evdi/evdi.changes        2026-09-01 
15:50:03.487318049 +0200
+++ /work/SRC/openSUSE:Factory/.evdi.new.383539/evdi.changes    2026-09-29 
17:51:56.705632163 +0200
@@ -1,0 +2,7 @@
+Mon Sep 28 22:59:57 UTC 2026 - Stefan Dirsch <[email protected]>
+
+- Update to version 1.15.1 (boo#1283054)
+  * Restore the painter pipeline when a reconnect arrives without
+    a modeset
+
+-------------------------------------------------------------------

Old:
----
  evdi-1.15.0.tar.gz

New:
----
  evdi-1.15.1.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ evdi.spec ++++++
--- /var/tmp/diff_new_pack.O7Kme2/_old  2026-09-29 17:51:58.231695888 +0200
+++ /var/tmp/diff_new_pack.O7Kme2/_new  2026-09-29 17:51:58.235696054 +0200
@@ -21,7 +21,7 @@
 
 Name:           evdi
 Release:        0
-Version:        1.15.0
+Version:        1.15.1
 Summary:        Extensible Virtual Display Interface (EVDI) is a Linux Kernel 
Module
 License:        GPL-2.0-only AND LGPL-2.1-only
 Group:          System/Kernel

++++++ evdi-1.15.0.tar.gz -> evdi-1.15.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/evdi-1.15.0/ci/deb_config 
new/evdi-1.15.1/ci/deb_config
--- old/evdi-1.15.0/ci/deb_config       2026-06-25 11:34:01.000000000 +0200
+++ new/evdi-1.15.1/ci/deb_config       2026-09-15 10:11:17.000000000 +0200
@@ -8,7 +8,7 @@
 evdi_maintainer='Synaptics Technical Support 
<[email protected]>'
 
 # shellcheck disable=SC2034
-evdi_version='1.15.0'
+evdi_version='1.15.1'
 
 # shellcheck disable=SC2034
 evdi_description="Extensible Virtual Display Interface (EVDI) is a Linux® 
kernel module that enables management of multiple screens.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/evdi-1.15.0/library/Makefile 
new/evdi-1.15.1/library/Makefile
--- old/evdi-1.15.0/library/Makefile    2026-06-25 11:34:01.000000000 +0200
+++ new/evdi-1.15.1/library/Makefile    2026-09-15 10:11:17.000000000 +0200
@@ -11,7 +11,7 @@
 DEPS = evdi_ioctl.h
 CFLAGS := -I../module -std=gnu99 -fPIC -D_FILE_OFFSET_BITS=64 $(CFLAGS) 
$$($(PKG_CONFIG) --cflags-only-I libdrm)
 
-LIBVER := 1.15.0
+LIBVER := 1.15.1
 LIBABI := 1
 
 PREFIX ?= /usr
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/evdi-1.15.0/library/evdi_lib.h 
new/evdi-1.15.1/library/evdi_lib.h
--- old/evdi-1.15.0/library/evdi_lib.h  2026-06-25 11:34:01.000000000 +0200
+++ new/evdi-1.15.1/library/evdi_lib.h  2026-09-15 10:11:17.000000000 +0200
@@ -15,7 +15,7 @@
 
 #define LIBEVDI_VERSION_MAJOR 1
 #define LIBEVDI_VERSION_MINOR 15
-#define LIBEVDI_VERSION_PATCH 0
+#define LIBEVDI_VERSION_PATCH 1
 
 struct evdi_lib_version {
        int version_major;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/evdi-1.15.0/module/Makefile 
new/evdi-1.15.1/module/Makefile
--- old/evdi-1.15.0/module/Makefile     2026-06-25 11:34:01.000000000 +0200
+++ new/evdi-1.15.1/module/Makefile     2026-09-15 10:11:17.000000000 +0200
@@ -73,7 +73,7 @@
 DKMS ?= dkms
 RM ?= rm
 
-MODVER=1.15.0
+MODVER=1.15.1
 
 ifeq ($(KVER),)
        KVER := $(shell uname -r)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/evdi-1.15.0/module/dkms.conf 
new/evdi-1.15.1/module/dkms.conf
--- old/evdi-1.15.0/module/dkms.conf    2026-06-25 11:34:01.000000000 +0200
+++ new/evdi-1.15.1/module/dkms.conf    2026-09-15 10:11:17.000000000 +0200
@@ -7,7 +7,7 @@
 #
 
 PACKAGE_NAME="evdi"
-PACKAGE_VERSION=1.15.0
+PACKAGE_VERSION=1.15.1
 AUTOINSTALL=yes
 
 MAKE[0]="make all INCLUDEDIR=/lib/modules/$kernelver/build/include 
KVERSION=$kernelver DKMS_BUILD=1"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/evdi-1.15.0/module/dkms_install.sh 
new/evdi-1.15.1/module/dkms_install.sh
--- old/evdi-1.15.0/module/dkms_install.sh      2026-06-25 11:34:01.000000000 
+0200
+++ new/evdi-1.15.1/module/dkms_install.sh      2026-09-15 10:11:17.000000000 
+0200
@@ -2,7 +2,7 @@
 # SPDX-License-Identifier: GPL-2.0-only
 # Copyright (c) 2023 DisplayLink (UK) Ltd.
 
-evdi_version='1.15.0'
+evdi_version='1.15.1'
 
 EVDI_DIR=$(dirname "${BASH_SOURCE[0]}")
 EVDI_REBOOT_RATIONALE=
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/evdi-1.15.0/module/evdi_drm_drv.h 
new/evdi-1.15.1/module/evdi_drm_drv.h
--- old/evdi-1.15.0/module/evdi_drm_drv.h       2026-06-25 11:34:01.000000000 
+0200
+++ new/evdi-1.15.1/module/evdi_drm_drv.h       2026-09-15 10:11:17.000000000 
+0200
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only
  * Copyright (C) 2012 Red Hat
- * Copyright (c) 2015 - 2020 DisplayLink (UK) Ltd.
+ * Copyright (c) 2015 - 2026 DisplayLink (UK) Ltd.
  *
  * Based on parts on udlfb.c:
  * Copyright (C) 2009 its respective authors
@@ -47,6 +47,7 @@
 struct evdi_device {
        struct drm_device *ddev;
        struct drm_connector *conn;
+       struct drm_crtc *crtc;
        struct evdi_cursor *cursor;
        bool cursor_events_enabled;
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/evdi-1.15.0/module/evdi_modeset.c 
new/evdi-1.15.1/module/evdi_modeset.c
--- old/evdi-1.15.0/module/evdi_modeset.c       2026-06-25 11:34:01.000000000 
+0200
+++ new/evdi-1.15.1/module/evdi_modeset.c       2026-09-15 10:11:17.000000000 
+0200
@@ -1,7 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
  * Copyright (C) 2012 Red Hat
- * Copyright (c) 2015 - 2020 DisplayLink (UK) Ltd.
+ * Copyright (c) 2015 - 2026 DisplayLink (UK) Ltd.
  *
  * Based on parts on udlfb.c:
  * Copyright (C) 2009 its respective authors
@@ -472,6 +472,7 @@
 
 static int evdi_crtc_init(struct drm_device *dev)
 {
+       struct evdi_device *evdi = dev->dev_private;
        struct drm_crtc *crtc = NULL;
        struct drm_plane *primary_plane = NULL;
        struct drm_plane *cursor_plane = NULL;
@@ -503,6 +504,9 @@
        EVDI_DEBUG("drm_crtc_init: %d p%p\n", status, primary_plane);
        drm_crtc_helper_add(crtc, &evdi_helper_funcs);
 
+       if (!status)
+               evdi->crtc = crtc;
+
        return 0;
 }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/evdi-1.15.0/module/evdi_painter.c 
new/evdi-1.15.1/module/evdi_painter.c
--- old/evdi-1.15.0/module/evdi_painter.c       2026-06-25 11:34:01.000000000 
+0200
+++ new/evdi-1.15.1/module/evdi_painter.c       2026-09-15 10:11:17.000000000 
+0200
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
- * Copyright (c) 2013 - 2020 DisplayLink (UK) Ltd.
+ * Copyright (c) 2013 - 2026 DisplayLink (UK) Ltd.
  *
  * This file is subject to the terms and conditions of the GNU General Public
  * License v2. See the file COPYING in the main directory of this archive for
@@ -605,6 +605,7 @@
        struct drm_pending_event *event = create_mode_changed_event(
                current_mode, bits_per_pixel, pixel_format);
 
+       EVDI_TEST_HOOK(evdi_testhook_painter_send_mode_changed(current_mode));
        evdi_painter_send_event(painter, event);
 }
 
@@ -912,6 +913,71 @@
        }
 }
 
+/*
+ * A replug that completes within the compositor's hotplug hysteresis (3s in
+ * mutter) is coalesced away, so no atomic commit follows the reconnect and the
+ * painter - whose scanout buffer was dropped on disconnect - never starts
+ * producing frames again. The KMS pipeline itself was never torn down, so
+ * re-emit from the live crtc/plane state what a commit would have emitted.
+ */
+static void evdi_painter_replay_kms_state(struct evdi_device *evdi)
+{
+       struct evdi_painter *painter = evdi->painter;
+       struct drm_crtc *crtc = evdi->crtc;
+       struct drm_plane *primary = crtc ? crtc->primary : NULL;
+       struct drm_modeset_acquire_ctx ctx;
+       struct evdi_framebuffer *efb = NULL;
+       struct drm_display_mode mode = { 0 };
+       struct drm_clip_rect rect;
+       int ret;
+
+       if (!primary)
+               return;
+
+       drm_modeset_acquire_init(&ctx, 0);
+retry:
+       ret = drm_modeset_lock(&crtc->mutex, &ctx);
+       if (!ret)
+               ret = drm_modeset_lock(&primary->mutex, &ctx);
+
+       if (ret == -EDEADLK) {
+               ret = drm_modeset_backoff(&ctx);
+               if (!ret)
+                       goto retry;
+       }
+
+       if (!ret &&
+           crtc->state && crtc->state->active &&
+           primary->state && primary->state->fb &&
+           primary->state->crtc == crtc) {
+               efb = to_evdi_fb(primary->state->fb);
+               drm_framebuffer_get(&efb->base);
+               mode = crtc->state->adjusted_mode;
+       }
+
+       drm_modeset_drop_locks(&ctx);
+       drm_modeset_acquire_fini(&ctx);
+
+       if (!efb)
+               return;
+
+       EVDI_INFO("(card%d) Reconnected without modeset, replaying %dx%d@%d\n",
+                 evdi->dev_index, mode.hdisplay, mode.vdisplay,
+                 drm_mode_vrefresh(&mode));
+
+       evdi_painter_set_scanout_buffer(painter, efb);
+       evdi_painter_mode_changed_notify(evdi, &mode);
+       /* Keep it armed so a commit still in flight notifies again. */
+       evdi_painter_force_full_modeset(painter);
+       evdi_painter_dpms_notify(painter, DRM_MODE_DPMS_ON);
+
+       rect = evdi_painter_framebuffer_size(painter);
+       evdi_painter_mark_dirty(evdi, &rect);
+       evdi_painter_send_update_ready_if_needed(painter);
+
+       drm_framebuffer_put(&efb->base);
+}
+
 static int
 evdi_painter_connect(struct evdi_device *evdi,
                     void const __user *edid_data, unsigned int edid_length,
@@ -921,6 +987,7 @@
 {
        struct evdi_painter *painter = evdi->painter;
        struct edid *new_edid = NULL;
+       bool was_connected;
        char buf[100];
 
        evdi_log_process(buf, sizeof(buf));
@@ -951,6 +1018,7 @@
 
        painter_lock(painter);
 
+       was_connected = painter->is_connected;
        evdi->pixel_area_limit = pixel_area_limit;
        evdi->pixel_per_second_limit = pixel_per_second_limit;
        painter->drm_filp = file;
@@ -967,6 +1035,10 @@
 
        EVDI_INFO("(card%d) Connected with %s\n", evdi->dev_index, buf);
 
+       /* A double connect keeps the painter armed, nothing to replay. */
+       if (!was_connected)
+               evdi_painter_replay_kms_state(evdi);
+
        drm_helper_hpd_irq_event(evdi->ddev);
 
        return 0;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/evdi-1.15.0/module/evdi_platform_drv.h 
new/evdi-1.15.1/module/evdi_platform_drv.h
--- old/evdi-1.15.0/module/evdi_platform_drv.h  2026-06-25 11:34:01.000000000 
+0200
+++ new/evdi-1.15.1/module/evdi_platform_drv.h  2026-09-15 10:11:17.000000000 
+0200
@@ -28,12 +28,12 @@
 #define DRIVER_NAME   "evdi"
 #define DRIVER_DESC   "Extensible Virtual Display Interface"
 #ifdef EVDI_HAVE_DRM_DRIVER_DATE
-#define DRIVER_DATE   "20260625"
+#define DRIVER_DATE   "20260915"
 #endif
 
 #define DRIVER_MAJOR 1
 #define DRIVER_MINOR 15
-#define DRIVER_PATCH 0
+#define DRIVER_PATCH 1
 
 void evdi_platform_remove_all_devices(struct device *device);
 unsigned int evdi_platform_device_count(struct device *device);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/evdi-1.15.0/module/tests/Makefile 
new/evdi-1.15.1/module/tests/Makefile
--- old/evdi-1.15.0/module/tests/Makefile       2026-06-25 11:34:01.000000000 
+0200
+++ new/evdi-1.15.1/module/tests/Makefile       2026-09-15 10:11:17.000000000 
+0200
@@ -1,5 +1,5 @@
 
 ccflags-$(CONFIG_DRM_EVDI_KUNIT_TEST) += -I$(srctree)/drivers/gpu/drm/evdi
 
-obj-$(CONFIG_DRM_EVDI_KUNIT_TEST) += evdi_test.o test_evdi_vt_switch.o 
evdi_fake_user_client.o evdi_fake_compositor.o
+obj-$(CONFIG_DRM_EVDI_KUNIT_TEST) += evdi_test.o test_evdi_vt_switch.o 
test_evdi_hotplug.o evdi_fake_user_client.o evdi_fake_compositor.o
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/evdi-1.15.0/module/tests/evdi_fake_compositor.c 
new/evdi-1.15.1/module/tests/evdi_fake_compositor.c
--- old/evdi-1.15.0/module/tests/evdi_fake_compositor.c 2026-06-25 
11:34:01.000000000 +0200
+++ new/evdi-1.15.1/module/tests/evdi_fake_compositor.c 2026-09-15 
10:11:17.000000000 +0200
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
- * Copyright (c) 2024 DisplayLink (UK) Ltd.
+ * Copyright (c) 2024 - 2026 DisplayLink (UK) Ltd.
  *
  * This file is subject to the terms and conditions of the GNU General Public
  * License v2. See the file COPYING in the main directory of this archive for
@@ -45,6 +45,8 @@
                .base = {
                        .format = drm_format_info(DRM_FORMAT_XRGB8888),
                        .pitches = { 4*640, 0, 0 },
+                       .width = 640,
+                       .height = 480,
                        },
                .obj = NULL,
                .active = true
@@ -55,18 +57,43 @@
        memcpy(&compositor_data->mode, &default_mode, sizeof(default_mode));
 }
 
+/* Stands in for the atomic commit a real compositor would have done. */
+static void fake_compositor_set_kms_state(struct drm_device *device,
+                                         struct evdi_framebuffer *efb,
+                                         struct drm_display_mode *mode)
+{
+       struct evdi_device *evdi = (struct evdi_device *)device->dev_private;
+       struct drm_crtc *crtc = evdi->crtc;
+       struct drm_plane *primary = crtc ? crtc->primary : NULL;
+
+       if (!crtc || !crtc->state || !primary || !primary->state)
+               return;
+
+       crtc->state->enable = efb != NULL;
+       crtc->state->active = efb != NULL;
+       primary->state->crtc = efb ? crtc : NULL;
+       primary->state->fb = efb ? &efb->base : NULL;
+
+       if (mode)
+               crtc->state->adjusted_mode = *mode;
+}
+
 void evdi_fake_compositor_connect(struct kunit *test, struct drm_device 
*device)
 {
        struct kunit_resource *resource = kunit_find_named_resource(test, 
"fake_wayland");
        struct evdi_fake_compositor_data *compositor_data = resource->data;
        struct evdi_device *evdi = (struct evdi_device *)device->dev_private;
 
+       fake_compositor_set_kms_state(device, compositor_data->efb,
+                                     &compositor_data->mode);
+
        evdi_painter_set_scanout_buffer(evdi->painter, compositor_data->efb);
        evdi_painter_mode_changed_notify(evdi, &compositor_data->mode);
        evdi_painter_dpms_notify(evdi->painter, DRM_MODE_DPMS_ON);
 }
 
-void evdi_fake_compositor_disconnect(__maybe_unused struct kunit *test, 
__maybe_unused struct drm_device *device)
+void evdi_fake_compositor_disconnect(__maybe_unused struct kunit *test, struct 
drm_device *device)
 {
+       fake_compositor_set_kms_state(device, NULL, NULL);
 }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/evdi-1.15.0/module/tests/evdi_test.c 
new/evdi-1.15.1/module/tests/evdi_test.c
--- old/evdi-1.15.0/module/tests/evdi_test.c    2026-06-25 11:34:01.000000000 
+0200
+++ new/evdi-1.15.1/module/tests/evdi_test.c    2026-09-15 10:11:17.000000000 
+0200
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
- * Copyright (c) 2024 DisplayLink (UK) Ltd.
+ * Copyright (c) 2024 - 2026 DisplayLink (UK) Ltd.
  *
  * This file is subject to the terms and conditions of the GNU General Public
  * License v2. See the file COPYING in the main directory of this archive for
@@ -55,6 +55,15 @@
                base->hooks.painter_send_dpms(mode);
 }
 
+void evdi_testhook_painter_send_mode_changed(const struct drm_display_mode 
*mode)
+{
+       struct kunit *test = kunit_get_current_test();
+       struct evdi_test_data *base = test ? (struct evdi_test_data 
*)test->priv : NULL;
+
+       if (base && base->hooks.painter_send_mode_changed)
+               base->hooks.painter_send_mode_changed(mode);
+}
+
 void evdi_testhook_drm_device_destroyed(void)
 {
        struct kunit *test = kunit_get_current_test();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/evdi-1.15.0/module/tests/evdi_test.h 
new/evdi-1.15.1/module/tests/evdi_test.h
--- old/evdi-1.15.0/module/tests/evdi_test.h    2026-06-25 11:34:01.000000000 
+0200
+++ new/evdi-1.15.1/module/tests/evdi_test.h    2026-09-15 10:11:17.000000000 
+0200
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only
  *
- * Copyright (c) 2024 DisplayLink (UK) Ltd.
+ * Copyright (c) 2024 - 2026 DisplayLink (UK) Ltd.
  *
  * This file is subject to the terms and conditions of the GNU General Public
  * License v2. See the file COPYING in the main directory of this archive for
@@ -22,14 +22,18 @@
 
 #include <linux/completion.h>
 
+struct drm_display_mode;
+
 /* evdi hooks for kunit tests */
 void evdi_testhook_painter_vt_register(struct notifier_block *vt_notifier);
 void evdi_testhook_painter_send_dpms(int mode);
+void evdi_testhook_painter_send_mode_changed(const struct drm_display_mode 
*mode);
 void evdi_testhook_drm_device_destroyed(void);
 
 struct evdi_test_hooks {
        void (*painter_vt_register)(struct notifier_block *vt_notifier);
        void (*painter_send_dpms)(int mode);
+       void (*painter_send_mode_changed)(const struct drm_display_mode *mode);
        void (*drm_device_destroyed)(void);
 };
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/evdi-1.15.0/module/tests/test_evdi_hotplug.c 
new/evdi-1.15.1/module/tests/test_evdi_hotplug.c
--- old/evdi-1.15.0/module/tests/test_evdi_hotplug.c    1970-01-01 
01:00:00.000000000 +0100
+++ new/evdi-1.15.1/module/tests/test_evdi_hotplug.c    2026-09-15 
10:11:17.000000000 +0200
@@ -0,0 +1,136 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Copyright (c) 2026 DisplayLink (UK) Ltd.
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License v2. See the file COPYING in the main directory of this archive for
+ * more details.
+ */
+
+
+#include <kunit/test.h>
+#include <kunit/test-bug.h>
+#include <kunit/device.h>
+#include "evdi_drm_drv.h"
+#include "tests/evdi_test.h"
+#include "tests/evdi_fake_user_client.h"
+#include "tests/evdi_fake_compositor.h"
+
+
+struct evdi_hotplug_test {
+       struct evdi_test_data base;
+       int dpms_mode;
+       int mode_changed_count;
+       int hdisplay;
+       int vdisplay;
+};
+#define to_evdi_hotplug_test(x) container_of(x, struct evdi_hotplug_test, base)
+
+static void testhook_painter_send_dpms(int mode)
+{
+       struct kunit *test = kunit_get_current_test();
+       struct evdi_hotplug_test *data = to_evdi_hotplug_test(test->priv);
+
+       data->dpms_mode = mode;
+}
+
+static void testhook_painter_send_mode_changed(const struct drm_display_mode 
*mode)
+{
+       struct kunit *test = kunit_get_current_test();
+       struct evdi_hotplug_test *data = to_evdi_hotplug_test(test->priv);
+
+       data->mode_changed_count++;
+       data->hdisplay = mode->hdisplay;
+       data->vdisplay = mode->vdisplay;
+}
+
+static int suite_test_hotplug_init(struct kunit *test)
+{
+       struct evdi_hotplug_test *data =
+               kunit_kzalloc(test, sizeof(struct evdi_hotplug_test), 
GFP_KERNEL);
+
+       evdi_test_data_init(test, &data->base);
+       data->base.hooks.painter_send_dpms = testhook_painter_send_dpms;
+       data->base.hooks.painter_send_mode_changed = 
testhook_painter_send_mode_changed;
+       data->base.dev = evdi_drm_device_create(data->base.parent);
+
+       evdi_fake_compositor_create(test);
+       evdi_fake_user_client_create(test);
+
+       evdi_fake_user_client_connect(test, data->base.dev);
+       evdi_fake_compositor_connect(test, data->base.dev);
+
+       return 0;
+}
+
+static void suite_test_hotplug_exit(struct kunit *test)
+{
+       struct evdi_hotplug_test *data = to_evdi_hotplug_test(test->priv);
+
+       evdi_fake_compositor_disconnect(test, data->base.dev);
+       evdi_fake_user_client_disconnect(test, data->base.dev);
+
+       if (data->base.dev) {
+               evdi_drm_device_remove(data->base.dev);
+               data->base.dev = NULL;
+       }
+
+       evdi_test_data_exit(test, &data->base);
+       kunit_kfree(test, test->priv);
+}
+
+static void test_evdi_painter_replays_mode_on_reconnect_without_modeset(struct 
kunit *test)
+{
+       struct evdi_hotplug_test *data = to_evdi_hotplug_test(test->priv);
+       struct evdi_device *evdi = (struct evdi_device 
*)data->base.dev->dev_private;
+       struct drm_clip_rect rect;
+
+       data->mode_changed_count = 0;
+       data->dpms_mode = DRM_MODE_DPMS_OFF;
+
+       /* Replug too quick for the compositor to tear the pipeline down. */
+       evdi_fake_user_client_disconnect(test, data->base.dev);
+       evdi_fake_user_client_connect(test, data->base.dev);
+
+       KUNIT_EXPECT_EQ(test, data->mode_changed_count, 1);
+       KUNIT_EXPECT_EQ(test, data->hdisplay, 640);
+       KUNIT_EXPECT_EQ(test, data->vdisplay, 480);
+       KUNIT_EXPECT_EQ(test, data->dpms_mode, DRM_MODE_DPMS_ON);
+       KUNIT_EXPECT_TRUE(test, evdi_painter_needs_full_modeset(evdi->painter));
+
+       rect = evdi_painter_framebuffer_size(evdi->painter);
+       KUNIT_EXPECT_EQ(test, rect.x2, 640);
+       KUNIT_EXPECT_EQ(test, rect.y2, 480);
+}
+
+static void 
test_evdi_painter_does_not_replay_mode_when_pipeline_was_torn_down(struct kunit 
*test)
+{
+       struct evdi_hotplug_test *data = to_evdi_hotplug_test(test->priv);
+       struct evdi_device *evdi = (struct evdi_device 
*)data->base.dev->dev_private;
+
+       data->mode_changed_count = 0;
+       data->dpms_mode = DRM_MODE_DPMS_OFF;
+
+       evdi_fake_compositor_disconnect(test, data->base.dev);
+       evdi_fake_user_client_disconnect(test, data->base.dev);
+       evdi_fake_user_client_connect(test, data->base.dev);
+
+       KUNIT_EXPECT_EQ(test, data->mode_changed_count, 0);
+       KUNIT_EXPECT_NE(test, data->dpms_mode, DRM_MODE_DPMS_ON);
+       KUNIT_EXPECT_TRUE(test, evdi_painter_needs_full_modeset(evdi->painter));
+}
+
+static struct kunit_case evdi_test_cases[] = {
+       KUNIT_CASE(test_evdi_painter_replays_mode_on_reconnect_without_modeset),
+       
KUNIT_CASE(test_evdi_painter_does_not_replay_mode_when_pipeline_was_torn_down),
+       {}
+};
+
+static struct kunit_suite evdi_test_suite = {
+       .name = "drm_evdi_hotplug_tests",
+       .test_cases = evdi_test_cases,
+       .init = suite_test_hotplug_init,
+       .exit = suite_test_hotplug_exit,
+};
+
+kunit_test_suite(evdi_test_suite);

Reply via email to