}
}
-static void translate_info_frame(const struct hw_info_frame *hw_info_frame,
- struct encoder_info_frame *encoder_info_frame)
+static void patch_gamut_packet_checksum(
+ struct encoder_info_packet *gamut_packet)
{
- memset(
- encoder_info_frame, 0, sizeof(struct encoder_info_frame));
-
/* For gamut we recalc checksum */
- if (hw_info_frame->gamut_packet.valid) {
+ if (gamut_packet->valid) {
uint8_t chk_sum = 0;
uint8_t *ptr;
uint8_t i;
- memmove(
- &encoder_info_frame->gamut,
- &hw_info_frame->gamut_packet,
- sizeof(struct hw_info_packet));
-
/*start of the Gamut data. */
- ptr = &encoder_info_frame->gamut.sb[3];
+ ptr = &gamut_packet->sb[3];
- for (i = 0; i <= encoder_info_frame->gamut.sb[1]; i++)
+ for (i = 0; i <= gamut_packet->sb[1]; i++)
chk_sum += ptr[i];
- encoder_info_frame->gamut.sb[2] = (uint8_t) (0x100 - chk_sum);
- }
-
- if (hw_info_frame->avi_info_packet.valid) {
- memmove(
- &encoder_info_frame->avi,
- &hw_info_frame->avi_info_packet,
- sizeof(struct hw_info_packet));
- }
-
- if (hw_info_frame->vendor_info_packet.valid) {
- memmove(
- &encoder_info_frame->vendor,
- &hw_info_frame->vendor_info_packet,
- sizeof(struct hw_info_packet));
- }
-
- if (hw_info_frame->spd_packet.valid) {
- memmove(
- &encoder_info_frame->spd,
- &hw_info_frame->spd_packet,
- sizeof(struct hw_info_packet));
- }
-
- if (hw_info_frame->vsc_packet.valid) {
- memmove(
- &encoder_info_frame->vsc,
- &hw_info_frame->vsc_packet,
- sizeof(struct hw_info_packet));
- }
-
- if (hw_info_frame->hdrsmd_packet.valid) {
- memmove(
- &encoder_info_frame->hdrsmd,
- &hw_info_frame->hdrsmd_packet,
- sizeof(struct hw_info_packet));
+ gamut_packet->sb[2] = (uint8_t) (0x100 - chk_sum);
}
}
static void set_avi_info_frame(
- struct hw_info_packet *info_packet,
+ struct encoder_info_packet *info_packet,
struct pipe_ctx *pipe_ctx)
{
struct core_stream *stream = pipe_ctx->stream;
uint8_t *check_sum = NULL;
uint8_t byte_index = 0;
- if (info_packet == NULL)
- return;
-
color_space = pipe_ctx->stream->public.output_color_space;
/* Initialize header */
info_packet->valid = true;
}
-static void set_vendor_info_packet(struct core_stream *stream,
- struct hw_info_packet *info_packet)
+static void set_vendor_info_packet(
+ struct encoder_info_packet *info_packet,
+ struct core_stream *stream)
{
uint32_t length = 0;
bool hdmi_vic_mode = false;
uint32_t i = 0;
enum dc_timing_3d_format format;
- ASSERT_CRITICAL(stream != NULL);
- ASSERT_CRITICAL(info_packet != NULL);
-
format = stream->public.timing.timing_3d_format;
/* Can be different depending on packet content */
info_packet->valid = true;
}
-static void set_spd_info_packet(struct core_stream *stream,
- struct hw_info_packet *info_packet)
+static void set_spd_info_packet(
+ struct encoder_info_packet *info_packet,
+ struct core_stream *stream)
{
/* SPD info packet for FreeSync */
}
static void set_hdr_static_info_packet(
+ struct encoder_info_packet *info_packet,
struct core_surface *surface,
- struct core_stream *stream,
- struct hw_info_packet *info_packet)
+ struct core_stream *stream)
{
uint16_t i = 0;
enum signal_type signal = stream->signal;
}
}
-static void set_vsc_info_packet(struct core_stream *stream,
- struct hw_info_packet *info_packet)
+static void set_vsc_info_packet(
+ struct encoder_info_packet *info_packet,
+ struct core_stream *stream)
{
unsigned int vscPacketRevision = 0;
unsigned int i;
void resource_build_info_frame(struct pipe_ctx *pipe_ctx)
{
enum signal_type signal = SIGNAL_TYPE_NONE;
- struct hw_info_frame info_frame = { { 0 } };
+ struct encoder_info_frame *info = &pipe_ctx->encoder_info_frame;
/* default all packets to invalid */
- info_frame.avi_info_packet.valid = false;
- info_frame.gamut_packet.valid = false;
- info_frame.vendor_info_packet.valid = false;
- info_frame.spd_packet.valid = false;
- info_frame.vsc_packet.valid = false;
- info_frame.hdrsmd_packet.valid = false;
+ info->avi.valid = false;
+ info->gamut.valid = false;
+ info->vendor.valid = false;
+ info->hdrsmd.valid = false;
+ info->vsc.valid = false;
signal = pipe_ctx->stream->signal;
/* HDMi and DP have different info packets*/
if (dc_is_hdmi_signal(signal)) {
- set_avi_info_frame(
- &info_frame.avi_info_packet, pipe_ctx);
- set_vendor_info_packet(
- pipe_ctx->stream, &info_frame.vendor_info_packet);
- set_spd_info_packet(pipe_ctx->stream, &info_frame.spd_packet);
- set_hdr_static_info_packet(pipe_ctx->surface,
- pipe_ctx->stream, &info_frame.hdrsmd_packet);
+ set_avi_info_frame(&info->avi, pipe_ctx);
+
+ set_vendor_info_packet(&info->vendor, pipe_ctx->stream);
+
+ set_spd_info_packet(&info->spd, pipe_ctx->stream);
+
+ set_hdr_static_info_packet(&info->hdrsmd,
+ pipe_ctx->surface, pipe_ctx->stream);
+
} else if (dc_is_dp_signal(signal)) {
- set_vsc_info_packet(pipe_ctx->stream, &info_frame.vsc_packet);
- set_spd_info_packet(pipe_ctx->stream, &info_frame.spd_packet);
- set_hdr_static_info_packet(pipe_ctx->surface,
- pipe_ctx->stream, &info_frame.hdrsmd_packet);
+ set_vsc_info_packet(&info->vsc, pipe_ctx->stream);
+
+ set_spd_info_packet(&info->spd, pipe_ctx->stream);
+
+ set_hdr_static_info_packet(&info->hdrsmd,
+ pipe_ctx->surface, pipe_ctx->stream);
}
- translate_info_frame(&info_frame,
- &pipe_ctx->encoder_info_frame);
+ patch_gamut_packet_checksum(&info->gamut);
}
enum dc_status resource_map_clock_resources(