libdrm: Add DRM_TEGRA_(G|S)ET_CLK_RATE ioctls

Add drm_tegra_get_clk_rate and drm_tegra_set_clk_rate structs and their
corresponding ioctl opcodes.  These are pulled from chromeos-3.18 kernel.

Change-Id: Iaea44706f7d7f7a36e8b88aea5c8facfbdd0ef18
Signed-off-by: Andrew Chew <achew@nvidia.com>
diff --git a/include/drm/tegra_drm.h b/include/drm/tegra_drm.h
index f97e82d..30f3590 100644
--- a/include/drm/tegra_drm.h
+++ b/include/drm/tegra_drm.h
@@ -163,6 +163,29 @@
 	__u32 flags;
 };
 
+enum request_type {
+	DRM_TEGRA_REQ_TYPE_CLK_KHZ = 0,
+	DRM_TEGRA_REQ_TYPE_BW_KBPS,
+};
+
+struct drm_tegra_get_clk_rate {
+	/* class ID*/
+	__u32 id;
+	/* request type: KBps or KHz */
+	__u32 type;
+	/* numeric value for type */
+	__u64 data;
+};
+
+struct drm_tegra_set_clk_rate {
+	/* class ID*/
+	__u32 id;
+	/* request type: KBps or KHz */
+	__u32 type;
+	/* numeric value for type */
+	__u64 data;
+};
+
 #define DRM_TEGRA_GEM_CREATE		0x00
 #define DRM_TEGRA_GEM_MMAP		0x01
 #define DRM_TEGRA_SYNCPT_READ		0x02
@@ -177,6 +200,8 @@
 #define DRM_TEGRA_GEM_GET_TILING	0x0b
 #define DRM_TEGRA_GEM_SET_FLAGS		0x0c
 #define DRM_TEGRA_GEM_GET_FLAGS		0x0d
+#define DRM_TEGRA_GET_CLK_RATE		0x0e
+#define DRM_TEGRA_SET_CLK_RATE		0x0f
 
 #define DRM_IOCTL_TEGRA_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GEM_CREATE, struct drm_tegra_gem_create)
 #define DRM_IOCTL_TEGRA_GEM_MMAP DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GEM_MMAP, struct drm_tegra_gem_mmap)
@@ -192,5 +217,7 @@
 #define DRM_IOCTL_TEGRA_GEM_GET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GEM_GET_TILING, struct drm_tegra_gem_get_tiling)
 #define DRM_IOCTL_TEGRA_GEM_SET_FLAGS DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GEM_SET_FLAGS, struct drm_tegra_gem_set_flags)
 #define DRM_IOCTL_TEGRA_GEM_GET_FLAGS DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GEM_GET_FLAGS, struct drm_tegra_gem_get_flags)
+#define DRM_IOCTL_TEGRA_GET_CLK_RATE DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GET_CLK_RATE, struct drm_tegra_get_clk_rate)
+#define DRM_IOCTL_TEGRA_SET_CLK_RATE DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_SET_CLK_RATE, struct drm_tegra_set_clk_rate)
 
 #endif