555.42.02

(cherry picked from commit 5a1c474040)
This commit is contained in:
Bernhard Stoeckner
2024-05-21 15:11:46 +02:00
committed by Gaurav Juvekar
parent caa2dd11a0
commit 3084c04453
1004 changed files with 172522 additions and 150960 deletions

View File

@@ -47,6 +47,7 @@ typedef enum tagSDP_PACKET_TYPE
typedef enum tagSDP_VSC_REVNUM
{
SDP_VSC_REVNUM_DISABLED = 0,
SDP_VSC_REVNUM_STEREO = 1,
SDP_VSC_REVNUM_STEREO_PSR,
SDP_VSC_REVNUM_STEREO_PSR2,
@@ -58,6 +59,7 @@ typedef enum tagSDP_VSC_REVNUM
typedef enum tagSDP_VSC_VALID_DATA_BYTES
{
SDP_VSC_VALID_DATA_BYTES_DISABLED = 0,
SDP_VSC_VALID_DATA_BYTES_STEREO = 1,
SDP_VSC_VALID_DATA_BYTES_STEREO_PSR = 8,
SDP_VSC_VALID_DATA_BYTES_PSR2 = 12,

View File

@@ -117,7 +117,7 @@ NvTiming_parseDisplayId20Info(
}
CODE_SEGMENT(PAGE_DD_CODE)
NvU32
NvU32
NvTiming_DisplayID2ValidationMask(
NVT_DISPLAYID_2_0_INFO *pDisplayId20Info,
NvBool bIsStrongValidation)
@@ -130,13 +130,13 @@ NvTiming_DisplayID2ValidationMask(
{
ret |= NVT_DID2_VALIDATION_ERR_MASK(NVT_DID2_VALIDATION_ERR_VERSION);
}
if (!pDisplayId20Info->valid_data_blocks.product_id_present)
{
ret |= NVT_DID2_VALIDATION_ERR_MASK(NVT_DID2_VALIDATION_ERR_PRODUCT_IDENTIFY);
}
if (pDisplayId20Info->primary_use_case >= PRODUCT_PRIMARY_USE_GENERIC_DISPLAY &&
if (pDisplayId20Info->primary_use_case >= PRODUCT_PRIMARY_USE_GENERIC_DISPLAY &&
pDisplayId20Info->primary_use_case <= PRODUCT_PRIMARY_USE_HEAD_MOUNT_AUGMENTED_REALITY)
{
if (!(pDisplayId20Info->valid_data_blocks.parameters_present &&
@@ -155,7 +155,7 @@ NvTiming_DisplayID2ValidationMask(
// Type 7 Timings data block
for (j = 0; j <= pDisplayId20Info->total_timings; j++)
{
if ( NVT_PREFERRED_TIMING_IS_DISPLAYID(pDisplayId20Info->timing[j].etc.flag) &&
if ( NVT_PREFERRED_TIMING_IS_DISPLAYID(pDisplayId20Info->timing[j].etc.flag) &&
(pDisplayId20Info->display_param.h_pixels != 0) &&
(pDisplayId20Info->display_param.v_pixels != 0))
{
@@ -175,12 +175,12 @@ NvTiming_DisplayID2ValidationMask(
}
CODE_SEGMENT(PAGE_DD_CODE)
NVT_STATUS
NVT_STATUS
NvTiming_DisplayID2ValidationDataBlocks(
NVT_DISPLAYID_2_0_INFO *pDisplayIdInfo,
NVT_DISPLAYID_2_0_INFO *pDisplayIdInfo,
NvBool bIsStrongValidation)
{
if (NvTiming_DisplayID2ValidationMask(pDisplayIdInfo, bIsStrongValidation) != 0)
if (NvTiming_DisplayID2ValidationMask(pDisplayIdInfo, bIsStrongValidation) != 0)
{
return NVT_STATUS_ERR;
}
@@ -272,7 +272,7 @@ parseDisplayId20SectionDataBlocks(
break;
}
// check data block is valid.
// check data block is valid.
if ((offset + DISPLAYID_2_0_DATA_BLOCK_SIZE_TOTAL(pDataBlock)) > pSection->header.section_bytes)
{
return NVT_STATUS_ERR;
@@ -284,7 +284,7 @@ parseDisplayId20SectionDataBlocks(
{
return status;
}
switch (pDataBlock->type)
{
case DISPLAYID_2_0_BLOCK_TYPE_PRODUCT_IDENTITY:
@@ -312,7 +312,7 @@ parseDisplayId20SectionDataBlocks(
case DISPLAYID_2_0_BLOCK_TYPE_INTERFACE_FEATURES:
pDisplayIdInfo->valid_data_blocks.interface_feature_present = NV_TRUE;
// Supported - Color depth is supported for all supported timings. Supported timing includes all Display-ID exposed timings
// Supported - Color depth is supported for all supported timings. Supported timing includes all Display-ID exposed timings
// (that is timing exposed using DisplayID timing types and CTA VICs)
if (IS_BPC_SUPPORTED_COLORFORMAT(pDisplayIdInfo->interface_features.yuv444.bpcs))
{
@@ -324,8 +324,8 @@ parseDisplayId20SectionDataBlocks(
pDisplayIdInfo->basic_caps |= NVT_DISPLAY_2_0_CAP_YCbCr_422;
}
if (pDisplayIdInfo->interface_features.audio_capability.support_48khz ||
pDisplayIdInfo->interface_features.audio_capability.support_44_1khz ||
if (pDisplayIdInfo->interface_features.audio_capability.support_48khz ||
pDisplayIdInfo->interface_features.audio_capability.support_44_1khz ||
pDisplayIdInfo->interface_features.audio_capability.support_32khz)
{
pDisplayIdInfo->basic_caps |= NVT_DISPLAY_2_0_CAP_BASIC_AUDIO;
@@ -344,7 +344,7 @@ parseDisplayId20SectionDataBlocks(
pDisplayIdInfo->valid_data_blocks.type10Timing_present = NV_TRUE;
break;
case DISPLAYID_2_0_BLOCK_TYPE_ADAPTIVE_SYNC:
pDisplayIdInfo->valid_data_blocks.adaptive_sync_present = NV_TRUE;
pDisplayIdInfo->valid_data_blocks.adaptive_sync_present = NV_TRUE;
break;
case DISPLAYID_2_0_BLOCK_TYPE_ARVR_HMD:
pDisplayIdInfo->valid_data_blocks.arvr_hmd_present = NV_TRUE;
@@ -371,15 +371,15 @@ parseDisplayId20SectionDataBlocks(
return status;
}
CODE_SEGMENT(PAGE_DD_CODE)
NVT_STATUS
NVT_STATUS
parseDisplayId20DataBlock(
const DISPLAYID_2_0_DATA_BLOCK_HEADER *pDataBlock,
NVT_DISPLAYID_2_0_INFO *pDisplayIdInfo)
{
NVT_STATUS status = NVT_STATUS_SUCCESS;
switch (pDataBlock->type)
{
case DISPLAYID_2_0_BLOCK_TYPE_PRODUCT_IDENTITY:
@@ -452,7 +452,7 @@ parseDisplayId20ProductIdentity(
pProductIdBlock = (const DISPLAYID_2_0_PROD_IDENTIFICATION_BLOCK *)pDataBlock;
// add more validation if needed
// add more validation if needed
if (pDisplayIdInfo == NULL) return status;
@@ -487,7 +487,7 @@ parseDisplayId20ProductIdentity(
CODE_SEGMENT(PAGE_DD_CODE)
NVT_STATUS
parseDisplayId20DisplayParam(
parseDisplayId20DisplayParam(
const DISPLAYID_2_0_DATA_BLOCK_HEADER *pDataBlock,
NVT_DISPLAYID_2_0_INFO *pDisplayIdInfo)
{
@@ -580,7 +580,7 @@ parseDisplayId20DisplayParam(
return status;
}
CODE_SEGMENT(PAGE_DD_CODE)
CODE_SEGMENT(PAGE_DD_CODE)
NVT_STATUS
parseDisplayId20Timing7(
const DISPLAYID_2_0_DATA_BLOCK_HEADER *pDataBlock,
@@ -603,7 +603,6 @@ parseDisplayId20Timing7(
{
if (pDataBlock->data_bytes % sizeof(DISPLAYID_2_0_TIMING_7_DESCRIPTOR) != 0)
{
nvt_assert(0);
return NVT_STATUS_ERR;
}
@@ -612,7 +611,6 @@ parseDisplayId20Timing7(
if (descriptorCount < 1 || descriptorCount > DISPLAYID_2_0_TIMING_7_MAX_DESCRIPTORS)
{
nvt_assert(0);
return NVT_STATUS_ERR;
}
@@ -620,7 +618,7 @@ parseDisplayId20Timing7(
{
startSeqNumber = getExistedTimingSeqNumber(pDisplayIdInfo, NVT_TYPE_DISPLAYID_7);
}
for (i = 0; i < descriptorCount; i++)
{
NVMISC_MEMSET(&newTiming, 0, sizeof(newTiming));
@@ -644,9 +642,9 @@ parseDisplayId20Timing7(
newTiming.etc.flag |= pTiming7Block->descriptors[i].options.is_preferred_or_ycc420 ? NVT_FLAG_DISPLAYID_DTD_PREFERRED_TIMING : 0;
}
NVT_SNPRINTF((char *)newTiming.etc.name, sizeof(newTiming.etc.name), "DID20-Type7:#%2d:%dx%dx%3d.%03dHz/%s",
NVT_SNPRINTF((char *)newTiming.etc.name, sizeof(newTiming.etc.name), "DID20-Type7:#%2d:%dx%dx%3d.%03dHz/%s",
(int)NVT_GET_TIMING_STATUS_SEQ(newTiming.etc.status),
(int)newTiming.HVisible,
(int)newTiming.HVisible,
(int)((newTiming.interlaced ? 2 : 1)*newTiming.VVisible),
(int)newTiming.etc.rrx1k/1000,
(int)newTiming.etc.rrx1k%1000,
@@ -669,7 +667,7 @@ parseDisplayId20Timing7(
return status;
}
CODE_SEGMENT(PAGE_DD_CODE)
CODE_SEGMENT(PAGE_DD_CODE)
NVT_STATUS
parseDisplayId20Timing8(
const DISPLAYID_2_0_DATA_BLOCK_HEADER *pDataBlock,
@@ -707,22 +705,22 @@ parseDisplayId20Timing8(
{
NVMISC_MEMSET(&newTiming, 0, sizeof(newTiming));
if (parseDisplayId20Timing8Descriptor(&pTiming8Block->timingCode, &newTiming,
pTiming8Block->header.timing_code_type,
if (parseDisplayId20Timing8Descriptor(&pTiming8Block->timingCode, &newTiming,
pTiming8Block->header.timing_code_type,
pTiming8Block->header.timing_code_size, i, startSeqNumber+i) == NVT_STATUS_SUCCESS)
{
newTiming.etc.flag |= ((pTiming8Block->header.revision == 1) && pTiming8Block->header.is_support_yuv420) ?
newTiming.etc.flag |= ((pTiming8Block->header.revision == 1) && pTiming8Block->header.is_support_yuv420) ?
NVT_FLAG_DISPLAYID_T7_T8_EXPLICT_YUV420 :
0;
NVT_SNPRINTF((char *)newTiming.etc.name, sizeof(newTiming.etc.name), "DID20-Type8:#%3d:%dx%dx%3d.%03dHz/%s",
(int)NVT_GET_TIMING_STATUS_SEQ(newTiming.etc.status),
(int)newTiming.HVisible, (int)newTiming.VVisible,
(int)newTiming.etc.rrx1k/1000, (int)newTiming.etc.rrx1k%1000,
(int)newTiming.etc.rrx1k/1000, (int)newTiming.etc.rrx1k%1000,
(newTiming.interlaced ? "I":"P"));
newTiming.etc.name[sizeof(newTiming.etc.name) - 1] = '\0';
newTiming.etc.rep = 0x1;
if (!assignNextAvailableDisplayId20Timing(pDisplayIdInfo, &newTiming))
{
break;
@@ -733,7 +731,7 @@ parseDisplayId20Timing8(
return status;
}
CODE_SEGMENT(PAGE_DD_CODE)
CODE_SEGMENT(PAGE_DD_CODE)
NVT_STATUS
parseDisplayId20Timing9(
const DISPLAYID_2_0_DATA_BLOCK_HEADER *pDataBlock,
@@ -745,11 +743,10 @@ parseDisplayId20Timing9(
NvU32 descriptorCount = 0;
NvU8 startSeqNumber = 0;
NvU8 i = 0;
descriptorCount = pDataBlock->data_bytes / sizeof(DISPLAYID_2_0_TIMING_9_DESCRIPTOR);
if (descriptorCount < 1 || descriptorCount > DISPLAYID_2_0_TIMING_9_MAX_DESCRIPTORS)
{
nvt_assert(0);
return NVT_STATUS_ERR;
}
@@ -771,7 +768,7 @@ parseDisplayId20Timing9(
break;
}
}
else
else
{
if (pDisplayIdInfo == NULL) return NVT_STATUS_ERR;
}
@@ -780,7 +777,7 @@ parseDisplayId20Timing9(
return status;
}
CODE_SEGMENT(PAGE_DD_CODE)
CODE_SEGMENT(PAGE_DD_CODE)
NVT_STATUS
parseDisplayId20Timing10(
const DISPLAYID_2_0_DATA_BLOCK_HEADER *pDataBlock,
@@ -801,7 +798,6 @@ parseDisplayId20Timing10(
if (pTiming10Block->header.type != DISPLAYID_2_0_BLOCK_TYPE_TIMING_10)
{
nvt_assert(0);
return NVT_STATUS_ERR;
}
@@ -811,7 +807,6 @@ parseDisplayId20Timing10(
if (descriptorCount < 1 || descriptorCount > DISPLAYID_2_0_TIMING_10_MAX_6BYTES_DESCRIPTORS)
{
nvt_assert(0);
return NVT_STATUS_ERR;
}
}
@@ -821,7 +816,6 @@ parseDisplayId20Timing10(
if (descriptorCount < 1 || descriptorCount > DISPLAYID_2_0_TIMING_10_MAX_7BYTES_DESCRIPTORS)
{
nvt_assert(0);
return NVT_STATUS_ERR;
}
}
@@ -836,9 +830,9 @@ parseDisplayId20Timing10(
for (i = 0; i < descriptorCount; i++)
{
NVMISC_MEMSET(&newTiming, 0, sizeof(newTiming));
if (NVT_STATUS_SUCCESS == parseDisplayId20Timing10Descriptor(&pTiming10Block->descriptors[i*eachOfDescriptorsSize],
&newTiming,
pTiming10Block->header.payload_bytes_len,
if (NVT_STATUS_SUCCESS == parseDisplayId20Timing10Descriptor(&pTiming10Block->descriptors[i*eachOfDescriptorsSize],
&newTiming,
pTiming10Block->header.payload_bytes_len,
startSeqNumber+i))
{
p6bytesDescriptor = (const DISPLAYID_2_0_TIMING_10_6BYTES_DESCRIPTOR *)&pTiming10Block->descriptors[i*eachOfDescriptorsSize];
@@ -852,10 +846,10 @@ parseDisplayId20Timing10(
{
NVT_SNPRINTF((char *)newTiming.etc.name, sizeof(newTiming.etc.name), "DID20-Type10:#%3d:%dx%dx%3d.%03dHz/%s",
(int)NVT_GET_TIMING_STATUS_SEQ(newTiming.etc.status),
(int)newTiming.HVisible,
(int)newTiming.HVisible,
(int)newTiming.VVisible,
(int)newTiming.etc.rrx1k/1000,
(int)newTiming.etc.rrx1k%1000,
(int)newTiming.etc.rrx1k/1000,
(int)newTiming.etc.rrx1k%1000,
(newTiming.interlaced ? "I":"P"));
}
else
@@ -863,10 +857,10 @@ parseDisplayId20Timing10(
NVT_SNPRINTF((char *)newTiming.etc.name, sizeof(newTiming.etc.name), "DID20-Type10RB%d:#%3d:%dx%dx%3d.%03dHz/%s",
p6bytesDescriptor->options.timing_formula,
(int)NVT_GET_TIMING_STATUS_SEQ(newTiming.etc.status),
(int)newTiming.HVisible,
(int)newTiming.HVisible,
(int)newTiming.VVisible,
(int)newTiming.etc.rrx1k/1000,
(int)newTiming.etc.rrx1k%1000,
(int)newTiming.etc.rrx1k/1000,
(int)newTiming.etc.rrx1k%1000,
(newTiming.interlaced ? "I":"P"));
}
@@ -907,7 +901,7 @@ parseDisplayId20RangeLimit(
return NVT_STATUS_ERR;
}
pRangeLimitsBlock = (const DISPLAYID_2_0_RANGE_LIMITS_BLOCK *)pDataBlock;
pRangeLimitsBlock = (const DISPLAYID_2_0_RANGE_LIMITS_BLOCK *)pDataBlock;
rangeLimits.revision = pDataBlock->revision;
@@ -923,7 +917,7 @@ parseDisplayId20RangeLimit(
rangeLimits.vfreq_max = pRangeLimitsBlock->dynamic_video_timing_range_support.vertical_frequency_max_9_8 << 8 |
pRangeLimitsBlock->vertical_frequency_max_7_0;
}
else
else
{
rangeLimits.vfreq_max = pRangeLimitsBlock->vertical_frequency_max_7_0;
}
@@ -940,9 +934,9 @@ parseDisplayId20RangeLimit(
}
return status;
}
NVMISC_MEMCPY(&pDisplayIdInfo->range_limits, &rangeLimits, sizeof(NVT_DISPLAYID_RANGE_LIMITS));
return status;
}
@@ -1006,7 +1000,7 @@ parseDisplayId20DisplayInterfaceFeatures(
pInterfaceFeaturesBlock->interface_color_depth_ycbcr420.bit_per_primary_14,
pInterfaceFeaturesBlock->interface_color_depth_ycbcr420.bit_per_primary_16);
// * 74.25MP/s
// * 74.25MP/s
pInterfaceFeatures->yuv420_min_pclk = pInterfaceFeaturesBlock->min_pixel_rate_ycbcr420 *
7425;
@@ -1201,7 +1195,7 @@ parseDisplayId20AdaptiveSync(
NvU8 i = 0;
NvU8 minRR = 0;
NvU16 maxRR = 0;
pAdaptiveSyncBlock = (const DISPLAYID_2_0_ADAPTIVE_SYNC_BLOCK *)pDataBlock;
if (pAdaptiveSyncBlock->header.payload_bytes_adaptive_sync_len == 0)
@@ -1209,7 +1203,6 @@ parseDisplayId20AdaptiveSync(
// Sanity check
if (pDataBlock->data_bytes % sizeof(DISPLAYID_2_0_ADAPTIVE_SYNC_DESCRIPTOR) != 0)
{
nvt_assert(0);
status = NVT_STATUS_ERR;
}
@@ -1226,7 +1219,6 @@ parseDisplayId20AdaptiveSync(
pAdaptiveSyncBlock->descriptors[i].max_refresh_rate.max_rr_7_0) + 1;
if (minRR > (maxRR + 1) || minRR == 0 || maxRR == 0)
{
nvt_assert(0);
status = NVT_STATUS_ERR;
}
}
@@ -1236,7 +1228,7 @@ parseDisplayId20AdaptiveSync(
pDisplayIdInfo->total_adaptive_sync_descriptor = descriptorCnt;
for (i = 0; i < descriptorCnt; i++)
{
{
// Byte 0 Adaptive-Sync Operation and Range Information
pDisplayIdInfo->adaptive_sync_descriptor[i].u.information.adaptive_sync_range = pAdaptiveSyncBlock->descriptors[i].operation_range_info.range;
pDisplayIdInfo->adaptive_sync_descriptor[i].u.information.duration_inc_flicker_perf = pAdaptiveSyncBlock->descriptors[i].operation_range_info.successive_frame_inc_tolerance;
@@ -1247,7 +1239,7 @@ parseDisplayId20AdaptiveSync(
// 6.2 format (six integer bits and two fractional bits) a value range of 0.00 to 63.75ms
pDisplayIdInfo->adaptive_sync_descriptor[i].max_duration_inc = pAdaptiveSyncBlock->descriptors[i].max_single_frame_inc;
pDisplayIdInfo->adaptive_sync_descriptor[i].min_rr = pAdaptiveSyncBlock->descriptors[i].min_refresh_rate;
pDisplayIdInfo->adaptive_sync_descriptor[i].max_rr = (pAdaptiveSyncBlock->descriptors[i].max_refresh_rate.max_rr_9_8 << 8 |
pDisplayIdInfo->adaptive_sync_descriptor[i].max_rr = (pAdaptiveSyncBlock->descriptors[i].max_refresh_rate.max_rr_9_8 << 8 |
pAdaptiveSyncBlock->descriptors[i].max_refresh_rate.max_rr_7_0) + 1;
// 6.2 format (six integer bits and two fractional bits) a value range of 0.00 to 63.75ms
pDisplayIdInfo->adaptive_sync_descriptor[i].max_duration_dec = pAdaptiveSyncBlock->descriptors[i].max_single_frame_dec;
@@ -1322,7 +1314,7 @@ parseDisplayId20BrightnessLuminanceRange(
CODE_SEGMENT(PAGE_DD_CODE)
NVT_STATUS
parseDisplayId20VendorSpecific(
const DISPLAYID_2_0_DATA_BLOCK_HEADER *pDataBlock,
const DISPLAYID_2_0_DATA_BLOCK_HEADER *pDataBlock,
NVT_DISPLAYID_2_0_INFO *pDisplayIdInfo)
{
NVT_STATUS status = NVT_STATUS_SUCCESS;
@@ -1336,10 +1328,10 @@ parseDisplayId20VendorSpecific(
block = (const DISPLAYID_2_0_VENDOR_SPECIFIC_BLOCK*)pDataBlock;
pVendorSpecific = &pDisplayIdInfo->vendor_specific;
ieee_oui = (NvU32)((block->vendor_id[0] << 16) |
(block->vendor_id[1] << 8) |
(block->vendor_id[2]));
ieee_oui = (NvU32)((block->vendor_id[0] << 16) |
(block->vendor_id[1] << 8) |
(block->vendor_id[2]));
switch (ieee_oui)
{
@@ -1347,17 +1339,17 @@ parseDisplayId20VendorSpecific(
// TODO: below parser shall be updated if DID21 changed in the future
if (pDataBlock->data_bytes == NVT_VESA_VENDOR_SPECIFIC_LENGTH)
{
pVendorSpecific->vesaVsdb.data_struct_type.type =
pVendorSpecific->vesaVsdb.data_struct_type.type =
block->vendor_specific_data[3] & NVT_VESA_ORG_VSDB_DATA_TYPE_MASK;
pVendorSpecific->vesaVsdb.data_struct_type.color_space_and_eotf =
pVendorSpecific->vesaVsdb.data_struct_type.color_space_and_eotf =
(block->vendor_specific_data[3] & NVT_VESA_ORG_VSDB_COLOR_SPACE_AND_EOTF_MASK) >> NVT_VESA_ORG_VSDB_COLOR_SPACE_AND_EOTF_SHIFT;
pVendorSpecific->vesaVsdb.overlapping.pixels_overlapping_count =
pVendorSpecific->vesaVsdb.overlapping.pixels_overlapping_count =
block->vendor_specific_data[4] & NVT_VESA_ORG_VSDB_PIXELS_OVERLAPPING_MASK;
pVendorSpecific->vesaVsdb.overlapping.multi_sst =
pVendorSpecific->vesaVsdb.overlapping.multi_sst =
(block->vendor_specific_data[4] & NVT_VESA_ORG_VSDB_MULTI_SST_MODE_MASK) >> NVT_VESA_ORG_VSDB_MULTI_SST_MODE_SHIFT;
pVendorSpecific->vesaVsdb.pass_through_integer.pass_through_integer_dsc =
pVendorSpecific->vesaVsdb.pass_through_integer.pass_through_integer_dsc =
block->vendor_specific_data[5] & NVT_VESA_ORG_VSDB_PASS_THROUGH_INTEGER_MASK;
pVendorSpecific->vesaVsdb.pass_through_fractional.pass_through_fraction_dsc =
pVendorSpecific->vesaVsdb.pass_through_fractional.pass_through_fraction_dsc =
block->vendor_specific_data[6] & NVT_VESA_ORG_VSDB_PASS_THROUGH_FRACTIOINAL_MASK;
}
else
@@ -1380,7 +1372,7 @@ parseDisplayId20CtaData(
NVT_DISPLAYID_2_0_INFO *pDisplayIdInfo)
{
NVT_STATUS status = NVT_STATUS_SUCCESS;
NVT_EDID_CEA861_INFO *p861Info = NULL;
const DISPLAYID_2_0_CTA_BLOCK * ctaBlock = NULL;
NvU8 *pcta_data = NULL;
@@ -1399,12 +1391,12 @@ parseDisplayId20CtaData(
{
status = parseCta861DataBlockInfo(pcta_data, pDataBlock->data_bytes, &pDisplayIdInfo->cta.cta861_info);
}
if (status != NVT_STATUS_SUCCESS)
{
return status;
}
}
p861Info = &(pDisplayIdInfo->cta.cta861_info);
parseCta861VsdbBlocks(p861Info, pDisplayIdInfo, FROM_DISPLAYID_20_DATA_BLOCK);
@@ -1416,7 +1408,10 @@ parseDisplayId20CtaData(
// yuv420-only video
parse861bShortYuv420Timing(p861Info, pDisplayIdInfo, FROM_DISPLAYID_20_DATA_BLOCK);
parseCea861HdrStaticMetadataDataBlock(p861Info, pDisplayIdInfo, FROM_DISPLAYID_20_DATA_BLOCK);
if (pDisplayIdInfo->cta.cta861_info.valid.hdr_static_metadata != 0)
{
parseCta861HdrStaticMetadataDataBlock(p861Info, pDisplayIdInfo, FROM_DISPLAYID_20_DATA_BLOCK);
}
// CEA861-F at 7.5.12 section about VFPDB block.
if (p861Info->total_svr > 0)
@@ -1446,9 +1441,9 @@ greatestCommonDenominator(
}
CODE_SEGMENT(PAGE_DD_CODE)
static NVT_STATUS
static NVT_STATUS
getPrimaryUseCase(
NvU8 product_type,
NvU8 product_type,
NVT_DISPLAYID_PRODUCT_PRIMARY_USE_CASE *primary_use_case)
{
NVT_STATUS status = NVT_STATUS_SUCCESS;
@@ -1517,7 +1512,7 @@ computeDisplayId20SectionCheckSum(
CODE_SEGMENT(PAGE_DD_CODE)
NvBool
assignNextAvailableDisplayId20Timing(
NVT_DISPLAYID_2_0_INFO *pDisplayIdInfo,
NVT_DISPLAYID_2_0_INFO *pDisplayIdInfo,
const NVT_TIMING *pTiming)
{
if (pDisplayIdInfo == NULL) return NV_TRUE;
@@ -1582,7 +1577,7 @@ parseDisplayId20Timing7Descriptor(
NVT_H_SYNC_NEGATIVE;
pTiming->VSyncPol = pDescriptor->vertical.sync_polarity ? NVT_V_SYNC_POSITIVE :
NVT_V_SYNC_NEGATIVE;
// EDID used in DP1.4 Compliance test had incorrect HBlank listed, leading to wrong raster sizes being set by driver (bug 2714607)
// Filter incorrect timings here. HTotal must cover sufficient blanking time
if (pTiming->HTotal < (pTiming->HVisible + pTiming->HFrontPorch + pTiming->HSyncWidth))
@@ -1641,7 +1636,7 @@ parseDisplayId20Timing7Descriptor(
pTiming->etc.rrx1k = NvTiming_CalcRRx1k(pTiming->pclk,
pTiming->interlaced,
pTiming->HTotal,
pTiming->VTotal);
pTiming->VTotal);
pTiming->etc.status = NVT_STATUS_DISPLAYID_7N(++count);
@@ -1669,7 +1664,7 @@ parseDisplayId20Timing8Descriptor(
{
case DISPLAYID_2_0_TIMING_CODE_DMT: //single-byte DMT ID Codes
status = NvTiming_EnumDMT((NvU32)(pTimingCode[idx]), pTiming);
break;
break;
case DISPLAYID_2_0_TIMING_CODE_CTA_VIC:
status = NvTiming_EnumCEA861bTiming((NvU32)(pTimingCode[idx]), pTiming);
break;
@@ -1678,7 +1673,7 @@ parseDisplayId20Timing8Descriptor(
break;
default:
{
nvt_assert(0 && "RESERVED timing code type");
nvt_assert(0 && "RESERVED timing code type");
status = NVT_STATUS_ERR;
}
break;
@@ -1725,7 +1720,7 @@ parseDisplayId20Timing9Descriptor(
{
case DISPLAYID_2_0_TIMING_FORMULA_CVT_1_2_STANDARD:
status = NvTiming_CalcCVT(width, height, rr, NVT_PROGRESSIVE, pTiming);
break;
break;
case DISPLAYID_2_0_TIMING_FORMULA_CVT_1_2_REDUCED_BLANKING_1:
status = NvTiming_CalcCVT_RB(width, height, rr, NVT_PROGRESSIVE, pTiming);
break;
@@ -1734,7 +1729,7 @@ parseDisplayId20Timing9Descriptor(
break;
default:
{
nvt_assert(0 && "Unknown timing formula");
nvt_assert(0 && "Unknown timing formula");
status = NVT_STATUS_ERR;
}
break;
@@ -1749,10 +1744,10 @@ parseDisplayId20Timing9Descriptor(
{
NVT_SNPRINTF((char *)pTiming->etc.name, sizeof(pTiming->etc.name), "DID20-Type9:#%3d:%dx%dx%3d.%03dHz/%s",
(int)NVT_GET_TIMING_STATUS_SEQ(pTiming->etc.status),
(int)pTiming->HVisible,
(int)pTiming->HVisible,
(int)pTiming->VVisible,
(int)pTiming->etc.rrx1k/1000,
(int)pTiming->etc.rrx1k%1000,
(int)pTiming->etc.rrx1k/1000,
(int)pTiming->etc.rrx1k%1000,
(pTiming->interlaced ? "I":"P"));
}
else
@@ -1760,10 +1755,10 @@ parseDisplayId20Timing9Descriptor(
NVT_SNPRINTF((char *)pTiming->etc.name, sizeof(pTiming->etc.name), "DID20-Type9RB%d:#%3d:%dx%dx%3d.%03dHz/%s",
pDescriptor->options.timing_formula,
(int)NVT_GET_TIMING_STATUS_SEQ(pTiming->etc.status),
(int)pTiming->HVisible,
(int)pTiming->HVisible,
(int)pTiming->VVisible,
(int)pTiming->etc.rrx1k/1000,
(int)pTiming->etc.rrx1k%1000,
(int)pTiming->etc.rrx1k/1000,
(int)pTiming->etc.rrx1k%1000,
(pTiming->interlaced ? "I":"P"));
}
}
@@ -1804,7 +1799,7 @@ parseDisplayId20Timing10Descriptor(
{
case DISPLAYID_2_0_TIMING_FORMULA_CVT_1_2_STANDARD:
status = NvTiming_CalcCVT(width, height, rr, NVT_PROGRESSIVE, pTiming);
break;
break;
case DISPLAYID_2_0_TIMING_FORMULA_CVT_1_2_REDUCED_BLANKING_1:
status = NvTiming_CalcCVT_RB(width, height, rr, NVT_PROGRESSIVE, pTiming);
break;
@@ -1839,15 +1834,15 @@ parseDisplayId20Timing10Descriptor(
}
}
break;
default:
default:
{
nvt_assert(0 && "Unknown timing formula");
nvt_assert(0 && "Unknown timing formula");
status = NVT_STATUS_ERR;
}
break;
}
if (status == NVT_STATUS_SUCCESS)
if (status == NVT_STATUS_SUCCESS)
{
pTiming->etc.status = NVT_STATUS_DISPLAYID_10N(++count);
return status;
@@ -1858,9 +1853,9 @@ parseDisplayId20Timing10Descriptor(
// get the existed stored timing sequence number
CODE_SEGMENT(PAGE_DD_CODE)
static NvU8
static NvU8
getExistedTimingSeqNumber(
NVT_DISPLAYID_2_0_INFO *pDisplayIdInfo,
NVT_DISPLAYID_2_0_INFO *pDisplayIdInfo,
enum NVT_TIMING_TYPE timingType)
{
NvU8 count = 0;
@@ -1906,16 +1901,16 @@ NvU32 getDID2Version(NvU8 *pData, NvU32 *pVer)
}
CODE_SEGMENT(PAGE_DD_CODE)
void
void
updateColorFormatForDisplayId20Timings(
NVT_DISPLAYID_2_0_INFO *pDisplayId20Info,
NVT_DISPLAYID_2_0_INFO *pDisplayId20Info,
NvU32 timingIdx)
{
// pDisplayId20Info parsed displayID20 info
// pDisplayId20Info parsed displayID20 info
NVT_TIMING *pT= &pDisplayId20Info->timing[timingIdx];
nvt_assert(timingIdx <= COUNT(pDisplayId20Info->timing));
// rgb444 (always support 6bpc and 8bpc as per DP spec 5.1.1.1.1 RGB Colorimetry)
UPDATE_BPC_FOR_COLORFORMAT(pT->etc.rgb444, 1,
1,
@@ -1925,14 +1920,14 @@ updateColorFormatForDisplayId20Timings(
pDisplayId20Info->interface_features.rgb444.bpc.bpc16);
// yuv444
UPDATE_BPC_FOR_COLORFORMAT(pT->etc.yuv444, 0, // yuv444 does not support 6bpc
UPDATE_BPC_FOR_COLORFORMAT(pT->etc.yuv444, 0, // yuv444 does not support 6bpc
pDisplayId20Info->interface_features.yuv444.bpc.bpc8,
pDisplayId20Info->interface_features.yuv444.bpc.bpc10,
pDisplayId20Info->interface_features.yuv444.bpc.bpc12,
pDisplayId20Info->interface_features.yuv444.bpc.bpc14,
pDisplayId20Info->interface_features.yuv444.bpc.bpc16);
// yuv422
UPDATE_BPC_FOR_COLORFORMAT(pT->etc.yuv422, 0, // yuv422 does not support 6bpc
UPDATE_BPC_FOR_COLORFORMAT(pT->etc.yuv422, 0, // yuv422 does not support 6bpc
pDisplayId20Info->interface_features.yuv422.bpc.bpc8,
pDisplayId20Info->interface_features.yuv422.bpc.bpc10,
pDisplayId20Info->interface_features.yuv422.bpc.bpc12,
@@ -1942,7 +1937,7 @@ updateColorFormatForDisplayId20Timings(
if (!NVT_DID20_TIMING_IS_CTA861(pT->etc.flag, pT->etc.status))
{
// yuv420
UPDATE_BPC_FOR_COLORFORMAT(pT->etc.yuv420, 0, // yuv420 does not support 6bpc
UPDATE_BPC_FOR_COLORFORMAT(pT->etc.yuv420, 0, // yuv420 does not support 6bpc
pDisplayId20Info->interface_features.yuv420.bpc.bpc8,
pDisplayId20Info->interface_features.yuv420.bpc.bpc10,
pDisplayId20Info->interface_features.yuv420.bpc.bpc12,

View File

@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: Copyright (c) 2017-2019 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-FileCopyrightText: Copyright (c) 2017-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: MIT
*
* Permission is hereby granted, free of charge, to any person obtaining a
@@ -2093,13 +2093,21 @@ DSC_GeneratePPSWithSliceCountMask
sliceArrayCount = sizeof(validSliceNum)/sizeof(NvU32);
maxSliceCount = MIN(pDscInfo->sinkCaps.maxNumHztSlices, pDscInfo->gpuCaps.maxNumHztSlices);
// For 2Head1OR mode, slice count supported by GPU is always 8.
maxSliceCount = MIN(pDscInfo->sinkCaps.maxNumHztSlices,
pModesetInfo->bDualMode ? 8U : pDscInfo->gpuCaps.maxNumHztSlices);
// lineBufferSize is reported in 1024 units by HW, so need to multiply by 1024 to get pixels.
maxSliceWidth = MIN(pDscInfo->sinkCaps.maxSliceWidth, pDscInfo->gpuCaps.lineBufferSize * 1024);
gpuSliceCountMask = DSC_GetSliceCountMask(maxSliceCount, NV_TRUE /*bInclusive*/);
if (pModesetInfo->bDualMode)
{
// For DSC_DUAL, slice counts 1 and 6 are invalid.
gpuSliceCountMask &= ~(0x11);
}
commonSliceCountMask = gpuSliceCountMask & pDscInfo->sinkCaps.sliceCountSupportedMask;
if (commonSliceCountMask == 0x0)
@@ -2107,8 +2115,12 @@ DSC_GeneratePPSWithSliceCountMask
return NVT_STATUS_DSC_SLICE_ERROR;
}
if (pModesetInfo->colorFormat == NVT_COLOR_FORMAT_YCbCr422 ||
pModesetInfo->colorFormat == NVT_COLOR_FORMAT_YCbCr420)
if ((pModesetInfo->colorFormat == NVT_COLOR_FORMAT_YCbCr422 &&
((pDscInfo->gpuCaps.encoderColorFormatMask & DSC_ENCODER_COLOR_FORMAT_Y_CB_CR_NATIVE_422) &&
(pDscInfo->sinkCaps.decoderColorFormatMask & DSC_DECODER_COLOR_FORMAT_Y_CB_CR_NATIVE_422))) ||
(pModesetInfo->colorFormat == NVT_COLOR_FORMAT_YCbCr420 &&
((pDscInfo->gpuCaps.encoderColorFormatMask & DSC_ENCODER_COLOR_FORMAT_Y_CB_CR_NATIVE_420) &&
(pDscInfo->sinkCaps.decoderColorFormatMask & DSC_DECODER_COLOR_FORMAT_Y_CB_CR_NATIVE_420))))
{
peakThroughPutIndex = pDscInfo->sinkCaps.peakThroughputMode1;
}
@@ -2149,7 +2161,7 @@ DSC_GeneratePPSWithSliceCountMask
for(i = 0U ; i < sliceArrayCount; i++)
{
if (possibleSliceCountMask & NVBIT(validSliceNum[i] - 1))
if (possibleSliceCountMask & DSC_SliceCountMaskforSliceNum(validSliceNum[i]))
{
ppsOut = NULL;
localDscInfo.forcedDscParams.sliceCount = validSliceNum[i];
@@ -2162,11 +2174,23 @@ DSC_GeneratePPSWithSliceCountMask
//
ppsOut = pps;
}
if (DSC_GeneratePPS(&localDscInfo, pModesetInfo, pWARData,
availableBandwidthBitsPerSecond, &scratchBuffer,
ppsOut, pBitsPerPixelX16) == NVT_STATUS_SUCCESS)
status = DSC_GeneratePPS(&localDscInfo, pModesetInfo, pWARData,
availableBandwidthBitsPerSecond, &scratchBuffer,
ppsOut, pBitsPerPixelX16);
if (status == NVT_STATUS_SUCCESS)
{
validSliceCountMask |= NVBIT(validSliceNum[i] - 1);
//
// DPlib and PPSlib follows DP spec to set slice count indices
// in slice count mask. This mapping of index to slice count
// is not 1:1. For eg. slice count 8 corresponds to bit
// index 5 as per spec. PPSLib clients are spec agnostic
// and prefer indices to indicate corresponding slice count.
// For eg. slice count = 8 should be set at bit index 7.
// So while passing the mask back to clients, here we set
// corresponding bit index.
//
validSliceCountMask |= NVBIT32((validSliceNum[i]) - 1U);
}
}
}
@@ -2176,6 +2200,12 @@ DSC_GeneratePPSWithSliceCountMask
return NVT_STATUS_PPS_SLICE_COUNT_ERROR;
}
if (validSliceCountMask == 0U)
{
// Reason for failure with hightest possible slice count will be returned.
return status;
}
*pSliceCountMask = validSliceCountMask;
return NVT_STATUS_SUCCESS;
@@ -2270,8 +2300,8 @@ DSC_GeneratePPS
case NVT_COLOR_FORMAT_YCbCr420:
in->convert_rgb = 0;
if ((pDscInfo->gpuCaps.encoderColorFormatMask & DSC_ENCODER_COLOR_FORMAT_Y_CB_CR_NATIVE_422) &&
(pDscInfo->sinkCaps.decoderColorFormatMask & DSC_DECODER_COLOR_FORMAT_Y_CB_CR_NATIVE_422))
if ((pDscInfo->gpuCaps.encoderColorFormatMask & DSC_ENCODER_COLOR_FORMAT_Y_CB_CR_NATIVE_420) &&
(pDscInfo->sinkCaps.decoderColorFormatMask & DSC_DECODER_COLOR_FORMAT_Y_CB_CR_NATIVE_420))
{
in->native_420 = 1;
}
@@ -2477,6 +2507,9 @@ DSC_GeneratePPS
if (in->native_422)
{
// bits_per_pixel in PPS is defined as 5 fractional bits in native422 mode
in->bits_per_pixel *= 2;
if (in->dsc_version_minor == 1)
{
// Error! DSC1.1 can't support native422!
@@ -2484,8 +2517,8 @@ DSC_GeneratePPS
goto done;
}
//the bpp in native 422 mode is doubled.
if((((NvS32)(in->bits_per_pixel)) < (NvS32)(2*6*BPP_UNIT)) ||
(((NvS32)(in->bits_per_pixel)) > (NvS32)(2*32*BPP_UNIT-1)))
if((((NvS32)(in->bits_per_pixel)) < (NvS32)(2*7*BPP_UNIT)) ||
(((NvS32)(in->bits_per_pixel)) > (NvS32)(2*2*(in->bits_per_component)*BPP_UNIT-1)))
{
// ERROR - bits_per_pixelx16 outside valid range
ret = NVT_STATUS_INVALID_BPP;

View File

@@ -1056,7 +1056,10 @@ NVT_STATUS NV_STDCALL NvTiming_ParseEDIDInfo(NvU8 *pEdid, NvU32 length, NVT_EDID
parseCta861VsvdbBlocks(p861Info, pInfo, FROM_CTA861_EXTENSION);
// parse HDR related information from the HDR static metadata data block
parseCea861HdrStaticMetadataDataBlock(p861Info, pInfo, FROM_CTA861_EXTENSION);
if (p861Info->valid.hdr_static_metadata != 0)
{
parseCta861HdrStaticMetadataDataBlock(p861Info, pInfo, FROM_CTA861_EXTENSION);
}
// Timings are listed (or shall) be listed in priority order
// So read SVD, yuv420 SVDs first before reading detailed timings

File diff suppressed because it is too large Load Diff

View File

@@ -377,8 +377,6 @@ static NVT_STATUS parseDisplayIdColorChar(NvU8 * block, NVT_DISPLAYID_INFO *pInf
if ((prim_num + wp_num) * sizeof(DISPLAYID_COLOR_POINT) + 1 != blk->header.data_bytes)
{
// Assert since this error is ignored
nvt_assert(0);
return NVT_STATUS_ERR;
}
@@ -416,8 +414,6 @@ static NVT_STATUS parseDisplayIdProdIdentityBlock(NvU8 * block, NVT_DISPLAYID_IN
DISPLAYID_PROD_IDENTIFICATION_BLOCK * blk = (DISPLAYID_PROD_IDENTIFICATION_BLOCK *)block;
if (blk->header.data_bytes - blk->productid_string_size != NVT_DISPLAYID_PRODUCT_IDENTITY_MIN_LEN)
{
// Assert since this error is ignored
nvt_assert(0);
return NVT_STATUS_ERR;
}
@@ -442,8 +438,6 @@ static NVT_STATUS parseDisplayIdParam(NvU8 * block, NVT_DISPLAYID_INFO *pInfo)
DISPLAYID_DISPLAY_PARAM_BLOCK * blk = (DISPLAYID_DISPLAY_PARAM_BLOCK *)block;
if (blk->header.data_bytes != NVT_DISPLAYID_DISPLAY_PARAM_BLOCK_LEN)
{
// Assert since this error is ignored
nvt_assert(0);
return NVT_STATUS_ERR;
}
@@ -479,8 +473,6 @@ static NVT_STATUS parseDisplayIdTiming1(NvU8 * block, NVT_EDID_INFO *pEdidInfo)
DISPLAYID_TIMING_1_BLOCK * blk = (DISPLAYID_TIMING_1_BLOCK *)block;
if (blk->header.data_bytes % sizeof(DISPLAYID_TIMING_1_DESCRIPTOR) != 0)
{
// Assert since this error is ignored
nvt_assert(0);
return NVT_STATUS_ERR;
}
@@ -607,8 +599,6 @@ static NVT_STATUS parseDisplayIdTiming2(NvU8 * block, NVT_EDID_INFO *pEdidInfo)
if (blk->header.data_bytes % sizeof(DISPLAYID_TIMING_2_DESCRIPTOR) != 0)
{
// Assert since this error is ignored
nvt_assert(0);
return NVT_STATUS_ERR;
}
@@ -766,8 +756,6 @@ static NVT_STATUS parseDisplayIdTiming3(NvU8 * block, NVT_EDID_INFO *pEdidInfo)
if (blk->header.data_bytes % sizeof(DISPLAYID_TIMING_3_DESCRIPTOR) != 0)
{
// Assert since this error is ignored
nvt_assert(0);
return NVT_STATUS_ERR;
}
@@ -801,8 +789,6 @@ static NVT_STATUS parseDisplayIdTiming4(NvU8 * block, NVT_EDID_INFO *pEdidInfo)
DISPLAYID_TIMING_4_BLOCK * blk = (DISPLAYID_TIMING_4_BLOCK *)block;
if (blk->header.data_bytes < 1 || blk->header.data_bytes > NVT_DISPLAYID_DATABLOCK_MAX_PAYLOAD_LEN)
{
// Assert since this error is ignored
nvt_assert(0);
return NVT_STATUS_ERR;
}
@@ -857,8 +843,6 @@ static NVT_STATUS parseDisplayIdTiming5(NvU8 * block, NVT_EDID_INFO *pEdidInfo)
DISPLAYID_TIMING_5_BLOCK * blk = (DISPLAYID_TIMING_5_BLOCK *)block;
if (blk->header.data_bytes < 1 || blk->header.data_bytes > NVT_DISPLAYID_DATABLOCK_MAX_PAYLOAD_LEN)
{
// Assert since this error is ignored
nvt_assert(0);
return NVT_STATUS_ERR;
}
for (i = 0; i * sizeof(DISPLAYID_TIMING_5_DESCRIPTOR) < blk->header.data_bytes; i++)
@@ -890,8 +874,6 @@ static NVT_STATUS parseDisplayIdTimingVesa(NvU8 * block, NVT_EDID_INFO *pEdidInf
DISPLAYID_TIMING_MODE_BLOCK * blk = (DISPLAYID_TIMING_MODE_BLOCK *)block;
if (blk->header.data_bytes != DISPLAYID_TIMING_VESA_BLOCK_SIZE)
{
// Assert since this error is ignored
nvt_assert(0);
return NVT_STATUS_ERR;
}
@@ -931,8 +913,6 @@ static NVT_STATUS parseDisplayIdTimingEIA(NvU8 * block, NVT_EDID_INFO *pEdidInfo
DISPLAYID_TIMING_MODE_BLOCK * blk = (DISPLAYID_TIMING_MODE_BLOCK *)block;
if (blk->header.data_bytes != DISPLAYID_TIMING_CEA_BLOCK_SIZE)
{
// Assert since this error is ignored
nvt_assert(0);
return NVT_STATUS_ERR;
}
@@ -975,8 +955,6 @@ static NVT_STATUS parseDisplayIdRangeLimits(NvU8 * block, NVT_DISPLAYID_INFO *pI
if (blk->header.data_bytes != DISPLAYID_RANGE_LIMITS_BLOCK_LEN)
{
// Assert since this error is ignored
nvt_assert(0);
return NVT_STATUS_ERR;
}
@@ -987,7 +965,7 @@ static NVT_STATUS parseDisplayIdRangeLimits(NvU8 * block, NVT_DISPLAYID_INFO *pI
blk->vertical_refresh_rate_min > blk->vertical_refresh_rate_max ||
minPclk > maxPclk)
{
nvt_assert(0 && "wrong range limit");
// wrong range limit
status = NVT_STATUS_ERR;
}
@@ -995,8 +973,6 @@ static NVT_STATUS parseDisplayIdRangeLimits(NvU8 * block, NVT_DISPLAYID_INFO *pI
if (pInfo->rl_num >= NVT_DISPLAYID_RANGE_LIMITS_MAX_COUNT)
{
// Assert since this error is ignored
nvt_assert(0);
return NVT_STATUS_ERR;
}
@@ -1027,8 +1003,6 @@ static NVT_STATUS parseDisplayIdSerialNumber(NvU8 * block, NVT_DISPLAYID_INFO *p
DISPLAYID_ASCII_STRING_BLOCK * blk = (DISPLAYID_ASCII_STRING_BLOCK *)block;
if (blk->header.data_bytes > NVT_DISPLAYID_DATABLOCK_MAX_PAYLOAD_LEN)
{
// Assert since this error is ignored
nvt_assert(0);
return NVT_STATUS_ERR;
}
@@ -1046,8 +1020,6 @@ static NVT_STATUS parseDisplayIdAsciiString(NvU8 * block, NVT_DISPLAYID_INFO *pI
DISPLAYID_ASCII_STRING_BLOCK * blk = (DISPLAYID_ASCII_STRING_BLOCK *)block;
if (blk->header.data_bytes > NVT_DISPLAYID_DATABLOCK_MAX_PAYLOAD_LEN)
{
// Assert since this error is ignored
nvt_assert(0);
return NVT_STATUS_ERR;
}
@@ -1065,8 +1037,6 @@ static NVT_STATUS parseDisplayIdDeviceData(NvU8 * block, NVT_DISPLAYID_INFO *pIn
DISPLAYID_DEVICE_DATA_BLOCK * blk = (DISPLAYID_DEVICE_DATA_BLOCK *)block;
if (blk->header.data_bytes != DISPLAYID_DEVICE_DATA_BLOCK_LEN)
{
// Assert since this error is ignored
nvt_assert(0);
return NVT_STATUS_ERR;
}
@@ -1103,8 +1073,6 @@ static NVT_STATUS parseDisplayIdInterfacePower(NvU8 * block, NVT_DISPLAYID_INFO
DISPLAYID_INTERFACE_POWER_BLOCK * blk = (DISPLAYID_INTERFACE_POWER_BLOCK *)block;
if (blk->header.data_bytes != DISPLAYID_INTERFACE_POWER_BLOCK_LEN)
{
// Assert since this error is ignored
nvt_assert(0);
return NVT_STATUS_ERR;
}
@@ -1141,8 +1109,6 @@ static NVT_STATUS parseDisplayIdDisplayInterface(NvU8 * block, NVT_DISPLAYID_INF
DISPLAYID_INTERFACE_DATA_BLOCK * blk = (DISPLAYID_INTERFACE_DATA_BLOCK *)block;
if (blk->header.data_bytes != DISPLAYID_INTERFACE_DATA_BLOCK_LEN)
{
// Assert since this error is ignored
nvt_assert(0);
return NVT_STATUS_ERR;
}
@@ -1177,7 +1143,7 @@ static NVT_STATUS parseDisplayIdDisplayInterface(NvU8 * block, NVT_DISPLAYID_INF
// Content Protection
pInfo->u4.display_interface.content_protection = DRF_VAL(T_DISPLAYID, _INTERFACE, _CONTENT, blk->content_protection);
pInfo->u4.display_interface.content_protection_version = blk->content_protection_version;
// Spread
pInfo->u4.display_interface.spread_spectrum = DRF_VAL(T_DISPLAYID, _INTERFACE, _SPREAD_TYPE, blk->spread);
pInfo->u4.display_interface.spread_percent = DRF_VAL(T_DISPLAYID, _INTERFACE, _SPREAD_PER, blk->spread);
@@ -1214,8 +1180,6 @@ static NVT_STATUS parseDisplayIdStereo(NvU8 * block, NVT_DISPLAYID_INFO *pInfo)
DISPLAYID_STEREO_INTERFACE_METHOD_BLOCK * blk = (DISPLAYID_STEREO_INTERFACE_METHOD_BLOCK *)block;
if (blk->header.data_bytes > NVT_DISPLAYID_DATABLOCK_MAX_PAYLOAD_LEN)
{
// Assert since this error is ignored
nvt_assert(0);
return NVT_STATUS_ERR;
}
@@ -1246,8 +1210,6 @@ static NVT_STATUS parseDisplayIdStereo(NvU8 * block, NVT_DISPLAYID_INFO *pInfo)
case NVT_DISPLAYID_STEREO_PROPRIETARY:
break;
default:
// Assert since this error is ignored
nvt_assert(0);
return NVT_STATUS_ERR;
}
@@ -1260,8 +1222,6 @@ static NVT_STATUS parseDisplayIdTiledDisplay(NvU8 * block, NVT_DISPLAYID_INFO *p
DISPLAYID_TILED_DISPLAY_BLOCK * blk = (DISPLAYID_TILED_DISPLAY_BLOCK *)block;
if (blk->header.data_bytes > NVT_DISPLAYID_DATABLOCK_MAX_PAYLOAD_LEN)
{
// Assert since this error is ignored
nvt_assert(0);
return NVT_STATUS_ERR;
}
@@ -1314,8 +1274,6 @@ static NVT_STATUS parseDisplayIdCtaData(NvU8 * block, NVT_EDID_INFO *pInfo)
NVT_EDID_CEA861_INFO *p861info;
if (blk->data_bytes > NVT_DISPLAYID_DATABLOCK_MAX_PAYLOAD_LEN)
{
// Assert since this error is ignored
nvt_assert(0);
return NVT_STATUS_ERR;
}
@@ -1337,7 +1295,10 @@ static NVT_STATUS parseDisplayIdCtaData(NvU8 * block, NVT_EDID_INFO *pInfo)
parseCta861HfScdb(p861info, pInfo, FROM_DISPLAYID_13_DATA_BLOCK);
//parse HDR related information from the HDR static metadata data block
parseCea861HdrStaticMetadataDataBlock(p861info, pInfo, FROM_DISPLAYID_13_DATA_BLOCK);
if (p861info->valid.hdr_static_metadata != 0)
{
parseCta861HdrStaticMetadataDataBlock(p861info, pInfo, FROM_DISPLAYID_13_DATA_BLOCK);
}
// base video
parse861bShortTiming(p861info, pInfo, FROM_DISPLAYID_13_DATA_BLOCK);
@@ -1359,8 +1320,7 @@ static NVT_STATUS parseDisplayIdDisplayInterfaceFeatures(NvU8 * block, NVT_DISPL
DISPLAYID_INTERFACE_FEATURES_DATA_BLOCK * blk = (DISPLAYID_INTERFACE_FEATURES_DATA_BLOCK *)block;
if (blk->header.data_bytes > DISPLAYID_INTERFACE_FEATURES_DATA_BLOCK_MAX_LEN)
{
// Assert since this error is ignored
nvt_assert(0);
return NVT_STATUS_ERR;
}

View File

@@ -44,9 +44,9 @@ PUSH_SEGMENTS
* the timings
*/
CODE_SEGMENT(PAGE_DD_CODE)
NVT_STATUS
NVT_STATUS
getDisplayId20EDIDExtInfo(
NvU8 *p,
NvU8 *p,
NvU32 size,
NVT_EDID_INFO *pEdidInfo)
{
@@ -62,10 +62,12 @@ getDisplayId20EDIDExtInfo(
}
// Calculate the All DisplayID20 Extension checksum
// The function name
// The function name
if (computeDisplayId20SectionCheckSum(p, sizeof(EDIDV1STRUC)) != 0)
{
nvt_assert(0 && "displayid2ext invalid checksum");
#ifdef DD_UNITTEST
return NVT_STATUS_ERR;
#endif
}
extSection = (DISPLAYID_2_0_SECTION *)(p + 1);
@@ -77,7 +79,7 @@ getDisplayId20EDIDExtInfo(
* @brief DisplayId20 as EDID extension block's "Section" entry point functions
*/
CODE_SEGMENT(PAGE_DD_CODE)
NVT_STATUS
NVT_STATUS
parseDisplayId20EDIDExtSection(
DISPLAYID_2_0_SECTION * extSection,
NVT_EDID_INFO *pEdidInfo)
@@ -92,8 +94,8 @@ parseDisplayId20EDIDExtSection(
return NVT_STATUS_ERR;
}
// It is based on the DisplayID v2.0 Errata E7
// First DisplayID2.0 section as EDID extension shall populate "Display Product Primary Use Case" byte with a value from 1h-8h based on the intended primary use case of the sink.
// It is based on the DisplayID v2.0 Errata E7
// First DisplayID2.0 section as EDID extension shall populate "Display Product Primary Use Case" byte with a value from 1h-8h based on the intended primary use case of the sink.
// Any subsequent DisplayID2.0 section EDID extension shall set the "Display Product Primary Use Case" byte to 0h.
pEdidInfo->total_did2_extensions++;
@@ -104,7 +106,9 @@ parseDisplayId20EDIDExtSection(
extSection->header.extension_count != DISPLAYID_2_0_PROD_EXTENSION)) ||
(pEdidInfo->total_did2_extensions > 1 && extSection->header.product_type != DISPLAYID_2_0_PROD_EXTENSION))
{
nvt_assert(0); // product_type value set incorrect in Display Product Primary Use Case field
#ifdef DD_UNITTEST
return NVT_STATUS_ERR;
#endif
}
pEdidInfo->ext_displayid20.version = extSection->header.version;
@@ -202,7 +206,7 @@ parseDisplayId20EDIDExtDataBlocks(
status = parseDisplayId20DataBlock(block_header, pDisplayId20Info);
if (pDisplayId20Info == NULL) return status;
// TODO : All the data blocks shall sync the data from the datablock in DisplayID2_0 to pEdidInfo
if (status == NVT_STATUS_SUCCESS && pDisplayId20Info->as_edid_extension == NV_TRUE)
{
@@ -214,7 +218,7 @@ parseDisplayId20EDIDExtDataBlocks(
case DISPLAYID_2_0_BLOCK_TYPE_INTERFACE_FEATURES:
pDisplayId20Info->valid_data_blocks.interface_feature_present = NV_TRUE;
// Supported - Color depth is supported for all supported timings. Supported timing includes all Display-ID exposed timings
// Supported - Color depth is supported for all supported timings. Supported timing includes all Display-ID exposed timings
// (that is timing exposed using DisplayID timing types and CTA VICs)
if (IS_BPC_SUPPORTED_COLORFORMAT(pDisplayId20Info->interface_features.yuv444.bpcs))
{
@@ -226,8 +230,8 @@ parseDisplayId20EDIDExtDataBlocks(
pDisplayId20Info->basic_caps |= NVT_DISPLAY_2_0_CAP_YCbCr_422;
}
if (pDisplayId20Info->interface_features.audio_capability.support_48khz ||
pDisplayId20Info->interface_features.audio_capability.support_44_1khz ||
if (pDisplayId20Info->interface_features.audio_capability.support_48khz ||
pDisplayId20Info->interface_features.audio_capability.support_44_1khz ||
pDisplayId20Info->interface_features.audio_capability.support_32khz)
{
pDisplayId20Info->basic_caps |= NVT_DISPLAY_2_0_CAP_BASIC_AUDIO;
@@ -244,7 +248,7 @@ parseDisplayId20EDIDExtDataBlocks(
pEdidInfo->ext861.hdr_static_metadata.byte1 |= NVT_CEA861_EOTF_SMPTE_ST2084;
pEdidInfo->ext861.colorimetry.byte1 |= NVT_CEA861_COLORIMETRY_BT2020RGB;
if (IS_BPC_SUPPORTED_COLORFORMAT(pDisplayId20Info->interface_features.yuv444.bpcs) ||
if (IS_BPC_SUPPORTED_COLORFORMAT(pDisplayId20Info->interface_features.yuv444.bpcs) ||
IS_BPC_SUPPORTED_COLORFORMAT(pDisplayId20Info->interface_features.yuv422.bpcs))
{
pEdidInfo->ext861.colorimetry.byte1 |= NVT_CEA861_COLORIMETRY_BT2020YCC;
@@ -253,8 +257,8 @@ parseDisplayId20EDIDExtDataBlocks(
}
break;
// DisplayID_v2.0 E5 defined
// if inside CTA embedded block existed 420 VDB/CMDB, then we follow these two blocks only.
// DisplayID_v2.0 E5 defined
// if inside CTA embedded block existed 420 VDB/CMDB, then we follow these two blocks only.
// * support for 420 pixel encoding is limited to the timings exposed in the restricted set exposed in the CTA data block.
// * field of "Mini Pixel Rate at YCbCr420" shall be set 00h
case DISPLAYID_2_0_BLOCK_TYPE_CTA_DATA:
@@ -285,11 +289,23 @@ parseDisplayId20EDIDExtDataBlocks(
pDisplayId20Info->basic_caps = pEdidInfo->ext861.basic_caps;
}
// this is the DisplayID20 Extension, so we need to copy the data from the CTA in DID20 to CTA section
// this is the DisplayID20 Extension, just copy needed data block value here:
if (pEdidInfo->ext861.revision == 0)
NVMISC_MEMCPY(&pEdidInfo->ext861, &pDisplayId20Info->cta.cta861_info, sizeof(NVT_EDID_CEA861_INFO));
{
if (pDisplayId20Info->cta.cta861_info.valid.colorimetry)
{
pEdidInfo->ext861.colorimetry.byte1 = pDisplayId20Info->cta.cta861_info.colorimetry.byte1;
pEdidInfo->ext861.colorimetry.byte2 = pDisplayId20Info->cta.cta861_info.colorimetry.byte2;
}
}
else if (pEdidInfo->ext861_2.revision == 0)
NVMISC_MEMCPY(&pEdidInfo->ext861_2, &pDisplayId20Info->cta.cta861_info, sizeof(NVT_EDID_CEA861_INFO));
{
if (pDisplayId20Info->cta.cta861_info.valid.colorimetry)
{
pEdidInfo->ext861_2.colorimetry.byte1 = pDisplayId20Info->cta.cta861_info.colorimetry.byte1;
pEdidInfo->ext861_2.colorimetry.byte2 = pDisplayId20Info->cta.cta861_info.colorimetry.byte2;
}
}
break;
case DISPLAYID_2_0_BLOCK_TYPE_DISPLAY_PARAM:
@@ -335,11 +351,11 @@ parseDisplayId20EDIDExtDataBlocks(
pDisplayId20Info->valid_data_blocks.dynamic_range_limit_present = NV_TRUE;
break;
case DISPLAYID_2_0_BLOCK_TYPE_ADAPTIVE_SYNC:
pDisplayId20Info->valid_data_blocks.adaptive_sync_present = NV_TRUE;
pDisplayId20Info->valid_data_blocks.adaptive_sync_present = NV_TRUE;
break;
case DISPLAYID_2_0_BLOCK_TYPE_BRIGHTNESS_LUMINANCE_RANGE:
pDisplayId20Info->valid_data_blocks.brightness_luminance_range_present = NV_TRUE;
break;
break;
case DISPLAYID_2_0_BLOCK_TYPE_VENDOR_SPEC:
pDisplayId20Info->valid_data_blocks.vendor_specific_present = NV_TRUE;
break;
@@ -354,21 +370,21 @@ parseDisplayId20EDIDExtDataBlocks(
/* @brief Update the correct color format / attribute of timings from interface feature data block
*/
CODE_SEGMENT(PAGE_DD_CODE)
void
void
updateColorFormatForDisplayId20ExtnTimings(
NVT_EDID_INFO *pInfo,
NVT_EDID_INFO *pInfo,
NvU32 timingIdx)
{
{
// pDisplayId20Info parsed displayID20 info
NVT_DISPLAYID_2_0_INFO *pDisplayId20Info = &pInfo->ext_displayid20;
NVT_TIMING *pT= &pInfo->timing[timingIdx];
nvt_assert(timingIdx <= COUNT(pInfo->timing));
if (pDisplayId20Info->as_edid_extension)
{
if ((pInfo->input.u.digital.video_interface == NVT_EDID_DIGITAL_VIDEO_INTERFACE_STANDARD_HDMI_A_SUPPORTED ||
pInfo->input.u.digital.video_interface == NVT_EDID_DIGITAL_VIDEO_INTERFACE_STANDARD_HDMI_B_SUPPORTED ||
pInfo->input.u.digital.video_interface == NVT_EDID_DIGITAL_VIDEO_INTERFACE_STANDARD_HDMI_B_SUPPORTED ||
pInfo->ext861.valid.H14B_VSDB || pInfo->ext861.valid.H20_HF_VSDB) && pInfo->ext861.revision >= NVT_CEA861_REV_A)
{
UPDATE_BPC_FOR_COLORFORMAT(pT->etc.rgb444, 0,

View File

@@ -128,6 +128,7 @@ NVT_STATUS NvTiming_CalcOVT(NvU32 width, NvU32 height, NvU32 refreshRate, NVT_TI
// ** Preparation **
// 1. Determine maximum Vrate of frame rate group (see Table 13) and V-Total granularity:
// Currently client doesn't have customize refresh rate value as it only from VFDB
switch (refreshRate)
{
case 24: case 25: case 30:
@@ -161,7 +162,7 @@ NVT_STATUS NvTiming_CalcOVT(NvU32 width, NvU32 height, NvU32 refreshRate, NVT_TI
default:
vTotalGranularity = 1;
maxVRate = refreshRate;
nvt_assert (0 && "invalid input refresh rate!");
break;
}
// 2. Minimum Vtotal is found from highest frame rate of Vrate group, Vactive and the minimum Vblank time of 460 μSec:

View File

@@ -4183,7 +4183,7 @@ typedef struct tagNVT_HDMI_LLC_DATA
typedef struct tagNVT_NVDA_VSDB_PAYLOAD
{
NvU8 opcode; // Nvidia specific opcode - please refer to VRR monitor spec v5
NvU8 opcode; // Nvidia specific opcode - please refer to VRR monitor spec v17
NvU8 vrrMinRefreshRate; // Minimum refresh rate supported by this monitor
} NVT_NVDA_VSDB_PAYLOAD;

View File

@@ -23,7 +23,7 @@
//
// File: nvtiming_pvt.h
//
// Purpose: the private functions/structures which are only used inside
// Purpose: the private functions/structures which are only used inside
// the nv timing library.
//
//*****************************************************************************
@@ -44,6 +44,11 @@
#define nvt_assert(p) ((void)0)
#ifdef DD_UNITTEST
#undef nvt_assert(p)
#define nvt_assert(p) ((void)0)
#endif // DD_UNITTEST
#include <stddef.h> // NULL
#ifdef __cplusplus
@@ -84,7 +89,7 @@ void parseEdidHdmiForumVSDB(VSDB_DATA *pVsdb, NVT_HDMI_FORUM_INFO *pHdmiIn
void getEdidHDM1_4bVsdbTiming(NVT_EDID_INFO *pInfo);
void parseEdidHDMILLCTiming(NVT_EDID_INFO *pInfo, VSDB_DATA *pVsdb, NvU32 *pSupported, HDMI3DSUPPORTMAP * pM);
void parseEdidNvidiaVSDBBlock(VSDB_DATA *pVsdb, NVDA_VSDB_PARSED_INFO *vsdbInfo);
void parseCea861HdrStaticMetadataDataBlock(NVT_EDID_CEA861_INFO *pExt861, void *pRawInfo, NVT_CTA861_ORIGIN flag);
void parseCta861HdrStaticMetadataDataBlock(NVT_EDID_CEA861_INFO *pExt861, void *pRawInfo, NVT_CTA861_ORIGIN flag);
void parseCta861DvStaticMetadataDataBlock(VSVDB_DATA* pVsvdb, NVT_DV_STATIC_METADATA* pDvInfo);
void parseCta861Hdr10PlusDataBlock(VSVDB_DATA* pVsvdb, NVT_HDR10PLUS_INFO* pHdr10PlusInfo);
void parseCta861DIDType7VideoTimingDataBlock(NVT_EDID_CEA861_INFO *pExt861, void *pRawInfo);