Lines Matching +full:aac +full:- +full:mode
17 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
44 return 256 - csum; in hdmi_infoframe_checksum()
55 * hdmi_avi_infoframe_init() - initialize an HDMI AVI infoframe
62 frame->type = HDMI_INFOFRAME_TYPE_AVI; in hdmi_avi_infoframe_init()
63 frame->version = 2; in hdmi_avi_infoframe_init()
64 frame->length = HDMI_AVI_INFOFRAME_SIZE; in hdmi_avi_infoframe_init()
70 if (frame->type != HDMI_INFOFRAME_TYPE_AVI || in hdmi_avi_infoframe_check_only()
71 frame->version != 2 || in hdmi_avi_infoframe_check_only()
72 frame->length != HDMI_AVI_INFOFRAME_SIZE) in hdmi_avi_infoframe_check_only()
73 return -EINVAL; in hdmi_avi_infoframe_check_only()
75 if (frame->picture_aspect > HDMI_PICTURE_ASPECT_16_9) in hdmi_avi_infoframe_check_only()
76 return -EINVAL; in hdmi_avi_infoframe_check_only()
82 * hdmi_avi_infoframe_check() - check a HDMI AVI infoframe
97 * hdmi_avi_infoframe_pack_only() - write HDMI AVI infoframe to binary buffer
121 length = HDMI_INFOFRAME_HEADER_SIZE + frame->length; in hdmi_avi_infoframe_pack_only()
124 return -ENOSPC; in hdmi_avi_infoframe_pack_only()
128 ptr[0] = frame->type; in hdmi_avi_infoframe_pack_only()
129 ptr[1] = frame->version; in hdmi_avi_infoframe_pack_only()
130 ptr[2] = frame->length; in hdmi_avi_infoframe_pack_only()
136 ptr[0] = ((frame->colorspace & 0x3) << 5) | (frame->scan_mode & 0x3); in hdmi_avi_infoframe_pack_only()
142 if (frame->active_aspect & 0xf) in hdmi_avi_infoframe_pack_only()
146 if (frame->top_bar || frame->bottom_bar) in hdmi_avi_infoframe_pack_only()
149 if (frame->left_bar || frame->right_bar) in hdmi_avi_infoframe_pack_only()
152 ptr[1] = ((frame->colorimetry & 0x3) << 6) | in hdmi_avi_infoframe_pack_only()
153 ((frame->picture_aspect & 0x3) << 4) | in hdmi_avi_infoframe_pack_only()
154 (frame->active_aspect & 0xf); in hdmi_avi_infoframe_pack_only()
156 ptr[2] = ((frame->extended_colorimetry & 0x7) << 4) | in hdmi_avi_infoframe_pack_only()
157 ((frame->quantization_range & 0x3) << 2) | in hdmi_avi_infoframe_pack_only()
158 (frame->nups & 0x3); in hdmi_avi_infoframe_pack_only()
160 if (frame->itc) in hdmi_avi_infoframe_pack_only()
163 ptr[3] = frame->video_code & 0x7f; in hdmi_avi_infoframe_pack_only()
165 ptr[4] = ((frame->ycc_quantization_range & 0x3) << 6) | in hdmi_avi_infoframe_pack_only()
166 ((frame->content_type & 0x3) << 4) | in hdmi_avi_infoframe_pack_only()
167 (frame->pixel_repeat & 0xf); in hdmi_avi_infoframe_pack_only()
169 ptr[5] = frame->top_bar & 0xff; in hdmi_avi_infoframe_pack_only()
170 ptr[6] = (frame->top_bar >> 8) & 0xff; in hdmi_avi_infoframe_pack_only()
171 ptr[7] = frame->bottom_bar & 0xff; in hdmi_avi_infoframe_pack_only()
172 ptr[8] = (frame->bottom_bar >> 8) & 0xff; in hdmi_avi_infoframe_pack_only()
173 ptr[9] = frame->left_bar & 0xff; in hdmi_avi_infoframe_pack_only()
174 ptr[10] = (frame->left_bar >> 8) & 0xff; in hdmi_avi_infoframe_pack_only()
175 ptr[11] = frame->right_bar & 0xff; in hdmi_avi_infoframe_pack_only()
176 ptr[12] = (frame->right_bar >> 8) & 0xff; in hdmi_avi_infoframe_pack_only()
185 * hdmi_avi_infoframe_pack() - check a HDMI AVI infoframe,
215 * hdmi_spd_infoframe_init() - initialize an HDMI SPD infoframe
229 frame->type = HDMI_INFOFRAME_TYPE_SPD; in hdmi_spd_infoframe_init()
230 frame->version = 1; in hdmi_spd_infoframe_init()
231 frame->length = HDMI_SPD_INFOFRAME_SIZE; in hdmi_spd_infoframe_init()
234 memcpy(frame->vendor, vendor, min(len, sizeof(frame->vendor))); in hdmi_spd_infoframe_init()
236 memcpy(frame->product, product, min(len, sizeof(frame->product))); in hdmi_spd_infoframe_init()
244 if (frame->type != HDMI_INFOFRAME_TYPE_SPD || in hdmi_spd_infoframe_check_only()
245 frame->version != 1 || in hdmi_spd_infoframe_check_only()
246 frame->length != HDMI_SPD_INFOFRAME_SIZE) in hdmi_spd_infoframe_check_only()
247 return -EINVAL; in hdmi_spd_infoframe_check_only()
253 * hdmi_spd_infoframe_check() - check a HDMI SPD infoframe
268 * hdmi_spd_infoframe_pack_only() - write HDMI SPD infoframe to binary buffer
292 length = HDMI_INFOFRAME_HEADER_SIZE + frame->length; in hdmi_spd_infoframe_pack_only()
295 return -ENOSPC; in hdmi_spd_infoframe_pack_only()
299 ptr[0] = frame->type; in hdmi_spd_infoframe_pack_only()
300 ptr[1] = frame->version; in hdmi_spd_infoframe_pack_only()
301 ptr[2] = frame->length; in hdmi_spd_infoframe_pack_only()
307 memcpy(ptr, frame->vendor, sizeof(frame->vendor)); in hdmi_spd_infoframe_pack_only()
308 memcpy(ptr + 8, frame->product, sizeof(frame->product)); in hdmi_spd_infoframe_pack_only()
310 ptr[24] = frame->sdi; in hdmi_spd_infoframe_pack_only()
319 * hdmi_spd_infoframe_pack() - check a HDMI SPD infoframe,
349 * hdmi_audio_infoframe_init() - initialize an HDMI audio infoframe
358 frame->type = HDMI_INFOFRAME_TYPE_AUDIO; in hdmi_audio_infoframe_init()
359 frame->version = 1; in hdmi_audio_infoframe_init()
360 frame->length = HDMI_AUDIO_INFOFRAME_SIZE; in hdmi_audio_infoframe_init()
368 if (frame->type != HDMI_INFOFRAME_TYPE_AUDIO || in hdmi_audio_infoframe_check_only()
369 frame->version != 1 || in hdmi_audio_infoframe_check_only()
370 frame->length != HDMI_AUDIO_INFOFRAME_SIZE) in hdmi_audio_infoframe_check_only()
371 return -EINVAL; in hdmi_audio_infoframe_check_only()
377 * hdmi_audio_infoframe_check() - check a HDMI audio infoframe
397 if (frame->channels >= 2) in hdmi_audio_infoframe_pack_payload()
398 channels = frame->channels - 1; in hdmi_audio_infoframe_pack_payload()
402 buffer[0] = ((frame->coding_type & 0xf) << 4) | (channels & 0x7); in hdmi_audio_infoframe_pack_payload()
403 buffer[1] = ((frame->sample_frequency & 0x7) << 2) | in hdmi_audio_infoframe_pack_payload()
404 (frame->sample_size & 0x3); in hdmi_audio_infoframe_pack_payload()
405 buffer[2] = frame->coding_type_ext & 0x1f; in hdmi_audio_infoframe_pack_payload()
406 buffer[3] = frame->channel_allocation; in hdmi_audio_infoframe_pack_payload()
407 buffer[4] = (frame->level_shift_value & 0xf) << 3; in hdmi_audio_infoframe_pack_payload()
409 if (frame->downmix_inhibit) in hdmi_audio_infoframe_pack_payload()
414 * hdmi_audio_infoframe_pack_only() - write HDMI audio infoframe to binary buffer
438 length = HDMI_INFOFRAME_HEADER_SIZE + frame->length; in hdmi_audio_infoframe_pack_only()
441 return -ENOSPC; in hdmi_audio_infoframe_pack_only()
445 ptr[0] = frame->type; in hdmi_audio_infoframe_pack_only()
446 ptr[1] = frame->version; in hdmi_audio_infoframe_pack_only()
447 ptr[2] = frame->length; in hdmi_audio_infoframe_pack_only()
460 * hdmi_audio_infoframe_pack() - check a HDMI Audio infoframe,
490 * hdmi_audio_infoframe_pack_for_dp - Pack a HDMI Audio infoframe for DisplayPort
511 memset(sdp->db, 0, sizeof(sdp->db)); in hdmi_audio_infoframe_pack_for_dp()
513 /* Secondary-data packet header */ in hdmi_audio_infoframe_pack_for_dp()
514 sdp->sdp_header.HB0 = 0; in hdmi_audio_infoframe_pack_for_dp()
515 sdp->sdp_header.HB1 = frame->type; in hdmi_audio_infoframe_pack_for_dp()
516 sdp->sdp_header.HB2 = DP_SDP_AUDIO_INFOFRAME_HB2; in hdmi_audio_infoframe_pack_for_dp()
517 sdp->sdp_header.HB3 = (dp_version & 0x3f) << 2; in hdmi_audio_infoframe_pack_for_dp()
519 hdmi_audio_infoframe_pack_payload(frame, sdp->db); in hdmi_audio_infoframe_pack_for_dp()
522 return frame->length + 4; in hdmi_audio_infoframe_pack_for_dp()
527 * hdmi_vendor_infoframe_init() - initialize an HDMI vendor infoframe
536 frame->type = HDMI_INFOFRAME_TYPE_VENDOR; in hdmi_vendor_infoframe_init()
537 frame->version = 1; in hdmi_vendor_infoframe_init()
539 frame->oui = HDMI_IEEE_OUI; in hdmi_vendor_infoframe_init()
545 frame->s3d_struct = HDMI_3D_STRUCTURE_INVALID; in hdmi_vendor_infoframe_init()
546 frame->length = HDMI_VENDOR_INFOFRAME_SIZE; in hdmi_vendor_infoframe_init()
555 if (frame->s3d_struct >= HDMI_3D_STRUCTURE_SIDE_BY_SIDE_HALF) in hdmi_vendor_infoframe_length()
557 else if (frame->vic != 0 || frame->s3d_struct != HDMI_3D_STRUCTURE_INVALID) in hdmi_vendor_infoframe_length()
565 if (frame->type != HDMI_INFOFRAME_TYPE_VENDOR || in hdmi_vendor_infoframe_check_only()
566 frame->version != 1 || in hdmi_vendor_infoframe_check_only()
567 frame->oui != HDMI_IEEE_OUI) in hdmi_vendor_infoframe_check_only()
568 return -EINVAL; in hdmi_vendor_infoframe_check_only()
571 if (frame->vic != 0 && frame->s3d_struct != HDMI_3D_STRUCTURE_INVALID) in hdmi_vendor_infoframe_check_only()
572 return -EINVAL; in hdmi_vendor_infoframe_check_only()
574 if (frame->length != hdmi_vendor_infoframe_length(frame)) in hdmi_vendor_infoframe_check_only()
575 return -EINVAL; in hdmi_vendor_infoframe_check_only()
581 * hdmi_vendor_infoframe_check() - check a HDMI vendor infoframe
591 frame->length = hdmi_vendor_infoframe_length(frame); in hdmi_vendor_infoframe_check()
598 * hdmi_vendor_infoframe_pack_only() - write a HDMI vendor infoframe to binary buffer
622 length = HDMI_INFOFRAME_HEADER_SIZE + frame->length; in hdmi_vendor_infoframe_pack_only()
625 return -ENOSPC; in hdmi_vendor_infoframe_pack_only()
629 ptr[0] = frame->type; in hdmi_vendor_infoframe_pack_only()
630 ptr[1] = frame->version; in hdmi_vendor_infoframe_pack_only()
631 ptr[2] = frame->length; in hdmi_vendor_infoframe_pack_only()
639 if (frame->s3d_struct != HDMI_3D_STRUCTURE_INVALID) { in hdmi_vendor_infoframe_pack_only()
641 ptr[8] = (frame->s3d_struct & 0xf) << 4; in hdmi_vendor_infoframe_pack_only()
642 if (frame->s3d_struct >= HDMI_3D_STRUCTURE_SIDE_BY_SIDE_HALF) in hdmi_vendor_infoframe_pack_only()
643 ptr[9] = (frame->s3d_ext_data & 0xf) << 4; in hdmi_vendor_infoframe_pack_only()
644 } else if (frame->vic) { in hdmi_vendor_infoframe_pack_only()
646 ptr[8] = frame->vic; in hdmi_vendor_infoframe_pack_only()
658 * hdmi_vendor_infoframe_pack() - check a HDMI Vendor infoframe,
690 if (frame->any.type != HDMI_INFOFRAME_TYPE_VENDOR || in hdmi_vendor_any_infoframe_check_only()
691 frame->any.version != 1) in hdmi_vendor_any_infoframe_check_only()
692 return -EINVAL; in hdmi_vendor_any_infoframe_check_only()
698 * hdmi_drm_infoframe_init() - initialize an HDMI Dynaminc Range and
708 frame->type = HDMI_INFOFRAME_TYPE_DRM; in hdmi_drm_infoframe_init()
709 frame->version = 1; in hdmi_drm_infoframe_init()
710 frame->length = HDMI_DRM_INFOFRAME_SIZE; in hdmi_drm_infoframe_init()
718 if (frame->type != HDMI_INFOFRAME_TYPE_DRM || in hdmi_drm_infoframe_check_only()
719 frame->version != 1) in hdmi_drm_infoframe_check_only()
720 return -EINVAL; in hdmi_drm_infoframe_check_only()
722 if (frame->length != HDMI_DRM_INFOFRAME_SIZE) in hdmi_drm_infoframe_check_only()
723 return -EINVAL; in hdmi_drm_infoframe_check_only()
729 * hdmi_drm_infoframe_check() - check a HDMI DRM infoframe
742 * hdmi_drm_infoframe_pack_only() - write HDMI DRM infoframe to binary buffer
762 length = HDMI_INFOFRAME_HEADER_SIZE + frame->length; in hdmi_drm_infoframe_pack_only()
765 return -ENOSPC; in hdmi_drm_infoframe_pack_only()
769 ptr[0] = frame->type; in hdmi_drm_infoframe_pack_only()
770 ptr[1] = frame->version; in hdmi_drm_infoframe_pack_only()
771 ptr[2] = frame->length; in hdmi_drm_infoframe_pack_only()
777 *ptr++ = frame->eotf; in hdmi_drm_infoframe_pack_only()
778 *ptr++ = frame->metadata_type; in hdmi_drm_infoframe_pack_only()
781 *ptr++ = frame->display_primaries[i].x; in hdmi_drm_infoframe_pack_only()
782 *ptr++ = frame->display_primaries[i].x >> 8; in hdmi_drm_infoframe_pack_only()
783 *ptr++ = frame->display_primaries[i].y; in hdmi_drm_infoframe_pack_only()
784 *ptr++ = frame->display_primaries[i].y >> 8; in hdmi_drm_infoframe_pack_only()
787 *ptr++ = frame->white_point.x; in hdmi_drm_infoframe_pack_only()
788 *ptr++ = frame->white_point.x >> 8; in hdmi_drm_infoframe_pack_only()
790 *ptr++ = frame->white_point.y; in hdmi_drm_infoframe_pack_only()
791 *ptr++ = frame->white_point.y >> 8; in hdmi_drm_infoframe_pack_only()
793 *ptr++ = frame->max_display_mastering_luminance; in hdmi_drm_infoframe_pack_only()
794 *ptr++ = frame->max_display_mastering_luminance >> 8; in hdmi_drm_infoframe_pack_only()
796 *ptr++ = frame->min_display_mastering_luminance; in hdmi_drm_infoframe_pack_only()
797 *ptr++ = frame->min_display_mastering_luminance >> 8; in hdmi_drm_infoframe_pack_only()
799 *ptr++ = frame->max_cll; in hdmi_drm_infoframe_pack_only()
800 *ptr++ = frame->max_cll >> 8; in hdmi_drm_infoframe_pack_only()
802 *ptr++ = frame->max_fall; in hdmi_drm_infoframe_pack_only()
803 *ptr++ = frame->max_fall >> 8; in hdmi_drm_infoframe_pack_only()
812 * hdmi_drm_infoframe_pack() - check a HDMI DRM infoframe,
842 * hdmi_vendor_any_infoframe_check() - check a vendor infoframe
854 if (frame->any.oui != HDMI_IEEE_OUI) in hdmi_vendor_any_infoframe_check()
855 return -EINVAL; in hdmi_vendor_any_infoframe_check()
857 return hdmi_vendor_infoframe_check(&frame->hdmi); in hdmi_vendor_any_infoframe_check()
861 * hdmi_vendor_any_infoframe_pack_only() - write a vendor infoframe to binary buffer
874 if (frame->any.oui != HDMI_IEEE_OUI) in hdmi_vendor_any_infoframe_pack_only()
875 return -EINVAL; in hdmi_vendor_any_infoframe_pack_only()
877 return hdmi_vendor_infoframe_pack_only(&frame->hdmi, buffer, size); in hdmi_vendor_any_infoframe_pack_only()
881 * hdmi_vendor_any_infoframe_pack() - check a vendor infoframe,
898 * hdmi_infoframe_check() - check a HDMI infoframe
909 switch (frame->any.type) { in hdmi_infoframe_check()
911 return hdmi_avi_infoframe_check(&frame->avi); in hdmi_infoframe_check()
913 return hdmi_spd_infoframe_check(&frame->spd); in hdmi_infoframe_check()
915 return hdmi_audio_infoframe_check(&frame->audio); in hdmi_infoframe_check()
917 return hdmi_vendor_any_infoframe_check(&frame->vendor); in hdmi_infoframe_check()
919 WARN(1, "Bad infoframe type %d\n", frame->any.type); in hdmi_infoframe_check()
920 return -EINVAL; in hdmi_infoframe_check()
926 * hdmi_infoframe_pack_only() - write a HDMI infoframe to binary buffer
944 switch (frame->any.type) { in hdmi_infoframe_pack_only()
946 length = hdmi_avi_infoframe_pack_only(&frame->avi, in hdmi_infoframe_pack_only()
950 length = hdmi_drm_infoframe_pack_only(&frame->drm, in hdmi_infoframe_pack_only()
954 length = hdmi_spd_infoframe_pack_only(&frame->spd, in hdmi_infoframe_pack_only()
958 length = hdmi_audio_infoframe_pack_only(&frame->audio, in hdmi_infoframe_pack_only()
962 length = hdmi_vendor_any_infoframe_pack_only(&frame->vendor, in hdmi_infoframe_pack_only()
966 WARN(1, "Bad infoframe type %d\n", frame->any.type); in hdmi_infoframe_pack_only()
967 length = -EINVAL; in hdmi_infoframe_pack_only()
975 * hdmi_infoframe_pack() - check a HDMI infoframe,
997 switch (frame->any.type) { in hdmi_infoframe_pack()
999 length = hdmi_avi_infoframe_pack(&frame->avi, buffer, size); in hdmi_infoframe_pack()
1002 length = hdmi_drm_infoframe_pack(&frame->drm, buffer, size); in hdmi_infoframe_pack()
1005 length = hdmi_spd_infoframe_pack(&frame->spd, buffer, size); in hdmi_infoframe_pack()
1008 length = hdmi_audio_infoframe_pack(&frame->audio, buffer, size); in hdmi_infoframe_pack()
1011 length = hdmi_vendor_any_infoframe_pack(&frame->vendor, in hdmi_infoframe_pack()
1015 WARN(1, "Bad infoframe type %d\n", frame->any.type); in hdmi_infoframe_pack()
1016 length = -EINVAL; in hdmi_infoframe_pack()
1047 hdmi_infoframe_type_get_name(frame->type), in hdmi_infoframe_log_header()
1048 frame->version, frame->length); in hdmi_infoframe_log_header()
1199 return "Unknown Non-uniform Scaling"; in hdmi_nups_get_name()
1246 hdmi_colorspace_get_name(frame->colorspace)); in hdmi_avi_infoframe_log()
1247 hdmi_log(" scan mode: %s\n", in hdmi_avi_infoframe_log()
1248 hdmi_scan_mode_get_name(frame->scan_mode)); in hdmi_avi_infoframe_log()
1250 hdmi_colorimetry_get_name(frame->colorimetry)); in hdmi_avi_infoframe_log()
1252 hdmi_picture_aspect_get_name(frame->picture_aspect)); in hdmi_avi_infoframe_log()
1254 hdmi_active_aspect_get_name(frame->active_aspect)); in hdmi_avi_infoframe_log()
1255 hdmi_log(" itc: %s\n", frame->itc ? "IT Content" : "No Data"); in hdmi_avi_infoframe_log()
1257 hdmi_extended_colorimetry_get_name(frame->extended_colorimetry)); in hdmi_avi_infoframe_log()
1259 hdmi_quantization_range_get_name(frame->quantization_range)); in hdmi_avi_infoframe_log()
1260 hdmi_log(" nups: %s\n", hdmi_nups_get_name(frame->nups)); in hdmi_avi_infoframe_log()
1261 hdmi_log(" video code: %u\n", frame->video_code); in hdmi_avi_infoframe_log()
1263 hdmi_ycc_quantization_range_get_name(frame->ycc_quantization_range)); in hdmi_avi_infoframe_log()
1265 hdmi_content_type_get_name(frame->content_type)); in hdmi_avi_infoframe_log()
1266 hdmi_log(" pixel repeat: %u\n", frame->pixel_repeat); in hdmi_avi_infoframe_log()
1268 frame->top_bar, frame->bottom_bar, in hdmi_avi_infoframe_log()
1269 frame->left_bar, frame->right_bar); in hdmi_avi_infoframe_log()
1284 return "D-VHS"; in hdmi_spd_sdi_get_name()
1298 return "Blu-Ray Disc (BD)"; in hdmi_spd_sdi_get_name()
1316 hdmi_log(" vendor: %.8s\n", frame->vendor); in hdmi_spd_infoframe_log()
1317 hdmi_log(" product: %.16s\n", frame->product); in hdmi_spd_infoframe_log()
1319 hdmi_spd_sdi_get_name(frame->sdi), frame->sdi); in hdmi_spd_infoframe_log()
1331 return "AC-3"; in hdmi_audio_coding_type_get_name()
1339 return "AAC"; in hdmi_audio_coding_type_get_name()
1349 return "DTS-HD"; in hdmi_audio_coding_type_get_name()
1412 return "HE AAC"; in hdmi_audio_coding_type_ext_get_name()
1414 return "HE AAC v2"; in hdmi_audio_coding_type_ext_get_name()
1418 return "MPEG-4 HE AAC"; in hdmi_audio_coding_type_ext_get_name()
1420 return "MPEG-4 HE AAC v2"; in hdmi_audio_coding_type_ext_get_name()
1422 return "MPEG-4 AAC LC"; in hdmi_audio_coding_type_ext_get_name()
1426 return "MPEG-4 HE AAC + MPEG Surround"; in hdmi_audio_coding_type_ext_get_name()
1428 return "MPEG-4 AAC LC + MPEG Surround"; in hdmi_audio_coding_type_ext_get_name()
1440 if (frame->channels) in hdmi_audio_infoframe_log()
1441 hdmi_log(" channels: %u\n", frame->channels - 1); in hdmi_audio_infoframe_log()
1445 hdmi_audio_coding_type_get_name(frame->coding_type)); in hdmi_audio_infoframe_log()
1447 hdmi_audio_sample_size_get_name(frame->sample_size)); in hdmi_audio_infoframe_log()
1449 hdmi_audio_sample_frequency_get_name(frame->sample_frequency)); in hdmi_audio_infoframe_log()
1451 hdmi_audio_coding_type_ext_get_name(frame->coding_type_ext)); in hdmi_audio_infoframe_log()
1453 frame->channel_allocation); in hdmi_audio_infoframe_log()
1455 frame->level_shift_value); in hdmi_audio_infoframe_log()
1457 frame->downmix_inhibit ? "Yes" : "No"); in hdmi_audio_infoframe_log()
1468 hdmi_log("length: %d\n", frame->length); in hdmi_drm_infoframe_log()
1469 hdmi_log("metadata type: %d\n", frame->metadata_type); in hdmi_drm_infoframe_log()
1470 hdmi_log("eotf: %d\n", frame->eotf); in hdmi_drm_infoframe_log()
1472 hdmi_log("x[%d]: %d\n", i, frame->display_primaries[i].x); in hdmi_drm_infoframe_log()
1473 hdmi_log("y[%d]: %d\n", i, frame->display_primaries[i].y); in hdmi_drm_infoframe_log()
1476 hdmi_log("white point x: %d\n", frame->white_point.x); in hdmi_drm_infoframe_log()
1477 hdmi_log("white point y: %d\n", frame->white_point.y); in hdmi_drm_infoframe_log()
1480 frame->max_display_mastering_luminance); in hdmi_drm_infoframe_log()
1482 frame->min_display_mastering_luminance); in hdmi_drm_infoframe_log()
1484 hdmi_log("max_cll: %d\n", frame->max_cll); in hdmi_drm_infoframe_log()
1485 hdmi_log("max_fall: %d\n", frame->max_fall); in hdmi_drm_infoframe_log()
1502 return "Side-by-side (Full)"; in hdmi_3d_structure_get_name()
1506 return "L + Depth + Graphics + Graphics-depth"; in hdmi_3d_structure_get_name()
1508 return "Top-and-Bottom"; in hdmi_3d_structure_get_name()
1510 return "Side-by-side (Half)"; in hdmi_3d_structure_get_name()
1522 const struct hdmi_vendor_infoframe *hvf = &frame->hdmi; in hdmi_vendor_any_infoframe_log()
1527 if (frame->any.oui != HDMI_IEEE_OUI) { in hdmi_vendor_any_infoframe_log()
1531 if (hvf->vic == 0 && hvf->s3d_struct == HDMI_3D_STRUCTURE_INVALID) { in hdmi_vendor_any_infoframe_log()
1536 if (hvf->vic) in hdmi_vendor_any_infoframe_log()
1537 hdmi_log(" HDMI VIC: %u\n", hvf->vic); in hdmi_vendor_any_infoframe_log()
1538 if (hvf->s3d_struct != HDMI_3D_STRUCTURE_INVALID) { in hdmi_vendor_any_infoframe_log()
1540 hdmi_3d_structure_get_name(hvf->s3d_struct)); in hdmi_vendor_any_infoframe_log()
1541 if (hvf->s3d_struct >= HDMI_3D_STRUCTURE_SIDE_BY_SIDE_HALF) in hdmi_vendor_any_infoframe_log()
1543 hvf->s3d_ext_data); in hdmi_vendor_any_infoframe_log()
1548 * hdmi_infoframe_log() - log info of HDMI infoframe
1557 switch (frame->any.type) { in hdmi_infoframe_log()
1559 hdmi_avi_infoframe_log(level, dev, &frame->avi); in hdmi_infoframe_log()
1562 hdmi_spd_infoframe_log(level, dev, &frame->spd); in hdmi_infoframe_log()
1565 hdmi_audio_infoframe_log(level, dev, &frame->audio); in hdmi_infoframe_log()
1568 hdmi_vendor_any_infoframe_log(level, dev, &frame->vendor); in hdmi_infoframe_log()
1571 hdmi_drm_infoframe_log(level, dev, &frame->drm); in hdmi_infoframe_log()
1578 * hdmi_avi_infoframe_unpack() - unpack binary buffer to a HDMI AVI infoframe
1596 return -EINVAL; in hdmi_avi_infoframe_unpack()
1601 return -EINVAL; in hdmi_avi_infoframe_unpack()
1604 return -EINVAL; in hdmi_avi_infoframe_unpack()
1610 frame->colorspace = (ptr[0] >> 5) & 0x3; in hdmi_avi_infoframe_unpack()
1612 frame->active_aspect = ptr[1] & 0xf; in hdmi_avi_infoframe_unpack()
1614 frame->top_bar = (ptr[6] << 8) | ptr[5]; in hdmi_avi_infoframe_unpack()
1615 frame->bottom_bar = (ptr[8] << 8) | ptr[7]; in hdmi_avi_infoframe_unpack()
1618 frame->left_bar = (ptr[10] << 8) | ptr[9]; in hdmi_avi_infoframe_unpack()
1619 frame->right_bar = (ptr[12] << 8) | ptr[11]; in hdmi_avi_infoframe_unpack()
1621 frame->scan_mode = ptr[0] & 0x3; in hdmi_avi_infoframe_unpack()
1623 frame->colorimetry = (ptr[1] >> 6) & 0x3; in hdmi_avi_infoframe_unpack()
1624 frame->picture_aspect = (ptr[1] >> 4) & 0x3; in hdmi_avi_infoframe_unpack()
1625 frame->active_aspect = ptr[1] & 0xf; in hdmi_avi_infoframe_unpack()
1627 frame->itc = ptr[2] & 0x80 ? true : false; in hdmi_avi_infoframe_unpack()
1628 frame->extended_colorimetry = (ptr[2] >> 4) & 0x7; in hdmi_avi_infoframe_unpack()
1629 frame->quantization_range = (ptr[2] >> 2) & 0x3; in hdmi_avi_infoframe_unpack()
1630 frame->nups = ptr[2] & 0x3; in hdmi_avi_infoframe_unpack()
1632 frame->video_code = ptr[3] & 0x7f; in hdmi_avi_infoframe_unpack()
1633 frame->ycc_quantization_range = (ptr[4] >> 6) & 0x3; in hdmi_avi_infoframe_unpack()
1634 frame->content_type = (ptr[4] >> 4) & 0x3; in hdmi_avi_infoframe_unpack()
1636 frame->pixel_repeat = ptr[4] & 0xf; in hdmi_avi_infoframe_unpack()
1642 * hdmi_spd_infoframe_unpack() - unpack binary buffer to a HDMI SPD infoframe
1661 return -EINVAL; in hdmi_spd_infoframe_unpack()
1666 return -EINVAL; in hdmi_spd_infoframe_unpack()
1670 return -EINVAL; in hdmi_spd_infoframe_unpack()
1678 frame->sdi = ptr[24]; in hdmi_spd_infoframe_unpack()
1684 * hdmi_audio_infoframe_unpack() - unpack binary buffer to a HDMI AUDIO infoframe
1703 return -EINVAL; in hdmi_audio_infoframe_unpack()
1708 return -EINVAL; in hdmi_audio_infoframe_unpack()
1712 return -EINVAL; in hdmi_audio_infoframe_unpack()
1720 frame->channels = ptr[0] & 0x7; in hdmi_audio_infoframe_unpack()
1721 frame->coding_type = (ptr[0] >> 4) & 0xf; in hdmi_audio_infoframe_unpack()
1722 frame->sample_size = ptr[1] & 0x3; in hdmi_audio_infoframe_unpack()
1723 frame->sample_frequency = (ptr[1] >> 2) & 0x7; in hdmi_audio_infoframe_unpack()
1724 frame->coding_type_ext = ptr[2] & 0x1f; in hdmi_audio_infoframe_unpack()
1725 frame->channel_allocation = ptr[3]; in hdmi_audio_infoframe_unpack()
1726 frame->level_shift_value = (ptr[4] >> 3) & 0xf; in hdmi_audio_infoframe_unpack()
1727 frame->downmix_inhibit = ptr[4] & 0x80 ? true : false; in hdmi_audio_infoframe_unpack()
1733 * hdmi_vendor_any_infoframe_unpack() - unpack binary buffer to a HDMI
1754 struct hdmi_vendor_infoframe *hvf = &frame->hdmi; in hdmi_vendor_any_infoframe_unpack()
1757 return -EINVAL; in hdmi_vendor_any_infoframe_unpack()
1762 return -EINVAL; in hdmi_vendor_any_infoframe_unpack()
1767 return -EINVAL; in hdmi_vendor_any_infoframe_unpack()
1771 return -EINVAL; in hdmi_vendor_any_infoframe_unpack()
1779 return -EINVAL; in hdmi_vendor_any_infoframe_unpack()
1784 return -EINVAL; in hdmi_vendor_any_infoframe_unpack()
1790 hvf->length = length; in hdmi_vendor_any_infoframe_unpack()
1794 return -EINVAL; in hdmi_vendor_any_infoframe_unpack()
1795 hvf->s3d_struct = ptr[4] >> 4; in hdmi_vendor_any_infoframe_unpack()
1796 if (hvf->s3d_struct >= HDMI_3D_STRUCTURE_SIDE_BY_SIDE_HALF) { in hdmi_vendor_any_infoframe_unpack()
1798 return -EINVAL; in hdmi_vendor_any_infoframe_unpack()
1799 hvf->s3d_ext_data = ptr[5] >> 4; in hdmi_vendor_any_infoframe_unpack()
1803 return -EINVAL; in hdmi_vendor_any_infoframe_unpack()
1804 hvf->vic = ptr[4]; in hdmi_vendor_any_infoframe_unpack()
1807 return -EINVAL; in hdmi_vendor_any_infoframe_unpack()
1814 * hdmi_drm_infoframe_unpack_only() - unpack binary buffer of CTA-861-G DRM
1821 * Unpacks CTA-861-G DRM infoframe DataBytes contained in the binary @buffer
1838 return -EINVAL; in hdmi_drm_infoframe_unpack_only()
1844 frame->eotf = ptr[0] & 0x7; in hdmi_drm_infoframe_unpack_only()
1845 frame->metadata_type = ptr[1] & 0x7; in hdmi_drm_infoframe_unpack_only()
1851 frame->display_primaries[i].x = (x_msb << 8) | x_lsb; in hdmi_drm_infoframe_unpack_only()
1854 frame->display_primaries[i].y = (y_msb << 8) | y_lsb; in hdmi_drm_infoframe_unpack_only()
1857 frame->white_point.x = (ptr[15] << 8) | ptr[14]; in hdmi_drm_infoframe_unpack_only()
1858 frame->white_point.y = (ptr[17] << 8) | ptr[16]; in hdmi_drm_infoframe_unpack_only()
1860 frame->max_display_mastering_luminance = (ptr[19] << 8) | ptr[18]; in hdmi_drm_infoframe_unpack_only()
1861 frame->min_display_mastering_luminance = (ptr[21] << 8) | ptr[20]; in hdmi_drm_infoframe_unpack_only()
1862 frame->max_cll = (ptr[23] << 8) | ptr[22]; in hdmi_drm_infoframe_unpack_only()
1863 frame->max_fall = (ptr[25] << 8) | ptr[24]; in hdmi_drm_infoframe_unpack_only()
1870 * hdmi_drm_infoframe_unpack() - unpack binary buffer to a HDMI DRM infoframe
1875 * Unpacks the CTA-861-G DRM infoframe contained in the binary @buffer into
1889 return -EINVAL; in hdmi_drm_infoframe_unpack()
1894 return -EINVAL; in hdmi_drm_infoframe_unpack()
1897 return -EINVAL; in hdmi_drm_infoframe_unpack()
1900 size - HDMI_INFOFRAME_HEADER_SIZE); in hdmi_drm_infoframe_unpack()
1905 * hdmi_infoframe_unpack() - unpack binary buffer to a HDMI infoframe
1924 return -EINVAL; in hdmi_infoframe_unpack()
1928 ret = hdmi_avi_infoframe_unpack(&frame->avi, buffer, size); in hdmi_infoframe_unpack()
1931 ret = hdmi_drm_infoframe_unpack(&frame->drm, buffer, size); in hdmi_infoframe_unpack()
1934 ret = hdmi_spd_infoframe_unpack(&frame->spd, buffer, size); in hdmi_infoframe_unpack()
1937 ret = hdmi_audio_infoframe_unpack(&frame->audio, buffer, size); in hdmi_infoframe_unpack()
1940 ret = hdmi_vendor_any_infoframe_unpack(&frame->vendor, buffer, size); in hdmi_infoframe_unpack()
1943 ret = -EINVAL; in hdmi_infoframe_unpack()