aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/host1x/hw/intr_hw.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2016-07-15 21:23:50 -0400
committerDave Airlie <airlied@redhat.com>2016-07-15 21:23:50 -0400
commit877fa9a42ddc087dc46a3a3aac18db8adde2bdf1 (patch)
treec5189830c8d3fed08e92deda8681f0676aaea8a5 /drivers/gpu/host1x/hw/intr_hw.c
parente2b80bac213cdfd443df9b6e1c769f98d0553c0c (diff)
parent64ea25c3bc86c05c7da6c683b86663f4c90158d6 (diff)
Merge tag 'drm/tegra/for-4.8-rc1' of git://anongit.freedesktop.org/tegra/linux into drm-next
drm/tegra: Changes for v4.8-rc1 This set of changes contains a bunch of cleanups to the host1x driver as well as the addition of a pin controller for DPAUX, which is required by boards to configure the DPAUX pads in AUX mode (for DisplayPort) or I2C mode (for HDMI and DDC). Included is also a bit of rework of the SOR driver in preparation to add DisplayPort support as well as some refactoring and cleanup. Finally, all output drivers are converted to runtime PM, which greatly simplifies the handling of clocks and resets. * tag 'drm/tegra/for-4.8-rc1' of git://anongit.freedesktop.org/tegra/linux: (35 commits) drm/tegra: sor: Reject HDMI 2.0 modes drm/tegra: sor: Prepare for generic PM domain support drm/tegra: dsi: Prepare for generic PM domain support drm/tegra: sor: Make XBAR configurable per SoC drm/tegra: sor: Use sor1_src clock to set parent for HDMI dt-bindings: display: tegra: Add source clock for SOR drm/tegra: sor: Implement sor1_brick clock drm/tegra: sor: Implement runtime PM drm/tegra: hdmi: Implement runtime PM drm/tegra: dsi: Implement runtime PM drm/tegra: dc: Implement runtime PM drm/tegra: hdmi: Enable audio over HDMI drm/tegra: sor: Do not support deep color modes drm/tegra: sor: Extract tegra_sor_mode_set() drm/tegra: sor: Split out tegra_sor_apply_config() drm/tegra: sor: Rename tegra_sor_calc_config() drm/tegra: sor: Factor out tegra_sor_set_parent_clock() drm/tegra: dpaux: Add pinctrl support dt-bindings: Add bindings for Tegra DPAUX pinctrl driver drm/tegra: Prepare DPAUX for supporting generic PM domains ...
Diffstat (limited to 'drivers/gpu/host1x/hw/intr_hw.c')
-rw-r--r--drivers/gpu/host1x/hw/intr_hw.c30
1 files changed, 20 insertions, 10 deletions
diff --git a/drivers/gpu/host1x/hw/intr_hw.c b/drivers/gpu/host1x/hw/intr_hw.c
index e1e31e9e67cd..dacb8009a605 100644
--- a/drivers/gpu/host1x/hw/intr_hw.c
+++ b/drivers/gpu/host1x/hw/intr_hw.c
@@ -38,14 +38,14 @@ static void host1x_intr_syncpt_handle(struct host1x_syncpt *syncpt)
38 host1x_sync_writel(host, BIT_MASK(id), 38 host1x_sync_writel(host, BIT_MASK(id),
39 HOST1X_SYNC_SYNCPT_THRESH_CPU0_INT_STATUS(BIT_WORD(id))); 39 HOST1X_SYNC_SYNCPT_THRESH_CPU0_INT_STATUS(BIT_WORD(id)));
40 40
41 queue_work(host->intr_wq, &syncpt->intr.work); 41 schedule_work(&syncpt->intr.work);
42} 42}
43 43
44static irqreturn_t syncpt_thresh_isr(int irq, void *dev_id) 44static irqreturn_t syncpt_thresh_isr(int irq, void *dev_id)
45{ 45{
46 struct host1x *host = dev_id; 46 struct host1x *host = dev_id;
47 unsigned long reg; 47 unsigned long reg;
48 int i, id; 48 unsigned int i, id;
49 49
50 for (i = 0; i < DIV_ROUND_UP(host->info->nb_pts, 32); i++) { 50 for (i = 0; i < DIV_ROUND_UP(host->info->nb_pts, 32); i++) {
51 reg = host1x_sync_readl(host, 51 reg = host1x_sync_readl(host,
@@ -62,7 +62,7 @@ static irqreturn_t syncpt_thresh_isr(int irq, void *dev_id)
62 62
63static void _host1x_intr_disable_all_syncpt_intrs(struct host1x *host) 63static void _host1x_intr_disable_all_syncpt_intrs(struct host1x *host)
64{ 64{
65 u32 i; 65 unsigned int i;
66 66
67 for (i = 0; i < DIV_ROUND_UP(host->info->nb_pts, 32); ++i) { 67 for (i = 0; i < DIV_ROUND_UP(host->info->nb_pts, 32); ++i) {
68 host1x_sync_writel(host, 0xffffffffu, 68 host1x_sync_writel(host, 0xffffffffu,
@@ -72,10 +72,12 @@ static void _host1x_intr_disable_all_syncpt_intrs(struct host1x *host)
72 } 72 }
73} 73}
74 74
75static int _host1x_intr_init_host_sync(struct host1x *host, u32 cpm, 75static int
76 void (*syncpt_thresh_work)(struct work_struct *)) 76_host1x_intr_init_host_sync(struct host1x *host, u32 cpm,
77 void (*syncpt_thresh_work)(struct work_struct *))
77{ 78{
78 int i, err; 79 unsigned int i;
80 int err;
79 81
80 host1x_hw_intr_disable_all_syncpt_intrs(host); 82 host1x_hw_intr_disable_all_syncpt_intrs(host);
81 83
@@ -106,18 +108,21 @@ static int _host1x_intr_init_host_sync(struct host1x *host, u32 cpm,
106} 108}
107 109
108static void _host1x_intr_set_syncpt_threshold(struct host1x *host, 110static void _host1x_intr_set_syncpt_threshold(struct host1x *host,
109 u32 id, u32 thresh) 111 unsigned int id,
112 u32 thresh)
110{ 113{
111 host1x_sync_writel(host, thresh, HOST1X_SYNC_SYNCPT_INT_THRESH(id)); 114 host1x_sync_writel(host, thresh, HOST1X_SYNC_SYNCPT_INT_THRESH(id));
112} 115}
113 116
114static void _host1x_intr_enable_syncpt_intr(struct host1x *host, u32 id) 117static void _host1x_intr_enable_syncpt_intr(struct host1x *host,
118 unsigned int id)
115{ 119{
116 host1x_sync_writel(host, BIT_MASK(id), 120 host1x_sync_writel(host, BIT_MASK(id),
117 HOST1X_SYNC_SYNCPT_THRESH_INT_ENABLE_CPU0(BIT_WORD(id))); 121 HOST1X_SYNC_SYNCPT_THRESH_INT_ENABLE_CPU0(BIT_WORD(id)));
118} 122}
119 123
120static void _host1x_intr_disable_syncpt_intr(struct host1x *host, u32 id) 124static void _host1x_intr_disable_syncpt_intr(struct host1x *host,
125 unsigned int id)
121{ 126{
122 host1x_sync_writel(host, BIT_MASK(id), 127 host1x_sync_writel(host, BIT_MASK(id),
123 HOST1X_SYNC_SYNCPT_THRESH_INT_DISABLE(BIT_WORD(id))); 128 HOST1X_SYNC_SYNCPT_THRESH_INT_DISABLE(BIT_WORD(id)));
@@ -127,8 +132,13 @@ static void _host1x_intr_disable_syncpt_intr(struct host1x *host, u32 id)
127 132
128static int _host1x_free_syncpt_irq(struct host1x *host) 133static int _host1x_free_syncpt_irq(struct host1x *host)
129{ 134{
135 unsigned int i;
136
130 devm_free_irq(host->dev, host->intr_syncpt_irq, host); 137 devm_free_irq(host->dev, host->intr_syncpt_irq, host);
131 flush_workqueue(host->intr_wq); 138
139 for (i = 0; i < host->info->nb_pts; i++)
140 cancel_work_sync(&host->syncpt[i].intr.work);
141
132 return 0; 142 return 0;
133} 143}
134 144