From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.3 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 14E41C433E3 for ; Mon, 24 Aug 2020 18:42:22 +0000 (UTC) Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D9EF02075B for ; Mon, 24 Aug 2020 18:42:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="KwlyeuB0" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D9EF02075B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=iommu-bounces@lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id CA4E9875A1; Mon, 24 Aug 2020 18:42:21 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ckkNDQnCJ4is; Mon, 24 Aug 2020 18:42:21 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by whitealder.osuosl.org (Postfix) with ESMTP id 5A7CB8758B; Mon, 24 Aug 2020 18:42:21 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 47915C016F; Mon, 24 Aug 2020 18:42:21 +0000 (UTC) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 6AB7DC0051 for ; Mon, 24 Aug 2020 18:42:19 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 66E0785B4A for ; Mon, 24 Aug 2020 18:42:19 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bQeV1OoLaERV for ; Mon, 24 Aug 2020 18:42:18 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pf1-f193.google.com (mail-pf1-f193.google.com [209.85.210.193]) by fraxinus.osuosl.org (Postfix) with ESMTPS id EA0FA85B94 for ; Mon, 24 Aug 2020 18:42:18 +0000 (UTC) Received: by mail-pf1-f193.google.com with SMTP id m71so5320202pfd.1 for ; Mon, 24 Aug 2020 11:42:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=qzWQCEAvxCv0hKpjyi842jRFwqaWI9Jm91Nndi5IFE8=; b=KwlyeuB0tEDm/a2EZ0NhqVfKxnkgghXFNQHEb7kaRzY8NOp4BYLBGQpp5a5wKlwBOT L9rAt9AT5+mQvkv0AykyB53qBc1xGbpJrptm+JZEmf8vQYwa8Dnt0hCFACf9hMdWkqp7 JxcNvEaqyyAvjlN6PQ/Bjh6CF9Ycun+BoUZFTH62XDdNTGyXGmO0S651znH0wFRz2Zww sXYANT+7Yp+37dB89pFEZzoCKsRJMWxWU9AXEseW6pMZTG6i8AoHNbOl7kokLvfkvNp8 U07LanP70VaclSMo575cM7YkYtmDgKv+CnUvfHTwuPIrhVE5iOeR2FVlyIzfAuw8arhM 5hNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qzWQCEAvxCv0hKpjyi842jRFwqaWI9Jm91Nndi5IFE8=; b=k9DBRo/cmZHbA5XdOWgsGceaawBorkMhLX3WquY/lfeL28KWJXRPiu2RAC95Q2OX7p pnRKcM6CF0Usocu7RWV+PJ921EMHQyM3EPSV1E1gG51hH0JPNWbqc7izO6EAyDHy2vuo TrmEkZQxDV9knHunlrClRpT6iYy0gI3VY31MttFKbZZUaSfXjMbDnWDPnf3qUWbqOJ5R Y04RPe1BdzAJpXxY3Qk1iveYRLtAJOPtlXrMso3ID89Q6Erokd9HvvkvocDtkG5P5PY8 TM3D96oqUHjAJdU2fl0CFwH1WXoZS7u23/JYKhXxHJ/0NlQU3d/VUXykBJcWt9Qmq5MB upiA== X-Gm-Message-State: AOAM530vrYh3FTR8pQAcc+hJc5AlN52fkIRz9fkcZy/o4rD10oObWZ4O 1XkW5gyfRuOis9ACuRTo7f4= X-Google-Smtp-Source: ABdhPJxSjEDwmjmh8UxD0TCGAsX4kaChXpZTTFF2qPQgFhL258x4Gj0h3d6KlPMcds/+HCtuRW2wXw== X-Received: by 2002:a63:1704:: with SMTP id x4mr4038217pgl.186.1598294538284; Mon, 24 Aug 2020 11:42:18 -0700 (PDT) Received: from localhost ([2601:1c0:5200:a6:307:a401:7b76:c6e5]) by smtp.gmail.com with ESMTPSA id a19sm12255705pfn.10.2020.08.24.11.42.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Aug 2020 11:42:17 -0700 (PDT) From: Rob Clark To: dri-devel@lists.freedesktop.org, iommu@lists.linux-foundation.org Subject: [PATCH 07/20] drm/msm: set adreno_smmu as gpu's drvdata Date: Mon, 24 Aug 2020 11:37:41 -0700 Message-Id: <20200824183825.1778810-8-robdclark@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200824183825.1778810-1-robdclark@gmail.com> References: <20200824183825.1778810-1-robdclark@gmail.com> MIME-Version: 1.0 Cc: David Airlie , Akhil P Oommen , Eric Anholt , Vivek Gautam , AngeloGioacchino Del Regno , Will Deacon , Rob Clark , Jonathan Marek , Ben Dooks , Sibi Sankar , Brian Masney , Joerg Roedel , "open list:DRM DRIVER FOR MSM ADRENO GPU" , Sharat Masetty , Stephen Boyd , John Stultz , Sean Paul , freedreno@lists.freedesktop.org, open list , Daniel Vetter , Shawn Guo , Robin Murphy X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" From: Rob Clark This will be populated by adreno-smmu, to provide a way for coordinating enabling/disabling TTBR0 translation. Signed-off-by: Rob Clark Reviewed-by: Jordan Crouse --- drivers/gpu/drm/msm/adreno/adreno_device.c | 2 -- drivers/gpu/drm/msm/msm_gpu.c | 2 +- drivers/gpu/drm/msm/msm_gpu.h | 6 +++++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/msm/adreno/adreno_device.c b/drivers/gpu/drm/msm/adreno/adreno_device.c index 26664e1b30c0..58e03b20e1c7 100644 --- a/drivers/gpu/drm/msm/adreno/adreno_device.c +++ b/drivers/gpu/drm/msm/adreno/adreno_device.c @@ -417,8 +417,6 @@ static int adreno_bind(struct device *dev, struct device *master, void *data) return PTR_ERR(gpu); } - dev_set_drvdata(dev, gpu); - return 0; } diff --git a/drivers/gpu/drm/msm/msm_gpu.c b/drivers/gpu/drm/msm/msm_gpu.c index 6aa9e04e52e7..806eb0957280 100644 --- a/drivers/gpu/drm/msm/msm_gpu.c +++ b/drivers/gpu/drm/msm/msm_gpu.c @@ -892,7 +892,7 @@ int msm_gpu_init(struct drm_device *drm, struct platform_device *pdev, gpu->gpu_cx = NULL; gpu->pdev = pdev; - platform_set_drvdata(pdev, gpu); + platform_set_drvdata(pdev, &gpu->adreno_smmu); msm_devfreq_init(gpu); diff --git a/drivers/gpu/drm/msm/msm_gpu.h b/drivers/gpu/drm/msm/msm_gpu.h index 8bda7beaed4b..f91b141add75 100644 --- a/drivers/gpu/drm/msm/msm_gpu.h +++ b/drivers/gpu/drm/msm/msm_gpu.h @@ -7,6 +7,7 @@ #ifndef __MSM_GPU_H__ #define __MSM_GPU_H__ +#include #include #include #include @@ -73,6 +74,8 @@ struct msm_gpu { struct platform_device *pdev; const struct msm_gpu_funcs *funcs; + struct adreno_smmu_priv adreno_smmu; + /* performance counters (hw & sw): */ spinlock_t perf_lock; bool perfcntr_active; @@ -143,7 +146,8 @@ struct msm_gpu { static inline struct msm_gpu *dev_to_gpu(struct device *dev) { - return dev_get_drvdata(dev); + struct adreno_smmu_priv *adreno_smmu = dev_get_drvdata(dev); + return container_of(adreno_smmu, struct msm_gpu, adreno_smmu); } /* It turns out that all targets use the same ringbuffer size */ -- 2.26.2 _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu