[psplash][RFC PATCH 12/14] Reverse modeset_list


Vasyl Vavrychuk
 

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 <vasyl.vavrychuk@...>
---
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