Skip to content

Commit 7afadb5

Browse files
committed
corrected build with new version of kernel
1 parent 7a19c8b commit 7afadb5

File tree

4 files changed

+18
-12
lines changed

4 files changed

+18
-12
lines changed

drivers/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,4 +235,6 @@ source "drivers/interconnect/Kconfig"
235235
source "drivers/counter/Kconfig"
236236

237237
source "drivers/most/Kconfig"
238+
239+
source "drivers/nvdla/Kconfig"
238240
endmenu

drivers/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,3 +189,4 @@ obj-$(CONFIG_GNSS) += gnss/
189189
obj-$(CONFIG_INTERCONNECT) += interconnect/
190190
obj-$(CONFIG_COUNTER) += counter/
191191
obj-$(CONFIG_MOST) += most/
192+
obj-$(CONFIG_NVDLA) += nvdla/

drivers/nvdla/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
config NVDLA
2-
bool
2+
bool "The NVIDIA Deep Learning Accelerator"
33
default y
44
depends on DRM
55
select DRM_GEM_CMA_HELPER

drivers/nvdla/nvdla_gem.c

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,14 @@
3232
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3333
*/
3434

35-
#include <drm/drm.h>
35+
#include <drm/drm_device.h>
36+
#include <drm/drm_drv.h>
37+
#include <drm/drm_gem.h>
3638
#include <drm/drm_gem_cma_helper.h>
3739

40+
#include <linux/dma-mapping.h>
41+
#include <linux/dma-map-ops.h>
42+
3843
#include <nvdla_linux.h>
3944
#include <nvdla_ioctl.h>
4045

@@ -205,7 +210,7 @@ nvdla_gem_create_with_handle(struct drm_file *file_priv,
205210
if (ret)
206211
goto free_drm_object;
207212

208-
drm_gem_object_unreference_unlocked(dobj);
213+
drm_gem_object_put(dobj);
209214

210215
return nobj;
211216

@@ -329,7 +334,7 @@ int32_t nvdla_gem_dma_addr(struct drm_device *dev, struct drm_file *file,
329334

330335
*addr = nobj->dma_addr;
331336

332-
drm_gem_object_put_unlocked(dobj);
337+
drm_gem_object_put(dobj);
333338

334339
return 0;
335340
}
@@ -352,7 +357,7 @@ static int32_t nvdla_gem_map_offset(struct drm_device *drm, void *data,
352357
args->offset = drm_vma_node_offset_addr(&dobj->vma_node);
353358

354359
out:
355-
drm_gem_object_unreference_unlocked(dobj);
360+
drm_gem_object_put(dobj);
356361

357362
return 0;
358363
}
@@ -387,7 +392,7 @@ static const struct drm_ioctl_desc nvdla_drm_ioctls[] = {
387392
};
388393

389394
static struct drm_driver nvdla_drm_driver = {
390-
.driver_features = DRIVER_GEM | DRIVER_PRIME | DRIVER_RENDER,
395+
.driver_features = DRIVER_GEM | DRIVER_RENDER,
391396

392397
.gem_vm_ops = &drm_gem_cma_vm_ops,
393398

@@ -417,7 +422,6 @@ static struct drm_driver nvdla_drm_driver = {
417422

418423
int32_t nvdla_drm_probe(struct nvdla_device *nvdla_dev)
419424
{
420-
int32_t dma;
421425
int32_t err;
422426
struct drm_device *drm;
423427
struct drm_driver *driver = &nvdla_drm_driver;
@@ -436,19 +440,18 @@ int32_t nvdla_drm_probe(struct nvdla_device *nvdla_dev)
436440
* TODO Register separate driver for memory and use DT node to
437441
* read memory range
438442
*/
439-
dma = dma_declare_coherent_memory(drm->dev, 0xC0000000, 0xC0000000,
440-
0x40000000, DMA_MEMORY_EXCLUSIVE);
443+
err = dma_declare_coherent_memory(drm->dev, 0xD0000000, 0xD0000000,
444+
0x28000000);
441445

442446
return 0;
443447

444448
unref:
445-
drm_dev_unref(drm);
449+
drm_dev_put(drm);
446450
return err;
447451
}
448452

449453
void nvdla_drm_remove(struct nvdla_device *nvdla_dev)
450454
{
451455
drm_dev_unregister(nvdla_dev->drm);
452-
dma_release_declared_memory(&nvdla_dev->pdev->dev);
453-
drm_dev_unref(nvdla_dev->drm);
456+
drm_dev_put(nvdla_dev->drm);
454457
}

0 commit comments

Comments
 (0)