All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] gpu: host1x: avoid IOMMU_API build error
@ 2019-03-04 19:53 Arnd Bergmann
  2019-03-05 11:44   ` Mikko Perttunen
  0 siblings, 1 reply; 3+ messages in thread
From: Arnd Bergmann @ 2019-03-04 19:53 UTC (permalink / raw)
  To: Thierry Reding, Dmitry Osipenko
  Cc: Arnd Bergmann, Mikko Perttunen, dri-devel, linux-tegra, linux-kernel

drivers/gpu/host1x/hw/channel_hw.c: In function 'host1x_channel_set_streamid':
drivers/gpu/host1x/hw/channel_hw.c:118:30: error: implicit declaration of function 'dev_iommu_fwspec_get'; did you mean 'iommu_fwspec_free'? [-Werror=implicit-function-declaration]
  struct iommu_fwspec *spec = dev_iommu_fwspec_get(channel->dev->parent);
                              ^~~~~~~~~~~~~~~~~~~~
                              iommu_fwspec_free
drivers/gpu/host1x/hw/channel_hw.c:118:30: error: initialization of 'struct iommu_fwspec *' from 'int' makes pointer from integer without a cast [-Werror=int-conversion]
drivers/gpu/host1x/hw/channel_hw.c:119:23: error: 'struct iommu_fwspec' has no member named 'ids'
  u32 sid = spec ? spec->ids[0] & 0xffff : 0x7f;
                       ^~
cc1: all warnings being treated as errors

Fixes: de5469c21ff9 ("gpu: host1x: Program the channel stream ID")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/gpu/host1x/hw/channel_hw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/host1x/hw/channel_hw.c b/drivers/gpu/host1x/hw/channel_hw.c
index 27101c04a827..738dccf4ee3f 100644
--- a/drivers/gpu/host1x/hw/channel_hw.c
+++ b/drivers/gpu/host1x/hw/channel_hw.c
@@ -114,7 +114,7 @@ static inline void synchronize_syncpt_base(struct host1x_job *job)
 
 static void host1x_channel_set_streamid(struct host1x_channel *channel)
 {
-#if HOST1X_HW >= 6
+#if HOST1X_HW >= 6 && defined(CONFIG_IOMMU_API)
 	struct iommu_fwspec *spec = dev_iommu_fwspec_get(channel->dev->parent);
 	u32 sid = spec ? spec->ids[0] & 0xffff : 0x7f;
 
-- 
2.20.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] gpu: host1x: avoid IOMMU_API build error
  2019-03-04 19:53 [PATCH] gpu: host1x: avoid IOMMU_API build error Arnd Bergmann
@ 2019-03-05 11:44   ` Mikko Perttunen
  0 siblings, 0 replies; 3+ messages in thread
From: Mikko Perttunen @ 2019-03-05 11:44 UTC (permalink / raw)
  To: Arnd Bergmann, Thierry Reding, Dmitry Osipenko
  Cc: dri-devel, linux-tegra, linux-kernel

On 4.3.2019 21.53, Arnd Bergmann wrote:
> drivers/gpu/host1x/hw/channel_hw.c: In function 'host1x_channel_set_streamid':
> drivers/gpu/host1x/hw/channel_hw.c:118:30: error: implicit declaration of function 'dev_iommu_fwspec_get'; did you mean 'iommu_fwspec_free'? [-Werror=implicit-function-declaration]
>    struct iommu_fwspec *spec = dev_iommu_fwspec_get(channel->dev->parent);
>                                ^~~~~~~~~~~~~~~~~~~~
>                                iommu_fwspec_free
> drivers/gpu/host1x/hw/channel_hw.c:118:30: error: initialization of 'struct iommu_fwspec *' from 'int' makes pointer from integer without a cast [-Werror=int-conversion]
> drivers/gpu/host1x/hw/channel_hw.c:119:23: error: 'struct iommu_fwspec' has no member named 'ids'
>    u32 sid = spec ? spec->ids[0] & 0xffff : 0x7f;
>                         ^~
> cc1: all warnings being treated as errors
> 
> Fixes: de5469c21ff9 ("gpu: host1x: Program the channel stream ID")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>   drivers/gpu/host1x/hw/channel_hw.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/host1x/hw/channel_hw.c b/drivers/gpu/host1x/hw/channel_hw.c
> index 27101c04a827..738dccf4ee3f 100644
> --- a/drivers/gpu/host1x/hw/channel_hw.c
> +++ b/drivers/gpu/host1x/hw/channel_hw.c
> @@ -114,7 +114,7 @@ static inline void synchronize_syncpt_base(struct host1x_job *job)
>   
>   static void host1x_channel_set_streamid(struct host1x_channel *channel)
>   {
> -#if HOST1X_HW >= 6
> +#if HOST1X_HW >= 6 && defined(CONFIG_IOMMU_API)
>   	struct iommu_fwspec *spec = dev_iommu_fwspec_get(channel->dev->parent);
>   	u32 sid = spec ? spec->ids[0] & 0xffff : 0x7f;
>   
> 

We should always program the stream ID - if IOMMU API is not enabled 
then 0x7f (SMMU bypass) should always be programmed.

Mikko

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] gpu: host1x: avoid IOMMU_API build error
@ 2019-03-05 11:44   ` Mikko Perttunen
  0 siblings, 0 replies; 3+ messages in thread
From: Mikko Perttunen @ 2019-03-05 11:44 UTC (permalink / raw)
  To: Arnd Bergmann, Thierry Reding, Dmitry Osipenko
  Cc: dri-devel, linux-tegra, linux-kernel

On 4.3.2019 21.53, Arnd Bergmann wrote:
> drivers/gpu/host1x/hw/channel_hw.c: In function 'host1x_channel_set_streamid':
> drivers/gpu/host1x/hw/channel_hw.c:118:30: error: implicit declaration of function 'dev_iommu_fwspec_get'; did you mean 'iommu_fwspec_free'? [-Werror=implicit-function-declaration]
>    struct iommu_fwspec *spec = dev_iommu_fwspec_get(channel->dev->parent);
>                                ^~~~~~~~~~~~~~~~~~~~
>                                iommu_fwspec_free
> drivers/gpu/host1x/hw/channel_hw.c:118:30: error: initialization of 'struct iommu_fwspec *' from 'int' makes pointer from integer without a cast [-Werror=int-conversion]
> drivers/gpu/host1x/hw/channel_hw.c:119:23: error: 'struct iommu_fwspec' has no member named 'ids'
>    u32 sid = spec ? spec->ids[0] & 0xffff : 0x7f;
>                         ^~
> cc1: all warnings being treated as errors
> 
> Fixes: de5469c21ff9 ("gpu: host1x: Program the channel stream ID")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>   drivers/gpu/host1x/hw/channel_hw.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/host1x/hw/channel_hw.c b/drivers/gpu/host1x/hw/channel_hw.c
> index 27101c04a827..738dccf4ee3f 100644
> --- a/drivers/gpu/host1x/hw/channel_hw.c
> +++ b/drivers/gpu/host1x/hw/channel_hw.c
> @@ -114,7 +114,7 @@ static inline void synchronize_syncpt_base(struct host1x_job *job)
>   
>   static void host1x_channel_set_streamid(struct host1x_channel *channel)
>   {
> -#if HOST1X_HW >= 6
> +#if HOST1X_HW >= 6 && defined(CONFIG_IOMMU_API)
>   	struct iommu_fwspec *spec = dev_iommu_fwspec_get(channel->dev->parent);
>   	u32 sid = spec ? spec->ids[0] & 0xffff : 0x7f;
>   
> 

We should always program the stream ID - if IOMMU API is not enabled 
then 0x7f (SMMU bypass) should always be programmed.

Mikko

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-03-05 11:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-04 19:53 [PATCH] gpu: host1x: avoid IOMMU_API build error Arnd Bergmann
2019-03-05 11:44 ` Mikko Perttunen
2019-03-05 11:44   ` Mikko Perttunen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.