linux/drivers/gpu/drm/drm_fbdev_ttm.c

// SPDX-License-Identifier: MIT

#include <linux/moduleparam.h>
#include <linux/vmalloc.h>

#include <drm/drm_crtc_helper.h>
#include <drm/drm_drv.h>
#include <drm/drm_fb_helper.h>
#include <drm/drm_framebuffer.h>
#include <drm/drm_gem.h>
#include <drm/drm_print.h>

#include <drm/drm_fbdev_ttm.h>

/* @user: 1=userspace, 0=fbcon */
static int drm_fbdev_ttm_fb_open(struct fb_info *info, int user)
{}

static int drm_fbdev_ttm_fb_release(struct fb_info *info, int user)
{}

FB_GEN_DEFAULT_DEFERRED_SYSMEM_OPS(drm_fbdev_ttm,
				   drm_fb_helper_damage_range,
				   drm_fb_helper_damage_area);

static void drm_fbdev_ttm_fb_destroy(struct fb_info *info)
{}

static const struct fb_ops drm_fbdev_ttm_fb_ops =;

/*
 * This function uses the client API to create a framebuffer backed by a dumb buffer.
 */
static int drm_fbdev_ttm_helper_fb_probe(struct drm_fb_helper *fb_helper,
					     struct drm_fb_helper_surface_size *sizes)
{}

static void drm_fbdev_ttm_damage_blit_real(struct drm_fb_helper *fb_helper,
					   struct drm_clip_rect *clip,
					   struct iosys_map *dst)
{}

static int drm_fbdev_ttm_damage_blit(struct drm_fb_helper *fb_helper,
				     struct drm_clip_rect *clip)
{}

static int drm_fbdev_ttm_helper_fb_dirty(struct drm_fb_helper *helper,
					 struct drm_clip_rect *clip)
{}

static const struct drm_fb_helper_funcs drm_fbdev_ttm_helper_funcs =;

static void drm_fbdev_ttm_client_unregister(struct drm_client_dev *client)
{}

static int drm_fbdev_ttm_client_restore(struct drm_client_dev *client)
{}

static int drm_fbdev_ttm_client_hotplug(struct drm_client_dev *client)
{}

static const struct drm_client_funcs drm_fbdev_ttm_client_funcs =;

/**
 * drm_fbdev_ttm_setup() - Setup fbdev emulation for TTM-based drivers
 * @dev: DRM device
 * @preferred_bpp: Preferred bits per pixel for the device.
 *
 * This function sets up fbdev emulation for TTM-based drivers that support
 * dumb buffers with a virtual address and that can be mmap'ed.
 * drm_fbdev_ttm_setup() shall be called after the DRM driver registered
 * the new DRM device with drm_dev_register().
 *
 * Restore, hotplug events and teardown are all taken care of. Drivers that do
 * suspend/resume need to call drm_fb_helper_set_suspend_unlocked() themselves.
 * Simple drivers might use drm_mode_config_helper_suspend().
 *
 * In order to provide fixed mmap-able memory ranges, fbdev emulation
 * uses a shadow buffer in system memory. The implementation blits the shadow
 * fbdev buffer onto the real buffer in regular intervals.
 *
 * This function is safe to call even when there are no connectors present.
 * Setup will be retried on the next hotplug event.
 *
 * The fbdev is destroyed by drm_dev_unregister().
 */
void drm_fbdev_ttm_setup(struct drm_device *dev, unsigned int preferred_bpp)
{}
EXPORT_SYMBOL();