From babb8d18c34acac959bc754a6948ac73d494532b Mon Sep 17 00:00:00 2001 From: Junil Kim Date: Tue, 30 Apr 2019 09:34:00 +0900 Subject: [PATCH] virgl: Fix flush in virgl_encoder_inline_write :Release Notes: Fix buggy code which makes a zero data length command. :Detailed Notes: Original upstream's patch is the following git-commit-id. 04e278f79334c36f2afa315d3dcfcbec055a4d2a :Testing Performed: Build OK. :QA Notes: N/A :Issues Addressed: [CHNSDK-11405] Fix a virgl issue --- ...ting-a-zero-data-length-command-case.patch | 25 +++++++++++++++++++ .../recipes-graphics/mesa/mesa_%.bbappend | 4 +++ 2 files changed, 29 insertions(+) create mode 100644 meta-webos/recipes-graphics/mesa/mesa/0001-Preventing-a-zero-data-length-command-case.patch diff --git a/meta-webos/recipes-graphics/mesa/mesa/0001-Preventing-a-zero-data-length-command-case.patch b/meta-webos/recipes-graphics/mesa/mesa/0001-Preventing-a-zero-data-length-command-case.patch new file mode 100644 index 000000000..45ea3f736 --- /dev/null +++ b/meta-webos/recipes-graphics/mesa/mesa/0001-Preventing-a-zero-data-length-command-case.patch @@ -0,0 +1,25 @@ +From be27e07c6883b0aa23c39d375bf4da15e82869eb Mon Sep 17 00:00:00 2001 +From: Junil Kim +Date: Tue, 30 Apr 2019 09:17:06 +0900 +Subject: [PATCH] Preventing a zero data length command case + +--- + src/gallium/drivers/virgl/virgl_encode.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/gallium/drivers/virgl/virgl_encode.c b/src/gallium/drivers/virgl/virgl_encode.c +index cbe8d19..733da94 100644 +--- a/src/gallium/drivers/virgl/virgl_encode.c ++++ b/src/gallium/drivers/virgl/virgl_encode.c +@@ -510,7 +510,7 @@ int virgl_encoder_inline_write(struct virgl_context *ctx, + + left_bytes = size; + while (left_bytes) { +- if (ctx->cbuf->cdw + 12 > VIRGL_MAX_CMDBUF_DWORDS) ++ if (ctx->cbuf->cdw + 12 >= VIRGL_MAX_CMDBUF_DWORDS) + ctx->base.flush(&ctx->base, NULL, 0); + + thispass = (VIRGL_MAX_CMDBUF_DWORDS - ctx->cbuf->cdw - 12) * 4; +-- +2.17.1 + diff --git a/meta-webos/recipes-graphics/mesa/mesa_%.bbappend b/meta-webos/recipes-graphics/mesa/mesa_%.bbappend index d36143e6c..4bff8422d 100644 --- a/meta-webos/recipes-graphics/mesa/mesa_%.bbappend +++ b/meta-webos/recipes-graphics/mesa/mesa_%.bbappend @@ -4,6 +4,10 @@ EXTENDPRAUTO_append = "webos1" FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:" +SRC_URI_append_qemuall = " \ + file://0001-Preventing-a-zero-data-length-command-case.patch \ + " + # Add gallium, gallium-llvmpipe, opengl and enable wayland even without wayland in DISTRO_FEATURES PACKAGECONFIG_qemuall = "opengl gbm egl gles dri wayland gallium"