summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorKevin Huang <kevinh@nvidia.com>2012-05-31 16:55:15 -0700
committerSimone Willett <swillett@nvidia.com>2012-06-04 14:43:15 -0700
commitde263f6e253976d8371da7e7b7089f1d9b79e92b (patch)
treeb2b8753436aa4229815deeb94ea82c125c3112aa /drivers
parent6265d503687da50baefd1b8364abd7194a5826e8 (diff)
video: tegra: dc: Export dispay feature table.
Bug 992947 Change-Id: I0d1ecc9f8f042956cbe631779260a38573936616 Signed-off-by: Kevin Huang <kevinh@nvidia.com> Reviewed-on: http://git-master/r/105776 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Jon Mayo <jmayo@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/tegra/dc/dc_config.h6
-rw-r--r--drivers/video/tegra/dc/ext/dev.c31
2 files changed, 34 insertions, 3 deletions
diff --git a/drivers/video/tegra/dc/dc_config.h b/drivers/video/tegra/dc/dc_config.h
index f513cd06dc45..314cd11e77f9 100644
--- a/drivers/video/tegra/dc/dc_config.h
+++ b/drivers/video/tegra/dc/dc_config.h
@@ -129,13 +129,13 @@ enum tegra_dc_feature_option {
};
struct tegra_dc_feature_entry {
- int window_index;
- enum tegra_dc_feature_option option;
+ u32 window_index;
+ u32 option;
long arg[ENTRY_SIZE];
};
struct tegra_dc_feature {
- unsigned num_entries;
+ u32 num_entries;
struct tegra_dc_feature_entry *entries;
};
diff --git a/drivers/video/tegra/dc/ext/dev.c b/drivers/video/tegra/dc/ext/dev.c
index c349a4720d2e..a8de7a7a26e0 100644
--- a/drivers/video/tegra/dc/ext/dev.c
+++ b/drivers/video/tegra/dc/ext/dev.c
@@ -708,6 +708,21 @@ static int tegra_dc_ext_get_status(struct tegra_dc_ext_user *user,
return 0;
}
+static int tegra_dc_ext_get_feature(struct tegra_dc_ext_user *user,
+ struct tegra_dc_ext_feature *feature)
+{
+ struct tegra_dc *dc = user->ext->dc;
+ struct tegra_dc_feature *table = dc->feature;
+
+ if (dc->enabled && feature->entries) {
+ feature->length = table->num_entries;
+ memcpy(feature->entries, table->entries, table->num_entries *
+ sizeof(struct tegra_dc_feature_entry));
+ }
+
+ return 0;
+}
+
static long tegra_dc_ioctl(struct file *filp, unsigned int cmd,
unsigned long arg)
{
@@ -805,6 +820,22 @@ static long tegra_dc_ioctl(struct file *filp, unsigned int cmd,
return tegra_dc_ext_set_lut(user, &args);
}
+ case TEGRA_DC_EXT_GET_FEATURES:
+ {
+ struct tegra_dc_ext_feature args;
+ int ret;
+
+ if (copy_from_user(&args, user_arg, sizeof(args)))
+ return -EFAULT;
+
+ ret = tegra_dc_ext_get_feature(user, &args);
+
+ if (copy_to_user(user_arg, &args, sizeof(args)))
+ return -EFAULT;
+
+ return ret;
+ }
+
default:
return -EINVAL;
}