replace common qcom sources with samsung ones

This commit is contained in:
SaschaNes
2025-08-12 22:13:00 +02:00
parent ba24dcded9
commit 6f7753de11
5682 changed files with 2450203 additions and 103634 deletions

View File

@@ -0,0 +1,15 @@
// Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
// SPDX-License-Identifier: BSD-3-Clause-Clear
#ifndef __COMMON_ADDRESS_H__
#define __COMMON_ADDRESS_H__
#include <cstdint>
typedef struct vendor_qti_hardware_display_common_Address {
// Pointer address
// Use utility function to access pointer
uint64_t addressPointer;
} vendor_qti_hardware_display_common_Address;
#endif // __COMMON_ADDRESS_H__

View File

@@ -0,0 +1,15 @@
// Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
// SPDX-License-Identifier: BSD-3-Clause-Clear
#ifndef __COMMON_BLENDMODE_H__
#define __COMMON_BLENDMODE_H__
typedef enum vendor_qti_hardware_display_common_BlendMode {
BLEND_MODE_INVALID = 0,
BLEND_MODE_NONE = 1,
BLEND_MODE_PREMULTIPLIED = 2,
BLEND_MODE_COVERAGE = 3,
BLEND_MODE_MAX = 0xFF,
} vendor_qti_hardware_display_common_BlendMode;
#endif // __COMMON_BLENDMODE_H__

View File

@@ -0,0 +1,15 @@
// Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
// SPDX-License-Identifier: BSD-3-Clause-Clear
#ifndef __COMMON_BUFFERCLIENT_H__
#define __COMMON_BUFFERCLIENT_H__
typedef enum vendor_qti_hardware_display_common_BufferClient {
BUFFERCLIENT_INVALID = -1,
BUFFERCLIENT_DPU = 0,
BUFFERCLIENT_UNTRUSTED_VM = 1,
BUFFERCLIENT_TRUSTED_VM = 2,
BUFFERCLIENT_MAX = 3,
} vendor_qti_hardware_display_common_BufferClient;
#endif // __COMMON_BUFFERCLIENT_H__

View File

@@ -0,0 +1,38 @@
// Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
// SPDX-License-Identifier: BSD-3-Clause-Clear
#ifndef __COMMON_BUFFERLAYOUT_H__
#define __COMMON_BUFFERLAYOUT_H__
#include "PlaneLayout.h"
#define QTI_MAX_NUM_PLANES 8
typedef struct vendor_qti_hardware_display_common_BufferLayout {
/**
* Layout for each plane
*/
vendor_qti_hardware_display_common_PlaneLayout planes[QTI_MAX_NUM_PLANES];
/**
* Number of planes in the buffer
*/
int plane_count;
/**
* Overall buffer size in bytes, including padding.
*/
int size_in_bytes;
/**
* Bytes per pixel
*/
int bpp;
/**
* Aligned width (in bytes) of buffer
*/
int aligned_width_in_bytes;
/**
* Aligned height (in number of rows) of buffer
*/
int aligned_height;
} vendor_qti_hardware_display_common_BufferLayout;
#endif // __COMMON_BUFFERLAYOUT_H__

View File

@@ -0,0 +1,16 @@
// Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
// SPDX-License-Identifier: BSD-3-Clause-Clear
#ifndef __COMMON_BUFFERPERMIISSION_H__
#define __COMMON_BUFFERPERMIISSION_H__
union vendor_qti_hardware_display_common_BufferPermission {
struct {
uint8_t read : 1;
uint8_t write : 1;
uint8_t execute : 1;
};
uint8_t permission;
};
#endif // __COMMON_BUFFERPERMIISSION_H__

View File

@@ -0,0 +1,149 @@
// Copyright (c) 2023-2024 Qualcomm Innovation Center, Inc. All rights reserved.
// SPDX-License-Identifier: BSD-3-Clause-Clear
#ifndef __COMMON_BUFFERUSAGE_H__
#define __COMMON_BUFFERUSAGE_H__
#include <cstdint>
typedef enum vendor_qti_hardware_display_common_BufferUsage : uint64_t {
/** Bit 0-3 is an enum */
CPU_READ_MASK = 0xf,
/** Buffer is never read by CPU */
CPU_READ_NEVER = 0,
/** Buffer is rarely read by CPU */
CPU_READ_RARELY = 2,
/** Buffer is often read by CPU */
CPU_READ_OFTEN = 3,
/** Bit 4-7 is an enum */
CPU_WRITE_MASK = 0xf << 4,
/** Buffer is never written by CPU */
CPU_WRITE_NEVER = 0 << 4,
/** Buffer is rarely written by CPU */
CPU_WRITE_RARELY = 2 << 4,
/** Buffer is often written by CPU */
CPU_WRITE_OFTEN = 3 << 4,
/** Buffer is used as a GPU texture */
GPU_TEXTURE = 1 << 8,
/** Buffer is used as a GPU render target */
GPU_RENDER_TARGET = 1 << 9,
/** bit 10 must be zero */
/** Buffer is used as a composer overlay layer */
COMPOSER_OVERLAY = 1 << 11,
/** Buffer is used as a composer client layer */
COMPOSER_CLIENT_TARGET = 1 << 12,
/** bit 13 must be zero */
/** Buffer has protected content */
PROTECTED = 1 << 14,
/** Buffer is used as composer cursor layer */
COMPOSER_CURSOR = 1 << 15,
/** Buffer is used as video encoder input */
VIDEO_ENCODER = 1 << 16,
/** Buffer is used as camera output */
CAMERA_OUTPUT = 1 << 17,
/** Buffer is used as camera input */
CAMERA_INPUT = 1 << 18,
/** bit 19 must be zero */
/** Buffer is used as a renderscript allocation */
RENDERSCRIPT = 1 << 20,
/** bit 21 must be zero */
/** Buffer is used as video decoder output */
VIDEO_DECODER = 1 << 22,
/** Buffer is used as a sensor direct report output */
SENSOR_DIRECT_DATA = 1 << 23,
/**
* Buffer is used as as an OpenGL shader storage or uniform
* buffer object
*/
GPU_DATA_BUFFER = 1 << 24,
/** Buffer is used as a cube map texture */
GPU_CUBE_MAP = 1 << 25,
/** Buffer contains a complete mipmap hierarchy */
GPU_MIPMAP_COMPLETE = 1 << 26,
/** Buffer is used as input for HEIC encoder */
HW_IMAGE_ENCODER = 1 << 27,
/* Non linear, Universal Bandwidth Compression */
QTI_ALLOC_UBWC = 1 << 28,
/**
* Buffer is allocated with uncached memory (using O_DSYNC),
* cannot be used with noncontiguous heaps
*/
QTI_PRIVATE_UNCACHED = 1 << 29,
/* Buffer has a 10 bit format if format is implementation defined */
QTI_PRIVATE_10BIT = 1 << 30,
/* Buffer is used for secure display */
QTI_PRIVATE_SECURE_DISPLAY = 1ULL << 31,
/* Buffer is used for front-buffer rendering */
FRONT_BUFFER = 1ULL << 32,
/* Buffer is used for Samsung Fingerprint Mask View */
QTI_PRIVATE_FINGERPRINT_MASK_BUFFER = 1L << 34,
/* Bits 33-47 must be zero and are reserved for future versions
* Bits 48-63 are reserved for vendor extensions
*/
/* This flag is used to indicate video NV21 format */
QTI_PRIVATE_VIDEO_NV21_ENCODER = 1ULL << 48,
/* Buffer uses PI format */
QTI_PRIVATE_ALLOC_UBWC_PI = 1ULL << 49,
/* Buffer is accessed by CDSP */
QTI_PRIVATE_CDSP = 1ULL << 50,
/* Buffer is used for WFD */
QTI_PRIVATE_WFD = 1ULL << 51,
/* Buffer uses video HW use case */
QTI_PRIVATE_VIDEO_HW = 1ULL << 52,
/* Buffer used for trusted VM use case */
QTI_PRIVATE_TRUSTED_VM = 1ULL << 53,
/* UBWC - NV12 4R */
QTI_ALLOC_UBWC_4R = 1ULL << 55,
/* UBWC - 8:5 compression ratio */
QTI_ALLOC_UBWC_L_8_TO_5 = 1ULL << 56,
/* UBWC - 2:1 compression ratio */
QTI_ALLOC_UBWC_L_2_TO_1 = 1ULL << 57,
/* This flag is used to indicate multiview use case */
QTI_PRIVATE_MULTI_VIEW_INFO = 1ULL << 58,
} vendor_qti_hardware_display_common_BufferUsage;
inline vendor_qti_hardware_display_common_BufferUsage operator|(
vendor_qti_hardware_display_common_BufferUsage lhs,
vendor_qti_hardware_display_common_BufferUsage rhs) {
return static_cast<vendor_qti_hardware_display_common_BufferUsage>(static_cast<uint64_t>(lhs) |
static_cast<uint64_t>(rhs));
}
inline vendor_qti_hardware_display_common_BufferUsage operator&(
vendor_qti_hardware_display_common_BufferUsage lhs,
vendor_qti_hardware_display_common_BufferUsage rhs) {
return static_cast<vendor_qti_hardware_display_common_BufferUsage>(static_cast<uint64_t>(lhs) &
static_cast<uint64_t>(rhs));
}
inline vendor_qti_hardware_display_common_BufferUsage operator&=(
vendor_qti_hardware_display_common_BufferUsage &lhs,
vendor_qti_hardware_display_common_BufferUsage rhs) {
lhs = lhs & rhs;
return lhs;
}
inline vendor_qti_hardware_display_common_BufferUsage operator|=(
vendor_qti_hardware_display_common_BufferUsage &lhs,
vendor_qti_hardware_display_common_BufferUsage rhs) {
lhs = lhs | rhs;
return lhs;
}
#endif // __COMMON_BUFFERUSAGE_H__

View File

@@ -0,0 +1,35 @@
// Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
// SPDX-License-Identifier: BSD-3-Clause-Clear
#ifndef __COMMON_CVPMETADATA_H__
#define __COMMON_CVPMETADATA_H__
#include <cstdint>
#define QTI_CVP_METADATA_SIZE 1024
typedef enum vendor_qti_hardware_display_common_CVPMetadataFlags {
/* bit wise flags */
QTI_CVP_METADATA_FLAG_NONE = 0x00000000,
QTI_CVP_METADATA_FLAG_REPEAT = 0x00000001,
} vendor_qti_hardware_display_common_CVPMetadataFlags;
typedef struct vendor_qti_hardware_display_common_CVPMetadata {
/** Payload size in bytes */
uint32_t size;
uint8_t payload[QTI_CVP_METADATA_SIZE];
uint32_t capture_frame_rate;
/** Frame rate in Q16 format.
* Eg: fps = 7.5, then
* capture_frame_rate = 7 << 16 --> Upper 16 bits to represent 7
* capture_frame_rate |= 5 -------> Lower 16 bits to represent 5
*
* If size > 0, framerate is valid
* If size = 0, invalid data, so ignore all parameters
*/
uint32_t cvp_frame_rate;
vendor_qti_hardware_display_common_CVPMetadataFlags flags;
uint32_t reserved[8];
} vendor_qti_hardware_display_common_CVPMetadata;
#endif // __COMMON_CVPMETADATA_H__

View File

@@ -0,0 +1,14 @@
// Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
// SPDX-License-Identifier: BSD-3-Clause-Clear
#ifndef __COMMON_CHROMASITING_H__
#define __COMMON_CHROMASITING_H__
typedef enum vendor_qti_hardware_display_common_ChromaSiting {
CHROMA_SITING_NONE = 0,
CHROMA_SITING_UNKNOWN = 1,
CHROMA_SITING_SITED_INTERSTITIAL = 2,
CHROMA_SITING_COSITED_HORIZONTAL = 3,
} vendor_qti_hardware_display_common_ChromaSiting;
#endif // __COMMON_CHROMASITING_H__

View File

@@ -0,0 +1,16 @@
// Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
// SPDX-License-Identifier: BSD-3-Clause-Clear
#ifndef __COMMON_COMPRESSION_H__
#define __COMMON_COMPRESSION_H__
typedef enum vendor_qti_hardware_display_common_Compression {
COMPRESSION_NONE = 0,
DISPLAY_STREAM_COMPRESSION = 1,
QTI_COMPRESSION_UBWC = 10,
QTI_COMPRESSION_UBWC_LOSSY_8_TO_5 = 11,
QTI_COMPRESSION_UBWC_LOSSY_2_TO_1 = 12,
COMPRESSION_MAX = 0xFF,
} vendor_qti_hardware_display_common_Compression;
#endif // __COMMON_COMPRESSION_H__

View File

@@ -0,0 +1,20 @@
// Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
// SPDX-License-Identifier: BSD-3-Clause-Clear
#ifndef __COMMON_CUSTOMCONTENTMETADATA_H__
#define __COMMON_CUSTOMCONTENTMETADATA_H__
#include <cstdint>
#define QTI_CUSTOM_METADATA_SIZE_BYTES 1024 * 42
/*
* Dynamic metadata separate from QtiDynamicMetadata.
* Used in limited cases.
*/
typedef struct vendor_qti_hardware_display_common_CustomContentMetadata {
uint64_t size;
uint8_t metadataPayload[QTI_CUSTOM_METADATA_SIZE_BYTES];
} vendor_qti_hardware_display_common_CustomContentMetadata;
#endif // __COMMON_CUSTOMCONTENTMETADATA_H__

View File

@@ -0,0 +1,26 @@
// Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
// SPDX-License-Identifier: BSD-3-Clause-Clear
#ifndef __COMMON_DATASPACE_H__
#define __COMMON_DATASPACE_H__
#include <cstdint>
#include "QtiColorPrimaries.h"
#include "QtiColorRange.h"
#include "QtiGammaTransfer.h"
/**
* Dataspace defines how color should be interpreted,
* using three components - color primaries, range, and transfer.
* See vendor.qti.hardware.display.common.QtiColorPrimaries,
* vendor.qti.hardware.display.common.QtiColorRange, and
* vendor.qti.hardware.display.common.QtiGammaTransfer for definitions.
*/
typedef struct vendor_qti_hardware_display_common_Dataspace {
vendor_qti_hardware_display_common_QtiColorPrimaries colorPrimaries;
vendor_qti_hardware_display_common_QtiColorRange range;
vendor_qti_hardware_display_common_QtiGammaTransfer transfer;
} vendor_qti_hardware_display_common_Dataspace;
#endif // __COMMON_DATASPACE_H__

View File

@@ -0,0 +1,13 @@
// Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
// SPDX-License-Identifier: BSD-3-Clause-Clear
#ifndef __COMMON_FENCE_H__
#define __COMMON_FENCE_H__
#include <memory>
typedef struct vendor_qti_hardware_display_common_Fence {
int fence_fd;
} vendor_qti_hardware_display_common_Fence;
#endif // __COMMON_FENCE_H__

View File

@@ -0,0 +1,20 @@
// Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
// SPDX-License-Identifier: BSD-3-Clause-Clear
#ifndef __COMMON_GRAPHICSMETADATA_H__
#define __COMMON_GRAPHICSMETADATA_H__
#include <cstdint>
#define QTI_GRAPHICS_METADATA_SIZE 4096
#define QTI_GRAPHICS_METADATA_SIZE_BYTES = (GRAPHICS_METADATA_SIZE * sizeof(uint32_t));
/**
* Graphics surface metadata.
*/
typedef struct vendor_qti_hardware_display_common_GraphicsMetadata {
uint32_t size; // TODO: get graphics to remove this to avoid "Metadata has bad signature" error
uint32_t data[QTI_GRAPHICS_METADATA_SIZE];
} vendor_qti_hardware_display_common_GraphicsMetadata;
#endif // __COMMON_GRAPHICSMETADATA_H__

View File

@@ -0,0 +1,28 @@
// Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
// SPDX-License-Identifier: BSD-3-Clause-Clear
#ifndef __COMMON_INTERLACED_H__
#define __COMMON_INTERLACED_H__
/**
* Describes how buffer's planes are interlaced.
*/
typedef enum vendor_qti_hardware_display_common_Interlaced {
INTERLACED_NONE = 0,
/*
* Horizontal interlacing
* Height of interlaced plane = 1/2 of buffer height
*/
TOP_BOTTOM = 1,
/*
* Vertical interlacing
* Width of interlaced plane = 1/2 of buffer width
*/
RIGHT_LEFT = 2,
/**
* Qualcomm interlaced definition
*/
QTI_INTERLACED = 10,
} vendor_qti_hardware_display_common_Interlaced;
#endif // __COMMON_INTERLACED_H__

View File

@@ -0,0 +1,15 @@
// Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
// SPDX-License-Identifier: BSD-3-Clause-Clear
#ifndef __COMMON_KEYVALUEPAIR_H__
#define __COMMON_KEYVALUEPAIR_H__
#include <cstdint>
#include <string>
typedef struct vendor_qti_hardware_display_common_KeyValuePair {
char key[256];
uint64_t value;
} vendor_qti_hardware_display_common_KeyValuePair;
#endif // __COMMON_KEYVALUEPAIR_H__

View File

@@ -0,0 +1,32 @@
// Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
// SPDX-License-Identifier: BSD-3-Clause-Clear
#ifndef __COMMON_METADATASTATUS_H__
#define __COMMON_METADATASTATUS_H__
#include "MetadataType.h"
#define IS_VENDOR_METADATA_TYPE(x) (x >= QTI_VT_TIMESTAMP)
#define GET_STANDARD_METADATA_STATUS_INDEX(x) x
#define GET_VENDOR_METADATA_STATUS_INDEX(x) x - QTI_VT_TIMESTAMP
#define METADATA_SET_SIZE 512
typedef struct vendor_qti_hardware_display_common_MetadataStatus {
/** isStandardMetadataSet will return true for a given
* vendor.qti.hardware.display.common.MetadataType if
* it has been explicitly set via ISnapMapper query.
* If it is false, the metadata has not been set
* and should be treated as a default value.
*/
bool isStandardMetadataSet[METADATA_SET_SIZE];
/**
* isVendorMetadataSet uses
* vendor.qti.hardware.display.common.MetadataType - 10000
* as an index.
*/
bool isVendorMetadataSet[METADATA_SET_SIZE];
} vendor_qti_hardware_display_common_MetadataStatus;
#endif // __COMMON_METADATASTATUS_H__

View File

@@ -0,0 +1,379 @@
// Copyright (c) 2023-2024 Qualcomm Innovation Center, Inc. All rights reserved.
// SPDX-License-Identifier: BSD-3-Clause-Clear
#ifndef __COMMON_METADATATYPE_H__
#define __COMMON_METADATATYPE_H__
typedef enum vendor_qti_hardware_display_common_MetadataType {
METADATA_TYPE_INVALID = 0,
/**
* ID of buffer, used for debug only.
* This does not change for the lifetime of the buffer.
* Functions supported: getMetadata
*/
BUFFER_ID = 1,
/**
* Name of buffer passed in at allocation time, used for debug.
* This does not change for the lifetime of the buffer.
* Functions supported: getMetadata
*/
NAME = 2,
/**
* Width of buffer in pixels, requested at allocation time.
* This does not change for the lifetime of the buffer.
* Functions supported: getMetadata
*/
WIDTH = 3,
/**
* Height of buffer in pixels, requested at at allocation time.
* This does not change for the lifetime of the buffer.
* Functions supported: getMetadata
*/
HEIGHT = 4,
/**
* Number of layers in the buffer, requested at allocation time.
* This does not change for the lifetime of the buffer.
* Functions supported: getMetadata
*/
LAYER_COUNT = 5,
/**
* Format of the buffer, requested at allocation time.
* This returns the type vendor_qti_hardware_display_common_PixelFormat
* This does not change for the lifetime of the buffer.
* Functions supported: getMetadata
*/
PIXEL_FORMAT_REQUESTED = 6,
/**
* Fourcc code for the format of the buffer.
* This does not change for the lifetime of the buffer.
* Functions supported: getMetadata
*/
PIXEL_FORMAT_FOURCC = 7,
/**
* Modifier used with fourcc format of the buffer.
* This does not change for the lifetime of the buffer.
* Functions supported: getMetadata
*/
DRM_PIXEL_FORMAT_MODIFIER = 8,
/**
* Usage of the buffer requested at allocation time.
* This is a bitmask with definitions in
* vendor_qti_hardware_display_common_BufferUsage This does not change for the
* lifetime of the buffer.
* Functions supported: getMetadata
*/
USAGE = 9,
/**
* Size in bytes of memory allocated for buffer, including metadata and
* padding. This does not change for the lifetime of the buffer.
* Functions supported: getMetadata
*/
ALLOCATION_SIZE = 10,
/**
* Returns true if buffer has protected content.
* This does not change for the lifetime of the buffer.
* Functions supported: getMetadata
*/
PROTECTED_CONTENT = 11,
/**
* Compression strategy of the buffer.
* Values are defined in vendor_qti_hardware_display_common_Compression
* This does not change for the lifetime of the buffer.
* Functions supported: getMetadata
*/
COMPRESSION = 12,
/**
* How buffer's planes are interlaced.
* Values are defined in vendor_qti_hardware_display_common_Interlaced
* This does not change for the lifetime of the buffer.
* Functions supported: getMetadata
*/
INTERLACED = 13,
/**
* Chroma siting of the buffer.
* Values are defined in vendor_qti_hardware_display_common_ChromaSiting
* This does not change for the lifetime of the buffer.
* Functions supported: getMetadata
*/
CHROMA_SITING = 14,
/**
* Layout of the buffer's planes.
* This returns vendor_qti_hardware_display_common_BufferLayout
* This does not change for the lifetime of the buffer.
* Functions supported: getMetadata
*/
PLANE_LAYOUTS = 15,
/**
* Crop region in pixels of the buffer.
* Crop is stored as vendor_qti_hardware_display_common_Rect
* Functions supported: getMetadata, setMetadata
*/
CROP = 16,
/**
* Dataspace of the buffer.
* Values are defined in vendor_qti_hardware_display_common_Dataspace
* Functions supported: getMetadata, setMetadata
*/
DATASPACE = 17,
/**
* Blend mode of the buffer,
* as defined in vendor_qti_hardware_display_common_BlendMode
* Functions supported: getMetadata, setMetadata
*/
BLEND_MODE = 18,
/**
* Aligned width of allocated buffer in pixels.
* This does not change for the lifetime of the buffer.
* Functions supported: getMetadata
*/
STRIDE = 23,
// Qti defined metadata types - start from 10000
/**
* Per frame VT timestamp used by camera.
* Functions supported: getMetadata, setMetadata
*/
VT_TIMESTAMP = 10000,
/**
* Interlaced strategy defined by video.
* Functions supported: getMetadata, setMetadata
*/
PP_PARAM_INTERLACED = 10002,
/**
* Set by camera to indicate buffer will be used for high performance video
* use case.
* Functions supported: getMetadata, setMetadata
*/
VIDEO_PERF_MODE = 10003,
/**
* Graphics surface metadata,
* as defined in vendor_qti_hardware_display_common_GraphicsMetadata
* Functions supported: getMetadata, setMetadata
*/
GRAPHICS_METADATA = 10004,
/**
* UBWC CR stats,
* as defined in vendor_qti_hardware_display_common_UBWCStats
* Functions supported: getMetadata, setMetadata
*/
UBWC_CR_STATS_INFO = 10005,
/**
* Frame rate, as a float.
* Functions supported: getMetadata, setMetadata
*/
REFRESH_RATE = 10006,
/**
* Used for GPU post processing to determine when to map secure buffer.
* Functions supported: getMetadata, setMetadata
*/
MAP_SECURE_BUFFER = 10007,
/**
* Used if VENUS output buffer is linear for UBWC interlaced video.
* Functions supported: getMetadata, setMetadata
*/
LINEAR_FORMAT = 10008,
/**
* Set by graphics to indicate that this buffer will be written to but not
* swapped out.
* Functions supported: getMetadata, setMetadata
*/
SINGLE_BUFFER_MODE = 10009,
/**
* CVP metadata set by camera and read by video,
* as defined in vendor_qti_hardware_display_common_CVPMetadata
* Functions supported: getMetadata, setMetadata
*/
CVP_METADATA = 10010,
/**
* Video histogram stats populated by video decoder,
* as defined in vendor_qti_hardware_display_common_VideoHistogramMetadata
* Functions supported: getMetadata, setMetadata
*/
VIDEO_HISTOGRAM_STATS = 10011,
/**
* File descriptor for buffer data, returned as an int.
* Functions supported: getMetadata
*/
FD = 10012,
/**
* Aligned width of allocated buffer in pixels.
* This does not change for the lifetime of the buffer.
* Functions supported: getMetadata
*/
ALIGNED_WIDTH_IN_PIXELS = 10014,
/**
* Aligned height of allocated buffer in pixels.
* This does not change for the lifetime of the buffer.
* Functions supported: getMetadata
*/
ALIGNED_HEIGHT_IN_PIXELS = 10015,
/**
* Used to track if metadata type has been set for the buffer.
* Functions supported: getMetadata
*/
STANDARD_METADATA_STATUS = 10016,
VENDOR_METADATA_STATUS = 10017,
/**
* Returns 1 for YUV, 0 otherwise.
* Functions supported: getMetadata
*/
BUFFER_TYPE = 10018,
/**
* Video timestamp info,
* as defined in vendor_qti_hardware_display_common_VideoTimestampInfo
* Functions supported: getMetadata, setMetadata
*/
VIDEO_TS_INFO = 10019,
/**
* Custom dimensions returns custom width of buffer with crop factored in (if
* crop is set) or interlaced height factored in for UBWC formats.
* Functions supported: getMetadata
*/
CUSTOM_DIMENSIONS_STRIDE = 10021,
CUSTOM_DIMENSIONS_HEIGHT = 10022,
/**
* Returns base address for RGB buffers,
* with offset for UBWC metadata factored in for UBWC buffer.
* If this is a linear buffer, result is the same as BASE_ADDRESS.
* Functions supported: getMetadata
*/
RGB_DATA_ADDRESS = 10023,
/**
* Indicates buffer access permission for a client,
* where permissions are defined in
* vendor_qti_hardware_display_common_BufferPermission and clients are defined
* in vendor_qti_hardware_display_common_BufferClient
* Functions supported: getMetadata, setMetadata
*/
BUFFER_PERMISSION = 10026,
/**
* Unique identifier updated by memory module
* to interpret the underlying memory by each VM.
* Functions supported: getMetadata, setMetadata
*/
MEM_HANDLE = 10027,
/**
* Set by clients to indicate that timed rendering will be
* enabled or disabled for this buffer
* Functions supported: getMetadata, setMetadata
*/
TIMED_RENDERING = 10028,
/**
* Dynamic metadata used for limited use cases.
* Functions supported: getMetadata, setMetadata
*/
CUSTOM_CONTENT_METADATA = 10029,
/**
* Video transcode stats populated by video decoder.
* Functions supported: getMetadata, setMetadata
*/
VIDEO_TRANSCODE_STATS = 10030,
/**
* Early notify line count, used by video.
* Functions supported: getMetadata, setMetadata
*/
EARLYNOTIFY_LINECOUNT = 10031,
/**
* Additional shared memory in buffer, outside of content and metadata,
* for client use. Defined in
* vendor_qti_hardware_display_common_ReservedRegion
* Functions supported: getMetadata
*/
RESERVED_REGION = 10032,
/**
* Used in combination with vendor_qti_hardware_display_common_PixelFormat
* to describe variants of standard pixel formats.
* Variants may have different alignment requirements.
* Definitions are in vendor_qti_hardware_display_common_PixelFormatModifier
* Functions supported: getMetadata
*/
FORMAT_MODIFIER = 10033,
/**
* Mastering display metadata,
* defined in vendor_qti_hardware_display_common_QtiMasteringDisplay
* Functions supported: getMetadata, setMetadata
*/
MASTERING_DISPLAY = 10034,
/**
* Content light level metadata,
* defined in vendor_qti_hardware_display_common_QtiContentLightLevel
* Functions supported: getMetadata, setMetadata
*/
CONTENT_LIGHT_LEVEL = 10035,
/**
* Dynamic HDR metadata,
* defined in vendor_qti_hardware_display_common_QtiDynamicMetadata
* Functions supported: getMetadata, setMetadata
*/
DYNAMIC_METADATA = 10036,
/**
* Matrix coefficients,
* defined in vendor_qti_hardware_display_common_QtiMatrixCoefficients
* Functions supported: getMetadata, setMetadata
*/
MATRIX_COEFFICIENTS = 10037,
/**
* Color remapping info,
* defined in vendor_qti_hardware_display_common_QtiColorRemappingInfo
* Functions supported: getMetadata, setMetadata
*/
COLOR_REMAPPING_INFO = 10038,
/**
* Base address of buffer data.
* This does not account for UBWC meta planes.
* Functions supported: getMetadata
*/
BASE_ADDRESS = 10039,
/**
* Indicates if buffer was allocated as UBWC.
* Functions supported: getMetadata
*/
IS_UBWC = 10040,
/**
* Indicates if buffer was allocated as tile rendered.
* Functions supported: getMetadata
*/
IS_TILE_RENDERED = 10041,
/**
* Indicates if buffer was allocated as cached.
* Functions supported: getMetadata
*/
IS_CACHED = 10042,
/**
* Name of heap used for allocation.
* Functions supported: getMetadata
*/
HEAP_NAME = 10043,
/**
* Pixel format post allocation.
* Functions supported: getMetadata
*/
PIXEL_FORMAT_ALLOCATED = 10044,
/**
* Last buffer dequeue duration.
* Functions supported: getMetadata, setMetadata
*/
BUFFER_DEQUEUE_DURATION = 10045,
/**
* Anamorphic compression related information for the buffer.
* Functions supported: getMetadata, setMetadata
*/
ANAMORPHIC_COMPRESSION_METADATA = 10046,
/**
* Default view for multi-view buffer
* Functions supported: getMetadata
*/
BASE_VIEW = 10047,
/**
* All available views for multi-view buffer
* Functions supported: getMetadata
*/
MULTI_VIEW_INFO = 10048,
/**
* Three Dimensional Reference Display Info
* Functions supported: getMetadata, setMetadata
*/
THREE_DIMENSIONAL_REF_INFO = 10049,
} vendor_qti_hardware_display_common_MetadataType;
#endif // __COMMON_METADATATYPE_H__

View File

@@ -0,0 +1,370 @@
/*
* Copyright (c) 2020-2021 The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* * Neither the name of The Linux Foundation. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Changes from Qualcomm Innovation Center are provided under the following license:
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
#ifndef __COMMON_PIXELFORMAT_H__
#define __COMMON_PIXELFORMAT_H__
#include <cstdint>
typedef enum vendor_qti_hardware_display_common_PixelFormat : uint32_t {
// Range is 0x0 to 0x100 except for formats where fourcc code is used
PIXEL_FORMAT_UNSPECIFIED = 0,
/**
* RGBA_8888 format:
* Contains 1 plane in the following order -
* (A) RGBA plane
*
* <-------- RGB_Stride -------->
* <------- Width ------->
* R G B A R G B A R G B A . . . . ^ ^
* R G B A R G B A R G B A . . . . | |
* R G B A R G B A R G B A . . . . Height |
* R G B A R G B A R G B A . . . . | RGB_Scanlines
* R G B A R G B A R G B A . . . . | |
* R G B A R G B A R G B A . . . . | |
* R G B A R G B A R G B A . . . . | |
* R G B A R G B A R G B A . . . . V |
* . . . . . . . . . . . . . . . . |
* . . . . . . . . . . . . . . . . |
* . . . . . . . . . . . . . . . . |
* . . . . . . . . . . . . . . . . V
*/
RGBA_8888 = 0x1,
/**
* RGBX_8888 format:
* Contains 1 plane in the following order -
* (A) RGBX plane, where X is an unused component
*
* <-------- RGB_Stride -------->
* <------- Width ------->
* R G B X R G B X R G B X . . . . ^ ^
* R G B X R G B X R G B X . . . . | |
* R G B X R G B X R G B X . . . . Height |
* R G B X R G B X R G B X . . . . | RGB_Scanlines
* R G B X R G B X R G B X . . . . | |
* R G B X R G B X R G B X . . . . | |
* R G B X R G B X R G B X . . . . | |
* R G B X R G B X R G B X . . . . V |
* . . . . . . . . . . . . . . . . |
* . . . . . . . . . . . . . . . . |
* . . . . . . . . . . . . . . . . |
* . . . . . . . . . . . . . . . . V
*/
RGBX_8888 = 0x2,
/**
* RGB_888 format:
* Contains 1 plane in the following order -
* (A) RGB plane
*
* <-------- RGB_Stride -------->
* <------- Width ------->
* R G B R G B R G B R G B . . . . ^ ^
* R G B R G B R G B R G B . . . . | |
* R G B R G B R G B R G B . . . . Height |
* R G B R G B R G B R G B . . . . | RGB_Scanlines
* R G B R G B R G B R G B . . . . | |
* R G B R G B R G B R G B . . . . | |
* R G B R G B R G B R G B . . . . | |
* R G B R G B R G B R G B . . . . V |
* . . . . . . . . . . . . . . . . |
* . . . . . . . . . . . . . . . . |
* . . . . . . . . . . . . . . . . |
* . . . . . . . . . . . . . . . . V
*/
RGB_888 = 0x3,
/**
* RGB_565 format:
* Contains 1 plane in the following order -
* (A) RGB plane
*
* <-------- RGB_Stride -------->
* <------- Width ------->
* R G B R G B R G B R G B . . . . ^ ^
* R G B R G B R G B R G B . . . . | |
* R G B R G B R G B R G B . . . . Height |
* R G B R G B R G B R G B . . . . | RGB_Scanlines
* R G B R G B R G B R G B . . . . | |
* R G B R G B R G B R G B . . . . | |
* R G B R G B R G B R G B . . . . | |
* R G B R G B R G B R G B . . . . V |
* . . . . . . . . . . . . . . . . |
* . . . . . . . . . . . . . . . . |
* . . . . . . . . . . . . . . . . |
* . . . . . . . . . . . . . . . . V
*/
RGB_565 = 0x4,
/**
* BGRA_8888 format:
* Contains 1 plane in the following order -
* (A) BGRA plane
*
* <-------- RGB_Stride -------->
* <------- Width ------->
* B G R A B G R A B G R A . . . . ^ ^
* B G R A B G R A B G R A . . . . | |
* B G R A B G R A B G R A . . . . Height |
* B G R A B G R A B G R A . . . . | RGB_Scanlines
* B G R A B G R A B G R A . . . . | |
* B G R A B G R A B G R A . . . . | |
* B G R A B G R A B G R A . . . . | |
* B G R A B G R A B G R A . . . . V |
* . . . . . . . . . . . . . . . . |
* . . . . . . . . . . . . . . . . |
* . . . . . . . . . . . . . . . . |
* . . . . . . . . . . . . . . . . V
*/
BGRA_8888 = 0x5,
YCBCR_422_SP = 0x10, // NV16
/**
* YCrCb_420_SP format:
* YUV 4:2:0 image with a plane of 8 bit Y samples followed
* by an interleaved V/U plane containing 8 bit 2x2 subsampled
* colour difference samples.
*
* <-------- Y/UV_Stride -------->
* <------- Width ------->
* Y Y Y Y Y Y Y Y Y Y Y Y . . . . ^ ^
* Y Y Y Y Y Y Y Y Y Y Y Y . . . . | |
* Y Y Y Y Y Y Y Y Y Y Y Y . . . . Height |
* Y Y Y Y Y Y Y Y Y Y Y Y . . . . | Y_Scanlines
* Y Y Y Y Y Y Y Y Y Y Y Y . . . . | |
* Y Y Y Y Y Y Y Y Y Y Y Y . . . . | |
* Y Y Y Y Y Y Y Y Y Y Y Y . . . . | |
* Y Y Y Y Y Y Y Y Y Y Y Y . . . . V |
* . . . . . . . . . . . . . . . . |
* . . . . . . . . . . . . . . . . |
* . . . . . . . . . . . . . . . . |
* . . . . . . . . . . . . . . . . V
* V U V U V U V U V U V U . . . . ^
* V U V U V U V U V U V U . . . . |
* V U V U V U V U V U V U . . . . |
* V U V U V U V U V U V U . . . . UV_Scanlines
* . . . . . . . . . . . . . . . . |
* . . . . . . . . . . . . . . . . V
* . . . . . . . . . . . . . . . . --> Padding & Buffer size alignment
*
*/
YCrCb_420_SP = 0x11, // NV21
YCBCR_422_I = 0x14, // YUY2
RGBA_FP16 = 0x16,
RAW16 = 0x20,
BLOB = 0x21,
IMPLEMENTATION_DEFINED = 0x22,
YCBCR_420_888 = 0x23,
RAW_OPAQUE = 0x24,
RAW10 = 0x25,
RAW12 = 0x26,
RAW14 = 0x144,
RGBA_1010102 = 0x2B,
Y8 = 0x20203859,
Y16 = 0x20363159,
YV12 = 0x32315659, // YCrCb 4:2:0 Planar
DEPTH_16 = 0x30,
DEPTH_24 = 0x31,
DEPTH_24_STENCIL_8 = 0x32,
DEPTH_32F = 0x33,
DEPTH_32F_STENCIL_8 = 0x34,
STENCIL_8 = 0x35,
/**
* YCBCR_P010 format:
* YUV 4:2:0 image with a plane of 10 bit Y samples followed
* by an interleaved U/V plane containing 10 bit 2x2 subsampled
* colour difference samples.
*
* <-------- Y/UV_Stride -------->
* <------- Width ------->
* Y Y Y Y Y Y Y Y Y Y Y Y . . . . ^ ^
* Y Y Y Y Y Y Y Y Y Y Y Y . . . . | |
* Y Y Y Y Y Y Y Y Y Y Y Y . . . . Height |
* Y Y Y Y Y Y Y Y Y Y Y Y . . . . | Y_Scanlines
* Y Y Y Y Y Y Y Y Y Y Y Y . . . . | |
* Y Y Y Y Y Y Y Y Y Y Y Y . . . . | |
* Y Y Y Y Y Y Y Y Y Y Y Y . . . . | |
* Y Y Y Y Y Y Y Y Y Y Y Y . . . . V |
* . . . . . . . . . . . . . . . . |
* . . . . . . . . . . . . . . . . |
* . . . . . . . . . . . . . . . . |
* . . . . . . . . . . . . . . . . V
* U V U V U V U V U V U V . . . . ^
* U V U V U V U V U V U V . . . . |
* U V U V U V U V U V U V . . . . |
* U V U V U V U V U V U V . . . . UV_Scanlines
* . . . . . . . . . . . . . . . . |
* . . . . . . . . . . . . . . . . V
* . . . . . . . . . . . . . . . . --> Buffer size alignment
*
*/
YCBCR_P010 = 0x36,
HSV_888 = 0x37,
/* R8 format:
* Contains 1 plane in the following order -
* (A) R plane
*
* <-------- RGB_Stride -------->
* <------- Width ------->
* R R R R R R R R R R R R . . . . ^ ^
* R R R R R R R R R R R R . . . . | |
* R R R R R R R R R R R R . . . . Height |
* R R R R R R R R R R R R . . . . | RGB_Scanlines
* R R R R R R R R R R R R . . . . | |
* R R R R R R R R R R R R . . . . | |
* R R R R R R R R R R R R . . . . | |
* R R R R R R R R R R R R . . . . V |
* . . . . . . . . . . . . . . . . |
* . . . . . . . . . . . . . . . . |
* . . . . . . . . . . . . . . . . |
* . . . . . . . . . . . . . . . . V
*
*/
R_8 = 0x38,
RGBA_5551 = 0x6,
RGBA_4444 = 0x7,
/**
* YCbCr_420_SP format:
* YUV 4:2:0 image with a plane of 8 bit Y samples followed
* by an interleaved U/V plane containing 8 bit 2x2 subsampled
* colour difference samples.
*
* <-------- Y/UV_Stride -------->
* <------- Width ------->
* Y Y Y Y Y Y Y Y Y Y Y Y . . . . ^ ^
* Y Y Y Y Y Y Y Y Y Y Y Y . . . . | |
* Y Y Y Y Y Y Y Y Y Y Y Y . . . . Height |
* Y Y Y Y Y Y Y Y Y Y Y Y . . . . | Y_Scanlines
* Y Y Y Y Y Y Y Y Y Y Y Y . . . . | |
* Y Y Y Y Y Y Y Y Y Y Y Y . . . . | |
* Y Y Y Y Y Y Y Y Y Y Y Y . . . . | |
* Y Y Y Y Y Y Y Y Y Y Y Y . . . . V |
* . . . . . . . . . . . . . . . . |
* . . . . . . . . . . . . . . . . |
* . . . . . . . . . . . . . . . . |
* . . . . . . . . . . . . . . . . V
* U V U V U V U V U V U V . . . . ^
* U V U V U V U V U V U V . . . . |
* U V U V U V U V U V U V . . . . |
* U V U V U V U V U V U V . . . . UV_Scanlines
* . . . . . . . . . . . . . . . . |
* . . . . . . . . . . . . . . . . V
* . . . . . . . . . . . . . . . . --> Padding & Buffer size alignment
*
*/
YCbCr_420_SP = 0x109,
YCrCb_422_SP = 0x10B,
RG_88 = 0x10E,
YCbCr_444_SP = 0x10F,
YCrCb_444_SP = 0x110,
YCrCb_422_I = 0x111,
BGRX_8888 = 0x112,
NV21_ZSL = 0x113,
BGR_565 = 0x115,
RAW8 = 0x123,
// 10 bit
ARGB_2101010 = 0x117,
RGBX_1010102 = 0x118,
XRGB_2101010 = 0x119,
BGRA_1010102 = 0x11A,
ABGR_2101010 = 0x11B,
BGRX_1010102 = 0x11C,
XBGR_2101010 = 0x11D,
TP10 = 0x7FA30C09,
CbYCrY_422_I = 0x120,
BGR_888 = 0x121,
// Camera utils format
MULTIPLANAR_FLEX = 0x127,
// Khronos ASTC formats
COMPRESSED_RGBA_ASTC_4x4_KHR = 0x93B0,
COMPRESSED_RGBA_ASTC_5x4_KHR = 0x93B1,
COMPRESSED_RGBA_ASTC_5x5_KHR = 0x93B2,
COMPRESSED_RGBA_ASTC_6x5_KHR = 0x93B3,
COMPRESSED_RGBA_ASTC_6x6_KHR = 0x93B4,
COMPRESSED_RGBA_ASTC_8x5_KHR = 0x93B5,
COMPRESSED_RGBA_ASTC_8x6_KHR = 0x93B6,
COMPRESSED_RGBA_ASTC_8x8_KHR = 0x93B7,
COMPRESSED_RGBA_ASTC_10x5_KHR = 0x93B8,
COMPRESSED_RGBA_ASTC_10x6_KHR = 0x93B9,
COMPRESSED_RGBA_ASTC_10x8_KHR = 0x93BA,
COMPRESSED_RGBA_ASTC_10x10_KHR = 0x93BB,
COMPRESSED_RGBA_ASTC_12x10_KHR = 0x93BC,
COMPRESSED_RGBA_ASTC_12x12_KHR = 0x93BD,
COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR = 0x93D0,
COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR = 0x93D1,
COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR = 0x93D2,
COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR = 0x93D3,
COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR = 0x93D4,
COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR = 0x93D5,
COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR = 0x93D6,
COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR = 0x93D7,
COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR = 0x93D8,
COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR = 0x93D9,
COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR = 0x93DA,
COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR = 0x93DB,
COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR = 0x93DC,
COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR = 0x93DD,
/* Legacy formats/currently unsupported
* R_16_UINT
* RG_1616_UINT
* RGBA_10101010
* RGB888_UBWC_FSC
* RGB101010_UBWC_FSC
* YCbCr_422_I_10BIT
* YCbCr_422_I_10BIT_COMPRESSED
* YCbCr_420_SP_4R_UBWC
**/
/* Explicit UBWC formats are removed - set UBWC flag with corresponding linear
*format YCbCr_420_SP_VENUS_UBWC YCbCr_420_P010_UBWC YCbCr_420_TP10_UBWC
**/
/* To be deprecated when ExtenableTypes are plumbed */
NV12_ENCODEABLE = 0x102,
NV21_ENCODEABLE = 0x7FA30C00,
YCbCr_420_SP_VENUS = 0x7FA30C04,
YCbCr_420_SP_TILED = 0x7FA30C03,
YCrCb_420_SP_ADRENO = 0x7FA30C01,
YCrCb_420_SP_VENUS = 0x114,
YCbCr_420_P010_VENUS = 0x7FA30C0A,
NV12_HEIF = 0x116,
NV12_LINEAR_FLEX = 0x125,
NV12_UBWC_FLEX = 0x126,
NV12_UBWC_FLEX_2_BATCH = 0x128,
NV12_UBWC_FLEX_4_BATCH = 0x129,
NV12_UBWC_FLEX_8_BATCH = 0x130,
/* --------------------------------------------------------------------------------*/
} vendor_qti_hardware_display_common_PixelFormat;
#endif // __COMMON_PIXELFORMAT_H__

View File

@@ -0,0 +1,24 @@
// Copyright (c) 2023-2024 Qualcomm Innovation Center, Inc. All rights reserved.
// SPDX-License-Identifier: BSD-3-Clause-Clear
#ifndef __COMMON_PIXELFORMATMODIFIER_H__
#define __COMMON_PIXELFORMATMODIFIER_H__
typedef enum vendor_qti_hardware_display_common_PixelFormatModifier {
PIXEL_FORMAT_MODIFIER_NONE = 0,
PIXEL_FORMAT_MODIFIER_VENUS = 1,
PIXEL_FORMAT_MODIFIER_ADRENO = 2,
PIXEL_FORMAT_MODIFIER_FLEX = 3,
PIXEL_FORMAT_MODIFIER_LINEAR_FLEX = 4,
PIXEL_FORMAT_MODIFIER_UBWC_FLEX = 5,
PIXEL_FORMAT_MODIFIER_UBWC_FLEX_2_BATCH = 6,
PIXEL_FORMAT_MODIFIER_UBWC_FLEX_4_BATCH = 7,
PIXEL_FORMAT_MODIFIER_UBWC_FLEX_8_BATCH = 8,
PIXEL_FORMAT_MODIFIER_TILED = 9,
PIXEL_FORMAT_MODIFIER_ENCODEABLE = 10,
PIXEL_FORMAT_MODIFIER_HEIF = 11,
PIXEL_FORMAT_MODIFIER_4R = 12,
PIXEL_FORMAT_MODIFIER_EXPLICIT_UBWC = 13
} vendor_qti_hardware_display_common_PixelFormatModifier;
#endif // __COMMON_PIXELFORMATMODIFIER_H__

View File

@@ -0,0 +1,58 @@
// Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
// SPDX-License-Identifier: BSD-3-Clause-Clear
#ifndef __COMMON_PLANELAYOUT_H__
#define __COMMON_PLANELAYOUT_H__
#include "PlaneLayoutComponent.h"
#define QTI_MAX_NUM_COMPONENTS 5
typedef struct vendor_qti_hardware_display_common_PlaneLayout {
/**
* Offset of the plane, relative to the start of the buffer layout.
*/
int offset_in_bytes;
/**
* A sample contains all the components in a plane.
* For example, a buffer with semiplanar YUV format has
* one plane with a sample of Y and another plane with a sample of
* CbCr.
*
* The sample size is distance in bits between samples in the same row.
*/
int sample_increment_bits;
/**
* Components describe the subpixel, or channels of a pixel.
* This array contains the types of components in the plane.
*/
vendor_qti_hardware_display_common_PlaneLayoutComponent components[QTI_MAX_NUM_COMPONENTS];
/**
* Number of components in the array.
*/
int component_count;
/**
* The number of bytes between two consecutive rows.
*/
int horizontal_stride_in_bytes;
/**
* The number of rows in a plane.
*/
int scanlines;
/**
* Overall size in bytes of the plane, including padding.
*/
int size_in_bytes;
/**
* Number of horizontally adjacent pixels using the same pixel data.
* Must be a poisitive power of 2. A value of 1 indicates no subsampling.
*/
int horizontal_subsampling;
/**
* Number of vertically adjacent pixels using the same pixel data.
* Must be a poisitive power of 2. A value of 1 indicates no subsampling.
*/
int vertical_subsampling;
} vendor_qti_hardware_display_common_PlaneLayout;
#endif // __COMMON_PLANELAYOUT_H__

View File

@@ -0,0 +1,27 @@
// Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
// SPDX-License-Identifier: BSD-3-Clause-Clear
#ifndef __COMMON_PLANELAYOUTCOMPONENT_H__
#define __COMMON_PLANELAYOUTCOMPONENT_H__
#include "PlaneLayoutComponentType.h"
/**
* PlaneLayoutComponent describes a subpixel, or channel of a pixel.
* For example, RGB has 3 components - red, green, and blue.
*/
typedef struct vendor_qti_hardware_display_common_PlaneLayoutComponent {
vendor_qti_hardware_display_common_PlaneLayoutComponentType type;
/**
* Offsets in bits from start of plane to first instance of component.
* This can be used with the plane offset to determine exact location
* of the first instance of this commponent.
*/
int offset_in_bits;
/**
* Size in bits of component.
*/
int size_in_bits;
} vendor_qti_hardware_display_common_PlaneLayoutComponent;
#endif // __COMMON_PLANELAYOUTCOMPONENT_H__

View File

@@ -0,0 +1,38 @@
// Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
// SPDX-License-Identifier: BSD-3-Clause-Clear
#ifndef __COMMON_PLANELAYOUTCOMPONENTTYPE_H__
#define __COMMON_PLANELAYOUTCOMPONENTTYPE_H__
#include <string>
#include <unordered_map>
typedef enum vendor_qti_hardware_display_common_PlaneLayoutComponentType {
/* Luma */
PLANE_LAYOUT_COMPONENT_TYPE_Y = 1 << 0,
/* Chroma blue */
PLANE_LAYOUT_COMPONENT_TYPE_CB = 1 << 1,
/* Chroma red */
PLANE_LAYOUT_COMPONENT_TYPE_CR = 1 << 2,
/* Red */
PLANE_LAYOUT_COMPONENT_TYPE_R = 1 << 10,
/* Green */
PLANE_LAYOUT_COMPONENT_TYPE_G = 1 << 11,
/* Blue */
PLANE_LAYOUT_COMPONENT_TYPE_B = 1 << 12,
/* Raw */
PLANE_LAYOUT_COMPONENT_TYPE_RAW = 1 << 20,
/* Blob */
PLANE_LAYOUT_COMPONENT_TYPE_BLOB = 1 << 29,
/* Alpha */
PLANE_LAYOUT_COMPONENT_TYPE_A = 1 << 30,
/* Meta */
PLANE_LAYOUT_COMPONENT_TYPE_META = 1 << 31,
} vendor_qti_hardware_display_common_PlaneLayoutComponentType;
#endif // __COMMON_PLANELAYOUTCOMPONENTTYPE_H__

View File

@@ -0,0 +1,29 @@
// Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved.
// SPDX-License-Identifier: BSD-3-Clause-Clear
#ifndef __COMMON_QTIANAMORPHICMETADATA_H__
#define __COMMON_QTIANAMORPHICMETADATA_H__
#include <cstdint>
#include <cfloat>
typedef struct vendor_qti_hardware_display_common_QtiAnamorphicMetadataPerEye {
double leftCR = 0; /* Horizontal left compression ratio. Needs to be > 1 */
double rightCR = 0; /* Horizontal right compression ratio. Needs to be > 1 */
double topCR = 0; /* Vertical top compression ratio. Needs to be > 1 */
double bottomCR = 0; /* Vertical bottom compression ratio. Needs to be > 1 */
uint32_t foveaX = 0; /* X position of the fovea region */
uint32_t foveaY = 0; /* Y position of the fovea region */
uint32_t foveaWidth = 0; /* Width of the fovea region */
uint32_t foveaHeight = 0; /* Height of the fovea region */
} vendor_qti_hardware_display_common_QtiAnamorphicMetadataPerEye;
typedef struct vendor_qti_hardware_display_common_QtiAnamorphicMetadata {
bool leftEyeDataValid = false;
bool rightEyeDataValid = false;
vendor_qti_hardware_display_common_QtiAnamorphicMetadataPerEye leftEyeParams; /* Left Eye */
vendor_qti_hardware_display_common_QtiAnamorphicMetadataPerEye rightEyeParams; /* Right Eye */
} vendor_qti_hardware_display_common_QtiAnamorphicMetadata;
#endif // __COMMON_QTIANAMORPHICMETADATA_H___

View File

@@ -0,0 +1,25 @@
// Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
// SPDX-License-Identifier: BSD-3-Clause-Clear
#ifndef __COMMON_QTICOLORPRIMARIES_H__
#define __COMMON_QTICOLORPRIMARIES_H__
// Based loosely on BT.2380 / H.265 specifications
typedef enum vendor_qti_hardware_display_common_QtiColorPrimaries {
// Unused = 0;
QtiColorPrimaries_BT709_5 = 1, /* ITU-R BT.709-5 or equivalent */
// Unspecified = 2, Reserved = 3
QtiColorPrimaries_BT470_6M = 4, /* ITU-R BT.470-6 System M or equivalent */
QtiColorPrimaries_BT601_6_625 = 5, /* ITU-R BT.601-6 625 or equivalent */
QtiColorPrimaries_BT601_6_525 = 6, /* ITU-R BT.601-6 525 or equivalent */
QtiColorPrimaries_SMPTE_240M = 7, /* SMPTE_240M */
QtiColorPrimaries_GenericFilm = 8, /* Generic Film */
QtiColorPrimaries_BT2020 = 9, /* ITU-R BT.2020 or equivalent */
QtiColorPrimaries_SMPTE_ST428 = 10, /* SMPTE_240M */
QtiColorPrimaries_AdobeRGB = 11, /* Adobe RGB */
QtiColorPrimaries_DCIP3 = 12, /* DCI-P3 */
QtiColorPrimaries_EBU3213 = 22, /* EBU 3213 */
QtiColorPrimaries_Max = 0xffff,
} vendor_qti_hardware_display_common_QtiColorPrimaries;
#endif // __COMMON_QTICOLORPRIMARIES_H__

View File

@@ -0,0 +1,14 @@
// Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
// SPDX-License-Identifier: BSD-3-Clause-Clear
#ifndef __COMMON_QTICOLORRANGE_H__
#define __COMMON_QTICOLORRANGE_H__
typedef enum vendor_qti_hardware_display_common_QtiColorRange {
QtiRange_Limited = 0,
QtiRange_Full = 1,
QtiRange_Extended = 2,
QtiRange_Max = 0xffff,
} vendor_qti_hardware_display_common_QtiColorRange;
#endif // __COMMON_QTICOLORRANGE_H__

View File

@@ -0,0 +1,34 @@
// Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
// SPDX-License-Identifier: BSD-3-Clause-Clear
#ifndef __COMMON_QTICOLORREMAPPINGINFO_H__
#define __COMMON_QTICOLORREMAPPINGINFO_H__
#include "QtiColorPrimaries.h"
#include "QtiGammaTransfer.h"
#include "QtiMatrixCoEfficients.h"
typedef struct vendor_qti_hardware_display_common_QtiColorRemappingInfo {
bool criEnabled;
uint32_t crId;
uint32_t crCancelFlag;
uint32_t crPersistenceFlag;
uint32_t crVideoSignalInfoPresentFlag;
uint32_t crRange;
vendor_qti_hardware_display_common_QtiColorPrimaries crPrimaries;
vendor_qti_hardware_display_common_QtiGammaTransfer crTransferFunction;
vendor_qti_hardware_display_common_QtiMatrixCoEfficients crMatrixCoefficients;
uint32_t crInputBitDepth;
uint32_t crOutputBitDepth;
uint32_t crPreLutNumValMinusOne[3];
uint32_t crPreLutCodedValue[3 * 33];
uint32_t crPreLutTargetValue[3 * 33];
uint32_t crMatrixPresentFlag;
uint32_t crLog2MatrixDenom;
int32_t crCoefficients[3 * 3];
uint32_t crPostLutNumValMinusOne[3];
uint32_t crPostLutCodedValue[3 * 33];
uint32_t crPostLutTargetValue[3 * 33];
} vendor_qti_hardware_display_common_QtiColorRemappingInfo;
#endif // __COMMON_QTICOLORREMAPPINGINFO_H__

View File

@@ -0,0 +1,19 @@
// Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
// SPDX-License-Identifier: BSD-3-Clause-Clear
#ifndef __COMMON_QTICONTENTLIGHTLEVEL_H__
#define __COMMON_QTICONTENTLIGHTLEVEL_H__
#include <cstdint>
typedef struct vendor_qti_hardware_display_common_QtiContentLightLevel {
/**
* Light level SEI (Supplement Enhancement Information).
* Indicates if QtiContentLightLevel info should be used.
*/
bool lightLevelSEIEnabled;
uint32_t maxContentLightLevel; /* Unit: candelas per square meter */
uint32_t maxFrameAverageLightLevel; /* Unit: candelas per square meter */
} vendor_qti_hardware_display_common_QtiContentLightLevel;
#endif // __COMMON_QTICONTENTLIGHTLEVEL_H__

View File

@@ -0,0 +1,21 @@
// Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
// SPDX-License-Identifier: BSD-3-Clause-Clear
#ifndef __COMMON_QTIDYNAMICMETADATA_H__
#define __COMMON_QTIDYNAMICMETADATA_H__
#include <cstdint>
#define QTI_HDR_DYNAMIC_META_DATA_SZ 1024
/**
* Dynamic HDR metadata.
* This is not used in tone mapping until it has been set for the first time.
*/
typedef struct vendor_qti_hardware_display_common_QtiDynamicMetadata {
bool dynamicMetaDataValid;
uint32_t dynamicMetaDataLen;
uint8_t dynamicMetaDataPayload[QTI_HDR_DYNAMIC_META_DATA_SZ];
} vendor_qti_hardware_display_common_QtiDynamicMetadata;
#endif // __COMMON_QTIDYNAMICMETADATA_H__

View File

@@ -0,0 +1,30 @@
// Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
// SPDX-License-Identifier: BSD-3-Clause-Clear
#ifndef __COMMON_QTIGAMMATRANSFER_H__
#define __COMMON_QTIGAMMATRANSFER_H__
// Based on BT.2380 / H.265 specifications
typedef enum vendor_qti_hardware_display_common_QtiGammaTransfer {
// Unused = 0;
QtiTransfer_sRGB = 1, // IEC 61966-2-1 sRGB
/* Unspecified = 2, Reserved = 3 */
QtiTransfer_Gamma2_2 = 4,
QtiTransfer_Gamma2_8 = 5,
QtiTransfer_SMPTE_170M = 6, // BT.601-6 525 or 625
QtiTransfer_SMPTE_240M = 7, // SMPTE_240M
QtiTransfer_Linear = 8,
QtiTransfer_Log = 9,
QtiTransfer_Log_Sqrt = 10,
QtiTransfer_XvYCC = 11, // IEC 61966-2-4
QtiTransfer_BT1361 = 12, // Rec.ITU-R BT.1361 extended gamut
QtiTransfer_sYCC = 13, // IEC 61966-2-1 sRGB or sYCC
QtiTransfer_BT2020_2_1 = 14, // Rec. ITU-R BT.2020-2 (same as the values 6, and 15)
QtiTransfer_BT2020_2_2 = 15, // Rec. ITU-R BT.2020-2 (same as the values 6, and 14)
QtiTransfer_SMPTE_ST2084 = 16, // 2084
QtiTransfer_ST_428 = 17, // SMPTE ST 428-1
QtiTransfer_HLG = 18, // ARIB STD-B67
QtiTransfer_Max = 0xffff,
} vendor_qti_hardware_display_common_QtiGammaTransfer;
#endif // __COMMON_QTIGAMMATRANSFER_H__

View File

@@ -0,0 +1,46 @@
// Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
// SPDX-License-Identifier: BSD-3-Clause-Clear
#ifndef __COMMON_QTIMASTERINGDISPLAY_H__
#define __COMMON_QTIMASTERINGDISPLAY_H__
#include <cstdint>
#include "XyColor.h"
/*
* Mastering display metadata.
*/
typedef struct vendor_qti_hardware_display_common_QtiMasteringDisplay {
/**
* Color volume SEI (Supplement Enhancement Information).
* Indicates if QtiMasterDisplay info should be used.
*/
bool colorVolumeSEIEnabled;
/**
* Chromaticity for red in the RGB primaries (unit 1/50000).
*/
vendor_qti_hardware_display_common_XyColor primaryRed;
/**
* Chromaticity for green in the RGB primaries (unit 1/50000).
*/
vendor_qti_hardware_display_common_XyColor primaryGreen;
/**
* Chromaticity for blue in the RGB primaries (unit 1/50000).
*/
vendor_qti_hardware_display_common_XyColor primaryBlue;
/**
* Chromaticity for the white point (unit 1/50000).
*/
vendor_qti_hardware_display_common_XyColor whitePoint;
/**
* Maximum luminance in candelas per square meter.
*/
uint32_t maxDisplayLuminance;
/**
* Minimum luminance in 1/10000 candelas per square meter.
*/
uint32_t minDisplayLuminance;
} vendor_qti_hardware_display_common_QtiMasteringDisplay;
#endif // __COMMON_QTIMASTERINGDISPLAY_H__

View File

@@ -0,0 +1,24 @@
// Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
// SPDX-License-Identifier: BSD-3-Clause-Clear
#ifndef __COMMON_QTIMATRIXCOEFFICIENTS_H__
#define __COMMON_QTIMATRIXCOEFFICIENTS_H__
typedef enum vendor_qti_hardware_display_common_QtiMatrixCoEfficients {
QtiMatrixCoEff_Identity = 0,
QtiMatrixCoEff_BT709_5 = 1,
/* Unspecified = 2, Reserved = 3 */
QtiMatrixCoeff_FCC_73_682 = 4,
QtiMatrixCoEff_BT601_6_625 = 5,
QtiMatrixCoEff_BT601_6_525 = 6,
QtiMatrixCoEff_SMPTE240M = 7, // used with 601_525_Unadjusted
QtiMatrixCoEff_YCgCo = 8,
QtiMatrixCoEff_BT2020 = 9,
QtiMatrixCoEff_BT2020Constant = 10,
QtiMatrixCoEff_BT601_6_Unadjusted = 11, // Used with BT601_625(KR=0.222, KB=0.071)
QtiMatrixCoEff_DCIP3 = 12,
QtiMatrixCoEff_Chroma_NonConstant = 13,
QtiMatrixCoEff_Max = 0xffff,
} vendor_qti_hardware_display_common_QtiMatrixCoEfficients;
#endif // __COMMON_QTIMATRIXCOEFFICIENTS_H__

View File

@@ -0,0 +1,14 @@
// Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved.
// SPDX-License-Identifier: BSD-3-Clause-Clear
#ifndef __COMMON_QTIVIEWS_H__
#define __COMMON_QTIVIEWS_H__
typedef enum vendor_qti_hardware_display_common_QtiViews {
PRIV_VIEW_MASK_PRIMARY = 0x00000001,
PRIV_VIEW_MASK_SECONDARY = 0x00000002,
PRIV_VIEW_MASK_PRIMARY_DEPTH = 0x00000004,
PRIV_VIEW_MASK_SECONDARY_DEPTH = 0x00000008,
} vendor_qti_hardware_display_common_QtiViews;
#endif // __COMMON_QTIVIEWS_H__

View File

@@ -0,0 +1,19 @@
// Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
// SPDX-License-Identifier: BSD-3-Clause-Clear
#ifndef __COMMON_RECT_H__
#define __COMMON_RECT_H__
#include <cstdint>
/**
* Position of a rectangle.
*/
typedef struct vendor_qti_hardware_display_common_Rect {
int32_t left;
int32_t top;
int32_t right;
int32_t bottom;
} vendor_qti_hardware_display_common_Rect;
#endif // __COMMON_RECT_H__

View File

@@ -0,0 +1,20 @@
// Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
// SPDX-License-Identifier: BSD-3-Clause-Clear
#ifndef __COMMON_RESERVEDREGION_H__
#define __COMMON_RESERVEDREGION_H__
#include <cstdint>
#include "Address.h"
/*
* Additional shared memory in buffer, outside of content and metadata,
* for client use.
*/
typedef struct vendor_qti_hardware_display_common_ReservedRegion {
uint32_t size;
vendor_qti_hardware_display_common_Address reserved_region_addr;
} vendor_qti_hardware_display_common_ReservedRegion;
#endif // __COMMON_RESERVEDREGION_H__

View File

@@ -0,0 +1,37 @@
// Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved.
// SPDX-License-Identifier: BSD-3-Clause-Clear
#ifndef __COMMON_QTITHREEDIMENSIONALREFINFO_H__
#define __COMMON_QTITHREEDIMENSIONALREFINFO_H__
#include <cstdint>
#define NUM_REF_DISPLAYS 32
typedef struct
vendor_qti_hardware_display_common_ThreeDimensionalRefDisplayInfo {
uint8_t left_view_id;
uint8_t right_view_id;
uint8_t exponent_ref_display_width;
uint8_t mantissa_ref_display_width;
uint8_t exponent_ref_viewing_distance;
// Valid only if ref_viewing_distance_flag is 1
uint8_t mantissa_ref_viewing_distance;
// Valid only if additional_shift_present_flag is 1
uint16_t num_sample_shift_plus512;
uint8_t additional_shift_present_flag;
uint8_t reserved[7]; // added for 64-bit alignment
} vendor_qti_hardware_display_common_ThreeDimensionalRefDisplayInfo;
typedef struct vendor_qti_hardware_display_common_ThreeDimensionalRefInfo {
uint8_t prec_ref_display_width;
uint8_t ref_viewing_distance_flag;
uint8_t prec_ref_viewing_dist; // Valid only if ref_viewing_distance_flag is 1
uint8_t num_ref_displays_minus1;
struct vendor_qti_hardware_display_common_ThreeDimensionalRefDisplayInfo
threedRefDispInfo[NUM_REF_DISPLAYS];
uint8_t three_dimensional_reference_displays_extension_flag;
uint8_t reserved[3]; // added for 64-bit alignment
} vendor_qti_hardware_display_common_ThreeDimensionalRefInfo;
#endif // __COMMON_QTITHREEDIMENSIONALREFINFO_H__

View File

@@ -0,0 +1,27 @@
// Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
// SPDX-License-Identifier: BSD-3-Clause-Clear
#ifndef __COMMON_UBWCSTATS_H__
#define __COMMON_UBWCSTATS_H__
#include <cstdint>
#include "UBWCVersion.h"
#include "UBWC_CR_Stats.h"
#define QTI_UBWC_STATS_ARRAY_SIZE 2
#define QTI_MAX_UBWC_STATS_LENGTH 32
typedef struct vendor_qti_hardware_display_common_UBWCStats {
vendor_qti_hardware_display_common_UBWCVersion version; /* Union depends on this version. */
uint8_t bDataValid; /* If [non-zero], CR Stats data is valid.
* Consumers may use stats data.
* If [zero], CR Stats data is invalid.
* Consumers *Shall* not use stats data */
union {
struct vendor_qti_hardware_display_common_UBWC_CR_Stats ubwc_stats;
uint32_t reserved[QTI_MAX_UBWC_STATS_LENGTH]; /* This is for future */
};
} vendor_qti_hardware_display_common_UBWCStats;
#endif // __COMMON_UBWCSTATS_H__

View File

@@ -0,0 +1,17 @@
// Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
// SPDX-License-Identifier: BSD-3-Clause-Clear
#ifndef __COMMON_UBWCVERSION_H__
#define __COMMON_UBWCVERSION_H__
typedef enum vendor_qti_hardware_display_common_UBWCVersion {
UBWC_VERSION_UNUSED = 0,
UBWC_VERSION_1_0 = 0x1,
UBWC_VERSION_2_0 = 0x2,
UBWC_VERSION_3_0 = 0x3,
UBWC_VERSION_4_0 = 0x4,
UBWC_VERSION_5_0 = 0x5,
UBWC_VERSION_MAX = 0xFF,
} vendor_qti_hardware_display_common_UBWCVersion;
#endif // __COMMON_UBWCVERSION_H__

View File

@@ -0,0 +1,19 @@
// Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
// SPDX-License-Identifier: BSD-3-Clause-Clear
#ifndef __COMMON_UBWCCRSTATS_H__
#define __COMMON_UBWCCRSTATS_H__
#include <cstdint>
typedef struct vendor_qti_hardware_display_common_UBWC_CR_Stats {
uint32_t nCRStatsTile32; /**< UBWC Stats info for 32 Byte Tile */
uint32_t nCRStatsTile64; /**< UBWC Stats info for 64 Byte Tile */
uint32_t nCRStatsTile96; /**< UBWC Stats info for 96 Byte Tile */
uint32_t nCRStatsTile128; /**< UBWC Stats info for 128 Byte Tile */
uint32_t nCRStatsTile160; /**< UBWC Stats info for 160 Byte Tile */
uint32_t nCRStatsTile192; /**< UBWC Stats info for 192 Byte Tile */
uint32_t nCRStatsTile256; /**< UBWC Stats info for 256 Byte Tile */
} vendor_qti_hardware_display_common_UBWC_CR_Stats;
#endif // __COMMON_UBWCCRSTATS_H__

View File

@@ -0,0 +1,25 @@
// Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
// SPDX-License-Identifier: BSD-3-Clause-Clear
#ifndef __COMMON_VIDEOHISTOGRAMMETADATA_H__
#define __COMMON_VIDEOHISTOGRAMMETADATA_H__
#include <cstdint>
#define QTI_VIDEO_HISTOGRAM_STATS_SIZE 4 * 1024
/**
* Video histogram stats populated by video decoder.
*/
typedef struct vendor_qti_hardware_display_common_VideoHistogramMetadata {
uint32_t stats_info[1024]; /* Video stats payload */
uint32_t stat_len; /* Payload size in bytes */
uint32_t frame_type; /* bit mask to indicate frame type */
uint32_t display_width;
uint32_t display_height;
uint32_t decode_width;
uint32_t decode_height;
uint32_t reserved[12];
} vendor_qti_hardware_display_common_VideoHistogramMetadata;
#endif // __COMMON_VIDEOHISTOGRAMMETADATA_H__

View File

@@ -0,0 +1,17 @@
// Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
// SPDX-License-Identifier: BSD-3-Clause-Clear
#ifndef __COMMON_VIDEOTIMESTAMPINFO_H__
#define __COMMON_VIDEOTIMESTAMPINFO_H__
#include <cstdint>
#define VIDEO_TIMESTAMP_INFO_SIZE 16
typedef struct vendor_qti_hardware_display_common_VideoTimestampInfo {
uint32_t enable; /* Enable video timestamp info */
uint32_t frame_number; /* Frame number/counter */
int64_t frame_timestamp_us; /* Frame timestamp in us */
} vendor_qti_hardware_display_common_VideoTimestampInfo;
#endif // __COMMON_VIDEOTIMESTAMPINFO_H__

View File

@@ -0,0 +1,17 @@
// Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
// SPDX-License-Identifier: BSD-3-Clause-Clear
#ifndef __COMMON_VIDEOTRANSCODESTATSMETADATA_H__
#define __COMMON_VIDEOTRANSCODESTATSMETADATA_H__
#include <cstdint>
#define QTI_VIDEO_TRANSCODE_PAYLOAD_NUM 32
#define QTI_VIDEO_TRANSCODE_STATS_SIZE (QTI_VIDEO_TRANSCODE_PAYLOAD_NUM * 4)
typedef struct vendor_qti_hardware_display_common_VideoTranscodeStatsMetadata {
uint32_t stats_info[QTI_VIDEO_TRANSCODE_PAYLOAD_NUM]; /* Transcode stats payload */
uint32_t stat_len; /* Full payload size in bytes */
} vendor_qti_hardware_display_common_VideoTranscodeStatsMetadata;
#endif // __COMMON_VIDEOTRANSCODESTATSMETADATA_H__

View File

@@ -0,0 +1,15 @@
// Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
// SPDX-License-Identifier: BSD-3-Clause-Clear
#ifndef __COMMON_XYCOLOR_H__
#define __COMMON_XYCOLOR_H__
/*
* 2-dimensional chromaticity, unit 1/50000.
*/
typedef struct vendor_qti_hardware_display_common_XyColor {
uint32_t x;
uint32_t y;
} vendor_qti_hardware_display_common_XyColor;
#endif // __COMMON_XYCOLOR_H__

View File

@@ -0,0 +1,42 @@
/*
* Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
#ifndef __DEBUG_CALLBACK_INTF__
#define __DEBUG_CALLBACK_INTF__
#include <cstdarg>
/*
This interface has all the functions necessary for debug info, such as
logs, traces and debug properties. Compositors must provide a concrete
implementation of this class on Init
*/
namespace sdm {
enum DebugLogType {
ERROR,
WARNING,
INFO,
DEBUG,
VERBOSE,
};
class DebugCallbackIntf {
public:
virtual ~DebugCallbackIntf() {}
virtual void Log(DebugLogType type, const char *log_tag, const char *fmt,
std::va_list &args) = 0;
virtual int GetProperty(const char *property_name, int *value) = 0;
virtual int GetProperty(const char *property_name, char *value) = 0;
virtual void BeginTrace(const char *class_name, const char *function_name,
const char *custom_string) = 0;
virtual void EndTrace() = 0;
virtual void ATrace(const char *custom_string, const int bit) = 0;
};
} // namespace sdm
#endif // __DEBUG_CALLBACK_INTF__