summaryrefslogtreecommitdiffstats
path: root/meta-agl-drm-lease/recipes-core/psplash/files/0014-psplash-drm.c-Allocate-resources-only-for-the-first-.patch
diff options
context:
space:
mode:
authorNaoto Yamaguchi <naoto.yamaguchi@aisin.co.jp>2023-04-23 20:25:45 +0900
committerNaoto Yamaguchi <naoto.yamaguchi@aisin.co.jp>2023-06-01 05:55:44 +0900
commit1abeb16b8222efb6608ce9a0f852c1f94d5c9ee6 (patch)
tree6a174add13db69702dcacb2c50560ce370b355dc /meta-agl-drm-lease/recipes-core/psplash/files/0014-psplash-drm.c-Allocate-resources-only-for-the-first-.patch
parent3bdbed71338a7b1570a8b3d7b30ebae92f80e4e5 (diff)
Enable drm-lease support at psplash
The upstream version of psplash is supporting fb based splash screen. On the other hand, drm lease infrastructure is not support fb. This patch enable drm-lease support at psplash. This work contributed by Hiroyuki Ishii at CES2023 demo development. Bug-AGL: SPEC-4766 Change-Id: Idd9a1f5c96c5e294099f2d9c2ef87c5ca5769c2e Signed-off-by: Naoto Yamaguchi <naoto.yamaguchi@aisin.co.jp>
Diffstat (limited to 'meta-agl-drm-lease/recipes-core/psplash/files/0014-psplash-drm.c-Allocate-resources-only-for-the-first-.patch')
-rw-r--r--meta-agl-drm-lease/recipes-core/psplash/files/0014-psplash-drm.c-Allocate-resources-only-for-the-first-.patch46
1 files changed, 46 insertions, 0 deletions
diff --git a/meta-agl-drm-lease/recipes-core/psplash/files/0014-psplash-drm.c-Allocate-resources-only-for-the-first-.patch b/meta-agl-drm-lease/recipes-core/psplash/files/0014-psplash-drm.c-Allocate-resources-only-for-the-first-.patch
new file mode 100644
index 00000000..28b1014b
--- /dev/null
+++ b/meta-agl-drm-lease/recipes-core/psplash/files/0014-psplash-drm.c-Allocate-resources-only-for-the-first-.patch
@@ -0,0 +1,46 @@
+From 7423f166c8899b84448f68739d5293f19f8dfd06 Mon Sep 17 00:00:00 2001
+From: Vasyl Vavrychuk <vasyl.vavrychuk@opensynergy.com>
+Date: Mon, 25 Apr 2022 10:59:53 +0300
+Subject: [PATCH 14/17] psplash-drm.c: Allocate resources only for the first
+ connector
+
+Since splash screen is shown only on the first scanout, there is no need
+to allocate resources for next connectors.
+
+drm-backend backport from:
+https://patchwork.yoctoproject.org/project/yocto/cover/20220425075954.10427-1-vasyl.vavrychuk@opensynergy.com/
+
+Signed-off-by: Vasyl Vavrychuk <vasyl.vavrychuk@opensynergy.com>
+---
+ psplash-drm.c | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/psplash-drm.c b/psplash-drm.c
+index 2468cf1..5e56286 100644
+--- a/psplash-drm.c
++++ b/psplash-drm.c
+@@ -39,6 +39,8 @@
+ #include <xf86drmMode.h>
+ #include "psplash-drm.h"
+
++#define MIN(a,b) ((a) < (b) ? (a) : (b))
++
+ struct modeset_dev;
+ static int modeset_find_crtc(int fd, drmModeRes *res, drmModeConnector *conn,
+ struct modeset_dev *dev);
+@@ -196,8 +198,10 @@ static int modeset_prepare(int fd)
+ return -errno;
+ }
+
+- /* iterate all connectors */
+- for (i = 0; i < res->count_connectors; ++i) {
++ /* ~iterate all connectors~ - Use first connector if present. It is
++ optimization related workaround since psplash supports drawing splash
++ screen on one scanout anyway. */
++ for (i = 0; i < MIN(res->count_connectors, 1); ++i) {
+ /* get information for each connector */
+ conn = drmModeGetConnector(fd, res->connectors[i]);
+ if (!conn) {
+--
+2.25.1
+