summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhang Nguyen <khang.nguyen.xw@renesas.com>2020-03-31 10:20:20 +0900
committerKhang Nguyen <khang.nguyen.xw@renesas.com>2020-05-04 18:17:34 +0900
commit8254b2369ae338a6cec5a3c1d83b66888459710d (patch)
treeb646655257836678b983875ff84bbb4d3c445dfb
parentf562f6ae2c2eb810ff8fc9a45aee0f9c16b7731a (diff)
rcar-gen3: weston: Backport fix patch for Weston crashes issue
This backports the fix from [1]: Without universal plane, the weston crashes with null pointer access in set_gbm_format function because that function called before output enable function. By changing timing to set color format for primary plane in this case, this issue fixes. [1]: https://cgit.freedesktop.org/wayland/weston/commit/?id=51048463dae4ace13776bb77675316007083a6ee Signed-off-by: Khang Nguyen <khang.nguyen.xw@renesas.com> Signed-off-by: Takamitsu Honda <takamitsu.honda.pv@renesas.com> Change-Id: Ia09b3f5bc0bf41b22b2210e2eea56913b4264761
-rw-r--r--meta-rcar-gen3/recipes-graphics/wayland/weston/0001-drm-change-timing-to-set-color-format-for-primary-pl.patch49
-rw-r--r--meta-rcar-gen3/recipes-graphics/wayland/weston_%.bbappend6
2 files changed, 55 insertions, 0 deletions
diff --git a/meta-rcar-gen3/recipes-graphics/wayland/weston/0001-drm-change-timing-to-set-color-format-for-primary-pl.patch b/meta-rcar-gen3/recipes-graphics/wayland/weston/0001-drm-change-timing-to-set-color-format-for-primary-pl.patch
new file mode 100644
index 0000000..2c797df
--- /dev/null
+++ b/meta-rcar-gen3/recipes-graphics/wayland/weston/0001-drm-change-timing-to-set-color-format-for-primary-pl.patch
@@ -0,0 +1,49 @@
+From 51048463dae4ace13776bb77675316007083a6ee Mon Sep 17 00:00:00 2001
+From: Tomohito Esaki <etom@igel.co.jp>
+Date: Mon, 30 Mar 2020 17:10:54 +0900
+Subject: [PATCH] drm: change timing to set color format for primary plane
+ without universal plane
+
+Without universal plane, the weston crashes with null pointer access in
+set_gbm_format function because that function called before output
+enable function. By changing timing to set color format for primary
+plane in this case, this issue fixes.
+
+Signed-off-by: Tomohito Esaki <etom@igel.co.jp>
+---
+ libweston/backend-drm/drm.c | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/libweston/backend-drm/drm.c b/libweston/backend-drm/drm.c
+index 3c5ca65..2aea82f 100644
+--- a/libweston/backend-drm/drm.c
++++ b/libweston/backend-drm/drm.c
+@@ -1389,12 +1389,6 @@ drm_output_set_gbm_format(struct weston_output *base,
+
+ if (parse_gbm_format(gbm_format, b->gbm_format, &output->gbm_format) == -1)
+ output->gbm_format = b->gbm_format;
+-
+- /* Without universal planes, we can't discover which formats are
+- * supported by the primary plane; we just hope that the GBM format
+- * works. */
+- if (!b->universal_planes)
+- output->scanout_plane->formats[0].format = output->gbm_format;
+ }
+
+ static void
+@@ -1626,6 +1620,12 @@ drm_output_init_crtc(struct drm_output *output, drmModeRes *resources)
+ goto err_crtc;
+ }
+
++ /* Without universal planes, we can't discover which formats are
++ * supported by the primary plane; we just hope that the GBM format
++ * works. */
++ if (!b->universal_planes)
++ output->scanout_plane->formats[0].format = output->gbm_format;
++
+ /* Failing to find a cursor plane is not fatal, as we'll fall back
+ * to software cursor. */
+ output->cursor_plane =
+--
+2.7.4
+
diff --git a/meta-rcar-gen3/recipes-graphics/wayland/weston_%.bbappend b/meta-rcar-gen3/recipes-graphics/wayland/weston_%.bbappend
index 4fab566..c2f75af 100644
--- a/meta-rcar-gen3/recipes-graphics/wayland/weston_%.bbappend
+++ b/meta-rcar-gen3/recipes-graphics/wayland/weston_%.bbappend
@@ -1,6 +1,12 @@
require include/gles-control.inc
require include/multimedia-control.inc
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+SRC_URI_append_rcar-gen3 = " \
+ file://0001-drm-change-timing-to-set-color-format-for-primary-pl.patch \
+"
+
PACKAGECONFIG_remove_virtclass-multilib-lib32 = "launch"
DEPENDS_append_rcar-gen3 = " \