Now, it has the same order as connectors in drmModeGetResources. As
result splash screen will be drawn on the first connector.

Signed-off-by: Vasyl Vavrychuk <[email protected]>
---
 psplash-drm.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/psplash-drm.c b/psplash-drm.c
index 30850ed..2468cf1 100644
--- a/psplash-drm.c
+++ b/psplash-drm.c
@@ -185,7 +185,7 @@ static int modeset_prepare(int fd)
        drmModeRes *res;
        drmModeConnector *conn;
        int i;
-       struct modeset_dev *dev;
+       struct modeset_dev *dev, *last_dev = NULL;
        int ret;
 
        /* retrieve resources */
@@ -226,8 +226,13 @@ static int modeset_prepare(int fd)
 
                /* free connector data and link device into global list */
                drmModeFreeConnector(conn);
-               dev->next = modeset_list;
-               modeset_list = dev;
+               if (last_dev == NULL) {
+                       modeset_list = dev;
+                       last_dev = dev;
+               } else {
+                       last_dev->next = dev;
+                       last_dev = dev;
+               }
        }
 
        /* free resources again */
-- 
2.30.2

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#56865): https://lists.yoctoproject.org/g/yocto/message/56865
Mute This Topic: https://lists.yoctoproject.org/mt/90680284/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to