aboutsummaryrefslogtreecommitdiffstats
path: root/meta-steppeeagle/recipes-kernel/linux/linux-yocto/0015-yocto-amd-drm-radeon-add-uvd-debugfs-support.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-steppeeagle/recipes-kernel/linux/linux-yocto/0015-yocto-amd-drm-radeon-add-uvd-debugfs-support.patch')
-rw-r--r--meta-steppeeagle/recipes-kernel/linux/linux-yocto/0015-yocto-amd-drm-radeon-add-uvd-debugfs-support.patch99
1 files changed, 99 insertions, 0 deletions
diff --git a/meta-steppeeagle/recipes-kernel/linux/linux-yocto/0015-yocto-amd-drm-radeon-add-uvd-debugfs-support.patch b/meta-steppeeagle/recipes-kernel/linux/linux-yocto/0015-yocto-amd-drm-radeon-add-uvd-debugfs-support.patch
new file mode 100644
index 00000000..fd312353
--- /dev/null
+++ b/meta-steppeeagle/recipes-kernel/linux/linux-yocto/0015-yocto-amd-drm-radeon-add-uvd-debugfs-support.patch
@@ -0,0 +1,99 @@
+From 627d32e67d83a65294cb9da1e7ef796009b0e5d8 Mon Sep 17 00:00:00 2001
+From: Leo Liu <leo.liu@amd.com>
+Date: Mon, 25 Nov 2013 17:25:41 -0500
+Subject: [PATCH 15/44] drm/radeon: add uvd debugfs support
+
+Signed-off-by: Leo Liu <leo.liu@amd.com>
+---
+ drivers/gpu/drm/radeon/radeon.h | 1 +
+ drivers/gpu/drm/radeon/radeon_uvd.c | 37 +++++++++++++++++++++++++++++++++++
+ 2 files changed, 38 insertions(+)
+
+diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
+index a21b1d4..b212569 100644
+--- a/drivers/gpu/drm/radeon/radeon.h
++++ b/drivers/gpu/drm/radeon/radeon.h
+@@ -1549,6 +1549,7 @@ struct radeon_uvd {
+ struct drm_file *filp[RADEON_MAX_UVD_HANDLES];
+ unsigned img_size[RADEON_MAX_UVD_HANDLES];
+ struct delayed_work idle_work;
++ bool status;
+ };
+
+ int radeon_uvd_init(struct radeon_device *rdev);
+diff --git a/drivers/gpu/drm/radeon/radeon_uvd.c b/drivers/gpu/drm/radeon/radeon_uvd.c
+index 1d029cc..2b502b4 100644
+--- a/drivers/gpu/drm/radeon/radeon_uvd.c
++++ b/drivers/gpu/drm/radeon/radeon_uvd.c
+@@ -53,6 +53,7 @@ MODULE_FIRMWARE(FIRMWARE_TAHITI);
+ MODULE_FIRMWARE(FIRMWARE_BONAIRE);
+
+ static void radeon_uvd_idle_work_handler(struct work_struct *work);
++static int radeon_debugfs_uvd_init(struct radeon_device *rdev);
+
+ int radeon_uvd_init(struct radeon_device *rdev)
+ {
+@@ -142,6 +143,10 @@ int radeon_uvd_init(struct radeon_device *rdev)
+ return r;
+ }
+
++ r = radeon_debugfs_uvd_init(rdev);
++ if (r)
++ dev_err(rdev->dev, "(%d) Register debugfs file for uvd failed\n", r);
++
+ radeon_bo_unreserve(rdev->uvd.vcpu_bo);
+
+ for (i = 0; i < RADEON_MAX_UVD_HANDLES; ++i) {
+@@ -785,6 +790,7 @@ static void radeon_uvd_idle_work_handler(struct work_struct *work)
+ schedule_delayed_work(&rdev->uvd.idle_work,
+ msecs_to_jiffies(UVD_IDLE_TIMEOUT_MS));
+ }
++ rdev->uvd.status = false;
+ }
+
+ void radeon_uvd_note_usage(struct radeon_device *rdev)
+@@ -812,6 +818,7 @@ void radeon_uvd_note_usage(struct radeon_device *rdev)
+ } else {
+ radeon_set_uvd_clocks(rdev, 53300, 40000);
+ }
++ rdev->uvd.status = true;
+ }
+ }
+
+@@ -951,3 +958,33 @@ int radeon_uvd_send_upll_ctlreq(struct radeon_device *rdev,
+
+ return 0;
+ }
++
++/*
++ * Debugfs info
++ */
++#if defined(CONFIG_DEBUG_FS)
++
++static int radeon_debugfs_uvd_info(struct seq_file *m, void *data)
++{
++ struct drm_info_node *node = (struct drm_info_node *) m->private;
++ struct drm_device *dev = node->minor->dev;
++ struct radeon_device *rdev = dev->dev_private;
++
++ seq_printf(m, "UVD Status: %s\n", ((rdev->uvd.status) ? "Busy" : "Idle"));
++
++ return 0;
++}
++
++static struct drm_info_list radeon_uvd_info_list[] = {
++ {"radeon_uvd_info", radeon_debugfs_uvd_info, 0, NULL},
++};
++#endif
++
++static int radeon_debugfs_uvd_init(struct radeon_device *rdev)
++{
++#if defined(CONFIG_DEBUG_FS)
++ return radeon_debugfs_add_files(rdev, radeon_uvd_info_list, ARRAY_SIZE(radeon_uvd_info_list));
++#else
++ return 0;
++#endif
++}
+--
+1.7.9.5
+