Lines Matching full:frame

56  * @frame: HDMI AVI infoframe
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()
83 * @frame: HDMI AVI infoframe
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()
98 * @frame: HDMI AVI infoframe
102 * Packs the information contained in the @frame structure into a binary
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()
187 * @frame: HDMI AVI infoframe
193 * contained in the @frame structure into a binary representation that
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()
216 * @frame: HDMI SPD infoframe
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()
254 * @frame: HDMI SPD infoframe
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()
269 * @frame: HDMI SPD infoframe
273 * Packs the information contained in the @frame structure into a binary
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()
321 * @frame: HDMI SPD infoframe
327 * contained in the @frame structure into a binary representation that
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()
350 * @frame: HDMI audio infoframe
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()
378 * @frame: HDMI audio infoframe
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()
415 * @frame: HDMI audio infoframe
419 * Packs the information contained in the @frame structure into a binary
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()
462 * @frame: HDMI Audio infoframe
468 * contained in the @frame structure into a binary representation that
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()
492 * @frame: HDMI Audio infoframe
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()
521 /* Return size = frame length + four HB for sdp_header */ in hdmi_audio_infoframe_pack_for_dp()
522 return frame->length + 4; in hdmi_audio_infoframe_pack_for_dp()
528 * @frame: HDMI vendor infoframe
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()
582 * @frame: HDMI infoframe
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()
599 * @frame: HDMI infoframe
603 * Packs the information contained in the @frame structure into a binary
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()
660 * @frame: HDMI Vendor infoframe
666 * contained in the @frame structure into a binary representation that
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()
700 * @frame: HDMI DRM infoframe
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()
730 * @frame: HDMI DRM infoframe
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()
743 * @frame: HDMI DRM infoframe
747 * Packs the information contained in the @frame structure into a binary
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()
814 * @frame: HDMI DRM infoframe
820 * contained in the @frame structure into a binary representation that
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()
899 * @frame: HDMI infoframe
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()
927 * @frame: HDMI infoframe
931 * Packs the information contained in the @frame structure into a binary
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()
977 * @frame: HDMI infoframe
983 * contained in the @frame structure into a binary representation that
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
1314 (const struct hdmi_any_infoframe *)frame); in hdmi_spd_infoframe_log()
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()
1435 const struct hdmi_audio_infoframe *frame) in hdmi_audio_infoframe_log() argument
1438 (const struct hdmi_any_infoframe *)frame); in hdmi_audio_infoframe_log()
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()
1462 const struct hdmi_drm_infoframe *frame) in hdmi_drm_infoframe_log() argument
1467 (struct hdmi_any_infoframe *)frame); in hdmi_drm_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()
1496 return "Frame Packing"; in hdmi_3d_structure_get_name()
1520 const union hdmi_vendor_any_infoframe *frame) in hdmi_vendor_any_infoframe_log() argument
1522 const struct hdmi_vendor_infoframe *hvf = &frame->hdmi; in hdmi_vendor_any_infoframe_log()
1525 (const struct hdmi_any_infoframe *)frame); in hdmi_vendor_any_infoframe_log()
1527 if (frame->any.oui != HDMI_IEEE_OUI) { in hdmi_vendor_any_infoframe_log()
1532 hdmi_log(" empty frame\n"); in hdmi_vendor_any_infoframe_log()
1551 * @frame: HDMI infoframe
1555 const union hdmi_infoframe *frame) in hdmi_infoframe_log() argument
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()
1579 * @frame: HDMI AVI infoframe
1584 * @frame of the HDMI Auxiliary Video (AVI) information frame.
1590 static int hdmi_avi_infoframe_unpack(struct hdmi_avi_infoframe *frame, in hdmi_avi_infoframe_unpack() argument
1606 hdmi_avi_infoframe_init(frame); 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()
1643 * @frame: HDMI SPD infoframe
1648 * @frame of the HDMI Source Product Description (SPD) information frame.
1654 static int hdmi_spd_infoframe_unpack(struct hdmi_spd_infoframe *frame, in hdmi_spd_infoframe_unpack() argument
1674 ret = hdmi_spd_infoframe_init(frame, ptr, ptr + 8); in hdmi_spd_infoframe_unpack()
1678 frame->sdi = ptr[24]; in hdmi_spd_infoframe_unpack()
1685 * @frame: HDMI Audio infoframe
1690 * @frame of the HDMI Audio information frame.
1696 static int hdmi_audio_infoframe_unpack(struct hdmi_audio_infoframe *frame, in hdmi_audio_infoframe_unpack() argument
1714 ret = hdmi_audio_infoframe_init(frame); 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()
1735 * @frame: HDMI Vendor infoframe
1740 * @frame of the HDMI Vendor information frame.
1747 hdmi_vendor_any_infoframe_unpack(union hdmi_vendor_any_infoframe *frame, in hdmi_vendor_any_infoframe_unpack() argument
1754 struct hdmi_vendor_infoframe *hvf = &frame->hdmi; in hdmi_vendor_any_infoframe_unpack()
1817 * @frame: HDMI DRM infoframe
1822 * into a structured @frame of the HDMI Dynamic Range and Mastering (DRM)
1827 int hdmi_drm_infoframe_unpack_only(struct hdmi_drm_infoframe *frame, in hdmi_drm_infoframe_unpack_only() argument
1840 ret = hdmi_drm_infoframe_init(frame); 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()
1871 * @frame: HDMI DRM infoframe
1876 * a structured @frame of the HDMI Dynamic Range and Mastering (DRM)
1882 static int hdmi_drm_infoframe_unpack(struct hdmi_drm_infoframe *frame, in hdmi_drm_infoframe_unpack() argument
1899 ret = hdmi_drm_infoframe_unpack_only(frame, ptr + HDMI_INFOFRAME_HEADER_SIZE, in hdmi_drm_infoframe_unpack()
1906 * @frame: HDMI infoframe
1911 * @frame of a HDMI infoframe.
1917 int hdmi_infoframe_unpack(union hdmi_infoframe *frame, in hdmi_infoframe_unpack() argument
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()