aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMikko Perttunen <mperttunen@nvidia.com>2017-09-28 08:50:40 -0400
committerThierry Reding <treding@nvidia.com>2017-10-20 08:19:52 -0400
commit2316f29fb57932e34a56998073246b8ec4c567f9 (patch)
treeaaa1f260843c97d0ee59ceca94acb3cb5bb0ffff
parentc3f52220f276504dea5615cc78750ddc9f468389 (diff)
gpu: host1x: Enable gather filter
The gather filter is a feature present on Tegra124 and newer where the hardware prevents GATHERed command buffers from executing commands normally reserved for the CDMA pushbuffer which is maintained by the kernel driver. This commit enables the gather filter on all supporting hardware. Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com> Reviewed-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
-rw-r--r--drivers/gpu/host1x/hw/channel_hw.c22
-rw-r--r--drivers/gpu/host1x/hw/hw_host1x04_channel.h12
-rw-r--r--drivers/gpu/host1x/hw/hw_host1x05_channel.h12
3 files changed, 46 insertions, 0 deletions
diff --git a/drivers/gpu/host1x/hw/channel_hw.c b/drivers/gpu/host1x/hw/channel_hw.c
index 1d3e9bdde2ce..9af758785a11 100644
--- a/drivers/gpu/host1x/hw/channel_hw.c
+++ b/drivers/gpu/host1x/hw/channel_hw.c
@@ -180,10 +180,32 @@ error:
180 return err; 180 return err;
181} 181}
182 182
183static void enable_gather_filter(struct host1x *host,
184 struct host1x_channel *ch)
185{
186#if HOST1X_HW >= 6
187 u32 val;
188
189 if (!host->hv_regs)
190 return;
191
192 val = host1x_hypervisor_readl(
193 host, HOST1X_HV_CH_KERNEL_FILTER_GBUFFER(ch->id / 32));
194 val |= BIT(ch->id % 32);
195 host1x_hypervisor_writel(
196 host, val, HOST1X_HV_CH_KERNEL_FILTER_GBUFFER(ch->id / 32));
197#elif HOST1X_HW >= 4
198 host1x_ch_writel(ch,
199 HOST1X_CHANNEL_CHANNELCTRL_KERNEL_FILTER_GBUFFER(1),
200 HOST1X_CHANNEL_CHANNELCTRL);
201#endif
202}
203
183static int host1x_channel_init(struct host1x_channel *ch, struct host1x *dev, 204static int host1x_channel_init(struct host1x_channel *ch, struct host1x *dev,
184 unsigned int index) 205 unsigned int index)
185{ 206{
186 ch->regs = dev->regs + index * HOST1X_CHANNEL_SIZE; 207 ch->regs = dev->regs + index * HOST1X_CHANNEL_SIZE;
208 enable_gather_filter(dev, ch);
187 return 0; 209 return 0;
188} 210}
189 211
diff --git a/drivers/gpu/host1x/hw/hw_host1x04_channel.h b/drivers/gpu/host1x/hw/hw_host1x04_channel.h
index 95e6f96142b9..2e8b635aa660 100644
--- a/drivers/gpu/host1x/hw/hw_host1x04_channel.h
+++ b/drivers/gpu/host1x/hw/hw_host1x04_channel.h
@@ -117,5 +117,17 @@ static inline u32 host1x_channel_dmactrl_dmainitget(void)
117} 117}
118#define HOST1X_CHANNEL_DMACTRL_DMAINITGET \ 118#define HOST1X_CHANNEL_DMACTRL_DMAINITGET \
119 host1x_channel_dmactrl_dmainitget() 119 host1x_channel_dmactrl_dmainitget()
120static inline u32 host1x_channel_channelctrl_r(void)
121{
122 return 0x98;
123}
124#define HOST1X_CHANNEL_CHANNELCTRL \
125 host1x_channel_channelctrl_r()
126static inline u32 host1x_channel_channelctrl_kernel_filter_gbuffer_f(u32 v)
127{
128 return (v & 0x1) << 2;
129}
130#define HOST1X_CHANNEL_CHANNELCTRL_KERNEL_FILTER_GBUFFER(v) \
131 host1x_channel_channelctrl_kernel_filter_gbuffer_f(v)
120 132
121#endif 133#endif
diff --git a/drivers/gpu/host1x/hw/hw_host1x05_channel.h b/drivers/gpu/host1x/hw/hw_host1x05_channel.h
index fce6e2c1ff4c..abbbc2641ce6 100644
--- a/drivers/gpu/host1x/hw/hw_host1x05_channel.h
+++ b/drivers/gpu/host1x/hw/hw_host1x05_channel.h
@@ -117,5 +117,17 @@ static inline u32 host1x_channel_dmactrl_dmainitget(void)
117} 117}
118#define HOST1X_CHANNEL_DMACTRL_DMAINITGET \ 118#define HOST1X_CHANNEL_DMACTRL_DMAINITGET \
119 host1x_channel_dmactrl_dmainitget() 119 host1x_channel_dmactrl_dmainitget()
120static inline u32 host1x_channel_channelctrl_r(void)
121{
122 return 0x98;
123}
124#define HOST1X_CHANNEL_CHANNELCTRL \
125 host1x_channel_channelctrl_r()
126static inline u32 host1x_channel_channelctrl_kernel_filter_gbuffer_f(u32 v)
127{
128 return (v & 0x1) << 2;
129}
130#define HOST1X_CHANNEL_CHANNELCTRL_KERNEL_FILTER_GBUFFER(v) \
131 host1x_channel_channelctrl_kernel_filter_gbuffer_f(v)
120 132
121#endif 133#endif