Skip to content

Commit

Permalink
virgl: Fix flush in virgl_encoder_inline_write
Browse files Browse the repository at this point in the history
: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
  • Loading branch information
sparkleholic committed Apr 30, 2019
1 parent 288cff4 commit dd1ed7f
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
From be27e07c6883b0aa23c39d375bf4da15e82869eb Mon Sep 17 00:00:00 2001
From: Junil Kim <[email protected]>
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

4 changes: 4 additions & 0 deletions meta-webos/recipes-graphics/mesa/mesa_%.bbappend
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ EXTENDPRAUTO_append = "webos1"

FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:"

SRC_URI_append_qemuxall = " \
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"

Expand Down

0 comments on commit dd1ed7f

Please sign in to comment.