/* * Created: Sun Dec 21 13:08:50 2008 by bgamari@gmail.com * * Copyright 2008 Ben Gamari <bgamari@gmail.com> * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE.
*/
/** * drm_debugfs_gpuva_info - dump the given DRM GPU VA space * @m: pointer to the &seq_file to write * @gpuvm: the &drm_gpuvm representing the GPU VA space * * Dumps the GPU VA mappings of a given DRM GPU VA manager. * * For each DRM GPU VA space drivers should call this function from their * &drm_info_list's show callback. * * Returns: 0 on success, -ENODEV if the &gpuvm is not initialized
*/ int drm_debugfs_gpuva_info(struct seq_file *m, struct drm_gpuvm *gpuvm)
{ struct drm_gpuva *va, *kva = &gpuvm->kernel_alloc_node;
if (!gpuvm->name) return -ENODEV;
seq_printf(m, "DRM GPU VA space (%s) [0x%016llx;0x%016llx]\n",
gpuvm->name, gpuvm->mm_start, gpuvm->mm_start + gpuvm->mm_range);
seq_printf(m, "Kernel reserved node [0x%016llx;0x%016llx]\n",
kva->va.addr, kva->va.addr + kva->va.range);
seq_puts(m, "\n");
seq_puts(m, " VAs | start | range | end | object | object offset\n");
seq_puts(m, "-------------------------------------------------------------------------------------------------------------\n");
drm_gpuvm_for_each_va(va, gpuvm) { if (unlikely(va == kva)) continue;
/** * drm_debugfs_create_files - Initialize a given set of debugfs files for DRM * minor * @files: The array of files to create * @count: The number of files given * @root: DRI debugfs dir entry. * @minor: device minor number * * Create a given set of debugfs files represented by an array of * &struct drm_info_list in the given root directory. These files will be removed * automatically on drm_debugfs_dev_fini().
*/ void drm_debugfs_create_files(conststruct drm_info_list *files, int count, struct dentry *root, struct drm_minor *minor)
{ struct drm_device *dev = minor->dev; struct drm_info_node *tmp; int i;
for (i = 0; i < count; i++) {
u32 features = files[i].driver_features;
if (features && !drm_core_check_all_features(dev, features)) continue;
tmp = drmm_kzalloc(dev, sizeof(*tmp), GFP_KERNEL); if (tmp == NULL) continue;
/** * drm_debugfs_clients_add - Add a per client debugfs directory * @file: drm_file for a client * * Create the debugfs directory for each client. This will be used to populate * driver specific data for each client. * * Also add the process information debugfs file for each client to tag * which client belongs to which process.
*/ void drm_debugfs_clients_add(struct drm_file *file)
{ char *client;
client = kasprintf(GFP_KERNEL, "client-%llu", file->client_id); if (!client) return;
/* Create a debugfs directory for the client in root on drm debugfs */
file->debugfs_client = debugfs_create_dir(client, drm_debugfs_root);
kfree(client);
client = kasprintf(GFP_KERNEL, "../%s", file->minor->dev->unique); if (!client) return;
/* Create a link from client_id to the drm device this client id belongs to */
debugfs_create_symlink("device", file->debugfs_client, client);
kfree(client);
}
/** * drm_debugfs_clients_remove - removes all debugfs directories and files * @file: drm_file for a client * * Removes the debugfs directories recursively from the client directory. * * There is also a possibility that debugfs files are open while the drm_file * is released.
*/ void drm_debugfs_clients_remove(struct drm_file *file)
{
debugfs_remove_recursive(file->debugfs_client);
file->debugfs_client = NULL;
}
/** * drm_debugfs_dev_init - create debugfs directory for the device * @dev: the device which we want to create the directory for * * Creates the debugfs directory for the device under the given root directory.
*/ void drm_debugfs_dev_init(struct drm_device *dev)
{ if (drm_core_check_feature(dev, DRIVER_COMPUTE_ACCEL))
dev->debugfs_root = debugfs_create_dir(dev->unique, accel_debugfs_root); else
dev->debugfs_root = debugfs_create_dir(dev->unique, drm_debugfs_root);
}
/** * drm_debugfs_dev_fini - cleanup debugfs directory * @dev: the device to cleanup the debugfs stuff * * Remove the debugfs directory, might be called multiple times.
*/ void drm_debugfs_dev_fini(struct drm_device *dev)
{
debugfs_remove_recursive(dev->debugfs_root);
dev->debugfs_root = NULL;
}
/** * drm_debugfs_add_file - Add a given file to the DRM device debugfs file list * @dev: drm device for the ioctl * @name: debugfs file name * @show: show callback * @data: driver-private data, should not be device-specific * * Add a given file entry to the DRM device debugfs file list to be created on * drm_debugfs_init.
*/ void drm_debugfs_add_file(struct drm_device *dev, constchar *name, int (*show)(struct seq_file*, void*), void *data)
{ struct drm_debugfs_entry *entry = drmm_kzalloc(dev, sizeof(*entry), GFP_KERNEL);
/** * drm_debugfs_add_files - Add an array of files to the DRM device debugfs file list * @dev: drm device for the ioctl * @files: The array of files to create * @count: The number of files given * * Add a given set of debugfs files represented by an array of * &struct drm_debugfs_info in the DRM device debugfs file list.
*/ void drm_debugfs_add_files(struct drm_device *dev, conststruct drm_debugfs_info *files, int count)
{ int i;
for (i = 0; i < count; i++)
drm_debugfs_add_file(dev, files[i].name, files[i].show, files[i].data);
}
EXPORT_SYMBOL(drm_debugfs_add_files);
buf = memdup_user(ubuf, len); if (IS_ERR(buf)) return PTR_ERR(buf);
if (len == 5 && !strncmp(buf, "reset", 5))
ret = drm_edid_override_reset(connector); else
ret = drm_edid_override_set(connector, buf, len);
kfree(buf);
return ret ? ret : len;
}
/* * Returns the min and max vrr vfreq through the connector's debugfs file. * Example usage: cat /sys/kernel/debug/dri/0/DP-1/vrr_range
*/ staticint vrr_range_show(struct seq_file *m, void *data)
{ struct drm_connector *connector = m->private;
if (connector->status != connector_status_connected) return -ENODEV;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.