Lines Matching refs:frame
58 void hdmi_avi_infoframe_init(struct hdmi_avi_infoframe *frame) in hdmi_avi_infoframe_init() argument
60 memset(frame, 0, sizeof(*frame)); in hdmi_avi_infoframe_init()
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()
68 static int hdmi_avi_infoframe_check_only(const struct hdmi_avi_infoframe *frame) in hdmi_avi_infoframe_check_only() argument
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()
75 if (frame->picture_aspect > HDMI_PICTURE_ASPECT_16_9) in hdmi_avi_infoframe_check_only()
90 int hdmi_avi_infoframe_check(struct hdmi_avi_infoframe *frame) in hdmi_avi_infoframe_check() argument
92 return hdmi_avi_infoframe_check_only(frame); in hdmi_avi_infoframe_check()
110 ssize_t hdmi_avi_infoframe_pack_only(const struct hdmi_avi_infoframe *frame, in hdmi_avi_infoframe_pack_only() argument
117 ret = hdmi_avi_infoframe_check_only(frame); in hdmi_avi_infoframe_pack_only()
121 length = HDMI_INFOFRAME_HEADER_SIZE + frame->length; 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()
201 ssize_t hdmi_avi_infoframe_pack(struct hdmi_avi_infoframe *frame, in hdmi_avi_infoframe_pack() argument
206 ret = hdmi_avi_infoframe_check(frame); in hdmi_avi_infoframe_pack()
210 return hdmi_avi_infoframe_pack_only(frame, buffer, size); in hdmi_avi_infoframe_pack()
222 int hdmi_spd_infoframe_init(struct hdmi_spd_infoframe *frame, in hdmi_spd_infoframe_init() argument
227 memset(frame, 0, sizeof(*frame)); in hdmi_spd_infoframe_init()
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()
242 static int hdmi_spd_infoframe_check_only(const struct hdmi_spd_infoframe *frame) in hdmi_spd_infoframe_check_only() argument
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()
261 int hdmi_spd_infoframe_check(struct hdmi_spd_infoframe *frame) in hdmi_spd_infoframe_check() argument
263 return hdmi_spd_infoframe_check_only(frame); in hdmi_spd_infoframe_check()
281 ssize_t hdmi_spd_infoframe_pack_only(const struct hdmi_spd_infoframe *frame, in hdmi_spd_infoframe_pack_only() argument
288 ret = hdmi_spd_infoframe_check_only(frame); in hdmi_spd_infoframe_pack_only()
292 length = HDMI_INFOFRAME_HEADER_SIZE + frame->length; 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()
335 ssize_t hdmi_spd_infoframe_pack(struct hdmi_spd_infoframe *frame, in hdmi_spd_infoframe_pack() argument
340 ret = hdmi_spd_infoframe_check(frame); in hdmi_spd_infoframe_pack()
344 return hdmi_spd_infoframe_pack_only(frame, buffer, size); in hdmi_spd_infoframe_pack()
354 int hdmi_audio_infoframe_init(struct hdmi_audio_infoframe *frame) in hdmi_audio_infoframe_init() argument
356 memset(frame, 0, sizeof(*frame)); in hdmi_audio_infoframe_init()
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()
366 static int hdmi_audio_infoframe_check_only(const struct hdmi_audio_infoframe *frame) in hdmi_audio_infoframe_check_only() argument
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()
385 int hdmi_audio_infoframe_check(const struct hdmi_audio_infoframe *frame) in hdmi_audio_infoframe_check() argument
387 return hdmi_audio_infoframe_check_only(frame); in hdmi_audio_infoframe_check()
392 hdmi_audio_infoframe_pack_payload(const struct hdmi_audio_infoframe *frame, in hdmi_audio_infoframe_pack_payload() argument
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()
427 ssize_t hdmi_audio_infoframe_pack_only(const struct hdmi_audio_infoframe *frame, in hdmi_audio_infoframe_pack_only() argument
434 ret = hdmi_audio_infoframe_check_only(frame); in hdmi_audio_infoframe_pack_only()
438 length = HDMI_INFOFRAME_HEADER_SIZE + frame->length; 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()
450 hdmi_audio_infoframe_pack_payload(frame, in hdmi_audio_infoframe_pack_only()
476 ssize_t hdmi_audio_infoframe_pack(struct hdmi_audio_infoframe *frame, in hdmi_audio_infoframe_pack() argument
481 ret = hdmi_audio_infoframe_check(frame); in hdmi_audio_infoframe_pack()
485 return hdmi_audio_infoframe_pack_only(frame, buffer, size); in hdmi_audio_infoframe_pack()
502 hdmi_audio_infoframe_pack_for_dp(const struct hdmi_audio_infoframe *frame, in hdmi_audio_infoframe_pack_for_dp() argument
507 ret = hdmi_audio_infoframe_check(frame); in hdmi_audio_infoframe_pack_for_dp()
515 sdp->sdp_header.HB1 = frame->type; 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()
532 int hdmi_vendor_infoframe_init(struct hdmi_vendor_infoframe *frame) in hdmi_vendor_infoframe_init() argument
534 memset(frame, 0, sizeof(*frame)); in hdmi_vendor_infoframe_init()
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()
552 static int hdmi_vendor_infoframe_length(const struct hdmi_vendor_infoframe *frame) in hdmi_vendor_infoframe_length() argument
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()
563 static int hdmi_vendor_infoframe_check_only(const struct hdmi_vendor_infoframe *frame) in hdmi_vendor_infoframe_check_only() argument
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()
571 if (frame->vic != 0 && frame->s3d_struct != HDMI_3D_STRUCTURE_INVALID) in hdmi_vendor_infoframe_check_only()
574 if (frame->length != hdmi_vendor_infoframe_length(frame)) in hdmi_vendor_infoframe_check_only()
589 int hdmi_vendor_infoframe_check(struct hdmi_vendor_infoframe *frame) in hdmi_vendor_infoframe_check() argument
591 frame->length = hdmi_vendor_infoframe_length(frame); in hdmi_vendor_infoframe_check()
593 return hdmi_vendor_infoframe_check_only(frame); in hdmi_vendor_infoframe_check()
611 ssize_t hdmi_vendor_infoframe_pack_only(const struct hdmi_vendor_infoframe *frame, in hdmi_vendor_infoframe_pack_only() argument
618 ret = hdmi_vendor_infoframe_check_only(frame); in hdmi_vendor_infoframe_pack_only()
622 length = HDMI_INFOFRAME_HEADER_SIZE + frame->length; 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()
674 ssize_t hdmi_vendor_infoframe_pack(struct hdmi_vendor_infoframe *frame, in hdmi_vendor_infoframe_pack() argument
679 ret = hdmi_vendor_infoframe_check(frame); in hdmi_vendor_infoframe_pack()
683 return hdmi_vendor_infoframe_pack_only(frame, buffer, size); in hdmi_vendor_infoframe_pack()
688 hdmi_vendor_any_infoframe_check_only(const union hdmi_vendor_any_infoframe *frame) in hdmi_vendor_any_infoframe_check_only() argument
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()
704 int hdmi_drm_infoframe_init(struct hdmi_drm_infoframe *frame) in hdmi_drm_infoframe_init() argument
706 memset(frame, 0, sizeof(*frame)); in hdmi_drm_infoframe_init()
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()
716 static int hdmi_drm_infoframe_check_only(const struct hdmi_drm_infoframe *frame) in hdmi_drm_infoframe_check_only() argument
718 if (frame->type != HDMI_INFOFRAME_TYPE_DRM || in hdmi_drm_infoframe_check_only()
719 frame->version != 1) in hdmi_drm_infoframe_check_only()
722 if (frame->length != HDMI_DRM_INFOFRAME_SIZE) in hdmi_drm_infoframe_check_only()
735 int hdmi_drm_infoframe_check(struct hdmi_drm_infoframe *frame) in hdmi_drm_infoframe_check() argument
737 return hdmi_drm_infoframe_check_only(frame); in hdmi_drm_infoframe_check()
755 ssize_t hdmi_drm_infoframe_pack_only(const struct hdmi_drm_infoframe *frame, in hdmi_drm_infoframe_pack_only() argument
762 length = HDMI_INFOFRAME_HEADER_SIZE + frame->length; 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()
828 ssize_t hdmi_drm_infoframe_pack(struct hdmi_drm_infoframe *frame, in hdmi_drm_infoframe_pack() argument
833 ret = hdmi_drm_infoframe_check(frame); in hdmi_drm_infoframe_pack()
837 return hdmi_drm_infoframe_pack_only(frame, buffer, size); in hdmi_drm_infoframe_pack()
845 hdmi_vendor_any_infoframe_check(union hdmi_vendor_any_infoframe *frame) in hdmi_vendor_any_infoframe_check() argument
849 ret = hdmi_vendor_any_infoframe_check_only(frame); in hdmi_vendor_any_infoframe_check()
854 if (frame->any.oui != HDMI_IEEE_OUI) in hdmi_vendor_any_infoframe_check()
857 return hdmi_vendor_infoframe_check(&frame->hdmi); in hdmi_vendor_any_infoframe_check()
864 hdmi_vendor_any_infoframe_pack_only(const union hdmi_vendor_any_infoframe *frame, in hdmi_vendor_any_infoframe_pack_only() argument
869 ret = hdmi_vendor_any_infoframe_check_only(frame); in hdmi_vendor_any_infoframe_pack_only()
874 if (frame->any.oui != HDMI_IEEE_OUI) 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()
885 hdmi_vendor_any_infoframe_pack(union hdmi_vendor_any_infoframe *frame, in hdmi_vendor_any_infoframe_pack() argument
890 ret = hdmi_vendor_any_infoframe_check(frame); in hdmi_vendor_any_infoframe_pack()
894 return hdmi_vendor_any_infoframe_pack_only(frame, buffer, size); in hdmi_vendor_any_infoframe_pack()
907 hdmi_infoframe_check(union hdmi_infoframe *frame) in hdmi_infoframe_check() argument
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()
940 hdmi_infoframe_pack_only(const union hdmi_infoframe *frame, void *buffer, size_t size) in hdmi_infoframe_pack_only() argument
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()
992 hdmi_infoframe_pack(union hdmi_infoframe *frame, in hdmi_infoframe_pack() argument
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()
1044 const struct hdmi_any_infoframe *frame) in hdmi_infoframe_log_header() argument
1047 hdmi_infoframe_type_get_name(frame->type), in hdmi_infoframe_log_header()
1048 frame->version, frame->length); in hdmi_infoframe_log_header()
1240 const struct hdmi_avi_infoframe *frame) in hdmi_avi_infoframe_log() argument
1243 (const struct hdmi_any_infoframe *)frame); in hdmi_avi_infoframe_log()
1246 hdmi_colorspace_get_name(frame->colorspace)); 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()
1311 const struct hdmi_spd_infoframe *frame) in hdmi_spd_infoframe_log() argument
1316 (const struct hdmi_any_infoframe *)frame); in hdmi_spd_infoframe_log()
1320 strncpy(buf, frame->vendor, 8); in hdmi_spd_infoframe_log()
1322 strncpy(buf, frame->product, 16); in hdmi_spd_infoframe_log()
1325 hdmi_spd_sdi_get_name(frame->sdi), frame->sdi); in hdmi_spd_infoframe_log()
1441 const struct hdmi_audio_infoframe *frame) in hdmi_audio_infoframe_log() argument
1444 (const struct hdmi_any_infoframe *)frame); in hdmi_audio_infoframe_log()
1446 if (frame->channels) in hdmi_audio_infoframe_log()
1447 hdmi_log(" channels: %u\n", frame->channels - 1); in hdmi_audio_infoframe_log()
1451 hdmi_audio_coding_type_get_name(frame->coding_type)); in hdmi_audio_infoframe_log()
1453 hdmi_audio_sample_size_get_name(frame->sample_size)); in hdmi_audio_infoframe_log()
1455 hdmi_audio_sample_frequency_get_name(frame->sample_frequency)); in hdmi_audio_infoframe_log()
1457 hdmi_audio_coding_type_ext_get_name(frame->coding_type_ext)); in hdmi_audio_infoframe_log()
1459 frame->channel_allocation); in hdmi_audio_infoframe_log()
1461 frame->level_shift_value); in hdmi_audio_infoframe_log()
1463 frame->downmix_inhibit ? "Yes" : "No"); in hdmi_audio_infoframe_log()
1468 const struct hdmi_drm_infoframe *frame) in hdmi_drm_infoframe_log() argument
1473 (struct hdmi_any_infoframe *)frame); in hdmi_drm_infoframe_log()
1474 hdmi_log("length: %d\n", frame->length); in hdmi_drm_infoframe_log()
1475 hdmi_log("metadata type: %d\n", frame->metadata_type); in hdmi_drm_infoframe_log()
1476 hdmi_log("eotf: %d\n", frame->eotf); in hdmi_drm_infoframe_log()
1478 hdmi_log("x[%d]: %d\n", i, frame->display_primaries[i].x); in hdmi_drm_infoframe_log()
1479 hdmi_log("y[%d]: %d\n", i, frame->display_primaries[i].y); in hdmi_drm_infoframe_log()
1482 hdmi_log("white point x: %d\n", frame->white_point.x); in hdmi_drm_infoframe_log()
1483 hdmi_log("white point y: %d\n", frame->white_point.y); in hdmi_drm_infoframe_log()
1486 frame->max_display_mastering_luminance); in hdmi_drm_infoframe_log()
1488 frame->min_display_mastering_luminance); in hdmi_drm_infoframe_log()
1490 hdmi_log("max_cll: %d\n", frame->max_cll); in hdmi_drm_infoframe_log()
1491 hdmi_log("max_fall: %d\n", frame->max_fall); in hdmi_drm_infoframe_log()
1526 const union hdmi_vendor_any_infoframe *frame) in hdmi_vendor_any_infoframe_log() argument
1528 const struct hdmi_vendor_infoframe *hvf = &frame->hdmi; in hdmi_vendor_any_infoframe_log()
1531 (const struct hdmi_any_infoframe *)frame); in hdmi_vendor_any_infoframe_log()
1533 if (frame->any.oui != HDMI_IEEE_OUI) { in hdmi_vendor_any_infoframe_log()
1561 const union hdmi_infoframe *frame) in hdmi_infoframe_log() argument
1563 switch (frame->any.type) { in hdmi_infoframe_log()
1565 hdmi_avi_infoframe_log(level, dev, &frame->avi); in hdmi_infoframe_log()
1568 hdmi_spd_infoframe_log(level, dev, &frame->spd); in hdmi_infoframe_log()
1571 hdmi_audio_infoframe_log(level, dev, &frame->audio); in hdmi_infoframe_log()
1574 hdmi_vendor_any_infoframe_log(level, dev, &frame->vendor); in hdmi_infoframe_log()
1577 hdmi_drm_infoframe_log(level, dev, &frame->drm); in hdmi_infoframe_log()
1596 static int hdmi_avi_infoframe_unpack(struct hdmi_avi_infoframe *frame, in hdmi_avi_infoframe_unpack() argument
1612 hdmi_avi_infoframe_init(frame); in hdmi_avi_infoframe_unpack()
1616 frame->colorspace = (ptr[0] >> 5) & 0x3; in hdmi_avi_infoframe_unpack()
1618 frame->active_aspect = ptr[1] & 0xf; in hdmi_avi_infoframe_unpack()
1620 frame->top_bar = (ptr[6] << 8) | ptr[5]; in hdmi_avi_infoframe_unpack()
1621 frame->bottom_bar = (ptr[8] << 8) | ptr[7]; in hdmi_avi_infoframe_unpack()
1624 frame->left_bar = (ptr[10] << 8) | ptr[9]; in hdmi_avi_infoframe_unpack()
1625 frame->right_bar = (ptr[12] << 8) | ptr[11]; in hdmi_avi_infoframe_unpack()
1627 frame->scan_mode = ptr[0] & 0x3; in hdmi_avi_infoframe_unpack()
1629 frame->colorimetry = (ptr[1] >> 6) & 0x3; in hdmi_avi_infoframe_unpack()
1630 frame->picture_aspect = (ptr[1] >> 4) & 0x3; in hdmi_avi_infoframe_unpack()
1631 frame->active_aspect = ptr[1] & 0xf; in hdmi_avi_infoframe_unpack()
1633 frame->itc = ptr[2] & 0x80 ? true : false; in hdmi_avi_infoframe_unpack()
1634 frame->extended_colorimetry = (ptr[2] >> 4) & 0x7; in hdmi_avi_infoframe_unpack()
1635 frame->quantization_range = (ptr[2] >> 2) & 0x3; in hdmi_avi_infoframe_unpack()
1636 frame->nups = ptr[2] & 0x3; in hdmi_avi_infoframe_unpack()
1638 frame->video_code = ptr[3] & 0x7f; in hdmi_avi_infoframe_unpack()
1639 frame->ycc_quantization_range = (ptr[4] >> 6) & 0x3; in hdmi_avi_infoframe_unpack()
1640 frame->content_type = (ptr[4] >> 4) & 0x3; in hdmi_avi_infoframe_unpack()
1642 frame->pixel_repeat = ptr[4] & 0xf; in hdmi_avi_infoframe_unpack()
1660 static int hdmi_spd_infoframe_unpack(struct hdmi_spd_infoframe *frame, in hdmi_spd_infoframe_unpack() argument
1680 ret = hdmi_spd_infoframe_init(frame, ptr, ptr + 8); in hdmi_spd_infoframe_unpack()
1684 frame->sdi = ptr[24]; in hdmi_spd_infoframe_unpack()
1702 static int hdmi_audio_infoframe_unpack(struct hdmi_audio_infoframe *frame, in hdmi_audio_infoframe_unpack() argument
1720 ret = hdmi_audio_infoframe_init(frame); in hdmi_audio_infoframe_unpack()
1726 frame->channels = ptr[0] & 0x7; in hdmi_audio_infoframe_unpack()
1727 frame->coding_type = (ptr[0] >> 4) & 0xf; in hdmi_audio_infoframe_unpack()
1728 frame->sample_size = ptr[1] & 0x3; in hdmi_audio_infoframe_unpack()
1729 frame->sample_frequency = (ptr[1] >> 2) & 0x7; in hdmi_audio_infoframe_unpack()
1730 frame->coding_type_ext = ptr[2] & 0x1f; in hdmi_audio_infoframe_unpack()
1731 frame->channel_allocation = ptr[3]; in hdmi_audio_infoframe_unpack()
1732 frame->level_shift_value = (ptr[4] >> 3) & 0xf; in hdmi_audio_infoframe_unpack()
1733 frame->downmix_inhibit = ptr[4] & 0x80 ? true : false; in hdmi_audio_infoframe_unpack()
1753 hdmi_vendor_any_infoframe_unpack(union hdmi_vendor_any_infoframe *frame, in hdmi_vendor_any_infoframe_unpack() argument
1760 struct hdmi_vendor_infoframe *hvf = &frame->hdmi; in hdmi_vendor_any_infoframe_unpack()
1833 int hdmi_drm_infoframe_unpack_only(struct hdmi_drm_infoframe *frame, in hdmi_drm_infoframe_unpack_only() argument
1846 ret = hdmi_drm_infoframe_init(frame); in hdmi_drm_infoframe_unpack_only()
1850 frame->eotf = ptr[0] & 0x7; in hdmi_drm_infoframe_unpack_only()
1851 frame->metadata_type = ptr[1] & 0x7; in hdmi_drm_infoframe_unpack_only()
1857 frame->display_primaries[i].x = (x_msb << 8) | x_lsb; in hdmi_drm_infoframe_unpack_only()
1860 frame->display_primaries[i].y = (y_msb << 8) | y_lsb; in hdmi_drm_infoframe_unpack_only()
1863 frame->white_point.x = (ptr[15] << 8) | ptr[14]; in hdmi_drm_infoframe_unpack_only()
1864 frame->white_point.y = (ptr[17] << 8) | ptr[16]; in hdmi_drm_infoframe_unpack_only()
1866 frame->max_display_mastering_luminance = (ptr[19] << 8) | ptr[18]; in hdmi_drm_infoframe_unpack_only()
1867 frame->min_display_mastering_luminance = (ptr[21] << 8) | ptr[20]; in hdmi_drm_infoframe_unpack_only()
1868 frame->max_cll = (ptr[23] << 8) | ptr[22]; in hdmi_drm_infoframe_unpack_only()
1869 frame->max_fall = (ptr[25] << 8) | ptr[24]; in hdmi_drm_infoframe_unpack_only()
1888 static int hdmi_drm_infoframe_unpack(struct hdmi_drm_infoframe *frame, in hdmi_drm_infoframe_unpack() argument
1905 ret = hdmi_drm_infoframe_unpack_only(frame, ptr + HDMI_INFOFRAME_HEADER_SIZE, in hdmi_drm_infoframe_unpack()
1923 int hdmi_infoframe_unpack(union hdmi_infoframe *frame, in hdmi_infoframe_unpack() argument
1934 ret = hdmi_avi_infoframe_unpack(&frame->avi, buffer, size); in hdmi_infoframe_unpack()
1937 ret = hdmi_drm_infoframe_unpack(&frame->drm, buffer, size); in hdmi_infoframe_unpack()
1940 ret = hdmi_spd_infoframe_unpack(&frame->spd, buffer, size); in hdmi_infoframe_unpack()
1943 ret = hdmi_audio_infoframe_unpack(&frame->audio, buffer, size); in hdmi_infoframe_unpack()
1946 ret = hdmi_vendor_any_infoframe_unpack(&frame->vendor, buffer, size); in hdmi_infoframe_unpack()