From patchwork Fri Nov 25 15:40:28 2022 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: 628554 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp1190745pvb; Fri, 25 Nov 2022 07:41:57 -0800 (PST) X-Google-Smtp-Source: AA0mqf67JdDf9GfGtN9NsD/O+9PCRoSVfIvWiWFnwZ0iPlV9E9RINvt7M4fD3bPg3c3DvJIfMGN4 X-Received: by 2002:a37:c54:0:b0:6ee:82bf:188d with SMTP id 81-20020a370c54000000b006ee82bf188dmr33802780qkm.744.1669390917456; Fri, 25 Nov 2022 07:41:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669390917; cv=none; d=google.com; s=arc-20160816; b=LO3Ryvmkg7A6nq7cC6iRrHz2QnIjCv4jOF6HJ8k9u7S7algeFxC80/xWJYh+5hT6jy MFetuy/g4G2OvG1P+5TWwlGcowNfFFDlYBm/jZbXp54y/KZE0bMORNNZ9Ztes3rSr38Z Ln6ubyeXFpaP4pzrVmTgknqbfbtH6zm7Ljj384AUwmHzL7lrf4jib4U7HbZlmmMl/wXW OIo6yhRcOL0fIOD5seiKtEjiBEYuj+4pLzFJRRTkEwHn2V+rsdkVyKRToJUMinIpeOdy vGc/24fsCnEl6nXw9gMohGJ4Ncby7WZu2E6dWg0sh5HmeoSK35ogqD3qIdmfZwr3X5SD K2Ig== 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=vuC2Vc1/RmRd2o01cfm9ZesNvyFbkIRS/scjQ5wTRCY=; b=ZNAtM5IKVddtRI7pDFeoK7LkAoqX9NfHYdz6Mqo7+HQWJn6ex/e/JK3ogw2+JGfCmo jMZIC3RpsSqWf0s2k4CaD66a18qsBDtuhTZvIiGTTL2n3yjWZcJ54p2Z5vu5Fm3ErPuY OzgP1Cx1Eebfci6Tjbl4Pk5C2vQzm8bZohzKNrmMMopaOajJS8XM0wTXgJIjO+3p3HG/ 6Hxvm4H5PbQfkjA6nEb06U6Vf/J9xJm7TZONQhEkXctBQCSY9qrd0UedVxuqEp82idw6 k0l2cPh/VvVHzirblpCdvZ7n1gVx4L7ICUDWpJr+SRz8Rkuw5V+IOB1nkv5FroP6fVWa xGnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="I/9SQuXy"; 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 d5-20020ac80605000000b0039ceb3ab9f0si2244203qth.720.2022.11.25.07.41.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Nov 2022 07:41:57 -0800 (PST) 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="I/9SQuXy"; 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 1oyaop-0001gu-Vz; Fri, 25 Nov 2022 10:40:48 -0500 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 1oyaoo-0001gm-Ip for qemu-devel@nongnu.org; Fri, 25 Nov 2022 10:40:46 -0500 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oyaom-0005rp-MR for qemu-devel@nongnu.org; Fri, 25 Nov 2022 10:40:45 -0500 Received: by mail-wr1-x42d.google.com with SMTP id bs21so7317901wrb.4 for ; Fri, 25 Nov 2022 07:40:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=vuC2Vc1/RmRd2o01cfm9ZesNvyFbkIRS/scjQ5wTRCY=; b=I/9SQuXyN+iIGqpReDcRx2sFMzrF8TmVJWLrD00x/QDUTp1bRuJF6sr8M0wW1Q6gbZ Wla2WHSrGyfgTbc1Oy7X2cBtrqsodJoFgMqR5iYE+AxsZ8Whyg9IrQOSeMAcmgI6606C d89d4f1U/6DI9tbU35CXp6Re3JV8gwWc75fZGpRKJF48K/bcRt7kPGPYBCKe5NSsDCAW AIP2LkyQ3lYlWY5V+1Hoi+fY5itrMtJ1Y4XlPDPYnaB0twOuSEHc7s6Go1CbXmaJEimz 4XvNXWtQHQsw6t9DYqP40xYK2rFVy7rdtf3EBglnPbFZdlolSu9i4ciwRRY8LuPdtE2U G/5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=vuC2Vc1/RmRd2o01cfm9ZesNvyFbkIRS/scjQ5wTRCY=; b=3rZiohcnfSddd5TX7b9DHAdVmPnyjzL0kiysUsza7uDei3b7q0PcjdIx8y2CiPS70/ hb16KAXxt6JlybBUkPaeXPkXFkBqnRgdFuKRdHI5bKb5Jo6kDSGzdDWf1tNHXy7/ob+z Bpu3G2Z1UTgv0YfVDaEiW9xL+4mpdUkm7EdoxdPjNmliqnNKhuz8a2XCKruvEzWQsh18 tbCQUlqPQWLZUt5zxCQgA2MeXG+aJhoZagWCCLkjvbw3gzcZYJmkm74lB8OM7B2Axz/8 iDhTsXcSWlmJHpITh0kGZi71yNwrJVUtMclM5Eplh4PJaocCIfVi1i6B5xgvGUmAv5dW 1eLw== X-Gm-Message-State: ANoB5pkcHZ9cCoiPtpRrrgajzMIWpXknAOepNTGmZNov+8nKGyUBPJTq GJezm3UFwZVq8eTpJ4wgD3WcUZdypQsgVw== X-Received: by 2002:a5d:6b0e:0:b0:236:7439:61e7 with SMTP id v14-20020a5d6b0e000000b00236743961e7mr15787301wrw.611.1669390842989; Fri, 25 Nov 2022 07:40:42 -0800 (PST) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id r6-20020a05600c458600b003cfd4a50d5asm9933010wmo.34.2022.11.25.07.40.41 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 25 Nov 2022 07:40:42 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mauro Matteo Cascella , Gerd Hoffmann , Peter Maydell , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Alexander Bulekov , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [RFC PATCH-for-7.2 2/4] hw/display/qxl: Document qxl_phys2virt() Date: Fri, 25 Nov 2022 16:40:28 +0100 Message-Id: <20221125154030.42108-3-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221125154030.42108-1-philmd@linaro.org> References: <20221125154030.42108-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=philmd@linaro.org; helo=mail-wr1-x42d.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 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 Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Marc-André Lureau --- hw/display/qxl.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/hw/display/qxl.h b/hw/display/qxl.h index e74de9579d..78b3a6c9ba 100644 --- a/hw/display/qxl.h +++ b/hw/display/qxl.h @@ -147,6 +147,25 @@ OBJECT_DECLARE_SIMPLE_TYPE(PCIQXLDevice, PCI_QXL) #define QXL_DEFAULT_REVISION (QXL_REVISION_STABLE_V12 + 1) /* qxl.c */ +/** + * qxl_phys2virt: Get a pointer within a PCI VRAM memory region. + * + * @qxl: QXL device + * @phys: physical offset of buffer within the VRAM + * @group_id: memory slot group + * + * Returns a host pointer to a buffer placed at offset @phys within the + * active slot @group_id of the PCI VGA RAM memory region associated with + * the @qxl device. If the slot is inactive, or the offset is out + * of the memory region, returns NULL. + * + * Use with care; by the time this function returns, the returned pointer is + * not protected by RCU anymore. If the caller is not within an RCU critical + * section and does not hold the iothread lock, it must have other means of + * protecting the pointer, such as a reference to the region that includes + * the incoming ram_addr_t. + * + */ void *qxl_phys2virt(PCIQXLDevice *qxl, QXLPHYSICAL phys, int group_id); void qxl_set_guest_bug(PCIQXLDevice *qxl, const char *msg, ...) G_GNUC_PRINTF(2, 3);