PATH:
usr
/
src
/
kernels
/
5.14.0-611.49.2.el9_7.x86_64
/
include
/
drm
/* SPDX-License-Identifier: MIT */ /* * Copyright © 2023 Intel Corporation */ #ifndef __DRM_ELD_H__ #define __DRM_ELD_H__ #include <linux/types.h> struct cea_sad; /* ELD Header Block */ #define DRM_ELD_HEADER_BLOCK_SIZE 4 #define DRM_ELD_VER 0 # define DRM_ELD_VER_SHIFT 3 # define DRM_ELD_VER_MASK (0x1f << 3) # define DRM_ELD_VER_CEA861D (2 << 3) /* supports 861D or below */ # define DRM_ELD_VER_CANNED (0x1f << 3) #define DRM_ELD_BASELINE_ELD_LEN 2 /* in dwords! */ /* ELD Baseline Block for ELD_Ver == 2 */ #define DRM_ELD_CEA_EDID_VER_MNL 4 # define DRM_ELD_CEA_EDID_VER_SHIFT 5 # define DRM_ELD_CEA_EDID_VER_MASK (7 << 5) # define DRM_ELD_CEA_EDID_VER_NONE (0 << 5) # define DRM_ELD_CEA_EDID_VER_CEA861 (1 << 5) # define DRM_ELD_CEA_EDID_VER_CEA861A (2 << 5) # define DRM_ELD_CEA_EDID_VER_CEA861BCD (3 << 5) # define DRM_ELD_MNL_SHIFT 0 # define DRM_ELD_MNL_MASK (0x1f << 0) #define DRM_ELD_SAD_COUNT_CONN_TYPE 5 # define DRM_ELD_SAD_COUNT_SHIFT 4 # define DRM_ELD_SAD_COUNT_MASK (0xf << 4) # define DRM_ELD_CONN_TYPE_SHIFT 2 # define DRM_ELD_CONN_TYPE_MASK (3 << 2) # define DRM_ELD_CONN_TYPE_HDMI (0 << 2) # define DRM_ELD_CONN_TYPE_DP (1 << 2) # define DRM_ELD_SUPPORTS_AI (1 << 1) # define DRM_ELD_SUPPORTS_HDCP (1 << 0) #define DRM_ELD_AUD_SYNCH_DELAY 6 /* in units of 2 ms */ # define DRM_ELD_AUD_SYNCH_DELAY_MAX 0xfa /* 500 ms */ #define DRM_ELD_SPEAKER 7 # define DRM_ELD_SPEAKER_MASK 0x7f # define DRM_ELD_SPEAKER_RLRC (1 << 6) # define DRM_ELD_SPEAKER_FLRC (1 << 5) # define DRM_ELD_SPEAKER_RC (1 << 4) # define DRM_ELD_SPEAKER_RLR (1 << 3) # define DRM_ELD_SPEAKER_FC (1 << 2) # define DRM_ELD_SPEAKER_LFE (1 << 1) # define DRM_ELD_SPEAKER_FLR (1 << 0) #define DRM_ELD_PORT_ID 8 /* offsets 8..15 inclusive */ # define DRM_ELD_PORT_ID_LEN 8 #define DRM_ELD_MANUFACTURER_NAME0 16 #define DRM_ELD_MANUFACTURER_NAME1 17 #define DRM_ELD_PRODUCT_CODE0 18 #define DRM_ELD_PRODUCT_CODE1 19 #define DRM_ELD_MONITOR_NAME_STRING 20 /* offsets 20..(20+mnl-1) inclusive */ #define DRM_ELD_CEA_SAD(mnl, sad) (20 + (mnl) + 3 * (sad)) /** * drm_eld_mnl - Get ELD monitor name length in bytes. * @eld: pointer to an eld memory structure with mnl set */ static inline int drm_eld_mnl(const u8 *eld) { return (eld[DRM_ELD_CEA_EDID_VER_MNL] & DRM_ELD_MNL_MASK) >> DRM_ELD_MNL_SHIFT; } int drm_eld_sad_get(const u8 *eld, int sad_index, struct cea_sad *cta_sad); int drm_eld_sad_set(u8 *eld, int sad_index, const struct cea_sad *cta_sad); /** * drm_eld_sad - Get ELD SAD structures. * @eld: pointer to an eld memory structure with sad_count set */ static inline const u8 *drm_eld_sad(const u8 *eld) { unsigned int ver, mnl; ver = (eld[DRM_ELD_VER] & DRM_ELD_VER_MASK) >> DRM_ELD_VER_SHIFT; if (ver != 2 && ver != 31) return NULL; mnl = drm_eld_mnl(eld); if (mnl > 16) return NULL; return eld + DRM_ELD_CEA_SAD(mnl, 0); } /** * drm_eld_sad_count - Get ELD SAD count. * @eld: pointer to an eld memory structure with sad_count set */ static inline int drm_eld_sad_count(const u8 *eld) { return (eld[DRM_ELD_SAD_COUNT_CONN_TYPE] & DRM_ELD_SAD_COUNT_MASK) >> DRM_ELD_SAD_COUNT_SHIFT; } /** * drm_eld_calc_baseline_block_size - Calculate baseline block size in bytes * @eld: pointer to an eld memory structure with mnl and sad_count set * * This is a helper for determining the payload size of the baseline block, in * bytes, for e.g. setting the Baseline_ELD_Len field in the ELD header block. */ static inline int drm_eld_calc_baseline_block_size(const u8 *eld) { return DRM_ELD_MONITOR_NAME_STRING - DRM_ELD_HEADER_BLOCK_SIZE + drm_eld_mnl(eld) + drm_eld_sad_count(eld) * 3; } /** * drm_eld_size - Get ELD size in bytes * @eld: pointer to a complete eld memory structure * * The returned value does not include the vendor block. It's vendor specific, * and comprises of the remaining bytes in the ELD memory buffer after * drm_eld_size() bytes of header and baseline block. * * The returned value is guaranteed to be a multiple of 4. */ static inline int drm_eld_size(const u8 *eld) { return DRM_ELD_HEADER_BLOCK_SIZE + eld[DRM_ELD_BASELINE_ELD_LEN] * 4; } /** * drm_eld_get_spk_alloc - Get speaker allocation * @eld: pointer to an ELD memory structure * * The returned value is the speakers mask. User has to use %DRM_ELD_SPEAKER * field definitions to identify speakers. */ static inline u8 drm_eld_get_spk_alloc(const u8 *eld) { return eld[DRM_ELD_SPEAKER] & DRM_ELD_SPEAKER_MASK; } /** * drm_eld_get_conn_type - Get device type hdmi/dp connected * @eld: pointer to an ELD memory structure * * The caller need to use %DRM_ELD_CONN_TYPE_HDMI or %DRM_ELD_CONN_TYPE_DP to * identify the display type connected. */ static inline u8 drm_eld_get_conn_type(const u8 *eld) { return eld[DRM_ELD_SAD_COUNT_CONN_TYPE] & DRM_ELD_CONN_TYPE_MASK; } #endif /* __DRM_ELD_H__ */
[-] 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]