From: Zhenyu Wang <zhenyu.z.wang@intel.com>
To: Mark Gross <mgross@linux.intel.com>,
Arjan van de Ven <arjan@linux.intel.com>,
LKML <linux-kernel@vger.kernel.org>
Cc: Dave Airlie <airlied@linux.ie>
Subject: Re: [agp-mm][PATCH 1/4][intel_iommu] explicit export current graphics dmar status
Date: Fri, 4 Jan 2008 09:53:38 +0800 [thread overview]
Message-ID: <20080104015338.GA17253@zhen-devel.sh.intel.com> (raw)
In-Reply-To: <20071219052608.GB24238@zhen-devel.sh.intel.com>
On 2007.12.19 13:26:08 +0000, Zhenyu Wang wrote:
>
> [agp-mm] [intel_iommu] explicit export current graphics dmar status
>
> To make it possbile to tell other modules about curent
> graphics dmar engine status, that could decide if graphics
> driver should remap physical address to dma address.
>
> Also this one trys to make dmar_disabled really present
> current status of DMAR, which would be used for completely
> express graphics dmar engine is active or not.
>
> Signed-off-by: Zhenyu Wang <zhenyu.z.wang@intel.com>
> ---
> drivers/pci/intel-iommu.c | 18 ++++++++++++++++--
> include/linux/dmar.h | 6 ++++++
> 2 files changed, 22 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c
> index e079a52..81a0abc 100644
> --- a/drivers/pci/intel-iommu.c
> +++ b/drivers/pci/intel-iommu.c
> @@ -53,7 +53,7 @@
> static void domain_remove_dev_info(struct dmar_domain *domain);
>
> static int dmar_disabled;
> -static int __initdata dmar_map_gfx = 1;
> +static int dmar_map_gfx = 1;
> static int dmar_forcedac;
>
> #define DUMMY_DEVICE_DOMAIN_INFO ((struct device_domain_info *)(-1))
> @@ -86,6 +86,16 @@ static int __init intel_iommu_setup(char *str)
> }
> __setup("intel_iommu=", intel_iommu_setup);
>
> +int intel_iommu_gfx_remapping(void)
> +{
> +#ifndef CONFIG_DMAR_GFX_WA
> + if (!dmar_disabled && iommu_detected && dmar_map_gfx)
> + return 1;
> +#endif
> + return 0;
> +}
> +EXPORT_SYMBOL_GPL(intel_iommu_gfx_remapping);
> +
> static struct kmem_cache *iommu_domain_cache;
> static struct kmem_cache *iommu_devinfo_cache;
> static struct kmem_cache *iommu_iova_cache;
> @@ -2189,8 +2199,12 @@ static void __init iommu_exit_mempool(void)
>
> void __init detect_intel_iommu(void)
> {
> - if (swiotlb || no_iommu || iommu_detected || dmar_disabled)
> + if (dmar_disabled)
> + return;
> + if (swiotlb || no_iommu || iommu_detected) {
> + dmar_disabled = 1;
> return;
> + }
> if (early_dmar_detect()) {
> iommu_detected = 1;
> }
> diff --git a/include/linux/dmar.h b/include/linux/dmar.h
> index ffb6439..8ae435e 100644
> --- a/include/linux/dmar.h
> +++ b/include/linux/dmar.h
> @@ -47,6 +47,8 @@ extern int intel_iommu_init(void);
> extern int dmar_table_init(void);
> extern int early_dmar_detect(void);
>
> +extern int intel_iommu_gfx_remapping(void);
> +
> extern struct list_head dmar_drhd_units;
> extern struct list_head dmar_rmrr_units;
>
> @@ -81,6 +83,10 @@ static inline int intel_iommu_init(void)
> {
> return -ENODEV;
> }
> +static inline int intel_iommu_gfx_remapping(void)
> +{
> + return 0;
> +}
>
> #endif /* !CONFIG_DMAR */
> #endif /* __DMAR_H__ */
> --
> 1.5.3.4
>
Any comments to this one? Is it ok to push this iommu patch with
agp dma remapping patches to next -mm?
Thanks.
next prev parent reply other threads:[~2008-01-04 2:07 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-18 5:08 [RFC][PATCH 0/4] enabling graphics memory dma remapping Zhenyu Wang
2007-12-18 5:09 ` [RFC][PATCH 1/4][intel_iommu] explicit export current graphics dmar status Zhenyu Wang
2007-12-18 5:11 ` [RFC][PATCH 2/4][AGP] Add generic support for graphics dma remapping Zhenyu Wang
2007-12-18 5:13 ` [RFC][PATCH 3/4][AGP] intel_agp: add support for graphics dma remapping on G33 Zhenyu Wang
2007-12-19 5:20 ` [agp-mm][PATCH 0/4] enabling graphics memory dma remapping Zhenyu Wang
2007-12-19 5:26 ` [agp-mm][PATCH 1/4][intel_iommu] explicit export current graphics dmar status Zhenyu Wang
2008-01-04 1:53 ` Zhenyu Wang [this message]
2008-01-08 20:44 ` mark gross
2008-01-25 3:02 ` Zhenyu Wang
2008-01-25 18:08 ` mark gross
2008-01-29 0:21 ` Zhenyu Wang
2007-12-19 5:28 ` [agp-mm][PATCH 2/4][AGP] Add generic support for graphics dma remapping Zhenyu Wang
2007-12-19 5:30 ` [agp-mm][PATCH 3/4][AGP] intel_agp: add support for graphics dma remapping on G33 Zhenyu Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080104015338.GA17253@zhen-devel.sh.intel.com \
--to=zhenyu.z.wang@intel.com \
--cc=airlied@linux.ie \
--cc=arjan@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgross@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome