linux/drivers/gpu/drm/drm_debugfs.c

/*
 * Created: Sun Dec 21 13:08:50 2008 by [email protected]
 *
 * Copyright 2008 Ben Gamari <[email protected]>
 *
 * 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.
 */

#include <linux/debugfs.h>
#include <linux/export.h>
#include <linux/seq_file.h>
#include <linux/slab.h>
#include <linux/uaccess.h>

#include <drm/drm_atomic.h>
#include <drm/drm_auth.h>
#include <drm/drm_bridge.h>
#include <drm/drm_client.h>
#include <drm/drm_debugfs.h>
#include <drm/drm_device.h>
#include <drm/drm_drv.h>
#include <drm/drm_edid.h>
#include <drm/drm_file.h>
#include <drm/drm_gem.h>
#include <drm/drm_managed.h>
#include <drm/drm_gpuvm.h>

#include "drm_crtc_internal.h"
#include "drm_internal.h"

/***************************************************
 * Initialization, etc.
 **************************************************/

static int drm_name_info(struct seq_file *m, void *data)
{}

static int drm_clients_info(struct seq_file *m, void *data)
{}

static int drm_gem_one_name_info(int id, void *ptr, void *data)
{}

static int drm_gem_name_info(struct seq_file *m, void *data)
{}

static const struct drm_debugfs_info drm_debugfs_list[] =;
#define DRM_DEBUGFS_ENTRIES


static int drm_debugfs_open(struct inode *inode, struct file *file)
{}

static int drm_debugfs_entry_open(struct inode *inode, struct file *file)
{}

static const struct file_operations drm_debugfs_entry_fops =;

static const struct file_operations drm_debugfs_fops =;

/**
 * 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)
{}
EXPORT_SYMBOL();

/**
 * 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(const struct drm_info_list *files, int count,
			      struct dentry *root, struct drm_minor *minor)
{}
EXPORT_SYMBOL();

int drm_debugfs_remove_files(const struct drm_info_list *files, int count,
			     struct dentry *root, struct drm_minor *minor)
{}
EXPORT_SYMBOL();

/**
 * drm_debugfs_dev_init - create debugfs directory for the device
 * @dev: the device which we want to create the directory for
 * @root: the parent directory depending on the device type
 *
 * Creates the debugfs directory for the device under the given root directory.
 */
void drm_debugfs_dev_init(struct drm_device *dev, struct dentry *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)
{}

void drm_debugfs_dev_register(struct drm_device *dev)
{}

int drm_debugfs_register(struct drm_minor *minor, int minor_id,
			 struct dentry *root)
{}

void drm_debugfs_unregister(struct drm_minor *minor)
{}

/**
 * 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, const char *name,
			  int (*show)(struct seq_file*, void*), void *data)
{}
EXPORT_SYMBOL();

/**
 * 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, const struct drm_debugfs_info *files, int count)
{}
EXPORT_SYMBOL();

static int connector_show(struct seq_file *m, void *data)
{}

static int connector_open(struct inode *inode, struct file *file)
{}

static ssize_t connector_write(struct file *file, const char __user *ubuf,
			       size_t len, loff_t *offp)
{}

static int edid_show(struct seq_file *m, void *data)
{}

static int edid_open(struct inode *inode, struct file *file)
{}

static ssize_t edid_write(struct file *file, const char __user *ubuf,
			  size_t len, loff_t *offp)
{}

/*
 * 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
 */
static int vrr_range_show(struct seq_file *m, void *data)
{}
DEFINE_SHOW_ATTRIBUTE();

/*
 * Returns Connector's max supported bpc through debugfs file.
 * Example usage: cat /sys/kernel/debug/dri/0/DP-1/output_bpc
 */
static int output_bpc_show(struct seq_file *m, void *data)
{}
DEFINE_SHOW_ATTRIBUTE();

static const struct file_operations drm_edid_fops =;


static const struct file_operations drm_connector_fops =;

#define HDMI_MAX_INFOFRAME_SIZE

static ssize_t
audio_infoframe_read(struct file *filp, char __user *ubuf, size_t count, loff_t *ppos)
{}

static const struct file_operations audio_infoframe_fops =;

static int create_hdmi_audio_infoframe_file(struct drm_connector *connector,
					    struct dentry *parent)
{}

#define DEFINE_INFOFRAME_FILE(_f)

DEFINE_INFOFRAME_FILE(avi);
DEFINE_INFOFRAME_FILE(hdmi);
DEFINE_INFOFRAME_FILE(hdr_drm);
DEFINE_INFOFRAME_FILE(spd);

static int create_hdmi_infoframe_files(struct drm_connector *connector,
				       struct dentry *parent)
{}

static void hdmi_debugfs_add(struct drm_connector *connector)
{}

void drm_debugfs_connector_add(struct drm_connector *connector)
{}

void drm_debugfs_connector_remove(struct drm_connector *connector)
{}

void drm_debugfs_crtc_add(struct drm_crtc *crtc)
{}

void drm_debugfs_crtc_remove(struct drm_crtc *crtc)
{}

static int bridges_show(struct seq_file *m, void *data)
{}
DEFINE_SHOW_ATTRIBUTE();

void drm_debugfs_encoder_add(struct drm_encoder *encoder)
{}

void drm_debugfs_encoder_remove(struct drm_encoder *encoder)
{}