From nobody Tue Feb 10 17:08:48 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass header.i=@intel.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1689222499; cv=none; d=zohomail.com; s=zohoarc; b=Ytoc0gddxvH6/EfnJJZlcbAWIfg2S4Q3EQc//xYK3OSRfeGfGa9QtWDyhuxmdY3yi5X5mnRbOe2UTi4i0nY4wuLvFOPAN9LlJm+SqJLv/DiGH1WdIa5zjEVlqz0V3MdywohuO/m8E7KIWU8RJwxumNRzPu+IncvzHI9hIAlHnQY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1689222499; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=YYURXYf9ZW8i4df1m2k+kgaNalaxvxw5X+rScPVheYM=; b=PFI0mqhuwB8x7W6ML4nyakDwJVuEj+rjP1R4MhUOJSQZnWh2yd5Tt4FKvWxnJruW1HwDeuGzVSq8scy1oMeadEIe/DwgwQvcSgh0rPz9TpbqlJCtz+4oX7M92SdAORS4HzBiEWRUvcJ++1zvo4KNxKyDUDTfuLX8gbItv//KI84= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=@intel.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1689222499399415.49821167263906; Wed, 12 Jul 2023 21:28:19 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qJnvR-0001Mh-1V; Thu, 13 Jul 2023 00:27:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qJnvP-0001MR-3y for qemu-devel@nongnu.org; Thu, 13 Jul 2023 00:27:31 -0400 Received: from mga06b.intel.com ([134.134.136.31] helo=mga06.intel.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qJnvJ-0000Yt-1g for qemu-devel@nongnu.org; Thu, 13 Jul 2023 00:27:30 -0400 Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jul 2023 21:27:21 -0700 Received: from dongwonk-z390-aorus-ultra-intel-gfx.fm.intel.com ([10.105.129.122]) by fmsmga007.fm.intel.com with ESMTP; 12 Jul 2023 21:27:21 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1689222445; x=1720758445; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=76t+NRma7/AM6uSkX3rnqWpfyMAhQ0AAZrgosHjTV4s=; b=A59BztH+zUaI24fSbEr5yJA//fnxLp9XJG7GvanbaUbnw5xySa8h49lY RkBB0j49vcqUgHtmCwRdGAYgbFDfth1o0Mi926vKscHViwXfiuCqXBjGy pRds0nYfNvZzeWpDcwVALZ0H62Cfn12tZeytbZPlxF6fx/5qP9PDIxePX AW0fURCVt7YhEogeQ4WpKHceWaIa29VYDKzBFMS6ibGs6N4ayWpojxk9n cXP8+kYTDUq7JJcTfFveiH5OKQ1eI/5e4SQN73UuYQ7PkfuKN5LH0CyHW WY6+7Hl59kCBB2xzklRN/s92GSNCk0U+EjYMMx2hbhIdPQbbrgqlmZJdk Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10769"; a="428831248" X-IronPort-AV: E=Sophos;i="6.01,201,1684825200"; d="scan'208";a="428831248" X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10769"; a="725150602" X-IronPort-AV: E=Sophos;i="6.01,201,1684825200"; d="scan'208";a="725150602" From: Dongwon Kim To: qemu-devel@nongnu.org Cc: Dongwon Kim , Gerd Hoffmann , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Vivek Kasireddy Subject: [PATCH] virtio-gpu-udmabuf: correct naming of QemuDmaBuf size properties Date: Wed, 12 Jul 2023 21:04:44 -0700 Message-Id: <20230713040444.32267-1-dongwon.kim@intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=134.134.136.31; envelope-from=dongwon.kim@intel.com; helo=mga06.intel.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @intel.com) X-ZM-MESSAGEID: 1689222501604100001 Replace 'width' and 'height' in QemuDmaBuf with 'backing_widht' and 'backing_height' as these commonly indicate the size of the whole surface (e.g. guest's Xorg extended display). Then use 'width' and 'height' for sub region in there (e.g. guest's scanouts). Cc: Gerd Hoffmann Cc: Marc-Andr=C3=A9 Lureau Cc: Vivek Kasireddy Signed-off-by: Dongwon Kim Reviewed-by: Marc-Andr=C3=A9 Lureau --- hw/display/virtio-gpu-udmabuf.c | 12 ++++++------ include/ui/console.h | 4 ++-- ui/dbus-listener.c | 8 ++++---- ui/egl-helpers.c | 8 ++++---- ui/gtk-egl.c | 8 ++++---- ui/gtk-gl-area.c | 6 +++--- 6 files changed, 23 insertions(+), 23 deletions(-) diff --git a/hw/display/virtio-gpu-udmabuf.c b/hw/display/virtio-gpu-udmabu= f.c index ef1a740de5..047758582c 100644 --- a/hw/display/virtio-gpu-udmabuf.c +++ b/hw/display/virtio-gpu-udmabuf.c @@ -181,13 +181,13 @@ static VGPUDMABuf } =20 dmabuf =3D g_new0(VGPUDMABuf, 1); - dmabuf->buf.width =3D fb->width; - dmabuf->buf.height =3D fb->height; + dmabuf->buf.width =3D r->width; + dmabuf->buf.height =3D r->height; dmabuf->buf.stride =3D fb->stride; dmabuf->buf.x =3D r->x; dmabuf->buf.y =3D r->y; - dmabuf->buf.scanout_width =3D r->width; - dmabuf->buf.scanout_height =3D r->height; + dmabuf->buf.backing_width =3D fb->width; + dmabuf->buf.backing_height =3D fb->height;; dmabuf->buf.fourcc =3D qemu_pixman_to_drm_format(fb->format); dmabuf->buf.fd =3D res->dmabuf_fd; dmabuf->buf.allow_fences =3D true; @@ -218,8 +218,8 @@ int virtio_gpu_update_dmabuf(VirtIOGPU *g, =20 g->dmabuf.primary[scanout_id] =3D new_primary; qemu_console_resize(scanout->con, - new_primary->buf.scanout_width, - new_primary->buf.scanout_height); + new_primary->buf.width, + new_primary->buf.height); dpy_gl_scanout_dmabuf(scanout->con, &new_primary->buf); =20 if (old_primary) { diff --git a/include/ui/console.h b/include/ui/console.h index f27b2aad4f..3e8b22d6c6 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -201,8 +201,8 @@ typedef struct QemuDmaBuf { uint32_t texture; uint32_t x; uint32_t y; - uint32_t scanout_width; - uint32_t scanout_height; + uint32_t backing_width; + uint32_t backing_height; bool y0_top; void *sync; int fence_fd; diff --git a/ui/dbus-listener.c b/ui/dbus-listener.c index 0240c39510..68ff343799 100644 --- a/ui/dbus-listener.c +++ b/ui/dbus-listener.c @@ -415,13 +415,13 @@ static void dbus_scanout_texture(DisplayChangeListene= r *dcl, backing_width, backing_height, x, y, w, h); #ifdef CONFIG_GBM QemuDmaBuf dmabuf =3D { - .width =3D backing_width, - .height =3D backing_height, + .width =3D w, + .height =3D h, .y0_top =3D backing_y_0_top, .x =3D x, .y =3D y, - .scanout_width =3D w, - .scanout_height =3D h, + .backing_width =3D backing_width, + .backing_height =3D backing_height, }; =20 assert(tex_id); diff --git a/ui/egl-helpers.c b/ui/egl-helpers.c index 8f9fbf583e..bc0960a9ec 100644 --- a/ui/egl-helpers.c +++ b/ui/egl-helpers.c @@ -148,8 +148,8 @@ void egl_fb_blit(egl_fb *dst, egl_fb *src, bool flip) if (src->dmabuf) { x1 =3D src->dmabuf->x; y1 =3D src->dmabuf->y; - w =3D src->dmabuf->scanout_width; - h =3D src->dmabuf->scanout_height; + w =3D src->dmabuf->width; + h =3D src->dmabuf->height; } =20 w =3D (x1 + w) > src->width ? src->width - x1 : w; @@ -314,9 +314,9 @@ void egl_dmabuf_import_texture(QemuDmaBuf *dmabuf) } =20 attrs[i++] =3D EGL_WIDTH; - attrs[i++] =3D dmabuf->width; + attrs[i++] =3D dmabuf->backing_width; attrs[i++] =3D EGL_HEIGHT; - attrs[i++] =3D dmabuf->height; + attrs[i++] =3D dmabuf->backing_height;; attrs[i++] =3D EGL_LINUX_DRM_FOURCC_EXT; attrs[i++] =3D dmabuf->fourcc; =20 diff --git a/ui/gtk-egl.c b/ui/gtk-egl.c index d59b8cd7d7..a37ad6c9db 100644 --- a/ui/gtk-egl.c +++ b/ui/gtk-egl.c @@ -258,9 +258,9 @@ void gd_egl_scanout_dmabuf(DisplayChangeListener *dcl, } =20 gd_egl_scanout_texture(dcl, dmabuf->texture, - dmabuf->y0_top, dmabuf->width, dmabuf->height, - dmabuf->x, dmabuf->y, dmabuf->scanout_width, - dmabuf->scanout_height, NULL); + dmabuf->y0_top, dmabuf->backing_width, dmabuf->= backing_height, + dmabuf->x, dmabuf->y, dmabuf->width, + dmabuf->height, NULL); =20 if (dmabuf->allow_fences) { vc->gfx.guest_fb.dmabuf =3D dmabuf; @@ -280,7 +280,7 @@ void gd_egl_cursor_dmabuf(DisplayChangeListener *dcl, if (!dmabuf->texture) { return; } - egl_fb_setup_for_tex(&vc->gfx.cursor_fb, dmabuf->width, dmabuf->he= ight, + egl_fb_setup_for_tex(&vc->gfx.cursor_fb, dmabuf->backing_width, dm= abuf->backing_height, dmabuf->texture, false); } else { egl_fb_destroy(&vc->gfx.cursor_fb); diff --git a/ui/gtk-gl-area.c b/ui/gtk-gl-area.c index 7367dfd793..ea3d50598e 100644 --- a/ui/gtk-gl-area.c +++ b/ui/gtk-gl-area.c @@ -299,9 +299,9 @@ void gd_gl_area_scanout_dmabuf(DisplayChangeListener *d= cl, } =20 gd_gl_area_scanout_texture(dcl, dmabuf->texture, - dmabuf->y0_top, dmabuf->width, dmabuf->heig= ht, - dmabuf->x, dmabuf->y, dmabuf->scanout_width, - dmabuf->scanout_height, NULL); + dmabuf->y0_top, dmabuf->backing_width, dmab= uf->backing_height, + dmabuf->x, dmabuf->y, dmabuf->width, + dmabuf->height, NULL); =20 if (dmabuf->allow_fences) { vc->gfx.guest_fb.dmabuf =3D dmabuf; --=20 2.20.1