Path: blob/master/drivers/gpu/drm/drm_displayid_internal.h
26444 views
/*1* Copyright © 2014 Red Hat Inc.2*3* Permission is hereby granted, free of charge, to any person obtaining a4* copy of this software and associated documentation files (the "Software"),5* to deal in the Software without restriction, including without limitation6* the rights to use, copy, modify, merge, publish, distribute, sublicense,7* and/or sell copies of the Software, and to permit persons to whom the8* Software is furnished to do so, subject to the following conditions:9*10* The above copyright notice and this permission notice shall be included in11* all copies or substantial portions of the Software.12*13* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR14* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,15* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL16* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR17* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,18* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR19* OTHER DEALINGS IN THE SOFTWARE.20*/2122#ifndef __DRM_DISPLAYID_INTERNAL_H__23#define __DRM_DISPLAYID_INTERNAL_H__2425#include <linux/types.h>26#include <linux/bits.h>2728struct drm_edid;2930#define VESA_IEEE_OUI 0x3a02923132/* DisplayID Structure versions */33#define DISPLAY_ID_STRUCTURE_VER_20 0x203435/* DisplayID Structure v1r2 Data Blocks */36#define DATA_BLOCK_PRODUCT_ID 0x0037#define DATA_BLOCK_DISPLAY_PARAMETERS 0x0138#define DATA_BLOCK_COLOR_CHARACTERISTICS 0x0239#define DATA_BLOCK_TYPE_1_DETAILED_TIMING 0x0340#define DATA_BLOCK_TYPE_2_DETAILED_TIMING 0x0441#define DATA_BLOCK_TYPE_3_SHORT_TIMING 0x0542#define DATA_BLOCK_TYPE_4_DMT_TIMING 0x0643#define DATA_BLOCK_VESA_TIMING 0x0744#define DATA_BLOCK_CEA_TIMING 0x0845#define DATA_BLOCK_VIDEO_TIMING_RANGE 0x0946#define DATA_BLOCK_PRODUCT_SERIAL_NUMBER 0x0a47#define DATA_BLOCK_GP_ASCII_STRING 0x0b48#define DATA_BLOCK_DISPLAY_DEVICE_DATA 0x0c49#define DATA_BLOCK_INTERFACE_POWER_SEQUENCING 0x0d50#define DATA_BLOCK_TRANSFER_CHARACTERISTICS 0x0e51#define DATA_BLOCK_DISPLAY_INTERFACE 0x0f52#define DATA_BLOCK_STEREO_DISPLAY_INTERFACE 0x1053#define DATA_BLOCK_TILED_DISPLAY 0x1254#define DATA_BLOCK_VENDOR_SPECIFIC 0x7f55#define DATA_BLOCK_CTA 0x815657/* DisplayID Structure v2r0 Data Blocks */58#define DATA_BLOCK_2_PRODUCT_ID 0x2059#define DATA_BLOCK_2_DISPLAY_PARAMETERS 0x2160#define DATA_BLOCK_2_TYPE_7_DETAILED_TIMING 0x2261#define DATA_BLOCK_2_TYPE_8_ENUMERATED_TIMING 0x2362#define DATA_BLOCK_2_TYPE_9_FORMULA_TIMING 0x2463#define DATA_BLOCK_2_DYNAMIC_VIDEO_TIMING 0x2564#define DATA_BLOCK_2_DISPLAY_INTERFACE_FEATURES 0x2665#define DATA_BLOCK_2_STEREO_DISPLAY_INTERFACE 0x2766#define DATA_BLOCK_2_TILED_DISPLAY_TOPOLOGY 0x2867#define DATA_BLOCK_2_CONTAINER_ID 0x2968#define DATA_BLOCK_2_TYPE_10_FORMULA_TIMING 0x2a69#define DATA_BLOCK_2_VENDOR_SPECIFIC 0x7e70#define DATA_BLOCK_2_CTA_DISPLAY_ID 0x817172/* DisplayID Structure v1r2 Product Type */73#define PRODUCT_TYPE_EXTENSION 074#define PRODUCT_TYPE_TEST 175#define PRODUCT_TYPE_PANEL 276#define PRODUCT_TYPE_MONITOR 377#define PRODUCT_TYPE_TV 478#define PRODUCT_TYPE_REPEATER 579#define PRODUCT_TYPE_DIRECT_DRIVE 68081/* DisplayID Structure v2r0 Display Product Primary Use Case (~Product Type) */82#define PRIMARY_USE_EXTENSION 083#define PRIMARY_USE_TEST 184#define PRIMARY_USE_GENERIC 285#define PRIMARY_USE_TV 386#define PRIMARY_USE_DESKTOP_PRODUCTIVITY 487#define PRIMARY_USE_DESKTOP_GAMING 588#define PRIMARY_USE_PRESENTATION 689#define PRIMARY_USE_HEAD_MOUNTED_VR 790#define PRIMARY_USE_HEAD_MOUNTED_AR 89192struct displayid_header {93u8 rev;94u8 bytes;95u8 prod_id;96u8 ext_count;97} __packed;9899struct displayid_block {100u8 tag;101u8 rev;102u8 num_bytes;103} __packed;104105struct displayid_tiled_block {106struct displayid_block base;107u8 tile_cap;108u8 topo[3];109u8 tile_size[4];110u8 tile_pixel_bezel[5];111u8 topology_id[8];112} __packed;113114struct displayid_detailed_timings_1 {115u8 pixel_clock[3];116u8 flags;117__le16 hactive;118__le16 hblank;119__le16 hsync;120__le16 hsw;121__le16 vactive;122__le16 vblank;123__le16 vsync;124__le16 vsw;125} __packed;126127struct displayid_detailed_timing_block {128struct displayid_block base;129struct displayid_detailed_timings_1 timings[];130} __packed;131132struct displayid_formula_timings_9 {133u8 flags;134__le16 hactive;135__le16 vactive;136u8 vrefresh;137} __packed;138139struct displayid_formula_timing_block {140struct displayid_block base;141struct displayid_formula_timings_9 timings[];142} __packed;143144#define DISPLAYID_VESA_MSO_OVERLAP GENMASK(3, 0)145#define DISPLAYID_VESA_MSO_MODE GENMASK(6, 5)146147struct displayid_vesa_vendor_specific_block {148struct displayid_block base;149u8 oui[3];150u8 data_structure_type;151u8 mso;152} __packed;153154/*155* DisplayID iteration.156*157* Do not access directly, this is private.158*/159struct displayid_iter {160const struct drm_edid *drm_edid;161162const u8 *section;163int length;164int idx;165int ext_index;166167u8 version;168u8 primary_use;169};170171void displayid_iter_edid_begin(const struct drm_edid *drm_edid,172struct displayid_iter *iter);173const struct displayid_block *174__displayid_iter_next(struct displayid_iter *iter);175#define displayid_iter_for_each(__block, __iter) \176while (((__block) = __displayid_iter_next(__iter)))177void displayid_iter_end(struct displayid_iter *iter);178179u8 displayid_version(const struct displayid_iter *iter);180u8 displayid_primary_use(const struct displayid_iter *iter);181182#endif183184185