From patchwork Fri Jun 7 13:18:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 10981845 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1296414E5 for ; Fri, 7 Jun 2019 13:21:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 01DBA2881B for ; Fri, 7 Jun 2019 13:21:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E9FA828A1F; Fri, 7 Jun 2019 13:21:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.47]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C2ED328AAB for ; Fri, 7 Jun 2019 13:21:30 +0000 (UTC) Received: from localhost ([::1]:51066 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hZEoE-0000uo-4Z for patchwork-qemu-devel@patchwork.kernel.org; Fri, 07 Jun 2019 09:21:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34445) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hZEm3-0007Oj-RQ for qemu-devel@nongnu.org; Fri, 07 Jun 2019 09:19:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hZEm2-0005GE-LY for qemu-devel@nongnu.org; Fri, 07 Jun 2019 09:19:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:14168) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hZEm2-0005CK-Cw for qemu-devel@nongnu.org; Fri, 07 Jun 2019 09:19:14 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B2F716EB97 for ; Fri, 7 Jun 2019 13:19:08 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-117-25.ams2.redhat.com [10.36.117.25]) by smtp.corp.redhat.com (Postfix) with ESMTP id 61A347FE99; Fri, 7 Jun 2019 13:19:03 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 00D3E17532; Fri, 7 Jun 2019 15:19:02 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Fri, 7 Jun 2019 15:18:57 +0200 Message-Id: <20190607131901.20107-2-kraxel@redhat.com> In-Reply-To: <20190607131901.20107-1-kraxel@redhat.com> References: <20190607131901.20107-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Fri, 07 Jun 2019 13:19:08 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 1/5] ui/curses: Fix build with -m32 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alex Williamson , Gerd Hoffmann , Max Reitz Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Max Reitz wchar_t may resolve to be an unsigned long on 32-bit architectures. Using the %x conversion specifier will then give a compiler warning: ui/curses.c: In function ‘get_ucs’: ui/curses.c:492:49: error: format ‘%x’ expects argument of type ‘unsigned int’, but argument 3 has type ‘wchar_t’ {aka ‘long int’} [-Werror=format=] 492 | fprintf(stderr, "Could not convert 0x%04x " | ~~~^ | | | unsigned int | %04lx 493 | "from wchar_t to a multibyte character: %s\n", 494 | wch, strerror(errno)); | ~~~ | | | wchar_t {aka long int} ui/curses.c:504:49: error: format ‘%x’ expects argument of type ‘unsigned int’, but argument 3 has type ‘wchar_t’ {aka ‘long int’} [-Werror=format=] 504 | fprintf(stderr, "Could not convert 0x%04x " | ~~~^ | | | unsigned int | %04lx 505 | "from a multibyte character to UCS-2 : %s\n", 506 | wch, strerror(errno)); | ~~~ | | | wchar_t {aka long int} Fix this by casting the wchar_t value to an unsigned long and using %lx as the conversion specifier. Fixes: b7b664a4fe9a955338f2e11a0f7433b29c8cbad0 Signed-off-by: Max Reitz Reviewed-by: Samuel Thibault Message-id: 20190527142540.23255-1-mreitz@redhat.com Signed-off-by: Gerd Hoffmann --- ui/curses.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ui/curses.c b/ui/curses.c index 1f3fcabb004b..e9319eb8ae19 100644 --- a/ui/curses.c +++ b/ui/curses.c @@ -489,9 +489,9 @@ static uint16_t get_ucs(wchar_t wch, iconv_t conv) memset(&ps, 0, sizeof(ps)); ret = wcrtomb(mbch, wch, &ps); if (ret == -1) { - fprintf(stderr, "Could not convert 0x%04x " + fprintf(stderr, "Could not convert 0x%04lx " "from wchar_t to a multibyte character: %s\n", - wch, strerror(errno)); + (unsigned long)wch, strerror(errno)); return 0xFFFD; } @@ -501,9 +501,9 @@ static uint16_t get_ucs(wchar_t wch, iconv_t conv) such = sizeof(uch); if (iconv(conv, &pmbch, &smbch, &puch, &such) == (size_t) -1) { - fprintf(stderr, "Could not convert 0x%04x " + fprintf(stderr, "Could not convert 0x%04lx " "from a multibyte character to UCS-2 : %s\n", - wch, strerror(errno)); + (unsigned long)wch, strerror(errno)); return 0xFFFD; } From patchwork Fri Jun 7 13:18:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 10981849 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2577492A for ; Fri, 7 Jun 2019 13:24:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1562E289EE for ; Fri, 7 Jun 2019 13:24:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 09FE028AF5; Fri, 7 Jun 2019 13:24:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.47]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id AFD2828A17 for ; Fri, 7 Jun 2019 13:24:19 +0000 (UTC) Received: from localhost ([::1]:51098 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hZEqx-000435-0r for patchwork-qemu-devel@patchwork.kernel.org; Fri, 07 Jun 2019 09:24:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34462) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hZEm5-0007R2-4G for qemu-devel@nongnu.org; Fri, 07 Jun 2019 09:19:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hZEm4-0005R3-4D for qemu-devel@nongnu.org; Fri, 07 Jun 2019 09:19:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58198) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hZEm3-0005KK-U7 for qemu-devel@nongnu.org; Fri, 07 Jun 2019 09:19:16 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 409E1CA36F for ; Fri, 7 Jun 2019 13:19:10 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-117-25.ams2.redhat.com [10.36.117.25]) by smtp.corp.redhat.com (Postfix) with ESMTP id E17F97DDF9; Fri, 7 Jun 2019 13:19:07 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 08F0F17534; Fri, 7 Jun 2019 15:19:02 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Fri, 7 Jun 2019 15:18:58 +0200 Message-Id: <20190607131901.20107-3-kraxel@redhat.com> In-Reply-To: <20190607131901.20107-1-kraxel@redhat.com> References: <20190607131901.20107-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 07 Jun 2019 13:19:10 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 2/5] console: add dmabuf modifier field. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alex Williamson , Gerd Hoffmann Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP dmabufs can have a format modifier (DRM_FORMAT_MOD_*) which is used for tiled layouts for example. Add a field to QemuDmaBuf so we can carry around that information. Signed-off-by: Gerd Hoffmann Reviewed-by: Marc-André Lureau Message-id: 20190529072144.26737-2-kraxel@redhat.com --- include/ui/console.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/ui/console.h b/include/ui/console.h index fef900db76a5..f9816968487c 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -175,6 +175,7 @@ typedef struct QemuDmaBuf { uint32_t height; uint32_t stride; uint32_t fourcc; + uint64_t modifier; uint32_t texture; bool y0_top; } QemuDmaBuf; From patchwork Fri Jun 7 13:18:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 10981843 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 79D3A924 for ; Fri, 7 Jun 2019 13:21:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6B03D288AE for ; Fri, 7 Jun 2019 13:21:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5F4DE28A1F; Fri, 7 Jun 2019 13:21:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.47]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1F48D288AE for ; Fri, 7 Jun 2019 13:21:23 +0000 (UTC) Received: from localhost ([::1]:51064 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hZEo6-0000o7-Cb for patchwork-qemu-devel@patchwork.kernel.org; Fri, 07 Jun 2019 09:21:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34428) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hZEm3-0007Nt-1o for qemu-devel@nongnu.org; Fri, 07 Jun 2019 09:19:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hZEm2-0005Dk-3f for qemu-devel@nongnu.org; Fri, 07 Jun 2019 09:19:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49698) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hZEm1-00057h-Te for qemu-devel@nongnu.org; Fri, 07 Jun 2019 09:19:14 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1EF0D3082145 for ; Fri, 7 Jun 2019 13:19:08 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-117-25.ams2.redhat.com [10.36.117.25]) by smtp.corp.redhat.com (Postfix) with ESMTP id 61B0A68C71; Fri, 7 Jun 2019 13:19:03 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 10D7117535; Fri, 7 Jun 2019 15:19:02 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Fri, 7 Jun 2019 15:18:59 +0200 Message-Id: <20190607131901.20107-4-kraxel@redhat.com> In-Reply-To: <20190607131901.20107-1-kraxel@redhat.com> References: <20190607131901.20107-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Fri, 07 Jun 2019 13:19:08 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 3/5] vfio/display: set dmabuf modifier field X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alex Williamson , Gerd Hoffmann Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Fill the new QemuDmaBuf->modifier field properly from plane info. Signed-off-by: Gerd Hoffmann Reviewed-by: Marc-André Lureau Acked-by: Alex Williamson Message-id: 20190529072144.26737-3-kraxel@redhat.com --- hw/vfio/display.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/vfio/display.c b/hw/vfio/display.c index 2c2d3e5b71d6..a5a608c5b226 100644 --- a/hw/vfio/display.c +++ b/hw/vfio/display.c @@ -248,6 +248,7 @@ static VFIODMABuf *vfio_display_get_dmabuf(VFIOPCIDevice *vdev, dmabuf->buf.height = plane.height; dmabuf->buf.stride = plane.stride; dmabuf->buf.fourcc = plane.drm_format; + dmabuf->buf.modifier = plane.drm_format_mod; dmabuf->buf.fd = fd; if (plane_type == DRM_PLANE_TYPE_CURSOR) { vfio_display_update_cursor(dmabuf, &plane); From patchwork Fri Jun 7 13:19:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 10981839 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9019714E5 for ; Fri, 7 Jun 2019 13:21:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 800B1288E5 for ; Fri, 7 Jun 2019 13:21:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 748B228A64; Fri, 7 Jun 2019 13:21:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.47]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 11F5A28C0B for ; Fri, 7 Jun 2019 13:21:18 +0000 (UTC) Received: from localhost ([::1]:51052 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hZEo2-0000eG-25 for patchwork-qemu-devel@patchwork.kernel.org; Fri, 07 Jun 2019 09:21:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34407) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hZEm1-0007ND-0F for qemu-devel@nongnu.org; Fri, 07 Jun 2019 09:19:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hZElz-00051W-Sr for qemu-devel@nongnu.org; Fri, 07 Jun 2019 09:19:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51102) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hZElz-0004uZ-Kw for qemu-devel@nongnu.org; Fri, 07 Jun 2019 09:19:11 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 64E3A3084213 for ; Fri, 7 Jun 2019 13:19:10 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-117-25.ams2.redhat.com [10.36.117.25]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6634D7DE35; Fri, 7 Jun 2019 13:19:03 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 1B78917536; Fri, 7 Jun 2019 15:19:02 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Fri, 7 Jun 2019 15:19:00 +0200 Message-Id: <20190607131901.20107-5-kraxel@redhat.com> In-Reply-To: <20190607131901.20107-1-kraxel@redhat.com> References: <20190607131901.20107-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Fri, 07 Jun 2019 13:19:10 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 4/5] egl-helpers: add modifier support to egl_get_fd_for_texture(). X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alex Williamson , Gerd Hoffmann Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Add modifier parameter to egl_get_fd_for_texture(), to return the used modifier on dmabuf exports. Signed-off-by: Gerd Hoffmann Message-id: 20190529072144.26737-4-kraxel@redhat.com --- include/ui/egl-helpers.h | 3 ++- ui/egl-helpers.c | 5 +++-- ui/spice-display.c | 7 ++++--- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/include/ui/egl-helpers.h b/include/ui/egl-helpers.h index b976cb872821..d71412779913 100644 --- a/include/ui/egl-helpers.h +++ b/include/ui/egl-helpers.h @@ -36,7 +36,8 @@ extern struct gbm_device *qemu_egl_rn_gbm_dev; extern EGLContext qemu_egl_rn_ctx; int egl_rendernode_init(const char *rendernode, DisplayGLMode mode); -int egl_get_fd_for_texture(uint32_t tex_id, EGLint *stride, EGLint *fourcc); +int egl_get_fd_for_texture(uint32_t tex_id, EGLint *stride, EGLint *fourcc, + EGLuint64KHR *modifier); void egl_dmabuf_import_texture(QemuDmaBuf *dmabuf); void egl_dmabuf_release_texture(QemuDmaBuf *dmabuf); diff --git a/ui/egl-helpers.c b/ui/egl-helpers.c index e90eef8c9c3a..0c9716067cfb 100644 --- a/ui/egl-helpers.c +++ b/ui/egl-helpers.c @@ -200,7 +200,8 @@ err: return -1; } -int egl_get_fd_for_texture(uint32_t tex_id, EGLint *stride, EGLint *fourcc) +int egl_get_fd_for_texture(uint32_t tex_id, EGLint *stride, EGLint *fourcc, + EGLuint64KHR *modifier) { EGLImageKHR image; EGLint num_planes, fd; @@ -214,7 +215,7 @@ int egl_get_fd_for_texture(uint32_t tex_id, EGLint *stride, EGLint *fourcc) } eglExportDMABUFImageQueryMESA(qemu_egl_display, image, fourcc, - &num_planes, NULL); + &num_planes, modifier); if (num_planes != 1) { eglDestroyImageKHR(qemu_egl_display, image); return -1; diff --git a/ui/spice-display.c b/ui/spice-display.c index a5e26479a866..104df2302575 100644 --- a/ui/spice-display.c +++ b/ui/spice-display.c @@ -888,7 +888,8 @@ static void spice_gl_switch(DisplayChangeListener *dcl, if (ssd->ds) { surface_gl_create_texture(ssd->gls, ssd->ds); fd = egl_get_fd_for_texture(ssd->ds->texture, - &stride, &fourcc); + &stride, &fourcc, + NULL); if (fd < 0) { surface_gl_destroy_texture(ssd->gls, ssd->ds); return; @@ -945,7 +946,7 @@ static void qemu_spice_gl_scanout_texture(DisplayChangeListener *dcl, int fd = -1; assert(tex_id); - fd = egl_get_fd_for_texture(tex_id, &stride, &fourcc); + fd = egl_get_fd_for_texture(tex_id, &stride, &fourcc, NULL); if (fd < 0) { fprintf(stderr, "%s: failed to get fd for texture\n", __func__); return; @@ -1063,7 +1064,7 @@ static void qemu_spice_gl_update(DisplayChangeListener *dcl, egl_fb_setup_new_tex(&ssd->blit_fb, dmabuf->width, dmabuf->height); fd = egl_get_fd_for_texture(ssd->blit_fb.texture, - &stride, &fourcc); + &stride, &fourcc, NULL); spice_qxl_gl_scanout(&ssd->qxl, fd, dmabuf->width, dmabuf->height, stride, fourcc, false); From patchwork Fri Jun 7 13:19:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 10981847 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C52F26C5 for ; Fri, 7 Jun 2019 13:24:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B38A528AAB for ; Fri, 7 Jun 2019 13:24:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A7CAF28C16; Fri, 7 Jun 2019 13:24:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.47]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 48BAB28C0C for ; Fri, 7 Jun 2019 13:24:16 +0000 (UTC) Received: from localhost ([::1]:51096 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hZEqt-0003vg-8H for patchwork-qemu-devel@patchwork.kernel.org; Fri, 07 Jun 2019 09:24:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34486) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hZEm6-0007UL-Et for qemu-devel@nongnu.org; Fri, 07 Jun 2019 09:19:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hZEm5-0005WW-FQ for qemu-devel@nongnu.org; Fri, 07 Jun 2019 09:19:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41296) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hZEm5-0005Te-A7 for qemu-devel@nongnu.org; Fri, 07 Jun 2019 09:19:17 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9B6BC6EB99 for ; Fri, 7 Jun 2019 13:19:11 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-117-25.ams2.redhat.com [10.36.117.25]) by smtp.corp.redhat.com (Postfix) with ESMTP id EEE221001B0C; Fri, 7 Jun 2019 13:19:08 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 2396A17538; Fri, 7 Jun 2019 15:19:02 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Fri, 7 Jun 2019 15:19:01 +0200 Message-Id: <20190607131901.20107-6-kraxel@redhat.com> In-Reply-To: <20190607131901.20107-1-kraxel@redhat.com> References: <20190607131901.20107-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Fri, 07 Jun 2019 13:19:11 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 5/5] egl-helpers: add modifier support to egl_dmabuf_import_texture() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alex Williamson , Gerd Hoffmann Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Check and use QemuDmaBuf->modifier in egl_dmabuf_import_texture() for dmabuf imports. Signed-off-by: Gerd Hoffmann Message-id: 20190529072144.26737-5-kraxel@redhat.com --- ui/egl-helpers.c | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/ui/egl-helpers.c b/ui/egl-helpers.c index 0c9716067cfb..edc53f6d3464 100644 --- a/ui/egl-helpers.c +++ b/ui/egl-helpers.c @@ -229,20 +229,36 @@ int egl_get_fd_for_texture(uint32_t tex_id, EGLint *stride, EGLint *fourcc, void egl_dmabuf_import_texture(QemuDmaBuf *dmabuf) { EGLImageKHR image = EGL_NO_IMAGE_KHR; - EGLint attrs[] = { - EGL_DMA_BUF_PLANE0_FD_EXT, dmabuf->fd, - EGL_DMA_BUF_PLANE0_PITCH_EXT, dmabuf->stride, - EGL_DMA_BUF_PLANE0_OFFSET_EXT, 0, - EGL_WIDTH, dmabuf->width, - EGL_HEIGHT, dmabuf->height, - EGL_LINUX_DRM_FOURCC_EXT, dmabuf->fourcc, - EGL_NONE, /* end of list */ - }; + EGLint attrs[64]; + int i = 0; if (dmabuf->texture != 0) { return; } + attrs[i++] = EGL_WIDTH; + attrs[i++] = dmabuf->width; + attrs[i++] = EGL_HEIGHT; + attrs[i++] = dmabuf->height; + attrs[i++] = EGL_LINUX_DRM_FOURCC_EXT; + attrs[i++] = dmabuf->fourcc; + + attrs[i++] = EGL_DMA_BUF_PLANE0_FD_EXT; + attrs[i++] = dmabuf->fd; + attrs[i++] = EGL_DMA_BUF_PLANE0_PITCH_EXT; + attrs[i++] = dmabuf->stride; + attrs[i++] = EGL_DMA_BUF_PLANE0_OFFSET_EXT; + attrs[i++] = 0; +#ifdef EGL_DMA_BUF_PLANE0_MODIFIER_LO_EXT + if (dmabuf->modifier) { + attrs[i++] = EGL_DMA_BUF_PLANE0_MODIFIER_LO_EXT; + attrs[i++] = (dmabuf->modifier >> 0) & 0xffffffff; + attrs[i++] = EGL_DMA_BUF_PLANE0_MODIFIER_HI_EXT; + attrs[i++] = (dmabuf->modifier >> 32) & 0xffffffff; + } +#endif + attrs[i++] = EGL_NONE; + image = eglCreateImageKHR(qemu_egl_display, EGL_NO_CONTEXT, EGL_LINUX_DMA_BUF_EXT,