mirror of
https://github.com/NVIDIA/open-gpu-kernel-modules.git
synced 2026-04-25 08:49:13 +00:00
565.57.01
This commit is contained in:
@@ -124,6 +124,8 @@ struct NvKmsKapiDevice {
|
||||
NvU64 supportedSurfaceMemoryFormats[NVKMS_KAPI_LAYER_MAX];
|
||||
NvBool supportsICtCp[NVKMS_KAPI_LAYER_MAX];
|
||||
|
||||
struct NvKmsKapiLutCaps lutCaps;
|
||||
|
||||
NvU32 numHeads;
|
||||
NvU32 numLayers[NVKMS_KAPI_MAX_HEADS];
|
||||
|
||||
|
||||
@@ -124,6 +124,14 @@ struct NvKmsKapiDisplayMode {
|
||||
#define NVKMS_KAPI_LAYER_INVALID_IDX 0xff
|
||||
#define NVKMS_KAPI_LAYER_PRIMARY_IDX 0
|
||||
|
||||
struct NvKmsKapiLutCaps {
|
||||
struct {
|
||||
struct NvKmsLUTCaps ilut;
|
||||
struct NvKmsLUTCaps tmo;
|
||||
} layer[NVKMS_KAPI_LAYER_MAX];
|
||||
struct NvKmsLUTCaps olut;
|
||||
};
|
||||
|
||||
struct NvKmsKapiDeviceResourcesInfo {
|
||||
|
||||
NvU32 numHeads;
|
||||
@@ -169,6 +177,8 @@ struct NvKmsKapiDeviceResourcesInfo {
|
||||
|
||||
NvU64 supportedSurfaceMemoryFormats[NVKMS_KAPI_LAYER_MAX];
|
||||
NvBool supportsICtCp[NVKMS_KAPI_LAYER_MAX];
|
||||
|
||||
struct NvKmsKapiLutCaps lutCaps;
|
||||
};
|
||||
|
||||
#define NVKMS_KAPI_LAYER_MASK(layerType) (1 << (layerType))
|
||||
@@ -262,21 +272,54 @@ struct NvKmsKapiLayerConfig {
|
||||
NvU16 dstWidth, dstHeight;
|
||||
|
||||
enum NvKmsInputColorSpace inputColorSpace;
|
||||
|
||||
struct {
|
||||
NvBool enabled;
|
||||
struct NvKmsKapiSurface *lutSurface;
|
||||
NvU64 offset;
|
||||
NvU32 vssSegments;
|
||||
NvU32 lutEntries;
|
||||
} ilut;
|
||||
|
||||
struct {
|
||||
NvBool enabled;
|
||||
struct NvKmsKapiSurface *lutSurface;
|
||||
NvU64 offset;
|
||||
NvU32 vssSegments;
|
||||
NvU32 lutEntries;
|
||||
} tmo;
|
||||
|
||||
struct NvKmsCscMatrix csc;
|
||||
NvBool cscUseMain;
|
||||
|
||||
struct {
|
||||
struct NvKmsCscMatrix lmsCtm;
|
||||
struct NvKmsCscMatrix lmsToItpCtm;
|
||||
struct NvKmsCscMatrix itpToLmsCtm;
|
||||
struct NvKmsCscMatrix blendCtm;
|
||||
struct {
|
||||
NvBool lmsCtm : 1;
|
||||
NvBool lmsToItpCtm : 1;
|
||||
NvBool itpToLmsCtm : 1;
|
||||
NvBool blendCtm : 1;
|
||||
} enabled;
|
||||
} matrixOverrides;
|
||||
};
|
||||
|
||||
struct NvKmsKapiLayerRequestedConfig {
|
||||
struct NvKmsKapiLayerConfig config;
|
||||
struct {
|
||||
NvBool surfaceChanged : 1;
|
||||
NvBool srcXYChanged : 1;
|
||||
NvBool srcWHChanged : 1;
|
||||
NvBool dstXYChanged : 1;
|
||||
NvBool dstWHChanged : 1;
|
||||
NvBool cscChanged : 1;
|
||||
NvBool tfChanged : 1;
|
||||
NvBool hdrMetadataChanged : 1;
|
||||
NvBool surfaceChanged : 1;
|
||||
NvBool srcXYChanged : 1;
|
||||
NvBool srcWHChanged : 1;
|
||||
NvBool dstXYChanged : 1;
|
||||
NvBool dstWHChanged : 1;
|
||||
NvBool cscChanged : 1;
|
||||
NvBool tfChanged : 1;
|
||||
NvBool hdrMetadataChanged : 1;
|
||||
NvBool matrixOverridesChanged : 1;
|
||||
NvBool ilutChanged : 1;
|
||||
NvBool tmoChanged : 1;
|
||||
} flags;
|
||||
};
|
||||
|
||||
@@ -342,18 +385,30 @@ struct NvKmsKapiHeadModeSetConfig {
|
||||
struct NvKmsLutRamps *pRamps;
|
||||
} output;
|
||||
} lut;
|
||||
|
||||
struct {
|
||||
NvBool enabled;
|
||||
struct NvKmsKapiSurface *lutSurface;
|
||||
NvU64 offset;
|
||||
NvU32 vssSegments;
|
||||
NvU32 lutEntries;
|
||||
} olut;
|
||||
|
||||
NvU32 olutFpNormScale;
|
||||
};
|
||||
|
||||
struct NvKmsKapiHeadRequestedConfig {
|
||||
struct NvKmsKapiHeadModeSetConfig modeSetConfig;
|
||||
struct {
|
||||
NvBool activeChanged : 1;
|
||||
NvBool displaysChanged : 1;
|
||||
NvBool modeChanged : 1;
|
||||
NvBool hdrInfoFrameChanged : 1;
|
||||
NvBool colorimetryChanged : 1;
|
||||
NvBool ilutChanged : 1;
|
||||
NvBool olutChanged : 1;
|
||||
NvBool activeChanged : 1;
|
||||
NvBool displaysChanged : 1;
|
||||
NvBool modeChanged : 1;
|
||||
NvBool hdrInfoFrameChanged : 1;
|
||||
NvBool colorimetryChanged : 1;
|
||||
NvBool legacyIlutChanged : 1;
|
||||
NvBool legacyOlutChanged : 1;
|
||||
NvBool olutChanged : 1;
|
||||
NvBool olutFpNormScaleChanged : 1;
|
||||
} flags;
|
||||
|
||||
struct NvKmsKapiCursorRequestedConfig cursorRequestedConfig;
|
||||
@@ -1172,21 +1227,6 @@ struct NvKmsKapiFunctionsTable {
|
||||
NvU64 *pPages
|
||||
);
|
||||
|
||||
/*!
|
||||
* Check if this memory object can be scanned out for display.
|
||||
*
|
||||
* \param [in] device A device allocated using allocateDevice().
|
||||
*
|
||||
* \param [in] memory The memory object to check for display support.
|
||||
*
|
||||
* \return NV_TRUE if this memory can be displayed, NV_FALSE if not.
|
||||
*/
|
||||
NvBool (*isMemoryValidForDisplay)
|
||||
(
|
||||
const struct NvKmsKapiDevice *device,
|
||||
const struct NvKmsKapiMemory *memory
|
||||
);
|
||||
|
||||
/*
|
||||
* Import SGT as a memory handle.
|
||||
*
|
||||
@@ -1504,6 +1544,16 @@ struct NvKmsKapiFunctionsTable {
|
||||
struct NvKmsKapiDevice *device,
|
||||
NvS32 index
|
||||
);
|
||||
|
||||
/*
|
||||
* Notify NVKMS that the system's framebuffer console has been disabled and
|
||||
* the reserved allocation for the old framebuffer console can be unmapped.
|
||||
*/
|
||||
void
|
||||
(*framebufferConsoleDisabled)
|
||||
(
|
||||
struct NvKmsKapiDevice *device
|
||||
);
|
||||
};
|
||||
|
||||
/** @} */
|
||||
@@ -1518,6 +1568,20 @@ NvBool nvKmsKapiGetFunctionsTable
|
||||
struct NvKmsKapiFunctionsTable *funcsTable
|
||||
);
|
||||
|
||||
NvU32 nvKmsKapiF16ToF32(NvU16 a);
|
||||
|
||||
NvU16 nvKmsKapiF32ToF16(NvU32 a);
|
||||
|
||||
NvU32 nvKmsKapiF32Mul(NvU32 a, NvU32 b);
|
||||
|
||||
NvU32 nvKmsKapiF32Div(NvU32 a, NvU32 b);
|
||||
|
||||
NvU32 nvKmsKapiF32Add(NvU32 a, NvU32 b);
|
||||
|
||||
NvU32 nvKmsKapiF32ToUI32RMinMag(NvU32 a, NvBool exact);
|
||||
|
||||
NvU32 nvKmsKapiUI32ToF32(NvU32 a);
|
||||
|
||||
/** @} */
|
||||
|
||||
#endif /* defined(__NVKMS_KAPI_H__) */
|
||||
|
||||
@@ -30,6 +30,9 @@
|
||||
#include "nvkms-rmapi.h"
|
||||
#include "nvkms-vrr.h"
|
||||
|
||||
#include "nvkms-softfloat.h"
|
||||
#include "nv-float.h"
|
||||
|
||||
#include "nvkms-kapi.h"
|
||||
#include "nvkms-kapi-private.h"
|
||||
#include "nvkms-kapi-internal.h"
|
||||
@@ -401,7 +404,13 @@ static NvBool KmsAllocateDevice(struct NvKmsKapiDevice *device)
|
||||
device->supportedSurfaceMemoryFormats[layer] =
|
||||
paramsAlloc->reply.layerCaps[layer].supportedSurfaceMemoryFormats;
|
||||
device->supportsICtCp[layer] = paramsAlloc->reply.layerCaps[layer].supportsICtCp;
|
||||
|
||||
device->lutCaps.layer[layer].ilut =
|
||||
paramsAlloc->reply.layerCaps[layer].ilut;
|
||||
device->lutCaps.layer[layer].tmo =
|
||||
paramsAlloc->reply.layerCaps[layer].tmo;
|
||||
}
|
||||
device->lutCaps.olut = paramsAlloc->reply.olutCaps;
|
||||
|
||||
if (paramsAlloc->reply.validNIsoFormatMask &
|
||||
(1 << NVKMS_NISO_FORMAT_FOUR_WORD_NVDISPLAY)) {
|
||||
@@ -1120,6 +1129,9 @@ static NvBool GetDeviceResourcesInfo
|
||||
nvkms_memcpy(info->supportsICtCp,
|
||||
device->supportsICtCp,
|
||||
sizeof(device->supportsICtCp));
|
||||
|
||||
info->lutCaps = device->lutCaps;
|
||||
|
||||
done:
|
||||
|
||||
return status;
|
||||
@@ -1909,57 +1921,6 @@ static NvBool GetMemoryPages
|
||||
return NV_TRUE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check if the memory we are creating this framebuffer with is valid. We
|
||||
* cannot scan out sysmem or compressed buffers.
|
||||
*
|
||||
* If we cannot use this memory for display it may be resident in sysmem
|
||||
* or may belong to another GPU.
|
||||
*/
|
||||
static NvBool IsMemoryValidForDisplay
|
||||
(
|
||||
const struct NvKmsKapiDevice *device,
|
||||
const struct NvKmsKapiMemory *memory
|
||||
)
|
||||
{
|
||||
NV_STATUS status;
|
||||
NV0041_CTRL_SURFACE_INFO surfaceInfo = {};
|
||||
NV0041_CTRL_GET_SURFACE_INFO_PARAMS surfaceInfoParams = {};
|
||||
|
||||
if (device == NULL || memory == NULL) {
|
||||
return NV_FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Don't do these checks on tegra. Tegra has different capabilities.
|
||||
* Here we always say display is possible so we never fail framebuffer
|
||||
* creation.
|
||||
*/
|
||||
if (device->isSOC) {
|
||||
return NV_TRUE;
|
||||
}
|
||||
|
||||
/* Get the type of address space this memory is in, i.e. vidmem or sysmem */
|
||||
surfaceInfo.index = NV0041_CTRL_SURFACE_INFO_INDEX_ADDR_SPACE_TYPE;
|
||||
|
||||
surfaceInfoParams.surfaceInfoListSize = 1;
|
||||
surfaceInfoParams.surfaceInfoList = (NvP64)&surfaceInfo;
|
||||
|
||||
status = nvRmApiControl(device->hRmClient,
|
||||
memory->hRmHandle,
|
||||
NV0041_CTRL_CMD_GET_SURFACE_INFO,
|
||||
&surfaceInfoParams,
|
||||
sizeof(surfaceInfoParams));
|
||||
if (status != NV_OK) {
|
||||
nvKmsKapiLogDeviceDebug(device,
|
||||
"Failed to get memory location of RM memory object 0x%x",
|
||||
memory->hRmHandle);
|
||||
return NV_FALSE;
|
||||
}
|
||||
|
||||
return surfaceInfo.data == NV0000_CTRL_CMD_CLIENT_GET_ADDR_SPACE_TYPE_VIDMEM;
|
||||
}
|
||||
|
||||
static void FreeMemoryPages
|
||||
(
|
||||
NvU64 *pPages
|
||||
@@ -2557,6 +2518,53 @@ static void AssignHDRMetadataConfig(
|
||||
}
|
||||
}
|
||||
|
||||
static void AssignLayerLutConfig(
|
||||
const struct NvKmsKapiDevice *device,
|
||||
const struct NvKmsKapiLayerConfig *layerConfig,
|
||||
const struct NvKmsKapiLayerRequestedConfig *layerRequestedConfig,
|
||||
const NvU32 layer,
|
||||
struct NvKmsFlipCommonParams *params,
|
||||
NvBool bFromKmsSetMode)
|
||||
{
|
||||
if ((device->lutCaps.layer[layer].ilut.supported) &&
|
||||
(layerRequestedConfig->flags.ilutChanged || bFromKmsSetMode)) {
|
||||
|
||||
params->layer[layer].ilut.specified = TRUE;
|
||||
params->layer[layer].ilut.enabled = layerConfig->ilut.enabled;
|
||||
|
||||
if (layerConfig->ilut.lutSurface != NULL) {
|
||||
params->layer[layer].ilut.lut.surfaceHandle =
|
||||
layerConfig->ilut.lutSurface->hKmsHandle;
|
||||
} else {
|
||||
params->layer[layer].ilut.lut.surfaceHandle = 0;
|
||||
}
|
||||
params->layer[layer].ilut.lut.offset = layerConfig->ilut.offset;
|
||||
params->layer[layer].ilut.lut.vssSegments =
|
||||
layerConfig->ilut.vssSegments;
|
||||
params->layer[layer].ilut.lut.lutEntries =
|
||||
layerConfig->ilut.lutEntries;
|
||||
}
|
||||
|
||||
if ((device->lutCaps.layer[layer].tmo.supported) &&
|
||||
(layerRequestedConfig->flags.tmoChanged || bFromKmsSetMode)) {
|
||||
|
||||
params->layer[layer].tmo.specified = TRUE;
|
||||
params->layer[layer].tmo.enabled = layerConfig->tmo.enabled;
|
||||
|
||||
if (layerConfig->tmo.lutSurface != NULL) {
|
||||
params->layer[layer].tmo.lut.surfaceHandle =
|
||||
layerConfig->tmo.lutSurface->hKmsHandle;
|
||||
} else {
|
||||
params->layer[layer].tmo.lut.surfaceHandle = 0;
|
||||
}
|
||||
params->layer[layer].tmo.lut.offset = layerConfig->tmo.offset;
|
||||
params->layer[layer].tmo.lut.vssSegments =
|
||||
layerConfig->tmo.vssSegments;
|
||||
params->layer[layer].tmo.lut.lutEntries =
|
||||
layerConfig->tmo.lutEntries;
|
||||
}
|
||||
}
|
||||
|
||||
static void NvKmsKapiCursorConfigToKms(
|
||||
const struct NvKmsKapiCursorRequestedConfig *requestedConfig,
|
||||
struct NvKmsFlipCommonParams *params,
|
||||
@@ -2626,12 +2634,21 @@ static NvBool NvKmsKapiOverlayLayerConfigToKms(
|
||||
params->layer[layer].colorSpace.specified = TRUE;
|
||||
}
|
||||
|
||||
if (layerRequestedConfig->flags.cscChanged || bFromKmsSetMode) {
|
||||
if (layerRequestedConfig->flags.cscChanged ||
|
||||
layerRequestedConfig->flags.matrixOverridesChanged ||
|
||||
bFromKmsSetMode) {
|
||||
params->layer[layer].csc.specified = NV_TRUE;
|
||||
params->layer[layer].csc.useMain = layerConfig->cscUseMain;
|
||||
if (!layerConfig->cscUseMain) {
|
||||
params->layer[layer].csc.matrix = layerConfig->csc;
|
||||
}
|
||||
|
||||
// 'blendCtm' overrides 'csc', but provides a 3x4 matrix.
|
||||
if (layerConfig->matrixOverrides.enabled.blendCtm) {
|
||||
params->layer[layer].csc.useMain = FALSE;
|
||||
params->layer[layer].csc.matrix =
|
||||
layerConfig->matrixOverrides.blendCtm;
|
||||
}
|
||||
}
|
||||
|
||||
if (layerRequestedConfig->flags.srcWHChanged || bFromKmsSetMode) {
|
||||
@@ -2656,6 +2673,51 @@ static NvBool NvKmsKapiOverlayLayerConfigToKms(
|
||||
AssignHDRMetadataConfig(layerConfig, layerRequestedConfig, layer,
|
||||
params, bFromKmsSetMode);
|
||||
|
||||
if (layerRequestedConfig->flags.matrixOverridesChanged || bFromKmsSetMode) {
|
||||
// 'lmsCtm' explicitly provides a matrix to program CSC00.
|
||||
if (layerConfig->matrixOverrides.enabled.lmsCtm) {
|
||||
params->layer[layer].csc00Override.matrix =
|
||||
layerConfig->matrixOverrides.lmsCtm;
|
||||
params->layer[layer].csc00Override.enabled = TRUE;
|
||||
} else {
|
||||
params->layer[layer].csc00Override.enabled = FALSE;
|
||||
}
|
||||
params->layer[layer].csc00Override.specified = TRUE;
|
||||
|
||||
// 'lmsToItpCtm' explicitly provides a matrix to program CSC01.
|
||||
if (layerConfig->matrixOverrides.enabled.lmsToItpCtm) {
|
||||
params->layer[layer].csc01Override.matrix =
|
||||
layerConfig->matrixOverrides.lmsToItpCtm;
|
||||
params->layer[layer].csc01Override.enabled = TRUE;
|
||||
} else {
|
||||
params->layer[layer].csc01Override.enabled = FALSE;
|
||||
}
|
||||
params->layer[layer].csc01Override.specified = TRUE;
|
||||
|
||||
// 'itpToLmsCtm' explicitly provides a matrix to program CSC10.
|
||||
if (layerConfig->matrixOverrides.enabled.itpToLmsCtm) {
|
||||
params->layer[layer].csc10Override.matrix =
|
||||
layerConfig->matrixOverrides.itpToLmsCtm;
|
||||
params->layer[layer].csc10Override.enabled = TRUE;
|
||||
} else {
|
||||
params->layer[layer].csc10Override.enabled = FALSE;
|
||||
}
|
||||
params->layer[layer].csc10Override.specified = TRUE;
|
||||
|
||||
// 'blendCtm' explicitly provides a matrix to program CSC11.
|
||||
if (layerConfig->matrixOverrides.enabled.blendCtm) {
|
||||
params->layer[layer].csc11Override.matrix =
|
||||
layerConfig->matrixOverrides.blendCtm;
|
||||
params->layer[layer].csc11Override.enabled = TRUE;
|
||||
} else {
|
||||
params->layer[layer].csc11Override.enabled = FALSE;
|
||||
}
|
||||
params->layer[layer].csc11Override.specified = TRUE;
|
||||
}
|
||||
|
||||
AssignLayerLutConfig(device, layerConfig, layerRequestedConfig, layer,
|
||||
params, bFromKmsSetMode);
|
||||
|
||||
if (commit) {
|
||||
NvU32 nextIndex = NVKMS_KAPI_INC_NOTIFIER_INDEX(
|
||||
device->layerState[head][layer].
|
||||
@@ -2754,19 +2816,74 @@ static NvBool NvKmsKapiPrimaryLayerConfigToKms(
|
||||
changed = TRUE;
|
||||
}
|
||||
|
||||
if (layerRequestedConfig->flags.cscChanged || bFromKmsSetMode) {
|
||||
if (layerRequestedConfig->flags.cscChanged ||
|
||||
layerRequestedConfig->flags.matrixOverridesChanged ||
|
||||
bFromKmsSetMode) {
|
||||
nvAssert(!layerConfig->cscUseMain);
|
||||
|
||||
params->layer[NVKMS_MAIN_LAYER].csc.specified = NV_TRUE;
|
||||
params->layer[NVKMS_MAIN_LAYER].csc.useMain = FALSE;
|
||||
params->layer[NVKMS_MAIN_LAYER].csc.matrix = layerConfig->csc;
|
||||
|
||||
// 'blendCtm' overrides 'csc', but provides a 3x4 matrix.
|
||||
if (layerConfig->matrixOverrides.enabled.blendCtm) {
|
||||
params->layer[NVKMS_MAIN_LAYER].csc.matrix =
|
||||
layerConfig->matrixOverrides.blendCtm;
|
||||
}
|
||||
|
||||
changed = TRUE;
|
||||
}
|
||||
|
||||
AssignHDRMetadataConfig(layerConfig, layerRequestedConfig, NVKMS_MAIN_LAYER,
|
||||
params, bFromKmsSetMode);
|
||||
|
||||
if (layerRequestedConfig->flags.matrixOverridesChanged || bFromKmsSetMode) {
|
||||
// 'lmsCtm' explicitly provides a matrix to program CSC00.
|
||||
if (layerConfig->matrixOverrides.enabled.lmsCtm) {
|
||||
params->layer[NVKMS_MAIN_LAYER].csc00Override.matrix =
|
||||
layerConfig->matrixOverrides.lmsCtm;
|
||||
params->layer[NVKMS_MAIN_LAYER].csc00Override.enabled = TRUE;
|
||||
} else {
|
||||
params->layer[NVKMS_MAIN_LAYER].csc00Override.enabled = FALSE;
|
||||
}
|
||||
params->layer[NVKMS_MAIN_LAYER].csc00Override.specified = TRUE;
|
||||
|
||||
// 'lmsToItpCtm' explicitly provides a matrix to program CSC01.
|
||||
if (layerConfig->matrixOverrides.enabled.lmsToItpCtm) {
|
||||
params->layer[NVKMS_MAIN_LAYER].csc01Override.matrix =
|
||||
layerConfig->matrixOverrides.lmsToItpCtm;
|
||||
params->layer[NVKMS_MAIN_LAYER].csc01Override.enabled = TRUE;
|
||||
} else {
|
||||
params->layer[NVKMS_MAIN_LAYER].csc01Override.enabled = FALSE;
|
||||
}
|
||||
params->layer[NVKMS_MAIN_LAYER].csc01Override.specified = TRUE;
|
||||
|
||||
// 'itpToLmsCtm' explicitly provides a matrix to program CSC10.
|
||||
if (layerConfig->matrixOverrides.enabled.itpToLmsCtm) {
|
||||
params->layer[NVKMS_MAIN_LAYER].csc10Override.matrix =
|
||||
layerConfig->matrixOverrides.itpToLmsCtm;
|
||||
params->layer[NVKMS_MAIN_LAYER].csc10Override.enabled = TRUE;
|
||||
} else {
|
||||
params->layer[NVKMS_MAIN_LAYER].csc10Override.enabled = FALSE;
|
||||
}
|
||||
params->layer[NVKMS_MAIN_LAYER].csc10Override.specified = TRUE;
|
||||
|
||||
// 'blendCtm' explicitly provides a matrix to program CSC11.
|
||||
if (layerConfig->matrixOverrides.enabled.blendCtm) {
|
||||
params->layer[NVKMS_MAIN_LAYER].csc11Override.matrix =
|
||||
layerConfig->matrixOverrides.blendCtm;
|
||||
params->layer[NVKMS_MAIN_LAYER].csc11Override.enabled = TRUE;
|
||||
} else {
|
||||
params->layer[NVKMS_MAIN_LAYER].csc11Override.enabled = FALSE;
|
||||
}
|
||||
params->layer[NVKMS_MAIN_LAYER].csc11Override.specified = TRUE;
|
||||
|
||||
changed = TRUE;
|
||||
}
|
||||
|
||||
AssignLayerLutConfig(device, layerConfig, layerRequestedConfig, NVKMS_MAIN_LAYER,
|
||||
params, bFromKmsSetMode);
|
||||
|
||||
if (commit && changed) {
|
||||
NvU32 nextIndex = NVKMS_KAPI_INC_NOTIFIER_INDEX(
|
||||
device->layerState[head][NVKMS_MAIN_LAYER].
|
||||
@@ -2850,7 +2967,7 @@ static void NvKmsKapiHeadLutConfigToKms(
|
||||
struct NvKmsSetOutputLutParams *output = &lutParams->output;
|
||||
|
||||
/* input LUT */
|
||||
if (headRequestedConfig->flags.ilutChanged || bFromKmsSetMode) {
|
||||
if (headRequestedConfig->flags.legacyIlutChanged || bFromKmsSetMode) {
|
||||
input->specified = NV_TRUE;
|
||||
input->depth = modeSetConfig->lut.input.depth;
|
||||
input->start = modeSetConfig->lut.input.start;
|
||||
@@ -2860,7 +2977,7 @@ static void NvKmsKapiHeadLutConfigToKms(
|
||||
}
|
||||
|
||||
/* output LUT */
|
||||
if (headRequestedConfig->flags.olutChanged || bFromKmsSetMode) {
|
||||
if (headRequestedConfig->flags.legacyOlutChanged || bFromKmsSetMode) {
|
||||
output->specified = NV_TRUE;
|
||||
output->enabled = modeSetConfig->lut.output.enabled;
|
||||
|
||||
@@ -2981,6 +3098,27 @@ static NvBool NvKmsKapiRequestedModeSetConfigToKms(
|
||||
¶msHead->flip.lut,
|
||||
NV_TRUE /* bFromKmsSetMode */);
|
||||
|
||||
if (device->lutCaps.olut.supported) {
|
||||
paramsHead->flip.olut.specified = TRUE;
|
||||
paramsHead->flip.olut.enabled = headModeSetConfig->olut.enabled;
|
||||
|
||||
if (headModeSetConfig->olut.lutSurface != NULL) {
|
||||
paramsHead->flip.olut.lut.surfaceHandle =
|
||||
headModeSetConfig->olut.lutSurface->hKmsHandle;
|
||||
} else {
|
||||
paramsHead->flip.olut.lut.surfaceHandle = 0;
|
||||
}
|
||||
paramsHead->flip.olut.lut.offset = headModeSetConfig->olut.offset;
|
||||
paramsHead->flip.olut.lut.vssSegments =
|
||||
headModeSetConfig->olut.vssSegments;
|
||||
paramsHead->flip.olut.lut.lutEntries =
|
||||
headModeSetConfig->olut.lutEntries;
|
||||
|
||||
paramsHead->flip.olutFpNormScale.specified = TRUE;
|
||||
paramsHead->flip.olutFpNormScale.val =
|
||||
headModeSetConfig->olutFpNormScale;
|
||||
}
|
||||
|
||||
NvKmsKapiCursorConfigToKms(&headRequestedConfig->cursorRequestedConfig,
|
||||
¶msHead->flip,
|
||||
NV_TRUE /* bFromKmsSetMode */);
|
||||
@@ -3240,6 +3378,30 @@ static NvBool KmsFlip(
|
||||
NvKmsKapiHeadLutConfigToKms(headRequestedConfig,
|
||||
&flipParams->lut,
|
||||
NV_FALSE /* bFromKmsSetMode */);
|
||||
|
||||
if (device->lutCaps.olut.supported && headRequestedConfig->flags.olutChanged) {
|
||||
flipParams->olut.specified = TRUE;
|
||||
flipParams->olut.enabled = headModeSetConfig->olut.enabled;
|
||||
|
||||
if (headModeSetConfig->olut.lutSurface != NULL) {
|
||||
flipParams->olut.lut.surfaceHandle =
|
||||
headModeSetConfig->olut.lutSurface->hKmsHandle;
|
||||
} else {
|
||||
flipParams->olut.lut.surfaceHandle = 0;
|
||||
}
|
||||
flipParams->olut.lut.offset = headModeSetConfig->olut.offset;
|
||||
flipParams->olut.lut.vssSegments =
|
||||
headModeSetConfig->olut.vssSegments;
|
||||
flipParams->olut.lut.lutEntries =
|
||||
headModeSetConfig->olut.lutEntries;
|
||||
}
|
||||
|
||||
if (device->lutCaps.olut.supported &&
|
||||
headRequestedConfig->flags.olutFpNormScaleChanged) {
|
||||
|
||||
flipParams->olutFpNormScale.specified = TRUE;
|
||||
flipParams->olutFpNormScale.val = headModeSetConfig->olutFpNormScale;
|
||||
}
|
||||
}
|
||||
|
||||
if (params->request.numFlipHeads == 0) {
|
||||
@@ -3337,9 +3499,11 @@ static NvBool ApplyModeSetConfig(
|
||||
}
|
||||
|
||||
bRequiredModeset =
|
||||
headRequestedConfig->flags.activeChanged ||
|
||||
headRequestedConfig->flags.displaysChanged ||
|
||||
headRequestedConfig->flags.modeChanged;
|
||||
headRequestedConfig->flags.activeChanged ||
|
||||
headRequestedConfig->flags.displaysChanged ||
|
||||
headRequestedConfig->flags.modeChanged ||
|
||||
headRequestedConfig->flags.hdrInfoFrameChanged ||
|
||||
headRequestedConfig->flags.colorimetryChanged;
|
||||
|
||||
/*
|
||||
* NVKMS flip ioctl could not validate flip configuration for an
|
||||
@@ -3527,6 +3691,28 @@ static NvBool SignalVrrSemaphore
|
||||
return status;
|
||||
}
|
||||
|
||||
static void FramebufferConsoleDisabled
|
||||
(
|
||||
struct NvKmsKapiDevice *device
|
||||
)
|
||||
{
|
||||
struct NvKmsFramebufferConsoleDisabledParams params = { };
|
||||
NvBool status;
|
||||
|
||||
if (device->hKmsDevice == 0x0) {
|
||||
return;
|
||||
}
|
||||
|
||||
params.request.deviceHandle = device->hKmsDevice;
|
||||
|
||||
status = nvkms_ioctl_from_kapi(device->pKmsOpen,
|
||||
NVKMS_IOCTL_FRAMEBUFFER_CONSOLE_DISABLED,
|
||||
¶ms, sizeof(params));
|
||||
if (!status) {
|
||||
nvKmsKapiLogDeviceDebug(device, "NVKMS FramebufferConsoleDisabled failed");
|
||||
}
|
||||
}
|
||||
|
||||
NvBool nvKmsKapiGetFunctionsTableInternal
|
||||
(
|
||||
struct NvKmsKapiFunctionsTable *funcsTable
|
||||
@@ -3595,8 +3781,6 @@ NvBool nvKmsKapiGetFunctionsTableInternal
|
||||
funcsTable->getMemoryPages = GetMemoryPages;
|
||||
funcsTable->freeMemoryPages = FreeMemoryPages;
|
||||
|
||||
funcsTable->isMemoryValidForDisplay = IsMemoryValidForDisplay;
|
||||
|
||||
funcsTable->importSemaphoreSurface = nvKmsKapiImportSemaphoreSurface;
|
||||
funcsTable->freeSemaphoreSurface = nvKmsKapiFreeSemaphoreSurface;
|
||||
funcsTable->registerSemaphoreSurfaceCallback =
|
||||
@@ -3606,6 +3790,7 @@ NvBool nvKmsKapiGetFunctionsTableInternal
|
||||
funcsTable->setSemaphoreSurfaceValue =
|
||||
nvKmsKapiSetSemaphoreSurfaceValue;
|
||||
funcsTable->setSuspendResumeCallback = nvKmsKapiSetSuspendResumeCallback;
|
||||
funcsTable->framebufferConsoleDisabled = FramebufferConsoleDisabled;
|
||||
|
||||
funcsTable->tryInitDisplaySemaphore = nvKmsKapiTryInitDisplaySemaphore;
|
||||
funcsTable->signalDisplaySemaphore = nvKmsKapiSignalDisplaySemaphore;
|
||||
@@ -3614,3 +3799,47 @@ NvBool nvKmsKapiGetFunctionsTableInternal
|
||||
|
||||
return NV_TRUE;
|
||||
}
|
||||
|
||||
NvU32 nvKmsKapiF16ToF32Internal(NvU16 a)
|
||||
{
|
||||
float16_t fa = { .v = a };
|
||||
return f16_to_f32(fa).v;
|
||||
}
|
||||
|
||||
NvU16 nvKmsKapiF32ToF16Internal(NvU32 a)
|
||||
{
|
||||
float32_t fa = { .v = a };
|
||||
return f32_to_f16(fa).v;
|
||||
}
|
||||
|
||||
NvU32 nvKmsKapiF32MulInternal(NvU32 a, NvU32 b)
|
||||
{
|
||||
float32_t fa = { .v = a };
|
||||
float32_t fb = { .v = b };
|
||||
return f32_mul(fa, fb).v;
|
||||
}
|
||||
|
||||
NvU32 nvKmsKapiF32DivInternal(NvU32 a, NvU32 b)
|
||||
{
|
||||
float32_t fa = { .v = a };
|
||||
float32_t fb = { .v = b };
|
||||
return f32_div(fa, fb).v;
|
||||
}
|
||||
|
||||
NvU32 nvKmsKapiF32AddInternal(NvU32 a, NvU32 b)
|
||||
{
|
||||
float32_t fa = { .v = a };
|
||||
float32_t fb = { .v = b };
|
||||
return f32_add(fa, fb).v;
|
||||
}
|
||||
|
||||
NvU32 nvKmsKapiF32ToUI32RMinMagInternal(NvU32 a, NvBool exact)
|
||||
{
|
||||
float32_t fa = { .v = a };
|
||||
return f32_to_ui32_r_minMag(fa, exact);
|
||||
}
|
||||
|
||||
NvU32 nvKmsKapiUI32ToF32Internal(NvU32 a)
|
||||
{
|
||||
return ui32_to_f32(a).v;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user