From patchwork Fri Nov 24 19:47:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Konovalov X-Patchwork-Id: 119625 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp2659145qgn; Fri, 24 Nov 2017 11:48:07 -0800 (PST) X-Google-Smtp-Source: AGs4zMYxlKM0kUclEg/M333HQCpoaAkNJCjpGo9fc3q9MZH+hkMjiRMaMJAS4Oiv1Es/5EcuDevL X-Received: by 10.101.82.202 with SMTP id z10mr28929627pgp.404.1511552887598; Fri, 24 Nov 2017 11:48:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511552887; cv=none; d=google.com; s=arc-20160816; b=ENOx8K1FH1ZlHE8fbcCP9PqFwVjSzLtcYOQ5upxmIMeGbpQZEkA5MfFes3/WHMKetl 9DYcR2grR+IWVJoraG3ljsRFNVk+6bN54qEA8d7UKVm4Yp9Oe4a9nuySEdGJ2K/ffNRa tDG/8mZ0IzVVR8IUry6r4YzKjkQywAqA+0T49jgL3YguM4uc5Km6YNjoN+jg8nCHbXFC 7u3/Mbzc0DJv/AXJT+ZAcrBPe4b/+sBdopiNB1pFw0Vz8NJhJsFD4Jlu6paRJpju3B3x b7TJDueWYp2v20oA8YgEbz8WBFehmU3FGP/ilfK3wCE7Mo74DOc2blmU4ZqqKFlJtQ9G WylA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:dkim-signature :delivered-to:arc-authentication-results; bh=v1HhpI5zu0SctFtd+B7CdLeF/Twl0vWoBOXS2/JY3w4=; b=duji6tbqN+e4CMikG58PRymunW2zFsm6ALHN4O0HXRGxpa3judQzb+3YumnZHJ5SdB dyihaAe5JyEdCNitz2pxU7cV9vAIXSPdMnyd+9O4uWW0Q6WyuAWXCKE1q2GvjYS7whPA r23hYjJ8vJj3f8+OneePmPgaRUFXVwhD0tOT1x8YLiMH4TVSj7E4bfPUz4nce0mnF5Lf LJ0ujM6qeWY680kdt9j7FGLqBhYMV6qz7SkDwwhf8gzYm8/mIYzY/2AwqlAwKfB2ayLn f1RVUQWRx3WQIQK4e7uBEeb7kAgNUZY+CmkiXVtcRIvKJxQ+Bcm4VjEHb1zV5e6rNiv9 W46w== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Kj3sIotX; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id y12si18186023plt.757.2017.11.24.11.48.06; Fri, 24 Nov 2017 11:48:07 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) client-ip=140.211.169.62; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Kj3sIotX; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from review.yoctoproject.org (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id 2A760786BC; Fri, 24 Nov 2017 19:48:03 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-lf0-f48.google.com (mail-lf0-f48.google.com [209.85.215.48]) by mail.openembedded.org (Postfix) with ESMTP id 4314B71A50 for ; Fri, 24 Nov 2017 19:48:01 +0000 (UTC) Received: by mail-lf0-f48.google.com with SMTP id k66so26526879lfg.3 for ; Fri, 24 Nov 2017 11:48:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=fS4EZejR9fVZFBt83bSx2BqgJiRgapXo/EQhYpEfwaA=; b=Kj3sIotXsJYv2Zi+NkwgJiKtQxd4sZ9kV6/Mlb/WbVRKEdFiGZyrzgpSwTwGNjkcsv 23Z185/NBZGEbTRynJvsE3CtBwe0CRYfb40XlfHV52XnjJE87xjN1a5NGUtMyPFNWmwv UvtehbpU6FkXCoYTdbBtHFlh6hxsZ7Xf9vudc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=fS4EZejR9fVZFBt83bSx2BqgJiRgapXo/EQhYpEfwaA=; b=Y0z/Qv2z2JlHyNNevyAba217JLHYANnkiyu0R4XRlcIDCcInJ1Wy30sTVXZ/eUEfOr myYwI66FyMX76p3q4LU8TGUT1it0VFyH+mCFyPMn6mhXcScHc9hIyHRdMwfHb3Ly96sy MCQlu6VtaXDmstbXc6vgjyH6pi0knATQ7mMlatIH+y+sNzEP5cHEUW3z1EVBA0XCHmp+ CHsjoMkBCqql3LgPvdL14r+mQaLPZqB21xsCp6LCVsSR1J2iVHgVYIX6aFUa/d5OVec2 Ok38TlcDWDyTNOu0JihVe0aCzLtXRt2L+LA7QzTlpgDA9a6Me8VswEDznZPqlplZtYAP 2Gpg== X-Gm-Message-State: AJaThX7lwnaejx1d5DMPb/Y0LVwvfM8BXphT6Kndic/QDb0IP2u0cIFi rqr43msGyhBpd7MUGXmXIh6jsW/F4YM= X-Received: by 10.25.147.204 with SMTP id w73mr8996782lfk.210.1511552881985; Fri, 24 Nov 2017 11:48:01 -0800 (PST) Received: from ynk-TM8481.dev.rtsoft.ru ([62.117.114.130]) by smtp.googlemail.com with ESMTPSA id q124sm4648884ljb.38.2017.11.24.11.48.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 24 Nov 2017 11:48:01 -0800 (PST) From: Andrey Konovalov To: openembedded-core@lists.openembedded.org Date: Fri, 24 Nov 2017 22:47:26 +0300 Message-Id: <1511552846-1887-1-git-send-email-andrey.konovalov@linaro.org> X-Mailer: git-send-email 2.7.4 Subject: [OE-core] [rocko][PATCH] weston: add patch to set pitch correctly for subsampled textures X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: openembedded-core-bounces@lists.openembedded.org Errors-To: openembedded-core-bounces@lists.openembedded.org This fixes display issue with YUV420/I420 and NV12 formats, that can result in crash of weston. The master branch has this fix as part of commit 148920f3971d "weston: Bump version to 3.0.0". The patch has been rebased to apply cleanly to weston 2.0.0. Signed-off-by: Andrey Konovalov --- ...t-pitch-correctly-for-subsampled-textures.patch | 55 ++++++++++++++++++++++ meta/recipes-graphics/wayland/weston_2.0.0.bb | 1 + 2 files changed, 56 insertions(+) create mode 100644 meta/recipes-graphics/wayland/weston/weston-gl-renderer-Set-pitch-correctly-for-subsampled-textures.patch -- 2.7.4 -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core diff --git a/meta/recipes-graphics/wayland/weston/weston-gl-renderer-Set-pitch-correctly-for-subsampled-textures.patch b/meta/recipes-graphics/wayland/weston/weston-gl-renderer-Set-pitch-correctly-for-subsampled-textures.patch new file mode 100644 index 0000000..c188018 --- /dev/null +++ b/meta/recipes-graphics/wayland/weston/weston-gl-renderer-Set-pitch-correctly-for-subsampled-textures.patch @@ -0,0 +1,55 @@ +Multi-plane sub-sampled textures have partial width/height, e.g. +YUV420/I420 has a full-size Y plane, followed by a half-width/height U +plane, and a half-width/height V plane. + +zwp_linux_dmabuf_v1 allows clients to pass an explicit pitch for each +plane, but for wl_shm this must be inferred. gl-renderer was correctly +accounting for the width and height when subsampling, but the pitch was +being taken as the pitch for the first plane. + +This does not match the requirements for GStreamer's waylandsink, in +particular, as well as other clients. Fix the SHM upload path to +correctly set the pitch for each plane, according to subsampling. + +Tested with: + $ gst-launch-1.0 videotestsrc ! waylandsink + +Upstream-Status: Backport [https://patchwork.freedesktop.org/patch/180767/] + +Signed-off-by: Daniel Stone +Fixes: fdeefe42418 ("gl-renderer: add support of WL_SHM_FORMAT_YUV420") +Reported-by: Fabien Lahoudere +Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103063 + +--- + libweston/gl-renderer.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/libweston/gl-renderer.c b/libweston/gl-renderer.c +index 244ce309..40bf0bb6 100644 +--- a/libweston/gl-renderer.c ++++ b/libweston/gl-renderer.c +@@ -1285,14 +1285,13 @@ gl_renderer_flush_damage(struct weston_surface *surface) + goto done; + } + +- glPixelStorei(GL_UNPACK_ROW_LENGTH_EXT, gs->pitch); +- + if (gs->needs_full_upload) { + glPixelStorei(GL_UNPACK_SKIP_PIXELS_EXT, 0); + glPixelStorei(GL_UNPACK_SKIP_ROWS_EXT, 0); + wl_shm_buffer_begin_access(buffer->shm_buffer); + for (j = 0; j < gs->num_textures; j++) { + glBindTexture(GL_TEXTURE_2D, gs->textures[j]); ++ glPixelStorei(GL_UNPACK_ROW_LENGTH_EXT, gs->pitch / gs->hsub[j]); + glTexImage2D(GL_TEXTURE_2D, 0, + gs->gl_format[j], + gs->pitch / gs->hsub[j], +@@ -1317,6 +1316,7 @@ gl_renderer_flush_damage(struct weston_surface *surface) + glPixelStorei(GL_UNPACK_SKIP_ROWS_EXT, r.y1); + for (j = 0; j < gs->num_textures; j++) { + glBindTexture(GL_TEXTURE_2D, gs->textures[j]); ++ glPixelStorei(GL_UNPACK_ROW_LENGTH_EXT, gs->pitch / gs->hsub[j]); + glTexSubImage2D(GL_TEXTURE_2D, 0, + r.x1 / gs->hsub[j], + r.y1 / gs->vsub[j], diff --git a/meta/recipes-graphics/wayland/weston_2.0.0.bb b/meta/recipes-graphics/wayland/weston_2.0.0.bb index 54b07bd..063494c 100644 --- a/meta/recipes-graphics/wayland/weston_2.0.0.bb +++ b/meta/recipes-graphics/wayland/weston_2.0.0.bb @@ -12,6 +12,7 @@ SRC_URI = "https://wayland.freedesktop.org/releases/${BPN}-${PV}.tar.xz \ file://0001-configure.ac-Fix-wayland-protocols-path.patch \ file://xwayland.weston-start \ file://0001-weston-launch-Provide-a-default-version-that-doesn-t.patch \ + file://weston-gl-renderer-Set-pitch-correctly-for-subsampled-textures.patch \ " SRC_URI[md5sum] = "15f38945942bf2a91fe2687145fb4c7d" SRC_URI[sha256sum] = "b4e446ac27f118196f1609dab89bb3cb3e81652d981414ad860e733b355365d8"