drm/amd/display: Info frame cleanup
* Use provided infopacket in stream (if valid) instead of reconstructing in set_vendor_info_packet() * Use proper format for enums * Use dc info packet struct instead Signed-off-by: Harmanprit Tatla <Harmanprit.Tatla@amd.com> Reviewed-by: Anthony Koo <Anthony.Koo@amd.com> Acked-by: Krunoslav Kovac <Krunoslav.Kovac@amd.com> Acked-by: Leo Li <sunpeng.li@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:

committed by
Alex Deucher

parent
242b0c8ffa
commit
ecd0136bfd
@@ -608,12 +608,12 @@ static void build_vrr_infopacket_data(const struct mod_vrr_params *vrr,
|
||||
static void build_vrr_infopacket_fs2_data(enum color_transfer_func app_tf,
|
||||
struct dc_info_packet *infopacket)
|
||||
{
|
||||
if (app_tf != transfer_func_unknown) {
|
||||
if (app_tf != TRANSFER_FUNC_UNKNOWN) {
|
||||
infopacket->valid = true;
|
||||
|
||||
infopacket->sb[6] |= 0x08; // PB6 = [Bit 3 = Native Color Active]
|
||||
|
||||
if (app_tf == transfer_func_gamma_22) {
|
||||
if (app_tf == TRANSFER_FUNC_GAMMA_22) {
|
||||
infopacket->sb[9] |= 0x04; // PB6 = [Bit 2 = Gamma 2.2 EOTF Active]
|
||||
}
|
||||
}
|
||||
@@ -688,11 +688,11 @@ void mod_freesync_build_vrr_infopacket(struct mod_freesync *mod_freesync,
|
||||
return;
|
||||
|
||||
switch (packet_type) {
|
||||
case packet_type_fs2:
|
||||
case PACKET_TYPE_FS2:
|
||||
build_vrr_infopacket_v2(stream->signal, vrr, app_tf, infopacket);
|
||||
break;
|
||||
case packet_type_vrr:
|
||||
case packet_type_fs1:
|
||||
case PACKET_TYPE_VRR:
|
||||
case PACKET_TYPE_FS1:
|
||||
default:
|
||||
build_vrr_infopacket_v1(stream->signal, vrr, infopacket);
|
||||
}
|
||||
|
@@ -26,15 +26,13 @@
|
||||
#ifndef MOD_INFO_PACKET_H_
|
||||
#define MOD_INFO_PACKET_H_
|
||||
|
||||
struct info_packet_inputs {
|
||||
const struct dc_stream_state *pStream;
|
||||
};
|
||||
#include "mod_shared.h"
|
||||
|
||||
struct info_packets {
|
||||
struct dc_info_packet *pVscInfoPacket;
|
||||
};
|
||||
//Forward Declarations
|
||||
struct dc_stream_state;
|
||||
struct dc_info_packet;
|
||||
|
||||
void mod_build_infopackets(struct info_packet_inputs *inputs,
|
||||
struct info_packets *info_packets);
|
||||
void mod_build_vsc_infopacket(const struct dc_stream_state *stream,
|
||||
struct dc_info_packet *info_packet);
|
||||
|
||||
#endif
|
||||
|
@@ -23,27 +23,26 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef MOD_SHARED_H_
|
||||
#define MOD_SHARED_H_
|
||||
|
||||
enum color_transfer_func {
|
||||
transfer_func_unknown,
|
||||
transfer_func_srgb,
|
||||
transfer_func_bt709,
|
||||
transfer_func_pq2084,
|
||||
transfer_func_pq2084_interim,
|
||||
transfer_func_linear_0_1,
|
||||
transfer_func_linear_0_125,
|
||||
transfer_func_dolbyvision,
|
||||
transfer_func_gamma_22,
|
||||
transfer_func_gamma_26
|
||||
TRANSFER_FUNC_UNKNOWN,
|
||||
TRANSFER_FUNC_SRGB,
|
||||
TRANSFER_FUNC_BT709,
|
||||
TRANSFER_FUNC_PQ2084,
|
||||
TRANSFER_FUNC_PQ2084_INTERIM,
|
||||
TRANSFER_FUNC_LINEAR_0_1,
|
||||
TRANSFER_FUNC_LINEAR_0_125,
|
||||
TRANSFER_FUNC_GAMMA_22,
|
||||
TRANSFER_FUNC_GAMMA_26
|
||||
};
|
||||
|
||||
enum vrr_packet_type {
|
||||
packet_type_vrr,
|
||||
packet_type_fs1,
|
||||
packet_type_fs2
|
||||
PACKET_TYPE_VRR,
|
||||
PACKET_TYPE_FS1,
|
||||
PACKET_TYPE_FS2
|
||||
};
|
||||
|
||||
|
||||
#endif /* MOD_SHARED_H_ */
|
||||
|
@@ -25,6 +25,10 @@
|
||||
|
||||
#include "mod_info_packet.h"
|
||||
#include "core_types.h"
|
||||
#include "dc_types.h"
|
||||
#include "mod_shared.h"
|
||||
|
||||
#define HDMI_INFOFRAME_TYPE_VENDOR 0x81
|
||||
|
||||
enum ColorimetryRGBDP {
|
||||
ColorimetryRGB_DP_sRGB = 0,
|
||||
@@ -41,7 +45,7 @@ enum ColorimetryYCCDP {
|
||||
ColorimetryYCC_DP_ITU2020YCbCr = 7,
|
||||
};
|
||||
|
||||
static void mod_build_vsc_infopacket(const struct dc_stream_state *stream,
|
||||
void mod_build_vsc_infopacket(const struct dc_stream_state *stream,
|
||||
struct dc_info_packet *info_packet)
|
||||
{
|
||||
unsigned int vscPacketRevision = 0;
|
||||
@@ -159,7 +163,7 @@ static void mod_build_vsc_infopacket(const struct dc_stream_state *stream,
|
||||
* DPCD register is exposed in the new Extended Receiver Capability field for DPCD Rev. 1.4
|
||||
* (and higher). When MISC1. bit 6. is Set to 1, a Source device uses a VSC SDP to indicate
|
||||
* the Pixel Encoding/Colorimetry Format and that a Sink device must ignore MISC1, bit 7, and
|
||||
* MISC0, bits 7:1 (MISC1, bit 7. and MISC0, bits 7:1 become “don’t care”).)
|
||||
* MISC0, bits 7:1 (MISC1, bit 7. and MISC0, bits 7:1 become "don't care").)
|
||||
*/
|
||||
if (vscPacketRevision == 0x5) {
|
||||
/* Secondary-data Packet ID = 0 */
|
||||
@@ -320,10 +324,3 @@ static void mod_build_vsc_infopacket(const struct dc_stream_state *stream,
|
||||
|
||||
}
|
||||
|
||||
void mod_build_infopackets(struct info_packet_inputs *inputs,
|
||||
struct info_packets *info_packets)
|
||||
{
|
||||
if (info_packets->pVscInfoPacket != NULL)
|
||||
mod_build_vsc_infopacket(inputs->pStream, info_packets->pVscInfoPacket);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user