Skip to contentSkip to conversation

gpu: host1x: avoid IOMMU_API build error

PATCH Superseded Arnd Bergmann 2 participants 2 messages Mar 4, 2019 – Mar 5, 2019

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gpu: host1x: avoid IOMMU_API build error

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")
---
 drivers/gpu/host1x/hw/channel_hw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/host1x/hw/channel_hw.c +1 -1
index 27101c04a827..738dccf4ee3f 100644
@@ -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;
 
Signature · 1 line
2.20.0
maintainer
#1 lore raw
Quoted 23 lines · Arnd Bergmann

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")
---
  drivers/gpu/host1x/hw/channel_hw.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/host1x/hw/channel_hw.c +0 -0
index 27101c04a827..738dccf4ee3f 100644

drivers/gpu/host1x/hw/channel_hw.c static inline void synchronize_syncpt_base(struct host1x_job *job) · line 120

Quoted 8 lines
drivers/gpu/host1x/hw/channel_hw.c +1 -1
@@ -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