| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 6 | 7 | * |
|---|
| 7 | 8 | * Copyright (c) 2012 Samsung Electronics Co., Ltd. |
|---|
| 8 | 9 | * http://www.samsung.com/ |
|---|
| 9 | | - * |
|---|
| 10 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 11 | | - * it under the terms of the GNU General Public License version 2 as |
|---|
| 12 | | - * published by the Free Software Foundation. |
|---|
| 13 | 10 | */ |
|---|
| 14 | 11 | |
|---|
| 15 | 12 | #undef DEBUG |
|---|
| .. | .. |
|---|
| 53 | 50 | return 0; |
|---|
| 54 | 51 | } |
|---|
| 55 | 52 | |
|---|
| 56 | | -/* Release temproary buffers for decoding */ |
|---|
| 53 | +/* Release temporary buffers for decoding */ |
|---|
| 57 | 54 | static void s5p_mfc_release_dec_desc_buffer_v6(struct s5p_mfc_ctx *ctx) |
|---|
| 58 | 55 | { |
|---|
| 59 | 56 | /* NOP */ |
|---|
| .. | .. |
|---|
| 736 | 733 | /* multi-slice control */ |
|---|
| 737 | 734 | /* multi-slice MB number or bit size */ |
|---|
| 738 | 735 | writel(ctx->slice_mode, mfc_regs->e_mslice_mode); |
|---|
| 739 | | - if (ctx->slice_mode == V4L2_MPEG_VIDEO_MULTI_SICE_MODE_MAX_MB) { |
|---|
| 736 | + if (ctx->slice_mode == V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_MAX_MB) { |
|---|
| 740 | 737 | writel(ctx->slice_size.mb, mfc_regs->e_mslice_size_mb); |
|---|
| 741 | 738 | } else if (ctx->slice_mode == |
|---|
| 742 | | - V4L2_MPEG_VIDEO_MULTI_SICE_MODE_MAX_BYTES) { |
|---|
| 739 | + V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_MAX_BYTES) { |
|---|
| 743 | 740 | writel(ctx->slice_size.bits, mfc_regs->e_mslice_size_bits); |
|---|
| 744 | 741 | } else { |
|---|
| 745 | 742 | writel(0x0, mfc_regs->e_mslice_size_mb); |
|---|
| .. | .. |
|---|
| 779 | 776 | /* multi-slice MB number or bit size */ |
|---|
| 780 | 777 | ctx->slice_mode = p->slice_mode; |
|---|
| 781 | 778 | reg = 0; |
|---|
| 782 | | - if (p->slice_mode == V4L2_MPEG_VIDEO_MULTI_SICE_MODE_MAX_MB) { |
|---|
| 779 | + if (p->slice_mode == V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_MAX_MB) { |
|---|
| 783 | 780 | reg |= (0x1 << 3); |
|---|
| 784 | 781 | writel(reg, mfc_regs->e_enc_options); |
|---|
| 785 | 782 | ctx->slice_size.mb = p->slice_mb; |
|---|
| 786 | | - } else if (p->slice_mode == V4L2_MPEG_VIDEO_MULTI_SICE_MODE_MAX_BYTES) { |
|---|
| 783 | + } else if (p->slice_mode == V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_MAX_BYTES) { |
|---|
| 787 | 784 | reg |= (0x1 << 3); |
|---|
| 788 | 785 | writel(reg, mfc_regs->e_enc_options); |
|---|
| 789 | 786 | ctx->slice_size.bits = p->slice_bit; |
|---|
| .. | .. |
|---|
| 843 | 840 | if (p->pad) { |
|---|
| 844 | 841 | reg = 0; |
|---|
| 845 | 842 | /** enable */ |
|---|
| 846 | | - reg |= (1 << 31); |
|---|
| 843 | + reg |= (1UL << 31); |
|---|
| 847 | 844 | /** cr value */ |
|---|
| 848 | 845 | reg |= ((p->pad_cr & 0xFF) << 16); |
|---|
| 849 | 846 | /** cb value */ |
|---|
| .. | .. |
|---|
| 1063 | 1060 | } |
|---|
| 1064 | 1061 | |
|---|
| 1065 | 1062 | /* aspect ratio VUI */ |
|---|
| 1066 | | - readl(mfc_regs->e_h264_options); |
|---|
| 1063 | + reg = readl(mfc_regs->e_h264_options); |
|---|
| 1067 | 1064 | reg &= ~(0x1 << 5); |
|---|
| 1068 | 1065 | reg |= ((p_h264->vui_sar & 0x1) << 5); |
|---|
| 1069 | 1066 | writel(reg, mfc_regs->e_h264_options); |
|---|
| .. | .. |
|---|
| 1086 | 1083 | |
|---|
| 1087 | 1084 | /* intra picture period for H.264 open GOP */ |
|---|
| 1088 | 1085 | /* control */ |
|---|
| 1089 | | - readl(mfc_regs->e_h264_options); |
|---|
| 1086 | + reg = readl(mfc_regs->e_h264_options); |
|---|
| 1090 | 1087 | reg &= ~(0x1 << 4); |
|---|
| 1091 | 1088 | reg |= ((p_h264->open_gop & 0x1) << 4); |
|---|
| 1092 | 1089 | writel(reg, mfc_regs->e_h264_options); |
|---|
| .. | .. |
|---|
| 1100 | 1097 | } |
|---|
| 1101 | 1098 | |
|---|
| 1102 | 1099 | /* 'WEIGHTED_BI_PREDICTION' for B is disable */ |
|---|
| 1103 | | - readl(mfc_regs->e_h264_options); |
|---|
| 1100 | + reg = readl(mfc_regs->e_h264_options); |
|---|
| 1104 | 1101 | reg &= ~(0x3 << 9); |
|---|
| 1105 | 1102 | writel(reg, mfc_regs->e_h264_options); |
|---|
| 1106 | 1103 | |
|---|
| 1107 | 1104 | /* 'CONSTRAINED_INTRA_PRED_ENABLE' is disable */ |
|---|
| 1108 | | - readl(mfc_regs->e_h264_options); |
|---|
| 1105 | + reg = readl(mfc_regs->e_h264_options); |
|---|
| 1109 | 1106 | reg &= ~(0x1 << 14); |
|---|
| 1110 | 1107 | writel(reg, mfc_regs->e_h264_options); |
|---|
| 1111 | 1108 | |
|---|
| 1112 | 1109 | /* ASO */ |
|---|
| 1113 | | - readl(mfc_regs->e_h264_options); |
|---|
| 1110 | + reg = readl(mfc_regs->e_h264_options); |
|---|
| 1114 | 1111 | reg &= ~(0x1 << 6); |
|---|
| 1115 | 1112 | reg |= ((p_h264->aso & 0x1) << 6); |
|---|
| 1116 | 1113 | writel(reg, mfc_regs->e_h264_options); |
|---|
| 1117 | 1114 | |
|---|
| 1118 | 1115 | /* hier qp enable */ |
|---|
| 1119 | | - readl(mfc_regs->e_h264_options); |
|---|
| 1116 | + reg = readl(mfc_regs->e_h264_options); |
|---|
| 1120 | 1117 | reg &= ~(0x1 << 8); |
|---|
| 1121 | 1118 | reg |= ((p_h264->open_gop & 0x1) << 8); |
|---|
| 1122 | 1119 | writel(reg, mfc_regs->e_h264_options); |
|---|
| .. | .. |
|---|
| 1137 | 1134 | writel(reg, mfc_regs->e_h264_num_t_layer); |
|---|
| 1138 | 1135 | |
|---|
| 1139 | 1136 | /* frame packing SEI generation */ |
|---|
| 1140 | | - readl(mfc_regs->e_h264_options); |
|---|
| 1137 | + reg = readl(mfc_regs->e_h264_options); |
|---|
| 1141 | 1138 | reg &= ~(0x1 << 25); |
|---|
| 1142 | 1139 | reg |= ((p_h264->sei_frame_packing & 0x1) << 25); |
|---|
| 1143 | 1140 | writel(reg, mfc_regs->e_h264_options); |
|---|
| .. | .. |
|---|
| 1928 | 1925 | |
|---|
| 1929 | 1926 | if (ctx->capture_state != QUEUE_BUFS_MMAPED) { |
|---|
| 1930 | 1927 | mfc_err("It seems that not all destination buffers were\n" |
|---|
| 1931 | | - "mmaped.MFC requires that all destination are mmaped\n" |
|---|
| 1928 | + "mmapped.MFC requires that all destination are mmapped\n" |
|---|
| 1932 | 1929 | "before starting processing.\n"); |
|---|
| 1933 | 1930 | return -EAGAIN; |
|---|
| 1934 | 1931 | } |
|---|