From 0bee410db5fdb5a97578b6dc002b7d54fedbfe64 Mon Sep 17 00:00:00 2001 From: Andrew Chew Date: Wed, 1 Aug 2012 16:39:32 -0700 Subject: tegra: Make tegra_vi01_device accessible Make it accessible outside of drivers/video/tegra. V4L2 driver needs to set some platform_data. Add suport for T20. Change-Id: I98353c2874ea28cfa0a7a5dd8a1dc4c586af4dd7 Signed-off-by: Andrew Chew Signed-off-by: Bryan Wu Reviewed-on: http://git-master/r/200220 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Matthew Pedro --- drivers/video/tegra/host/t20/t20.c | 6 ++++++ drivers/video/tegra/host/t30/t30.c | 6 ++++++ 2 files changed, 12 insertions(+) (limited to 'drivers/video') diff --git a/drivers/video/tegra/host/t20/t20.c b/drivers/video/tegra/host/t20/t20.c index 71ed7334e714..e6840ae7ba1c 100644 --- a/drivers/video/tegra/host/t20/t20.c +++ b/drivers/video/tegra/host/t20/t20.c @@ -286,3 +286,9 @@ int nvhost_init_t20_support(struct nvhost_master *host, return 0; } + +/* Hacky way to get access to struct nvhost_device tegra_vi01_device. */ +struct nvhost_device *t20_get_tegra_vi01_device(void) +{ + return &tegra_vi01_device; +} diff --git a/drivers/video/tegra/host/t30/t30.c b/drivers/video/tegra/host/t30/t30.c index 334d598d5c0b..6c3a7f925177 100644 --- a/drivers/video/tegra/host/t30/t30.c +++ b/drivers/video/tegra/host/t30/t30.c @@ -301,3 +301,9 @@ int nvhost_init_t30_support(struct nvhost_master *host, return 0; } + +/* Hacky way to get access to struct nvhost_device tegra_vi01_device. */ +struct nvhost_device *t30_get_tegra_vi01_device(void) +{ + return &tegra_vi01_device; +} -- cgit v1.2.3 From cf430cbe6d219edf9da694697a5406bf27ed39a0 Mon Sep 17 00:00:00 2001 From: Andrew Chew Date: Wed, 1 Aug 2012 12:57:12 -0700 Subject: tegra: When using V4L2, don't use vi client. The VI client within drivers/video/tegra is mutually exclusive with the Tegra V4L2 framework, since they both want to own the camera hardware. Change-Id: Idebd0f619f5fc7eb6323b2e08c29c9692c8887a0 Signed-off-by: Andrew Chew Signed-off-by: Bryan Wu Reviewed-on: http://git-master/r/200221 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Matthew Pedro --- drivers/video/tegra/host/Makefile | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/video') diff --git a/drivers/video/tegra/host/Makefile b/drivers/video/tegra/host/Makefile index 6e5e469897b3..c2608218c811 100644 --- a/drivers/video/tegra/host/Makefile +++ b/drivers/video/tegra/host/Makefile @@ -22,7 +22,9 @@ obj-$(CONFIG_TEGRA_GRHOST) += t20/ obj-$(CONFIG_TEGRA_GRHOST) += t30/ obj-$(CONFIG_TEGRA_GRHOST) += gr2d/ obj-$(CONFIG_TEGRA_GRHOST) += isp/ +ifeq ($(CONFIG_TEGRA_CAMERA),y) obj-$(CONFIG_TEGRA_GRHOST) += vi/ +endif obj-$(CONFIG_TEGRA_GRHOST) += nvhost.o obj-$(CONFIG_TEGRA_GRHOST_USE_NVMAP) += nvmap.o -- cgit v1.2.3 From 2fb9cd0d92979598e3aa5319babdbe6be4c6df22 Mon Sep 17 00:00:00 2001 From: Vikram Fugro Date: Wed, 30 Oct 2013 13:40:20 +0530 Subject: media: nvmap: Few tweaks in nvmap The tweaks are only specific to r16-r2 branch and will not go into mainline. - Pass nvmap memory handle to the user through the mmap'd buffer allocated by videobuf2 client. - Allow the "user" nvmap client to access the nvmap memory handle of "videobuf2-dma-nvmap" client. Re-arranging the copyright message in nvmap_dev.c for Automatic validation to pass. Bug 1369083 Change-Id: Ia27d172253860e79557911c2e848bc9084d662d4 Signed-off-by: Vikram Fugro Reviewed-on: http://git-master/r/309494 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Krishna Reddy Reviewed-by: Kaustubh Purandare Reviewed-by: Winnie Hsu Reviewed-by: Matthew Pedro --- drivers/video/tegra/nvmap/nvmap_dev.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/tegra/nvmap/nvmap_dev.c b/drivers/video/tegra/nvmap/nvmap_dev.c index 0c12348db88e..3b0db14f16ca 100644 --- a/drivers/video/tegra/nvmap/nvmap_dev.c +++ b/drivers/video/tegra/nvmap/nvmap_dev.c @@ -1,10 +1,10 @@ /* + * Copyright (c) 2011-2013, NVIDIA CORPORATION. All rights reserved. + * * drivers/video/tegra/nvmap/nvmap_dev.c * * User-space interface to nvmap * - * Copyright (c) 2011-2012, NVIDIA Corporation. - * * 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 * the Free Software Foundation; either version 2 of the License, or @@ -231,6 +231,14 @@ struct nvmap_handle *nvmap_get_handle_id(struct nvmap_client *client, struct nvmap_handle_ref *ref; struct nvmap_handle *h = NULL; + /* 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 */ + if (!strcmp(((struct nvmap_handle *)id)->owner->name, + "videobuf2-dma-nvmap")) + client = ((struct nvmap_handle *)id)->owner; + nvmap_ref_lock(client); ref = _nvmap_validate_id_locked(client, id); if (ref) -- cgit v1.2.3