Exemple #1
0
        /// <summary>
        ///     Thus function sets the EDID data for the specified GPU handle and connection bit mask.
        ///     User can either send (Gpu handle and output id) or only display Id in variable outputId parameter and gpuHandle
        ///     parameter can be default handle.
        ///     Note: The EDID will be cached across the boot session and will be enumerated to the OS in this call. To remove the
        ///     EDID set size of EDID to zero. OS and NVAPI connection status APIs will reflect the newly set or removed EDID
        ///     dynamically.
        ///     This feature will NOT be supported on the following boards: GeForce, Quadro VX, Tesla
        /// </summary>
        /// <param name="gpuHandle">Physical GPU handle to check outputs</param>
        /// <param name="displayId">Output identification</param>
        /// <param name="edid">EDID information</param>
        /// <exception cref="NVIDIANotSupportedException">This operation is not supported.</exception>
        /// <exception cref="NVIDIAApiException">
        ///     Status.InvalidArgument: gpuHandle or edid is invalid, outputId has 0 or > 1 bits
        ///     set
        /// </exception>
        /// <exception cref="NVIDIAApiException">Status.NvidiaDeviceNotFound: No NVIDIA GPU driving a display was found.</exception>
        /// <exception cref="NVIDIAApiException">Status.ExpectedPhysicalGPUHandle: gpuHandle was not a physical GPU handle.</exception>
        /// <exception cref="NVIDIAApiException">Status.NotSupported: For the above mentioned GPUs</exception>
        /// <exception cref="Exception">A delegate callback throws an exception.</exception>
        public static void SetEDID(PhysicalGPUHandle gpuHandle, uint displayId, IEDID edid)
        {
            var gpuSetEDID = DelegateFactory.GetDelegate <Delegates.GPU.NvAPI_GPU_SetEDID>();

            if (!gpuSetEDID.Accepts().Contains(edid.GetType()))
            {
                throw new NVIDIANotSupportedException("This operation is not supported.");
            }

            using (var edidReference = ValueTypeReference.FromValueType(edid, edid.GetType()))
            {
                var status = gpuSetEDID(gpuHandle, displayId, edidReference);

                if (status != Status.Ok)
                {
                    throw new NVIDIAApiException(status);
                }
            }
        }
Exemple #2
0
 /// <summary>
 ///     Thus function sets the EDID data for the specified GPU handle and connection bit mask.
 ///     User can either send (Gpu handle and output id) or only display Id in variable outputId parameter and gpuHandle
 ///     parameter can be default handle.
 ///     Note: The EDID will be cached across the boot session and will be enumerated to the OS in this call. To remove the
 ///     EDID set size of EDID to zero. OS and NVAPI connection status APIs will reflect the newly set or removed EDID
 ///     dynamically.
 ///     This feature will NOT be supported on the following boards: GeForce, Quadro VX, Tesla
 /// </summary>
 /// <param name="gpuHandle">Physical GPU handle to check outputs</param>
 /// <param name="outputId">Output identification</param>
 /// <param name="edid">EDID information</param>
 /// <exception cref="NVIDIANotSupportedException">This operation is not supported.</exception>
 /// <exception cref="NVIDIAApiException">
 ///     Status.InvalidArgument: gpuHandle or edid is invalid, outputId has 0 or > 1 bits
 ///     set
 /// </exception>
 /// <exception cref="NVIDIAApiException">Status.NvidiaDeviceNotFound: No NVIDIA GPU driving a display was found.</exception>
 /// <exception cref="NVIDIAApiException">Status.ExpectedPhysicalGPUHandle: gpuHandle was not a physical GPU handle.</exception>
 /// <exception cref="NVIDIAApiException">Status.NotSupported: For the above mentioned GPUs</exception>
 public static void SetEDID(PhysicalGPUHandle gpuHandle, OutputId outputId, IEDID edid)
 {
     SetEDID(gpuHandle, (uint)outputId, edid);
 }