From nobody Mon Feb 9 17:06:31 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1600091454; cv=none; d=zohomail.com; s=zohoarc; b=bypmS6k7Mx8x3d3gzSWe64UdEoidK+n52QN92S8aAlBccuzxpjRntq6WRMGzRy/VdcAKZouqoxm/6tRgkAH00npQje7YwE1L5kMGAHiB8cqHnPJ3G6H1te0A1YSLey2TkOdJuBiPHdFPqqHj31KB0kjNfb/vFbKvbbml93WQf8Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600091454; 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=tF8qpzdaZ/T6Te/ZEiZs8KXYQcEQMACXlftO9ZA3/MU=; b=nSpf/gZ2mAeAxJysCp1vgKcst+bjfgl47yXRhbBMe2FoPxyPClc3IbvTJcenNVhqUXMIdwNsHOLjTd4PrzEhwL8LimDvppYjRFEOkrm1hmfnGN1yHKOxdQMfNN7zchmP99tqPs+xKhliA6VFsioAOgVP/paimL0uQJdEN2wbdeU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1600091454647294.05967474652664; Mon, 14 Sep 2020 06:50:54 -0700 (PDT) Received: from localhost ([::1]:50296 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kHosf-0006EB-4D for importer@patchew.org; Mon, 14 Sep 2020 09:50:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34300) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kHokp-0002mt-AY for qemu-devel@nongnu.org; Mon, 14 Sep 2020 09:42:47 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:42224) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kHokm-00037D-AJ for qemu-devel@nongnu.org; Mon, 14 Sep 2020 09:42:47 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-526-CBhB85IvNTGaYlL1jsoW5g-1; Mon, 14 Sep 2020 09:42:41 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 24A8A1006701 for ; Mon, 14 Sep 2020 13:42:40 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-85.ams2.redhat.com [10.36.112.85]) by smtp.corp.redhat.com (Postfix) with ESMTP id C34627BE5B; Mon, 14 Sep 2020 13:42:33 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id C5BF131F73; Mon, 14 Sep 2020 15:42:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600090962; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tF8qpzdaZ/T6Te/ZEiZs8KXYQcEQMACXlftO9ZA3/MU=; b=L8pVlIeRo/Y6sTxoupCixDmo9GFPjQrE9Z7TPAs0e/60gWOVvqnwCIC+7PpDwShErWbKdu RYq8vCgdPGSnX78eSk9CvgqqUDaFDxeWUXsTfVlsXK5poL+BN7DB6tKy2HOqJ0DEkp+kL2 0eVx7PgbvmkWfeuEF2/vOLPJ7U/9BIQ= X-MC-Unique: CBhB85IvNTGaYlL1jsoW5g-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH v2 5/6] virtio-gpu: make virtio_gpu_ops static Date: Mon, 14 Sep 2020 15:42:23 +0200 Message-Id: <20200914134224.29769-6-kraxel@redhat.com> In-Reply-To: <20200914134224.29769-1-kraxel@redhat.com> References: <20200914134224.29769-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0.001 X-Mimecast-Originator: redhat.com 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=63.128.21.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/14 02:55:39 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -38 X-Spam_score: -3.9 X-Spam_bar: --- X-Spam_report: (-3.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.792, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Gerd Hoffmann , Eduardo Habkost , "Michael S. Tsirkin" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Reference it via ops pointer instead, simliar to the vga one. Removes hard symbol reference, needed to build virtio-gpu modular. Signed-off-by: Gerd Hoffmann --- include/hw/virtio/virtio-gpu.h | 3 +-- hw/display/virtio-gpu-base.c | 3 ++- hw/display/virtio-vga.c | 16 ++++++++-------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/hw/virtio/virtio-gpu.h b/include/hw/virtio/virtio-gpu.h index f334b780858c..6b45b4799a3e 100644 --- a/include/hw/virtio/virtio-gpu.h +++ b/include/hw/virtio/virtio-gpu.h @@ -106,6 +106,7 @@ struct VirtIOGPUBase { =20 struct virtio_gpu_base_conf conf; struct virtio_gpu_config virtio_config; + const GraphicHwOps *hw_ops; =20 bool use_virgl_renderer; int renderer_blocked; @@ -171,8 +172,6 @@ struct VhostUserGPU { bool backend_blocked; }; =20 -extern const GraphicHwOps virtio_gpu_ops; - #define VIRTIO_GPU_FILL_CMD(out) do { \ size_t s; \ s =3D iov_to_buf(cmd->elem.out_sg, cmd->elem.out_num, 0, \ diff --git a/hw/display/virtio-gpu-base.c b/hw/display/virtio-gpu-base.c index 796130860657..aeb87235420a 100644 --- a/hw/display/virtio-gpu-base.c +++ b/hw/display/virtio-gpu-base.c @@ -112,7 +112,7 @@ virtio_gpu_gl_block(void *opaque, bool block) } } =20 -const GraphicHwOps virtio_gpu_ops =3D { +static const GraphicHwOps virtio_gpu_ops =3D { .invalidate =3D virtio_gpu_invalidate_display, .gfx_update =3D virtio_gpu_update_display, .text_update =3D virtio_gpu_text_update, @@ -162,6 +162,7 @@ virtio_gpu_base_device_realize(DeviceState *qdev, g->req_state[0].width =3D g->conf.xres; g->req_state[0].height =3D g->conf.yres; =20 + g->hw_ops =3D &virtio_gpu_ops; for (i =3D 0; i < g->conf.max_outputs; i++) { g->scanout[i].con =3D graphic_console_init(DEVICE(g), i, &virtio_gpu_ops, g); diff --git a/hw/display/virtio-vga.c b/hw/display/virtio-vga.c index 573e7d59282a..f9410a0c2e61 100644 --- a/hw/display/virtio-vga.c +++ b/hw/display/virtio-vga.c @@ -13,7 +13,7 @@ static void virtio_vga_base_invalidate_display(void *opaq= ue) VirtIOGPUBase *g =3D vvga->vgpu; =20 if (g->enable) { - virtio_gpu_ops.invalidate(g); + g->hw_ops->invalidate(g); } else { vvga->vga.hw_ops->invalidate(&vvga->vga); } @@ -25,7 +25,7 @@ static void virtio_vga_base_update_display(void *opaque) VirtIOGPUBase *g =3D vvga->vgpu; =20 if (g->enable) { - virtio_gpu_ops.gfx_update(g); + g->hw_ops->gfx_update(g); } else { vvga->vga.hw_ops->gfx_update(&vvga->vga); } @@ -37,8 +37,8 @@ static void virtio_vga_base_text_update(void *opaque, con= sole_ch_t *chardata) VirtIOGPUBase *g =3D vvga->vgpu; =20 if (g->enable) { - if (virtio_gpu_ops.text_update) { - virtio_gpu_ops.text_update(g, chardata); + if (g->hw_ops->text_update) { + g->hw_ops->text_update(g, chardata); } } else { if (vvga->vga.hw_ops->text_update) { @@ -52,8 +52,8 @@ static int virtio_vga_base_ui_info(void *opaque, uint32_t= idx, QemuUIInfo *info) VirtIOVGABase *vvga =3D opaque; VirtIOGPUBase *g =3D vvga->vgpu; =20 - if (virtio_gpu_ops.ui_info) { - return virtio_gpu_ops.ui_info(g, idx, info); + if (g->hw_ops->ui_info) { + return g->hw_ops->ui_info(g, idx, info); } return -1; } @@ -63,8 +63,8 @@ static void virtio_vga_base_gl_block(void *opaque, bool b= lock) VirtIOVGABase *vvga =3D opaque; VirtIOGPUBase *g =3D vvga->vgpu; =20 - if (virtio_gpu_ops.gl_block) { - virtio_gpu_ops.gl_block(g, block); + if (g->hw_ops->gl_block) { + g->hw_ops->gl_block(g, block); } } =20 --=20 2.27.0