From patchwork Tue Jun 4 09:56:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 801405 Delivered-To: patch@linaro.org Received: by 2002:a5d:65c4:0:b0:35b:5a80:51b4 with SMTP id e4csp2313457wrw; Tue, 4 Jun 2024 03:00:34 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWrB5v1NgX7piAtqsV4GwAEqiRytPhziWJFm5MUFLlp7x2xASlv+SaykhfuPEqGwPt2g9Mj+WwbnzxOB6qE0HIc X-Google-Smtp-Source: AGHT+IEYvyKo4NkjGtoU8PSzG4kgmgcLmgj79XP+InvDrmKIseRU2u9LUpIs1HoXNT8/n+bBul+O X-Received: by 2002:a05:622a:1213:b0:43e:3d29:431d with SMTP id d75a77b69052e-43ff523a205mr150544411cf.14.1717495233878; Tue, 04 Jun 2024 03:00:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1717495233; cv=none; d=google.com; s=arc-20160816; b=OvuVtzHOol00w3pPgaew93IWNC/k5+11Qvc78bzIn1PWgrR6IR49Wumigw3pKLwaUj qUAJL/lhfh/BY17JinKRyzjyO2SooieLr0QMK1swmPld/lkXNUhsuAnZmh+mFpqSYrkF BIp6TrJmaD4LevnmCiBHJ7FQCGIzakOMYgB4SiPywAf0q+YxbLrmBAdq64jWQ94dWGJT Zbvq63GKpP2AgQNGoxNgXkFEWJBBHUL72UJ+3ifeDW2b2SMtOU3PIQSqW/ZteFR51PTe MHgA/1taXIZLm1rp7KoNyBWMDwW7n9sq+vkuCPlp5yHifeNUj70y1F6kgvTdVjzKk6xl o1/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=JSS7Auq4rjMzsXWfz5GZCQIt8zRmJ+DnGC7DTwkUw/o=; fh=g9mmjh55/wUFf9Wq0guPuyCdKaIT/2E6bcB1YTQY5Gg=; b=SFMcKBFQO3h6TPO59YKvLC1QdnpxH0P6en9dbmdwz7pxqJR2aYM4qbVimtJqzglduX UvvS+eiLboMhpcx3Qw1vyuzHhtHJOZHPE9Zyqj+OT0hpinYCuNVEEkXFBzEdOI2M6isn jbEJiSrP5qP8eOfCu3W/8iUti5DwLj2tjHZbg/yGZOL0iEHHxcslptiVo7r/bElfmUVt HHKXrMO8+T0op8xVYMLI5BFc/eGMtD4i+RiACUqaQ5YCzTu/S0l5rnZzq8suEZMh2s/L bcgpYsBUP3X0yaaQXW++Rx1j76kDxc1Vj7wqcmEntIq/CAnuDJEuqNahtLFwfKlcIciK 4HTA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gt9SidZV; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-43ff25b95f5si106860621cf.764.2024.06.04.03.00.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 04 Jun 2024 03:00:33 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gt9SidZV; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sEQwD-00063G-N9; Tue, 04 Jun 2024 05:58:41 -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 1sEQw8-0005qZ-ES for qemu-devel@nongnu.org; Tue, 04 Jun 2024 05:58:36 -0400 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sEQw5-0002KT-GI for qemu-devel@nongnu.org; Tue, 04 Jun 2024 05:58:36 -0400 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-4214fe0067fso3750185e9.1 for ; Tue, 04 Jun 2024 02:58:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717495111; x=1718099911; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=JSS7Auq4rjMzsXWfz5GZCQIt8zRmJ+DnGC7DTwkUw/o=; b=gt9SidZVNko3upKcRpipSjF5pYz7twkzxZhDl2BhJ+xZ5usTBIp91e5cKQJu2Ntd3s ylKi07E9O5MkCu/dNNhdp6wI27ALTXvLtLsAxnD3rXy39tDsVEq9rLBsBjPTQ2NjJNFc 96EHK5/NyQUUbCYIpM/DqqF3uj+4BMWl9j3WIaa+51KkoIa18bcIVZJDpb8TLYprfD6d 5Y9BdjpH5SEtZlbs45Rq2y+z06OfSUtFmpjJzxlpltKVRetfE1VelvZiygR4H1aVLqmK Ha63BdIwOKwxlmNZzsvvGY6yMJRrfMnYO5JXP2QhFpy4N3MCXpb8H8JHkk6nIczsxhEY mLCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717495111; x=1718099911; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JSS7Auq4rjMzsXWfz5GZCQIt8zRmJ+DnGC7DTwkUw/o=; b=ZuAW6sHaoppCTKXyHyOc89ffR8UexJLKODs6dYkbPYVVIeYTgMqN68yrMWkhbPwaUC MRjBY2LKyPiW61RaPcyRUHvU0x4iUPF8+UQBrWlyrQ4VgH23GBR2VDbWS4bCSj7hE7Pz 93gHG7v1uP3v7hYDL4xNVnC3SeI7ZoTn6LvOS0/WYEKW6QHgcFvrWNSIApbYQUif9v+0 or1RUUmie+jdCUf97CXdlU7UWWVqiKD/rpg2Z/Z9iZf6PoSPM5H1Cs0iuiY0j2Cr/ejR +YMtRILFqrDURyNmjsrzqGtRP/fPLq6Jt0ybBVWNnd4KBWTthwgEElaM2ezOuk7zdcWd X11A== X-Gm-Message-State: AOJu0YxAtNrDvoq94+kZ1YVzkhQcCluj3lNw9sK1z2RqQHoqUlAZ73zr KfHmGLDgG4B5+vAP0HvVnaszqVPV8RU3ofvvL0lE6M/z36iPHi+PYA7ib04xFb1Lubh8pLspXRK h X-Received: by 2002:a5d:58c3:0:b0:35e:81b0:e28f with SMTP id ffacd0b85a97d-35e81b0e4efmr299450f8f.40.1717495111682; Tue, 04 Jun 2024 02:58:31 -0700 (PDT) Received: from m1x-phil.lan ([176.176.159.34]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-35dd04c0d6csm11105972f8f.1.2024.06.04.02.58.30 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 04 Jun 2024 02:58:31 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Paul Durrant Subject: [PULL 26/32] hw/xen: Register framebuffer backend via xen_backend_init() Date: Tue, 4 Jun 2024 11:56:02 +0200 Message-ID: <20240604095609.12285-27-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240604095609.12285-1-philmd@linaro.org> References: <20240604095609.12285-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=philmd@linaro.org; helo=mail-wm1-x336.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Align the framebuffer backend with the other legacy ones, register it via xen_backend_init() when '-vga xenfb' is used. It is safe because MODULE_INIT_XEN_BACKEND is called in xen_bus_realize(), long after CLI processing initialized the vga_interface_type variable. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Paul Durrant Message-Id: <20240510104908.76908-8-philmd@linaro.org> --- include/hw/xen/xen-legacy-backend.h | 3 --- hw/display/xenfb.c | 9 +++++++-- hw/xenpv/xen_machine_pv.c | 2 -- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/hw/xen/xen-legacy-backend.h b/include/hw/xen/xen-legacy-backend.h index e55a14057f..943732b8d1 100644 --- a/include/hw/xen/xen-legacy-backend.h +++ b/include/hw/xen/xen-legacy-backend.h @@ -66,9 +66,6 @@ static inline void xen_be_unmap_grant_ref(struct XenLegacyDevice *xendev, return xen_be_unmap_grant_refs(xendev, ptr, &ref, 1); } -/* backend drivers not included in all machines */ -extern const struct XenDevOps xen_framebuffer_ops; /* xenfb.c */ - /* configuration (aka xenbus setup) */ void xen_config_cleanup(void); int xen_config_dev_vfb(int vdev, const char *type); diff --git a/hw/display/xenfb.c b/hw/display/xenfb.c index b6d370bdf6..ff442ced1a 100644 --- a/hw/display/xenfb.c +++ b/hw/display/xenfb.c @@ -29,6 +29,7 @@ #include "ui/input.h" #include "ui/console.h" +#include "sysemu/sysemu.h" #include "hw/xen/xen-legacy-backend.h" #include "hw/xen/interface/io/fbif.h" @@ -996,8 +997,12 @@ static const GraphicHwOps xenfb_ops = { .ui_info = xenfb_ui_info, }; -static void xen_vkbd_register_backend(void) +static void xen_ui_register_backend(void) { xen_be_register("vkbd", &xen_kbdmouse_ops); + + if (vga_interface_type == VGA_XENFB) { + xen_be_register("vfb", &xen_framebuffer_ops); + } } -xen_backend_init(xen_vkbd_register_backend); +xen_backend_init(xen_ui_register_backend); diff --git a/hw/xenpv/xen_machine_pv.c b/hw/xenpv/xen_machine_pv.c index b500ce0989..24395f42cb 100644 --- a/hw/xenpv/xen_machine_pv.c +++ b/hw/xenpv/xen_machine_pv.c @@ -50,8 +50,6 @@ static void xen_init_pv(MachineState *machine) break; } - xen_be_register("vfb", &xen_framebuffer_ops); - /* configure framebuffer */ if (vga_interface_type == VGA_XENFB) { xen_config_dev_vfb(0, "vnc");