PATH:
usr
/
src
/
kernels
/
5.14.0-611.49.2.el9_7.x86_64
/
include
/
drm
/* SPDX-License-Identifier: GPL-2.0 or MIT */ #ifndef _DRM_CLIENT_H_ #define _DRM_CLIENT_H_ #include <linux/iosys-map.h> #include <linux/lockdep.h> #include <linux/mutex.h> #include <linux/types.h> #include <drm/drm_connector.h> #include <drm/drm_crtc.h> struct drm_client_dev; struct drm_device; struct drm_file; struct drm_framebuffer; struct drm_gem_object; struct drm_minor; struct module; /** * struct drm_client_funcs - DRM client callbacks */ struct drm_client_funcs { /** * @owner: The module owner */ struct module *owner; /** * @unregister: * * Called when &drm_device is unregistered. The client should respond by * releasing its resources using drm_client_release(). * * This callback is optional. */ void (*unregister)(struct drm_client_dev *client); /** * @restore: * * Called on drm_lastclose(). The first client instance in the list that * returns zero gets the privilege to restore and no more clients are * called. This callback is not called after @unregister has been called. * * Note that the core does not guarantee exclusion against concurrent * drm_open(). Clients need to ensure this themselves, for example by * using drm_master_internal_acquire() and * drm_master_internal_release(). * * This callback is optional. */ int (*restore)(struct drm_client_dev *client); /** * @hotplug: * * Called on drm_kms_helper_hotplug_event(). * This callback is not called after @unregister has been called. * * This callback is optional. */ int (*hotplug)(struct drm_client_dev *client); /** * @suspend: * * Called when suspending the device. * * This callback is optional. * * FIXME: Some callers hold the console lock when invoking this * function. This interferes with fbdev emulation, which * also tries to acquire the lock. Push the console lock * into the callback and remove 'holds_console_lock'. */ int (*suspend)(struct drm_client_dev *client, bool holds_console_lock); /** * @resume: * * Called when resuming the device from suspend. * * This callback is optional. * * FIXME: Some callers hold the console lock when invoking this * function. This interferes with fbdev emulation, which * also tries to acquire the lock. Push the console lock * into the callback and remove 'holds_console_lock'. */ int (*resume)(struct drm_client_dev *client, bool holds_console_lock); }; /** * struct drm_client_dev - DRM client instance */ struct drm_client_dev { /** * @dev: DRM device */ struct drm_device *dev; /** * @name: Name of the client. */ const char *name; /** * @list: * * List of all clients of a DRM device, linked into * &drm_device.clientlist. Protected by &drm_device.clientlist_mutex. */ struct list_head list; /** * @funcs: DRM client functions (optional) */ const struct drm_client_funcs *funcs; /** * @file: DRM file */ struct drm_file *file; /** * @modeset_mutex: Protects @modesets. */ struct mutex modeset_mutex; /** * @modesets: CRTC configurations */ struct drm_mode_set *modesets; /** * @suspended: * * The client has been suspended. */ bool suspended; /** * @hotplug_pending: * * A hotplug event has been received while the client was suspended. * Try again on resume. */ bool hotplug_pending; /** * @hotplug_failed: * * Set by client hotplug helpers if the hotplugging failed * before. It is usually not tried again. */ bool hotplug_failed; }; int drm_client_init(struct drm_device *dev, struct drm_client_dev *client, const char *name, const struct drm_client_funcs *funcs); void drm_client_release(struct drm_client_dev *client); void drm_client_register(struct drm_client_dev *client); /** * struct drm_client_buffer - DRM client buffer */ struct drm_client_buffer { /** * @client: DRM client */ struct drm_client_dev *client; /** * @pitch: Buffer pitch */ u32 pitch; /** * @gem: GEM object backing this buffer * * FIXME: The dependency on GEM here isn't required, we could * convert the driver handle to a dma-buf instead and use the * backend-agnostic dma-buf vmap support instead. This would * require that the handle2fd prime ioctl is reworked to pull the * fd_install step out of the driver backend hooks, to make that * final step optional for internal users. */ struct drm_gem_object *gem; /** * @map: Virtual address for the buffer */ struct iosys_map map; /** * @fb: DRM framebuffer */ struct drm_framebuffer *fb; }; struct drm_client_buffer * drm_client_framebuffer_create(struct drm_client_dev *client, u32 width, u32 height, u32 format); void drm_client_framebuffer_delete(struct drm_client_buffer *buffer); int drm_client_framebuffer_flush(struct drm_client_buffer *buffer, struct drm_rect *rect); int drm_client_buffer_vmap_local(struct drm_client_buffer *buffer, struct iosys_map *map_copy); void drm_client_buffer_vunmap_local(struct drm_client_buffer *buffer); int drm_client_buffer_vmap(struct drm_client_buffer *buffer, struct iosys_map *map); void drm_client_buffer_vunmap(struct drm_client_buffer *buffer); int drm_client_modeset_create(struct drm_client_dev *client); void drm_client_modeset_free(struct drm_client_dev *client); int drm_client_modeset_probe(struct drm_client_dev *client, unsigned int width, unsigned int height); bool drm_client_rotation(struct drm_mode_set *modeset, unsigned int *rotation); int drm_client_modeset_check(struct drm_client_dev *client); int drm_client_modeset_commit_locked(struct drm_client_dev *client); int drm_client_modeset_commit(struct drm_client_dev *client); int drm_client_modeset_dpms(struct drm_client_dev *client, int mode); /** * drm_client_for_each_modeset() - Iterate over client modesets * @modeset: &drm_mode_set loop cursor * @client: DRM client */ #define drm_client_for_each_modeset(modeset, client) \ for (({ lockdep_assert_held(&(client)->modeset_mutex); }), \ modeset = (client)->modesets; modeset->crtc; modeset++) /** * drm_client_for_each_connector_iter - connector_list iterator macro * @connector: &struct drm_connector pointer used as cursor * @iter: &struct drm_connector_list_iter * * This iterates the connectors that are useable for internal clients (excludes * writeback connectors). * * For more info see drm_for_each_connector_iter(). */ #define drm_client_for_each_connector_iter(connector, iter) \ drm_for_each_connector_iter(connector, iter) \ if (connector->connector_type != DRM_MODE_CONNECTOR_WRITEBACK) #endif
[-] drm_eld.h
[edit]
[-] drm_bridge.h
[edit]
[-] spsc_queue.h
[edit]
[-] drm_gem_dma_helper.h
[edit]
[-] drm_property.h
[edit]
[-] drm_auth.h
[edit]
[-] drm_mipi_dbi.h
[edit]
[-] drm_mode_object.h
[edit]
[-] drm_pciids.h
[edit]
[+]
ttm
[-] drm_privacy_screen_machine.h
[edit]
[-] drm_fixed.h
[edit]
[-] drm_fb_helper.h
[edit]
[-] drm_gem_ttm_helper.h
[edit]
[-] drm_pagemap.h
[edit]
[-] drm_atomic_uapi.h
[edit]
[-] drm_module.h
[edit]
[+]
display
[-] drm_encoder.h
[edit]
[-] drm_file.h
[edit]
[-] drm_connector.h
[edit]
[-] drm_utils.h
[edit]
[-] drm_suballoc.h
[edit]
[+]
intel
[-] drm_audio_component.h
[edit]
[-] drm_prime.h
[edit]
[-] drm_atomic_helper.h
[edit]
[-] i915_pciids.h
[edit]
[-] drm_mipi_dsi.h
[edit]
[-] drm_writeback.h
[edit]
[-] drm_gem_framebuffer_helper.h
[edit]
[-] drm_lease.h
[edit]
[-] drm_crtc_helper.h
[edit]
[-] drm_client.h
[edit]
[-] Makefile
[edit]
[-] drm_vblank.h
[edit]
[-] drm_format_helper.h
[edit]
[-] drm_fb_dma_helper.h
[edit]
[-] drm_mode_config.h
[edit]
[-] drm_debugfs.h
[edit]
[-] drm_print.h
[edit]
[-] drm_client_event.h
[edit]
[-] drm_panel.h
[edit]
[-] drm_gem_shmem_helper.h
[edit]
[-] drm_debugfs_crc.h
[edit]
[-] drm_cache.h
[edit]
[-] drm_sysfs.h
[edit]
[+]
clients
[-] drm_edid.h
[edit]
[-] drm_modeset_helper.h
[edit]
[-] drm_atomic_state_helper.h
[edit]
[-] drm_ioctl.h
[edit]
[-] drm_blend.h
[edit]
[-] drm_gem_vram_helper.h
[edit]
[-] drm_panic.h
[edit]
[-] drm_plane_helper.h
[edit]
[-] drm_fbdev_dma.h
[edit]
[-] drm_bridge_connector.h
[edit]
[-] drm_probe_helper.h
[edit]
[-] drm_modeset_helper_vtables.h
[edit]
[-] drm_device.h
[edit]
[-] drm_exec.h
[edit]
[-] drm_atomic.h
[edit]
[-] gud.h
[edit]
[-] drm_gem.h
[edit]
[-] drm_gpuvm.h
[edit]
[-] drm_mm.h
[edit]
[-] drm_plane.h
[edit]
[-] drm_gpusvm.h
[edit]
[-] drm_simple_kms_helper.h
[edit]
[-] drm_syncobj.h
[edit]
[-] drm_gem_atomic_helper.h
[edit]
[-] drm_fbdev_shmem.h
[edit]
[-] drm_framebuffer.h
[edit]
[-] drm_accel.h
[edit]
[-] drm_self_refresh_helper.h
[edit]
[-] amd_asic_type.h
[edit]
[-] drm_privacy_screen_consumer.h
[edit]
[-] gpu_scheduler.h
[edit]
[-] drm_fbdev_ttm.h
[edit]
[-] drm_managed.h
[edit]
[-] task_barrier.h
[edit]
[-] drm_fourcc.h
[edit]
[-] drm_vblank_work.h
[edit]
[-] drm_modes.h
[edit]
[-] drm_vma_manager.h
[edit]
[-] drm_buddy.h
[edit]
[-] drm_of.h
[edit]
[+]
..
[+]
bridge
[-] drm_modeset_lock.h
[edit]
[-] drm_rect.h
[edit]
[-] drm_flip_work.h
[edit]
[-] drm_util.h
[edit]
[-] drm_damage_helper.h
[edit]
[-] drm_drv.h
[edit]
[-] drm_kunit_helpers.h
[edit]
[-] drm_color_mgmt.h
[edit]
[-] drm_crtc.h
[edit]
[-] drm_privacy_screen_driver.h
[edit]