<br><br><div class="gmail_quote">2012/11/7 Leela Krishna Amudala <span dir="ltr"><<a href="mailto:l.krishna@samsung.com" target="_blank">l.krishna@samsung.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello Rahul,<br>
<div><div class="h5"><br>
On Mon, Nov 5, 2012 at 2:32 PM, Rahul Sharma <<a href="mailto:rahul.sharma@samsung.com">rahul.sharma@samsung.com</a>> wrote:<br>
> This patch adds iommu support for hdmi driver with device tree based<br>
> search. It searches for sysmmu property in hdmi dt node to get tv<br>
> iommu device pointer which will be used to configure iommu hw interface.<br>
><br>
> This patch is based on "exynos-drm-next-iommu" branch at<br>
> <a href="http://git.kernel.org/?p=linux/kernel/git/daeinki/drm-exynos.git" target="_blank">http://git.kernel.org/?p=linux/kernel/git/daeinki/drm-exynos.git</a><br>
><br>
> This patch is having dependency on  linux-samsung-soc patchset named<br>
> "add dt based support for iommu for hdmi"<br>
><br>
> Signed-off-by: Rahul Sharma <<a href="mailto:rahul.sharma@samsung.com">rahul.sharma@samsung.com</a>><br>
> Signed-off-by: Prathyush K <<a href="mailto:prathyush.k@samsung.com">prathyush.k@samsung.com</a>><br>
> ---<br>
>  drivers/gpu/drm/exynos/exynos_hdmi.c |   35 ++++++++++++++++++++++++++++++++++<br>
>  1 files changed, 35 insertions(+), 0 deletions(-)<br>
><br>
> diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c<br>
> index d1a1d71..ee110c9 100644<br>
> --- a/drivers/gpu/drm/exynos/exynos_hdmi.c<br>
> +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c<br>
> @@ -34,7 +34,9 @@<br>
>  #include <linux/regulator/consumer.h><br>
>  #include <linux/io.h><br>
>  #include <linux/of_gpio.h><br>
> +#include <linux/of_platform.h><br>
>  #include <plat/gpio-cfg.h><br>
> +#include <mach/sysmmu.h><br>
><br>
>  #include <drm/exynos_drm.h><br>
><br>
> @@ -2275,6 +2277,34 @@ void hdmi_attach_hdmiphy_client(struct i2c_client *hdmiphy)<br>
>  }<br>
><br>
>  #ifdef CONFIG_OF<br>
> +<br>
> +static int drm_hdmi_dt_init_iommu(struct device *dev)<br>
> +{<br>
> +       struct platform_device *pds;<br>
> +       struct device_node *dn, *dns;<br>
> +       const __be32 *parp;<br>
> +<br>
> +       dn = dev->of_node;<br>
> +       parp = of_get_property(dn, "sysmmu", NULL);<br>
> +       if (parp == NULL) {<br>
> +               dev_err(dev, "failed to find sysmmu property\n");<br>
> +               return -EINVAL;<br>
> +       }<br>
> +       dns = of_find_node_by_phandle(be32_to_cpup(parp));<br>
> +       if (dns == NULL) {<br>
> +               dev_err(dev, "failed to find sysmmu node\n");<br>
> +               return -EINVAL;<br>
> +       }<br>
> +       pds = of_find_device_by_node(dns);<br>
> +       if (pds == NULL) {<br>
> +               dev_err(dev, "failed to find sysmmu platform device\n");<br>
> +               return -EINVAL;<br>
> +       }<br>
> +<br>
> +       platform_set_sysmmu(&pds->dev, dev);<br>
> +       return 0;<br>
> +}<br>
> +<br>
<br>
</div></div>As a part of adding iommu support to FIMD driver, we have to implement<br>
the same function in FIMD driver also, which makes code replication.<br>
So, it would be better to move this function out of this file and put<br>
it in a common drm file so that FIMD also can use it.<br>
<br></blockquote><div><br>I tend to agree with you but I think it's better to move it into drivers/iommu/exynos-iommu.c because IOMMU units could be used by device driver based on not only DRM but also V4L2.<br><br>Thanks,<br>
Inki Dae<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Best Wishes,<br>
Leela Krishna Amudala.<br>
<div class="HOEnZb"><div> </div></div></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">
>  static struct s5p_hdmi_platform_data *drm_hdmi_dt_parse_pdata<br>
>                                         (struct device *dev)<br>
>  {<br>
> @@ -2294,6 +2324,11 @@ static struct s5p_hdmi_platform_data *drm_hdmi_dt_parse_pdata<br>
>                 goto err_data;<br>
>         }<br>
><br>
> +       if (drm_hdmi_dt_init_iommu(dev)){<br>
> +               DRM_ERROR("no sysmmu property found\n");<br>
> +               goto err_data;<br>
> +       }<br>
> +<br>
>         pd->hpd_gpio = of_get_named_gpio_flags(np, "hpd-gpio", 0, &flags);<br>
><br>
>         return pd;<br>
> --<br>
> 1.7.0.4<br>
><br>
> _______________________________________________<br>
> dri-devel mailing list<br>
> <a href="mailto:dri-devel@lists.freedesktop.org">dri-devel@lists.freedesktop.org</a><br>
> <a href="http://lists.freedesktop.org/mailman/listinfo/dri-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/dri-devel</a><br>
_______________________________________________<br>
dri-devel mailing list<br>
<a href="mailto:dri-devel@lists.freedesktop.org">dri-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/dri-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/dri-devel</a><br>
</div></div></blockquote></div><br>