video: tegra: Expose possible bound head mask
Robert Morell [Mon, 21 Mar 2011 21:42:35 +0000 (14:42 -0700)]
This change adds support for userspace to query which heads an output
may be bound to.  Since our implementation currently hardcodes the head
to output mapping, we currently always fill in a single bit.  However,
for future implementations we will be able to dynamically bind outputs
to heads.

bug 818525

Original-Change-Id: Ib0dead7748620a538c8f8d6ef548ca8b13a9c2b2
Signed-off-by: Robert Morell <rmorell@nvidia.com>
Reviewed-on: http://git-master/r/40528
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>
Tested-by: Varun Colbert <vcolbert@nvidia.com>

Rebase-Id: R524f90dca82a3a67fa3289a3ebc4c7e32716749b

drivers/video/tegra/dc/ext/control.c
include/video/tegra_dc_ext.h

index aab7db4..1bf0b2d 100644 (file)
@@ -54,6 +54,7 @@ get_output_properties(struct tegra_dc_ext_control_output_properties *properties)
        }
 
        properties->associated_head = properties->handle;
+       properties->head_mask = (1 << properties->associated_head);
 
        dc = tegra_dc_get_dc(properties->associated_head);
        properties->connected = tegra_dc_get_connected(dc);
index a7c455c..971becc 100644 (file)
@@ -193,11 +193,23 @@ enum tegra_dc_ext_control_output_type {
        TEGRA_DC_EXT_DVI,
 };
 
+/*
+ * Get the properties for a given output.
+ *
+ * handle (in): Which output to query
+ * type (out): Describes the type of the output
+ * connected (out): Non-zero iff the output is currently connected
+ * associated_head (out): The head number that the output is currently
+ *      bound to.  -1 iff the output is not associated with any head.
+ * head_mask (out): Bitmask of which heads the output may be bound to (some
+ *      outputs are permanently bound to a single head).
+ */
 struct tegra_dc_ext_control_output_properties {
        __u32 handle;
        enum tegra_dc_ext_control_output_type type;
        __u32 connected;
        __s32 associated_head;
+       __u32 head_mask;
 };
 
 struct tegra_dc_ext_control_output_edid {