Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp2219447pxb; Fri, 25 Mar 2022 13:16:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzQSEMjOouXXMLSe8WaG29JdBJ1nRSg4wy7bw0ZSvGmv9aqfC1lVmq6Nq6+Ki/WpdsAkOoQ X-Received: by 2002:a17:90a:1d05:b0:1bf:6a85:fbf5 with SMTP id c5-20020a17090a1d0500b001bf6a85fbf5mr14310429pjd.205.1648239415995; Fri, 25 Mar 2022 13:16:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648239415; cv=none; d=google.com; s=arc-20160816; b=hyRzjWv887UckvVWO+JsS9keDzWfDthAZTb2DqJqhFGH+Uava20uJHya/y319Yn3Hj jGZIzkuNDZ2SLEjMs9CTdKxs9ZpPC8Th8mY/zEXvvQA3m8XGYhHQH/EuWHSskzoTyn4B BkD6z6P406qbJrXhx7GHJpOwpHq5HiwfC3jrr3eaU+yJ0UBe2+UzZ4TsTXW4Xt/RK+6n NiQJ1qF7IouZ4hPVa/LUoKN3YrBB+GPhXQPa/y21JhHFG4uhjAYpNgE+JkkZAovlITzx OyH+RXW9EpZADPH63u7Uewnf842jHXnQGYRFLe34D6PeXD7guBB1cmzAt6dI+65mVYe9 Fu6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=xVjY+0+WQdrpFP0Z4+mXCq1mql+ycXs6eG3CZHDrAmU=; b=JciEsijQWk7DMUzbPwjGnDcQlxLojMKoEKm7M8I6XH805t4hjE70DGQi1/Q7+hdVxq N0G41gaHiB8/pZDbqO+kTAsAhzVh/J1IyWhKeOQjAuaBtCNMA0saGFDZQ84/pY6bLqW+ KCsv8M5WyYgErygcC+fXNNcLhCWx0XFAkCmQPp27xC17eoxHF/uWVtNewWy9GHIPs6uv FqT62w9AN6mJ6wZLw2Os5MN4ZF0TfBu+eMbpeeY6HQFUdSQc6JydGEqPUWs0YZusAsdl PWxHy73XnDXL9E4zX3E3V3kt1nYJVd/UexOVmt3VmoJwRxdEUPLHAXerFxhGHvANmuAO 1TRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=lojiQifx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id z13-20020a63e54d000000b003816043eea5si3318690pgj.154.2022.03.25.13.16.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Mar 2022 13:16:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=lojiQifx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 630D3280ED3; Fri, 25 Mar 2022 12:24:21 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229474AbiCYTZu (ORCPT + 99 others); Fri, 25 Mar 2022 15:25:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229457AbiCYTZt (ORCPT ); Fri, 25 Mar 2022 15:25:49 -0400 Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DEC4D3DFD05 for ; Fri, 25 Mar 2022 11:57:42 -0700 (PDT) Received: by mail-ej1-x633.google.com with SMTP id yy13so17156449ejb.2 for ; Fri, 25 Mar 2022 11:57:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=xVjY+0+WQdrpFP0Z4+mXCq1mql+ycXs6eG3CZHDrAmU=; b=lojiQifx8p87NyqVcH+S1qS6PCpqH5hv3kq4ooLqiFC6LxWDa9UgXn8DlfDAioSt1j KSAuBaTunUxouxmXWo2+15PDH/VN/ieCBsBJjuXFbc2xfnfwVCtSGvaagNNpTDQGdZgE GP918nP4FtvgObAnrg127i02SvnAsUwXRs55MBrgGN+iQOAb1f6li/1MjBa9/AIbQjcl mgniBgRiqj/I+/X+mqlQZ3Yf4r8wOKWKwWOdxvUj92XMj6UjWxYclsnxsu9WGd2BMtBK AKM5VkfdFaGTir6C62aKUl6BF7HJFlvGSMaTZIWstEg+TiHsrgU4JcvQ7X03/T8g0qeI 4+HA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=xVjY+0+WQdrpFP0Z4+mXCq1mql+ycXs6eG3CZHDrAmU=; b=2TabadfczzJhLbkVOQcbqhv4hAk0N4f42xQoNQQIIae082Hj4G2O68zK/qfqF7Tucx aRPjXYm5GCcE5oy+q6xwLWU2gvEl69mV0yTkt7fzXwKV207vAiKFrUeX4x4OlqmtVKgx 6tVwr/TcqxyqyGcjfwrOZRCJyNNcd+SrrDhSV/quYh++EeKX3m1RQJNrzBlvkRDR8+mY QA9AzkWWWcR/DVGfwsaJcvyc1MUQDbYkqz9/TV2F11wN2wmK3049U/d8afqSjgQdJsen iMyCEkgrCW1TCtyTl+6cusNZ7wqjrIswc02SM39kXc1BjkKEGpSQf2XI2mT2kNL7L1H9 e3ng== X-Gm-Message-State: AOAM5317fvUMnPGwHt8WygVOJdsM8rxZETsNPfa6NKQxq8/O/LaWwNBD m7t2JB5hvu1mEAKXi4TwzEDYfkmZT+E= X-Received: by 2002:ac2:57d4:0:b0:448:2cba:6c86 with SMTP id k20-20020ac257d4000000b004482cba6c86mr8667977lfo.201.1648230681400; Fri, 25 Mar 2022 10:51:21 -0700 (PDT) Received: from inno-pc.lan (88-115-161-74.elisa-laajakaista.fi. [88.115.161.74]) by smtp.gmail.com with ESMTPSA id h18-20020a056512339200b0044a2e5b94afsm777155lfg.56.2022.03.25.10.51.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Mar 2022 10:51:20 -0700 (PDT) From: Zhi Wang X-Google-Original-From: Zhi Wang To: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Zhi Wang Subject: [PATCH v7 0/3] Refactor GVT-g MMIO tracking table and handlers Date: Fri, 25 Mar 2022 13:51:13 -0400 Message-Id: <20220325175116.167097-1-zhi.a.wang@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org To support the new mdev interfaces and the re-factor patches from Christoph, which moves the GVT-g code into a dedicated module, the GVT-g initialization path has to be separated into two phases: a) Early initialization. The early initialization of GVT requires to be done when loading i915. Mostly it's because the initial clean HW state needs to be saved before i915 touches the HW. b) Late initalization. This phases of initalization will setup the rest components of GVT-g, which can be done later when the dedicated module is being loaded. To initialize the GVT-g MMIO tracking table in the early initalization stage, which will be done in i915, the GVT-g MMIO tracking table needs to be sperated accordingly and moved into i915. v7: - Keep the marcos of device generation in GVT-g. (Christoph, Jani) v6: - Move the mmio_table.c into i915. (Christoph) - Keep init_device_info and related structures in GVT-g. (Christoph) - Refine the callbacks of the iterator. (Christoph) - Move the flags of MMIO register defination to GVT-g. (Chrsitoph) - Move the mmio block handling to GVT-g. v5: - Re-design the mmio table framework. (Christoph) v4: - Fix the errors of patch checking scripts. v3: - Fix the errors when CONFIG_DRM_I915_WERROR is turned on. (Jani) v2: - Implement a mmio table instead of generating it by marco in i915. (Jani) Zhi Wang (3): i915/gvt: Separate the MMIO tracking table from GVT-g i915/gvt: Save the initial HW state snapshot in i915 i915/gvt: Use the initial HW state snapshot saved in i915 drivers/gpu/drm/i915/Makefile | 2 +- drivers/gpu/drm/i915/gvt/firmware.c | 25 +- drivers/gpu/drm/i915/gvt/gvt.h | 3 +- drivers/gpu/drm/i915/gvt/handlers.c | 1031 ++------------- drivers/gpu/drm/i915/gvt/mmio.h | 1 - drivers/gpu/drm/i915/gvt/reg.h | 9 +- drivers/gpu/drm/i915/i915_drv.h | 2 + drivers/gpu/drm/i915/intel_gvt.c | 92 +- drivers/gpu/drm/i915/intel_gvt.h | 21 + drivers/gpu/drm/i915/intel_gvt_mmio_table.c | 1308 +++++++++++++++++++ 10 files changed, 1577 insertions(+), 917 deletions(-) create mode 100644 drivers/gpu/drm/i915/intel_gvt_mmio_table.c -- 2.25.1