linux/drivers/gpu/drm/gud/gud_drv.c

// SPDX-License-Identifier: MIT
/*
 * Copyright 2020 Noralf Trønnes
 */

#include <linux/dma-buf.h>
#include <linux/dma-mapping.h>
#include <linux/lz4.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/string_helpers.h>
#include <linux/usb.h>
#include <linux/vmalloc.h>
#include <linux/workqueue.h>

#include <drm/drm_atomic_helper.h>
#include <drm/drm_blend.h>
#include <drm/drm_damage_helper.h>
#include <drm/drm_debugfs.h>
#include <drm/drm_drv.h>
#include <drm/drm_fbdev_shmem.h>
#include <drm/drm_fourcc.h>
#include <drm/drm_gem_atomic_helper.h>
#include <drm/drm_gem_framebuffer_helper.h>
#include <drm/drm_gem_shmem_helper.h>
#include <drm/drm_managed.h>
#include <drm/drm_print.h>
#include <drm/drm_probe_helper.h>
#include <drm/drm_simple_kms_helper.h>
#include <drm/gud.h>

#include "gud_internal.h"

/* Only used internally */
static const struct drm_format_info gud_drm_format_r1 =;

static const struct drm_format_info gud_drm_format_xrgb1111 =;

static int gud_usb_control_msg(struct usb_interface *intf, bool in,
			       u8 request, u16 value, void *buf, size_t len)
{}

static int gud_get_display_descriptor(struct usb_interface *intf,
				      struct gud_display_descriptor_req *desc)
{}

static int gud_status_to_errno(u8 status)
{}

static int gud_usb_get_status(struct usb_interface *intf)
{}

static int gud_usb_transfer(struct gud_device *gdrm, bool in, u8 request, u16 index,
			    void *buf, size_t len)
{}

/*
 * @buf cannot be allocated on the stack.
 * Returns number of bytes received or negative error code on failure.
 */
int gud_usb_get(struct gud_device *gdrm, u8 request, u16 index, void *buf, size_t max_len)
{}

/*
 * @buf can be allocated on the stack or NULL.
 * Returns zero on success or negative error code on failure.
 */
int gud_usb_set(struct gud_device *gdrm, u8 request, u16 index, void *buf, size_t len)
{}

/*
 * @val can be allocated on the stack.
 * Returns zero on success or negative error code on failure.
 */
int gud_usb_get_u8(struct gud_device *gdrm, u8 request, u16 index, u8 *val)
{}

/* Returns zero on success or negative error code on failure. */
int gud_usb_set_u8(struct gud_device *gdrm, u8 request, u8 val)
{}

static int gud_get_properties(struct gud_device *gdrm)
{}

/*
 * FIXME: Dma-buf sharing requires DMA support by the importing device.
 *        This function is a workaround to make USB devices work as well.
 *        See todo.rst for how to fix the issue in the dma-buf framework.
 */
static struct drm_gem_object *gud_gem_prime_import(struct drm_device *drm, struct dma_buf *dma_buf)
{}

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

static const struct drm_simple_display_pipe_funcs gud_pipe_funcs =;

static const struct drm_mode_config_funcs gud_mode_config_funcs =;

static const u64 gud_pipe_modifiers[] =;

DEFINE_DRM_GEM_FOPS(gud_fops);

static const struct drm_driver gud_drm_driver =;

static int gud_alloc_bulk_buffer(struct gud_device *gdrm)
{}

static void gud_free_buffers_and_mutex(void *data)
{}

static int gud_probe(struct usb_interface *intf, const struct usb_device_id *id)
{}

static void gud_disconnect(struct usb_interface *interface)
{}

static int gud_suspend(struct usb_interface *intf, pm_message_t message)
{}

static int gud_resume(struct usb_interface *intf)
{}

static const struct usb_device_id gud_id_table[] =;

MODULE_DEVICE_TABLE(usb, gud_id_table);

static struct usb_driver gud_usb_driver =;

module_usb_driver();

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();