diff options
author | Marcel Ziswiler <marcel.ziswiler@toradex.com> | 2015-01-16 03:15:03 +0100 |
---|---|---|
committer | Marcel Ziswiler <marcel.ziswiler@toradex.com> | 2015-01-16 10:42:08 +0100 |
commit | 4e87f2dd9bc258c85b2f3bb1a100b49927fbe6f3 (patch) | |
tree | 96c82edf20e2c28e8fc4d97438d00e3b18b8afe9 /drivers/video | |
parent | fe4c58c4b96a24aba8e27956e8158b3002723b17 (diff) | |
parent | c7460e0d6afd754ebf5555477129579bc83c47b9 (diff) |
Merge remote-tracking branch 'remotes/nvidia/l4t/l4t-r16-r2' into tegra-next
(tegra-l4t-r16-16.5)
Conflicts:
drivers/media/video/tegra_v4l2_camera.c
drivers/mmc/host/sdhci.c
drivers/watchdog/tegra_wdt.c
include/media/tegra_v4l2_camera.h
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/tegra/dc/hdmi.c | 5 | ||||
-rw-r--r-- | drivers/video/tegra/fb.c | 4 | ||||
-rw-r--r-- | drivers/video/tegra/host/nvhost_acm.c | 3 | ||||
-rw-r--r-- | drivers/video/tegra/host/nvhost_job.c | 9 | ||||
-rw-r--r-- | drivers/video/tegra/host/nvhost_syncpt.c | 1 | ||||
-rw-r--r-- | drivers/video/tegra/host/nvmap.c | 11 | ||||
-rw-r--r-- | drivers/video/tegra/host/nvmap.h | 5 | ||||
-rw-r--r-- | drivers/video/tegra/nvmap/nvmap.c | 16 | ||||
-rw-r--r-- | drivers/video/tegra/nvmap/nvmap_handle.c | 13 |
9 files changed, 52 insertions, 15 deletions
diff --git a/drivers/video/tegra/dc/hdmi.c b/drivers/video/tegra/dc/hdmi.c index e5e6fff7eb46..85a5d63e9326 100644 --- a/drivers/video/tegra/dc/hdmi.c +++ b/drivers/video/tegra/dc/hdmi.c @@ -4,7 +4,7 @@ * Copyright (C) 2010 Google, Inc. * Author: Erik Gilling <konkers@android.com> * - * Copyright (c) 2010-2012, NVIDIA CORPORATION, All rights reserved. + * Copyright (c) 2010-2013, NVIDIA CORPORATION, All rights reserved. * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and @@ -1262,7 +1262,8 @@ static bool tegra_dc_hdmi_valid_asp_ratio(const struct tegra_dc *dc, return false; /* To check the aspect upto two decimal digits, calculate in % */ - m_aspratio = (mode->xres*100 / mode->yres); + if (mode->yres) + m_aspratio = (mode->xres*100 / mode->yres); if ((m_aspratio < TEGRA_DC_HDMI_MIN_ASPECT_RATIO_PERCENT) || (m_aspratio > TEGRA_DC_HDMI_MAX_ASPECT_RATIO_PERCENT)) diff --git a/drivers/video/tegra/fb.c b/drivers/video/tegra/fb.c index 9d6f15cda48b..d0e7809cd83d 100644 --- a/drivers/video/tegra/fb.c +++ b/drivers/video/tegra/fb.c @@ -6,7 +6,7 @@ * Colin Cross <ccross@android.com> * Travis Geiselbrecht <travis@palm.com> * - * Copyright (c) 2010-2012, NVIDIA CORPORATION, All rights reserved. + * Copyright (c) 2010-2013, NVIDIA CORPORATION, All rights reserved. * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and @@ -274,6 +274,8 @@ static int tegra_fb_blank(int blank, struct fb_info *info) dev_dbg(&tegra_fb->ndev->dev, "unblank\n"); tegra_fb->win->flags = TEGRA_WIN_FLAG_ENABLED; tegra_dc_enable(tegra_fb->win->dc); + tegra_dc_update_windows(&tegra_fb->win, 1); + tegra_dc_sync_windows(&tegra_fb->win, 1); return 0; case FB_BLANK_NORMAL: diff --git a/drivers/video/tegra/host/nvhost_acm.c b/drivers/video/tegra/host/nvhost_acm.c index f22c91ac03f1..860ce6b35572 100644 --- a/drivers/video/tegra/host/nvhost_acm.c +++ b/drivers/video/tegra/host/nvhost_acm.c @@ -3,7 +3,7 @@ * * Tegra Graphics Host Automatic Clock Management * - * Copyright (c) 2010-2012, NVIDIA Corporation. All rights reserved. + * Copyright (c) 2010-2014, NVIDIA Corporation. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -221,6 +221,7 @@ void nvhost_module_busy(struct nvhost_device *dev) dev->refcount++; if (dev->refcount > 0 && !nvhost_module_powered(dev)) to_state_running_locked(dev); + mutex_unlock(&dev->lock); } diff --git a/drivers/video/tegra/host/nvhost_job.c b/drivers/video/tegra/host/nvhost_job.c index f0f7e64d4504..5587f51ea996 100644 --- a/drivers/video/tegra/host/nvhost_job.c +++ b/drivers/video/tegra/host/nvhost_job.c @@ -3,7 +3,7 @@ * * Tegra Graphics Host Job * - * Copyright (c) 2010-2012, NVIDIA Corporation. + * Copyright (c) 2010-2014, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -30,6 +30,7 @@ #include "dev.h" #include "nvhost_memmgr.h" #include "chip_support.h" +#include "nvmap.h" /* Magic to use to fill freed handle slots */ #define BAD_MAGIC 0xdeadbeef @@ -327,8 +328,10 @@ void nvhost_job_unpin(struct nvhost_job *job) int i; for (i = 0; i < job->num_unpins; i++) { - mem_op().unpin(job->memmgr, job->unpins[i]); - mem_op().put(job->memmgr, job->unpins[i]); + struct mem_handle *handle; + handle = nvhost_nvmap_validate_ref(job->memmgr, job->unpins[i]); + mem_op().unpin(job->memmgr, handle); + mem_op().put(job->memmgr, handle); } memset(job->unpins, BAD_MAGIC, diff --git a/drivers/video/tegra/host/nvhost_syncpt.c b/drivers/video/tegra/host/nvhost_syncpt.c index de3e04f65cdd..5837a3f76cf0 100644 --- a/drivers/video/tegra/host/nvhost_syncpt.c +++ b/drivers/video/tegra/host/nvhost_syncpt.c @@ -487,6 +487,7 @@ u32 nvhost_syncpt_incr_max_ext(struct nvhost_device *dev, u32 id, u32 incrs) struct nvhost_syncpt *sp = &(nvhost_get_host(dev)->syncpt); return nvhost_syncpt_incr_max(sp, id, incrs); } +EXPORT_SYMBOL(nvhost_syncpt_incr_max_ext); void nvhost_syncpt_cpu_incr_ext(struct nvhost_device *dev, u32 id) { diff --git a/drivers/video/tegra/host/nvmap.c b/drivers/video/tegra/host/nvmap.c index fd82f40c59ff..b8361c4a1a36 100644 --- a/drivers/video/tegra/host/nvmap.c +++ b/drivers/video/tegra/host/nvmap.c @@ -3,7 +3,7 @@ * * Tegra Graphics Host Nvmap support * - * Copyright (c) 2012, NVIDIA Corporation. + * Copyright (c) 2012-2014, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -82,6 +82,15 @@ struct mem_handle *nvhost_nvmap_get(struct mem_mgr *mgr, u32 id) nvmap_duplicate_handle_id((struct nvmap_client *)mgr, id); } +struct mem_handle *nvhost_nvmap_validate_ref(struct mem_mgr *mgr, + struct mem_handle *handle) +{ + unsigned long ref; + ref = nvmap_validate_ref((struct nvmap_client *)mgr, + (struct nvmap_handle_ref *)handle); + return (struct mem_handle *)ref; +} + int nvhost_init_nvmap_support(struct nvhost_chip_support *chip) { chip->mem.alloc_mgr = nvhost_nvmap_alloc_mgr; diff --git a/drivers/video/tegra/host/nvmap.h b/drivers/video/tegra/host/nvmap.h index 90f64d44f434..25e3535ce544 100644 --- a/drivers/video/tegra/host/nvmap.h +++ b/drivers/video/tegra/host/nvmap.h @@ -3,7 +3,7 @@ * * Tegra Graphics Host nvmap memory manager * - * Copyright (c) 2010-2012, NVIDIA Corporation. + * Copyright (c) 2010-2014, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -23,5 +23,6 @@ struct nvhost_chip_support; int nvhost_init_nvmap_support(struct nvhost_chip_support *op); - +struct mem_handle *nvhost_nvmap_validate_ref(struct mem_mgr *mgr, + struct mem_handle *handle); #endif diff --git a/drivers/video/tegra/nvmap/nvmap.c b/drivers/video/tegra/nvmap/nvmap.c index e66ca982f2f3..3329153b2c1b 100644 --- a/drivers/video/tegra/nvmap/nvmap.c +++ b/drivers/video/tegra/nvmap/nvmap.c @@ -3,7 +3,7 @@ * * Memory manager for Tegra GPU * - * Copyright (c) 2009-2012, NVIDIA Corporation. + * Copyright (c) 2009-2014, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -366,7 +366,6 @@ phys_addr_t nvmap_pin(struct nvmap_client *client, h = nvmap_handle_get(ref->handle); if (WARN_ON(!h)) return -EINVAL; - atomic_inc(&ref->pin); if (WARN_ON(mutex_lock_interruptible(&client->share->pin_lock))) { @@ -384,7 +383,6 @@ phys_addr_t nvmap_pin(struct nvmap_client *client, map_iovmm_area(h); phys = handle_phys(h); } - return ret ?: phys; } EXPORT_SYMBOL(nvmap_pin); @@ -624,3 +622,15 @@ int nvmap_mark_global(struct nvmap_client *client, struct nvmap_handle_ref *r) return 0; } + +unsigned long nvmap_validate_ref(struct nvmap_client *client, + struct nvmap_handle_ref *r) +{ + struct nvmap_handle_ref *ref; + unsigned long id = nvmap_ref_to_id(r); + + nvmap_ref_lock(client); + ref = _nvmap_validate_id_locked(client, id); + nvmap_ref_unlock(client); + return (unsigned long)ref; +} diff --git a/drivers/video/tegra/nvmap/nvmap_handle.c b/drivers/video/tegra/nvmap/nvmap_handle.c index c1add8383e83..d1d5f267f5c5 100644 --- a/drivers/video/tegra/nvmap/nvmap_handle.c +++ b/drivers/video/tegra/nvmap/nvmap_handle.c @@ -3,7 +3,7 @@ * * Handle allocation and freeing routines for nvmap * - * Copyright (c) 2009-2012, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2009-2014, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -905,7 +905,7 @@ void nvmap_free_handle_id(struct nvmap_client *client, unsigned long id) nvmap_err(client, "%s freeing pinned handle %p\n", current->group_leader->comm, h); - while (pins--) + while (pins-- > 0) nvmap_unpin_handles(client, &ref->handle, 1); if (h->owner == client) @@ -989,6 +989,15 @@ struct nvmap_handle_ref *nvmap_duplicate_handle_id(struct nvmap_client *client, BUG_ON(!client || client->dev != nvmap_dev); /* on success, the reference count for the handle should be * incremented, so the success paths will not call nvmap_handle_put */ + + /* Allow the handle to be accessed by other (non-owner) + clients only if the owner is "videobuf2-dma-nvmap + which is a V4L2 capture kernel module. This handle can + be accessed by the "user" client for rendering/encoding */ + if (!strcmp(((struct nvmap_handle *)id)->owner->name, + "videobuf2-dma-nvmap")) + client = ((struct nvmap_handle *)id)->owner; + h = nvmap_validate_get(client, id); if (!h) { |