linux/drivers/gpu/drm/amd/display/modules/info_packet/info_packet.c

/*
 * Copyright 2018 Advanced Micro Devices, Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
 * to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 * OTHER DEALINGS IN THE SOFTWARE.
 *
 * Authors: AMD
 *
 */

#include "mod_info_packet.h"
#include "core_types.h"
#include "dc_types.h"
#include "mod_shared.h"
#include "mod_freesync.h"
#include "dc.h"

enum vsc_packet_revision {};

#define HDMI_INFOFRAME_TYPE_VENDOR
#define HF_VSIF_VERSION

// VTEM Byte Offset
#define VTEM_PB0
#define VTEM_PB1
#define VTEM_PB2
#define VTEM_PB3
#define VTEM_PB4
#define VTEM_PB5
#define VTEM_PB6

#define VTEM_MD0
#define VTEM_MD1
#define VTEM_MD2
#define VTEM_MD3


// VTEM Byte Masks
//PB0
#define MASK_VTEM_PB0__RESERVED0
#define MASK_VTEM_PB0__SYNC
#define MASK_VTEM_PB0__VFR
#define MASK_VTEM_PB0__AFR
#define MASK_VTEM_PB0__DS_TYPE
	//0: Periodic pseudo-static EM Data Set
	//1: Periodic dynamic EM Data Set
	//2: Unique EM Data Set
	//3: Reserved
#define MASK_VTEM_PB0__END
#define MASK_VTEM_PB0__NEW

//PB1
#define MASK_VTEM_PB1__RESERVED1

//PB2
#define MASK_VTEM_PB2__ORGANIZATION_ID
	//0: This is a Vendor Specific EM Data Set
	//1: This EM Data Set is defined by This Specification (HDMI 2.1 r102.clean)
	//2: This EM Data Set is defined by CTA-861-G
	//3: This EM Data Set is defined by VESA
//PB3
#define MASK_VTEM_PB3__DATA_SET_TAG_MSB
//PB4
#define MASK_VTEM_PB4__DATA_SET_TAG_LSB
//PB5
#define MASK_VTEM_PB5__DATA_SET_LENGTH_MSB
//PB6
#define MASK_VTEM_PB6__DATA_SET_LENGTH_LSB



//PB7-27 (20 bytes):
//PB7 = MD0
#define MASK_VTEM_MD0__VRR_EN
#define MASK_VTEM_MD0__M_CONST
#define MASK_VTEM_MD0__QMS_EN
#define MASK_VTEM_MD0__RESERVED2
#define MASK_VTEM_MD0__FVA_FACTOR_M1

//MD1
#define MASK_VTEM_MD1__BASE_VFRONT

//MD2
#define MASK_VTEM_MD2__BASE_REFRESH_RATE_98
#define MASK_VTEM_MD2__RB
#define MASK_VTEM_MD2__NEXT_TFR

//MD3
#define MASK_VTEM_MD3__BASE_REFRESH_RATE_07

enum ColorimetryRGBDP {};
enum ColorimetryYCCDP {};

void mod_build_vsc_infopacket(const struct dc_stream_state *stream,
		struct dc_info_packet *info_packet,
		enum dc_color_space cs,
		enum color_transfer_func tf)
{}

/**
 *  mod_build_hf_vsif_infopacket - Prepare HDMI Vendor Specific info frame.
 *                                 Follows HDMI Spec to build up Vendor Specific info frame
 *
 *  @stream:      contains data we may need to construct VSIF (i.e. timing_3d_format, etc.)
 *  @info_packet: output structure where to store VSIF
 */
void mod_build_hf_vsif_infopacket(const struct dc_stream_state *stream,
		struct dc_info_packet *info_packet)
{}

void mod_build_adaptive_sync_infopacket(const struct dc_stream_state *stream,
		enum adaptive_sync_type asType,
		const struct AS_Df_params *param,
		struct dc_info_packet *info_packet)
{}

void mod_build_adaptive_sync_infopacket_v1(struct dc_info_packet *info_packet)
{}

void mod_build_adaptive_sync_infopacket_v2(const struct dc_stream_state *stream,
		const struct AS_Df_params *param,
		struct dc_info_packet *info_packet)
{}