aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_info.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-10-14 03:39:08 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-10-14 03:39:08 -0400
commit2d65a9f48fcdf7866aab6457bc707ca233e0c791 (patch)
treef93e5838d6ac2e59434367f4ff905f7d9c45fc2b /drivers/gpu/drm/drm_info.c
parentda92da3638a04894afdca8b99e973ddd20268471 (diff)
parentdfda0df3426483cf5fc7441f23f318edbabecb03 (diff)
Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux
Pull drm updates from Dave Airlie: "This is the main git pull for the drm, I pretty much froze major pulls at -rc5/6 time, and haven't had much fallout, so will probably continue doing that. Lots of changes all over, big internal header cleanup to make it clear drm features are legacy things and what are things that modern KMS drivers should be using. Also big move to use the new generic fences in all the TTM drivers. core: atomic prep work, vblank rework changes, allows immediate vblank disables major header reworking and cleanups to better delinate legacy interfaces from what KMS drivers should be using. cursor planes locking fixes ttm: move to generic fences (affects all TTM drivers) ppc64 caching fixes radeon: userptr support, uvd for old asics, reset rework for fence changes better buffer placement changes, dpm feature enablement hdmi audio support fixes intel: Cherryview work, 180 degree rotation, skylake prep work, execlist command submission full ppgtt prep work cursor improvements edid caching, vdd handling improvements nouveau: fence reworking kepler memory clock work gt21x clock work fan control improvements hdmi infoframe fixes DP audio ast: ppc64 fixes caching fix rcar: rcar-du DT support ipuv3: prep work for capture support msm: LVDS support for mdp4, new panel, gpu refactoring exynos: exynos3250 SoC support, drop bad mmap interface, mipi dsi changes, and component match support" * 'drm-next' of git://people.freedesktop.org/~airlied/linux: (640 commits) drm/mst: rework payload table allocation to conform better. drm/ast: Fix HW cursor image drm/radeon/kv: add uvd/vce info to dpm debugfs output drm/radeon/ci: add uvd/vce info to dpm debugfs output drm/radeon: export reservation_object from dmabuf to ttm drm/radeon: cope with foreign fences inside the reservation object drm/radeon: cope with foreign fences inside display drm/core: use helper to check driver features drm/radeon/cik: write gfx ucode version to ucode addr reg drm/radeon/si: print full CS when we hit a packet 0 drm/radeon: remove unecessary includes drm/radeon/combios: declare legacy_connector_convert as static drm/radeon/atombios: declare connector convert tables as static drm/radeon: drop btc_get_max_clock_from_voltage_dependency_table drm/radeon/dpm: drop clk/voltage dependency filters for BTC drm/radeon/dpm: drop clk/voltage dependency filters for CI drm/radeon/dpm: drop clk/voltage dependency filters for SI drm/radeon/dpm: drop clk/voltage dependency filters for NI drm/radeon: disable audio when we disable hdmi (v2) drm/radeon: split audio enable between eg and r600 (v2) ...
Diffstat (limited to 'drivers/gpu/drm/drm_info.c')
-rw-r--r--drivers/gpu/drm/drm_info.c89
1 files changed, 25 insertions, 64 deletions
diff --git a/drivers/gpu/drm/drm_info.c b/drivers/gpu/drm/drm_info.c
index ecaf0fa2eec8..51efebd434f3 100644
--- a/drivers/gpu/drm/drm_info.c
+++ b/drivers/gpu/drm/drm_info.c
@@ -35,6 +35,9 @@
35 35
36#include <linux/seq_file.h> 36#include <linux/seq_file.h>
37#include <drm/drmP.h> 37#include <drm/drmP.h>
38#include <drm/drm_gem.h>
39
40#include "drm_legacy.h"
38 41
39/** 42/**
40 * Called when "/proc/dri/.../name" is read. 43 * Called when "/proc/dri/.../name" is read.
@@ -183,15 +186,32 @@ int drm_clients_info(struct seq_file *m, void *data)
183 struct drm_device *dev = node->minor->dev; 186 struct drm_device *dev = node->minor->dev;
184 struct drm_file *priv; 187 struct drm_file *priv;
185 188
189 seq_printf(m,
190 "%20s %5s %3s master a %5s %10s\n",
191 "command",
192 "pid",
193 "dev",
194 "uid",
195 "magic");
196
197 /* dev->filelist is sorted youngest first, but we want to present
198 * oldest first (i.e. kernel, servers, clients), so walk backwardss.
199 */
186 mutex_lock(&dev->struct_mutex); 200 mutex_lock(&dev->struct_mutex);
187 seq_printf(m, "a dev pid uid magic\n\n"); 201 list_for_each_entry_reverse(priv, &dev->filelist, lhead) {
188 list_for_each_entry(priv, &dev->filelist, lhead) { 202 struct task_struct *task;
189 seq_printf(m, "%c %3d %5d %5d %10u\n", 203
190 priv->authenticated ? 'y' : 'n', 204 rcu_read_lock(); /* locks pid_task()->comm */
191 priv->minor->index, 205 task = pid_task(priv->pid, PIDTYPE_PID);
206 seq_printf(m, "%20s %5d %3d %c %c %5d %10u\n",
207 task ? task->comm : "<unknown>",
192 pid_vnr(priv->pid), 208 pid_vnr(priv->pid),
209 priv->minor->index,
210 priv->is_master ? 'y' : 'n',
211 priv->authenticated ? 'y' : 'n',
193 from_kuid_munged(seq_user_ns(m), priv->uid), 212 from_kuid_munged(seq_user_ns(m), priv->uid),
194 priv->magic); 213 priv->magic);
214 rcu_read_unlock();
195 } 215 }
196 mutex_unlock(&dev->struct_mutex); 216 mutex_unlock(&dev->struct_mutex);
197 return 0; 217 return 0;
@@ -223,62 +243,3 @@ int drm_gem_name_info(struct seq_file *m, void *data)
223 243
224 return 0; 244 return 0;
225} 245}
226
227#if DRM_DEBUG_CODE
228
229int drm_vma_info(struct seq_file *m, void *data)
230{
231 struct drm_info_node *node = (struct drm_info_node *) m->private;
232 struct drm_device *dev = node->minor->dev;
233 struct drm_vma_entry *pt;
234 struct vm_area_struct *vma;
235 unsigned long vma_count = 0;
236#if defined(__i386__)
237 unsigned int pgprot;
238#endif
239
240 mutex_lock(&dev->struct_mutex);
241 list_for_each_entry(pt, &dev->vmalist, head)
242 vma_count++;
243
244 seq_printf(m, "vma use count: %lu, high_memory = %pK, 0x%pK\n",
245 vma_count, high_memory,
246 (void *)(unsigned long)virt_to_phys(high_memory));
247
248 list_for_each_entry(pt, &dev->vmalist, head) {
249 vma = pt->vma;
250 if (!vma)
251 continue;
252 seq_printf(m,
253 "\n%5d 0x%pK-0x%pK %c%c%c%c%c%c 0x%08lx000",
254 pt->pid,
255 (void *)vma->vm_start, (void *)vma->vm_end,
256 vma->vm_flags & VM_READ ? 'r' : '-',
257 vma->vm_flags & VM_WRITE ? 'w' : '-',
258 vma->vm_flags & VM_EXEC ? 'x' : '-',
259 vma->vm_flags & VM_MAYSHARE ? 's' : 'p',
260 vma->vm_flags & VM_LOCKED ? 'l' : '-',
261 vma->vm_flags & VM_IO ? 'i' : '-',
262 vma->vm_pgoff);
263
264#if defined(__i386__)
265 pgprot = pgprot_val(vma->vm_page_prot);
266 seq_printf(m, " %c%c%c%c%c%c%c%c%c",
267 pgprot & _PAGE_PRESENT ? 'p' : '-',
268 pgprot & _PAGE_RW ? 'w' : 'r',
269 pgprot & _PAGE_USER ? 'u' : 's',
270 pgprot & _PAGE_PWT ? 't' : 'b',
271 pgprot & _PAGE_PCD ? 'u' : 'c',
272 pgprot & _PAGE_ACCESSED ? 'a' : '-',
273 pgprot & _PAGE_DIRTY ? 'd' : '-',
274 pgprot & _PAGE_PSE ? 'm' : 'k',
275 pgprot & _PAGE_GLOBAL ? 'g' : 'l');
276#endif
277 seq_printf(m, "\n");
278 }
279 mutex_unlock(&dev->struct_mutex);
280 return 0;
281}
282
283#endif
284