diff options
author | Dave Airlie <airlied@redhat.com> | 2016-03-04 16:53:25 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2016-03-04 16:53:25 -0500 |
commit | 26bae5e04c3570728787f809b13546a8169fdf95 (patch) | |
tree | ddb961dc8fec60bbe73ae97c4a37df8f244df1aa | |
parent | 0dff9738ec6dddf701821a6aa477ced809f17ef0 (diff) | |
parent | c95469aa5a188384ccf8ac520ece931c66caf8aa (diff) |
Merge tag 'drm/tegra/for-4.5-rc7' of git://anongit.freedesktop.org/tegra/linux into drm-fixes
drm/tegra: Fixes for v4.5-rc7
Two small fixes that restore PRIME support.
* tag 'drm/tegra/for-4.5-rc7' of git://anongit.freedesktop.org/tegra/linux:
gpu: host1x: Set DMA ops on device creation
gpu: host1x: Set DMA mask
-rw-r--r-- | drivers/gpu/host1x/bus.c | 2 | ||||
-rw-r--r-- | drivers/gpu/host1x/dev.c | 7 | ||||
-rw-r--r-- | drivers/gpu/host1x/dev.h | 1 |
3 files changed, 10 insertions, 0 deletions
diff --git a/drivers/gpu/host1x/bus.c b/drivers/gpu/host1x/bus.c index da462afcb225..dd2dbb9746ce 100644 --- a/drivers/gpu/host1x/bus.c +++ b/drivers/gpu/host1x/bus.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/host1x.h> | 18 | #include <linux/host1x.h> |
19 | #include <linux/of.h> | 19 | #include <linux/of.h> |
20 | #include <linux/slab.h> | 20 | #include <linux/slab.h> |
21 | #include <linux/of_device.h> | ||
21 | 22 | ||
22 | #include "bus.h" | 23 | #include "bus.h" |
23 | #include "dev.h" | 24 | #include "dev.h" |
@@ -394,6 +395,7 @@ static int host1x_device_add(struct host1x *host1x, | |||
394 | device->dev.coherent_dma_mask = host1x->dev->coherent_dma_mask; | 395 | device->dev.coherent_dma_mask = host1x->dev->coherent_dma_mask; |
395 | device->dev.dma_mask = &device->dev.coherent_dma_mask; | 396 | device->dev.dma_mask = &device->dev.coherent_dma_mask; |
396 | dev_set_name(&device->dev, "%s", driver->driver.name); | 397 | dev_set_name(&device->dev, "%s", driver->driver.name); |
398 | of_dma_configure(&device->dev, host1x->dev->of_node); | ||
397 | device->dev.release = host1x_device_release; | 399 | device->dev.release = host1x_device_release; |
398 | device->dev.bus = &host1x_bus_type; | 400 | device->dev.bus = &host1x_bus_type; |
399 | device->dev.parent = host1x->dev; | 401 | device->dev.parent = host1x->dev; |
diff --git a/drivers/gpu/host1x/dev.c b/drivers/gpu/host1x/dev.c index 314bf3718cc7..ff348690df94 100644 --- a/drivers/gpu/host1x/dev.c +++ b/drivers/gpu/host1x/dev.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/of_device.h> | 23 | #include <linux/of_device.h> |
24 | #include <linux/clk.h> | 24 | #include <linux/clk.h> |
25 | #include <linux/io.h> | 25 | #include <linux/io.h> |
26 | #include <linux/dma-mapping.h> | ||
26 | 27 | ||
27 | #define CREATE_TRACE_POINTS | 28 | #define CREATE_TRACE_POINTS |
28 | #include <trace/events/host1x.h> | 29 | #include <trace/events/host1x.h> |
@@ -68,6 +69,7 @@ static const struct host1x_info host1x01_info = { | |||
68 | .nb_bases = 8, | 69 | .nb_bases = 8, |
69 | .init = host1x01_init, | 70 | .init = host1x01_init, |
70 | .sync_offset = 0x3000, | 71 | .sync_offset = 0x3000, |
72 | .dma_mask = DMA_BIT_MASK(32), | ||
71 | }; | 73 | }; |
72 | 74 | ||
73 | static const struct host1x_info host1x02_info = { | 75 | static const struct host1x_info host1x02_info = { |
@@ -77,6 +79,7 @@ static const struct host1x_info host1x02_info = { | |||
77 | .nb_bases = 12, | 79 | .nb_bases = 12, |
78 | .init = host1x02_init, | 80 | .init = host1x02_init, |
79 | .sync_offset = 0x3000, | 81 | .sync_offset = 0x3000, |
82 | .dma_mask = DMA_BIT_MASK(32), | ||
80 | }; | 83 | }; |
81 | 84 | ||
82 | static const struct host1x_info host1x04_info = { | 85 | static const struct host1x_info host1x04_info = { |
@@ -86,6 +89,7 @@ static const struct host1x_info host1x04_info = { | |||
86 | .nb_bases = 64, | 89 | .nb_bases = 64, |
87 | .init = host1x04_init, | 90 | .init = host1x04_init, |
88 | .sync_offset = 0x2100, | 91 | .sync_offset = 0x2100, |
92 | .dma_mask = DMA_BIT_MASK(34), | ||
89 | }; | 93 | }; |
90 | 94 | ||
91 | static const struct host1x_info host1x05_info = { | 95 | static const struct host1x_info host1x05_info = { |
@@ -95,6 +99,7 @@ static const struct host1x_info host1x05_info = { | |||
95 | .nb_bases = 64, | 99 | .nb_bases = 64, |
96 | .init = host1x05_init, | 100 | .init = host1x05_init, |
97 | .sync_offset = 0x2100, | 101 | .sync_offset = 0x2100, |
102 | .dma_mask = DMA_BIT_MASK(34), | ||
98 | }; | 103 | }; |
99 | 104 | ||
100 | static struct of_device_id host1x_of_match[] = { | 105 | static struct of_device_id host1x_of_match[] = { |
@@ -148,6 +153,8 @@ static int host1x_probe(struct platform_device *pdev) | |||
148 | if (IS_ERR(host->regs)) | 153 | if (IS_ERR(host->regs)) |
149 | return PTR_ERR(host->regs); | 154 | return PTR_ERR(host->regs); |
150 | 155 | ||
156 | dma_set_mask_and_coherent(host->dev, host->info->dma_mask); | ||
157 | |||
151 | if (host->info->init) { | 158 | if (host->info->init) { |
152 | err = host->info->init(host); | 159 | err = host->info->init(host); |
153 | if (err) | 160 | if (err) |
diff --git a/drivers/gpu/host1x/dev.h b/drivers/gpu/host1x/dev.h index 0b6e8e9629c5..dace124994bb 100644 --- a/drivers/gpu/host1x/dev.h +++ b/drivers/gpu/host1x/dev.h | |||
@@ -96,6 +96,7 @@ struct host1x_info { | |||
96 | int nb_mlocks; /* host1x: number of mlocks */ | 96 | int nb_mlocks; /* host1x: number of mlocks */ |
97 | int (*init)(struct host1x *); /* initialize per SoC ops */ | 97 | int (*init)(struct host1x *); /* initialize per SoC ops */ |
98 | int sync_offset; | 98 | int sync_offset; |
99 | u64 dma_mask; /* mask of addressable memory */ | ||
99 | }; | 100 | }; |
100 | 101 | ||
101 | struct host1x { | 102 | struct host1x { |